490 |
enum scroll_bar_part *, |
enum scroll_bar_part *, |
491 |
Lisp_Object *, Lisp_Object *, |
Lisp_Object *, Lisp_Object *, |
492 |
unsigned long *)); |
unsigned long *)); |
493 |
|
static void x_check_fullscreen P_ ((struct frame *)); |
494 |
|
static void x_check_fullscreen_move P_ ((struct frame *)); |
495 |
|
|
496 |
/* Flush display of frame F, or of all frames if F is null. */ |
/* Flush display of frame F, or of all frames if F is null. */ |
497 |
|
|
10245 |
f = x_window_to_frame (dpyinfo, event.xexpose.window); |
f = x_window_to_frame (dpyinfo, event.xexpose.window); |
10246 |
if (f) |
if (f) |
10247 |
{ |
{ |
10248 |
|
x_check_fullscreen (f); |
10249 |
|
|
10250 |
if (f->async_visible == 0) |
if (f->async_visible == 0) |
10251 |
{ |
{ |
10252 |
f->async_visible = 1; |
f->async_visible = 1; |
10848 |
f = x_top_window_to_frame (dpyinfo, event.xconfigure.window); |
f = x_top_window_to_frame (dpyinfo, event.xconfigure.window); |
10849 |
if (f) |
if (f) |
10850 |
{ |
{ |
10851 |
|
/* If there is a pending resize for fullscreen, don't |
10852 |
|
do this one, the right one will come later. |
10853 |
|
The toolkit version doesn't seem to need this, but we |
10854 |
|
need to reset it below. */ |
10855 |
|
int dont_resize = |
10856 |
|
((f->output_data.x->want_fullscreen & FULLSCREEN_WAIT) |
10857 |
|
&& FRAME_NEW_WIDTH (f) != 0); |
10858 |
#ifndef USE_X_TOOLKIT |
#ifndef USE_X_TOOLKIT |
10859 |
int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height); |
int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height); |
10860 |
int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width); |
int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width); |
10861 |
|
if (dont_resize) |
10862 |
|
goto OTHER; |
10863 |
|
|
10864 |
/* In the toolkit version, change_frame_size |
/* In the toolkit version, change_frame_size |
10865 |
is called by the code that handles resizing |
is called by the code that handles resizing |
10887 |
x_real_positions (f, &f->output_data.x->left_pos, |
x_real_positions (f, &f->output_data.x->left_pos, |
10888 |
&f->output_data.x->top_pos); |
&f->output_data.x->top_pos); |
10889 |
|
|
10890 |
|
x_check_fullscreen_move(f); |
10891 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_WAIT) |
10892 |
|
f->output_data.x->want_fullscreen &= |
10893 |
|
~(FULLSCREEN_WAIT|FULLSCREEN_BOTH); |
10894 |
#ifdef HAVE_X_I18N |
#ifdef HAVE_X_I18N |
10895 |
if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea)) |
if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea)) |
10896 |
xic_set_statusarea (f); |
xic_set_statusarea (f); |
12660 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
12661 |
} |
} |
12662 |
|
|
12663 |
|
/* Check if we need to resize the frame due to a fullscreen request. |
12664 |
|
If so needed, resize the frame. */ |
12665 |
|
static void |
12666 |
|
x_check_fullscreen (f) |
12667 |
|
struct frame *f; |
12668 |
|
{ |
12669 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_BOTH) |
12670 |
|
{ |
12671 |
|
int width, height, ign; |
12672 |
|
|
12673 |
|
x_real_positions (f, &f->output_data.x->left_pos, |
12674 |
|
&f->output_data.x->top_pos); |
12675 |
|
|
12676 |
|
x_fullscreen_adjust (f, &width, &height, &ign, &ign); |
12677 |
|
|
12678 |
|
/* We do not need to move the window, it shall be taken care of |
12679 |
|
when setting WM manager hints. |
12680 |
|
If the frame is visible already, the position is checked by |
12681 |
|
x_check_fullscreen_move. */ |
12682 |
|
if (f->width != width || f->height != height) |
12683 |
|
{ |
12684 |
|
change_frame_size (f, height, width, 0, 1, 0); |
12685 |
|
SET_FRAME_GARBAGED (f); |
12686 |
|
cancel_mouse_face (f); |
12687 |
|
|
12688 |
|
/* Wait for the change of frame size to occur */ |
12689 |
|
f->output_data.x->want_fullscreen |= FULLSCREEN_WAIT; |
12690 |
|
|
12691 |
|
} |
12692 |
|
} |
12693 |
|
} |
12694 |
|
|
12695 |
|
/* If frame parameters are set after the frame is mapped, we need to move |
12696 |
|
the window. This is done in xfns.c. |
12697 |
|
Some window managers moves the window to the right position, some |
12698 |
|
moves the outer window manager window to the specified position. |
12699 |
|
Here we check that we are in the right spot. If not, make a second |
12700 |
|
move, assuming we are dealing with the second kind of window manager. */ |
12701 |
|
static void |
12702 |
|
x_check_fullscreen_move (f) |
12703 |
|
struct frame *f; |
12704 |
|
{ |
12705 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_MOVE_WAIT) |
12706 |
|
{ |
12707 |
|
int expect_top = f->output_data.x->top_pos; |
12708 |
|
int expect_left = f->output_data.x->left_pos; |
12709 |
|
|
12710 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_HEIGHT) |
12711 |
|
expect_top = 0; |
12712 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_WIDTH) |
12713 |
|
expect_left = 0; |
12714 |
|
|
12715 |
|
if (expect_top != f->output_data.x->top_pos |
12716 |
|
|| expect_left != f->output_data.x->left_pos) |
12717 |
|
x_set_offset (f, expect_left, expect_top, 1); |
12718 |
|
|
12719 |
|
/* Just do this once */ |
12720 |
|
f->output_data.x->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT; |
12721 |
|
} |
12722 |
|
} |
12723 |
|
|
12724 |
|
|
12725 |
|
/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the |
12726 |
|
wanted positions of the WM window (not emacs window). |
12727 |
|
Return in *WIDTH and *HEIGHT the wanted width and height of Emacs |
12728 |
|
window (FRAME_X_WINDOW). |
12729 |
|
*/ |
12730 |
|
void |
12731 |
|
x_fullscreen_adjust (f, width, height, top_pos, left_pos) |
12732 |
|
struct frame *f; |
12733 |
|
int *width; |
12734 |
|
int *height; |
12735 |
|
int *top_pos; |
12736 |
|
int *left_pos; |
12737 |
|
{ |
12738 |
|
int newwidth = f->width, newheight = f->height; |
12739 |
|
|
12740 |
|
*top_pos = f->output_data.x->top_pos; |
12741 |
|
*left_pos = f->output_data.x->left_pos; |
12742 |
|
|
12743 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_HEIGHT) |
12744 |
|
{ |
12745 |
|
int ph; |
12746 |
|
|
12747 |
|
ph = FRAME_X_DISPLAY_INFO (f)->height; |
12748 |
|
newheight = PIXEL_TO_CHAR_HEIGHT (f, ph); |
12749 |
|
ph = CHAR_TO_PIXEL_HEIGHT (f, newheight) |
12750 |
|
- f->output_data.x->y_pixels_diff; |
12751 |
|
newheight = PIXEL_TO_CHAR_HEIGHT (f, ph); |
12752 |
|
*top_pos = 0; |
12753 |
|
} |
12754 |
|
|
12755 |
|
if (f->output_data.x->want_fullscreen & FULLSCREEN_WIDTH) |
12756 |
|
{ |
12757 |
|
int pw; |
12758 |
|
|
12759 |
|
pw = FRAME_X_DISPLAY_INFO (f)->width; |
12760 |
|
newwidth = PIXEL_TO_CHAR_WIDTH (f, pw); |
12761 |
|
pw = CHAR_TO_PIXEL_WIDTH (f, newwidth) |
12762 |
|
- f->output_data.x->x_pixels_diff; |
12763 |
|
newwidth = PIXEL_TO_CHAR_WIDTH (f, pw); |
12764 |
|
*left_pos = 0; |
12765 |
|
} |
12766 |
|
|
12767 |
|
*width = newwidth; |
12768 |
|
*height = newheight; |
12769 |
|
} |
12770 |
|
|
12771 |
|
|
12772 |
/* Change the size of frame F's X window to COLS/ROWS in the case F |
/* Change the size of frame F's X window to COLS/ROWS in the case F |
12773 |
doesn't have a widget. If CHANGE_GRAVITY is 1, we change to |
doesn't have a widget. If CHANGE_GRAVITY is 1, we change to |