aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2003-10-05 13:42:04 +0000
committerJan Djärv2003-10-05 13:42:04 +0000
commit068ae0fd96c6bbd9aaa3b3d96232cf548749a36d (patch)
treef81a93a29681e6d45d53c696b9d7d41ad8f0b219
parent96f09305d6345236220a4c705688c63210b5b890 (diff)
downloademacs-068ae0fd96c6bbd9aaa3b3d96232cf548749a36d.tar.gz
emacs-068ae0fd96c6bbd9aaa3b3d96232cf548749a36d.zip
* w32term.c (w32_read_socket): Remove call to x_check_fullscreen_move,
that function is removed. * xterm.c (x_set_offset): Use move_offset_left/top instead of x/y_pixels_outer_diff. (x_check_expected_move): Calculate move_offset_left/top. * xterm.h (struct x_output): New members: move_offset_top/left. * frame.c (x_set_frame_parameters): x_fullscreen_move removed, call x_set_offset directly. * frame.h (enum): FULLSCREEN_MOVE_WAIT removed.
-rw-r--r--src/ChangeLog14
-rw-r--r--src/frame.c27
-rw-r--r--src/frame.h1
-rw-r--r--src/w32term.c36
-rw-r--r--src/xterm.c15
-rw-r--r--src/xterm.h6
6 files changed, 32 insertions, 67 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1dfef46a7ce..2063e768fdd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,19 @@
12003-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 12003-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 2
3 * w32term.c (w32_read_socket): Remove call to x_check_fullscreen_move,
4 that function is removed.
5
6 * xterm.c (x_set_offset): Use move_offset_left/top instead of
7 x/y_pixels_outer_diff.
8 (x_check_expected_move): Calculate move_offset_left/top.
9
10 * xterm.h (struct x_output): New members: move_offset_top/left.
11
12 * frame.c (x_set_frame_parameters): x_fullscreen_move removed,
13 call x_set_offset directly.
14
15 * frame.h (enum): FULLSCREEN_MOVE_WAIT removed.
16
3 * frame.c (Fdelete_frame): Free decode_mode_spec_buffer. 17 * frame.c (Fdelete_frame): Free decode_mode_spec_buffer.
4 18
5 * xterm.c (x_delete_display): Free font names and font_encoder 19 * xterm.c (x_delete_display): Free font names and font_encoder
diff --git a/src/frame.c b/src/frame.c
index 87175e0c6c9..3a3758b93e0 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2593,30 +2593,6 @@ x_fullscreen_adjust (f, width, height, top_pos, left_pos)
2593} 2593}
2594 2594
2595 2595
2596/* Really try to move where we want to be in case of fullscreen. Some WMs
2597 moves the window where we tell them. Some (mwm, twm) moves the outer
2598 window manager window there instead.
2599 Try to compensate for those WM here. */
2600
2601static void
2602x_fullscreen_move (f, new_top, new_left)
2603 struct frame *f;
2604 int new_top;
2605 int new_left;
2606{
2607 if (new_top != f->top_pos || new_left != f->left_pos)
2608 {
2609 int move_x = new_left;
2610 int move_y = new_top;
2611
2612#ifndef HAVE_X_WINDOWS
2613 f->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
2614#endif
2615
2616 x_set_offset (f, move_x, move_y, 1);
2617 }
2618}
2619
2620/* Change the parameters of frame F as specified by ALIST. 2596/* Change the parameters of frame F as specified by ALIST.
2621 If a parameter is not specially recognized, do nothing special; 2597 If a parameter is not specially recognized, do nothing special;
2622 otherwise call the `x_set_...' function for that parameter. 2598 otherwise call the `x_set_...' function for that parameter.
@@ -2812,7 +2788,8 @@ x_set_frame_parameters (f, alist)
2812 int new_left, new_top; 2788 int new_left, new_top;
2813 2789
2814 x_fullscreen_adjust (f, &width, &height, &new_top, &new_left); 2790 x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
2815 x_fullscreen_move (f, new_top, new_left); 2791 if (new_top != f->top_pos || new_left != f->left_pos)
2792 x_set_offset (f, new_left, new_top, 1);
2816 } 2793 }
2817#endif 2794#endif
2818 2795
diff --git a/src/frame.h b/src/frame.h
index 0b758fccca7..5efede23199 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1023,7 +1023,6 @@ enum
1023 FULLSCREEN_HEIGHT = 2, 1023 FULLSCREEN_HEIGHT = 2,
1024 FULLSCREEN_BOTH = 3, 1024 FULLSCREEN_BOTH = 3,
1025 FULLSCREEN_WAIT = 4, 1025 FULLSCREEN_WAIT = 4,
1026 FULLSCREEN_MOVE_WAIT = 8,
1027}; 1026};
1028 1027
1029 1028
diff --git a/src/w32term.c b/src/w32term.c
index 27f221d06ca..3e4543471c3 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3064,7 +3064,6 @@ note_mouse_movement (frame, msg)
3064static struct scroll_bar *x_window_to_scroll_bar (); 3064static struct scroll_bar *x_window_to_scroll_bar ();
3065static void x_scroll_bar_report_motion (); 3065static void x_scroll_bar_report_motion ();
3066static void x_check_fullscreen P_ ((struct frame *)); 3066static void x_check_fullscreen P_ ((struct frame *));
3067static void x_check_fullscreen_move P_ ((struct frame *));
3068static int glyph_rect P_ ((struct frame *f, int, int, RECT *)); 3067static int glyph_rect P_ ((struct frame *f, int, int, RECT *));
3069 3068
3070 3069
@@ -4476,7 +4475,6 @@ w32_read_socket (sd, bufp, numchars, expected)
4476 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 4475 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
4477 if (f) 4476 if (f)
4478 { 4477 {
4479 x_check_fullscreen_move(f);
4480 if (f->want_fullscreen & FULLSCREEN_WAIT) 4478 if (f->want_fullscreen & FULLSCREEN_WAIT)
4481 f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH); 4479 f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH);
4482 } 4480 }
@@ -5442,9 +5440,7 @@ x_check_fullscreen (f)
5442 x_fullscreen_adjust (f, &width, &height, &ign, &ign); 5440 x_fullscreen_adjust (f, &width, &height, &ign, &ign);
5443 5441
5444 /* We do not need to move the window, it shall be taken care of 5442 /* We do not need to move the window, it shall be taken care of
5445 when setting WM manager hints. 5443 when setting WM manager hints. */
5446 If the frame is visible already, the position is checked by
5447 x_check_fullscreen_move. */
5448 if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) 5444 if (FRAME_COLS (f) != width || FRAME_LINES (f) != height)
5449 { 5445 {
5450 change_frame_size (f, height, width, 0, 1, 0); 5446 change_frame_size (f, height, width, 0, 1, 0);
@@ -5457,36 +5453,6 @@ x_check_fullscreen (f)
5457 } 5453 }
5458} 5454}
5459 5455
5460/* If frame parameters are set after the frame is mapped, we need to move
5461 the window. This is done in xfns.c.
5462 Some window managers moves the window to the right position, some
5463 moves the outer window manager window to the specified position.
5464 Here we check that we are in the right spot. If not, make a second
5465 move, assuming we are dealing with the second kind of window manager. */
5466static void
5467x_check_fullscreen_move (f)
5468 struct frame *f;
5469{
5470 if (f->want_fullscreen & FULLSCREEN_MOVE_WAIT)
5471 {
5472 int expect_top = f->top_pos;
5473 int expect_left = f->left_pos;
5474
5475 if (f->want_fullscreen & FULLSCREEN_HEIGHT)
5476 expect_top = 0;
5477 if (f->want_fullscreen & FULLSCREEN_WIDTH)
5478 expect_left = 0;
5479
5480 if (expect_top != f->top_pos
5481 || expect_left != f->left_pos)
5482 x_set_offset (f, expect_left, expect_top, 1);
5483
5484 /* Just do this once */
5485 f->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT;
5486 }
5487}
5488
5489
5490/* Call this to change the size of frame F's x-window. 5456/* Call this to change the size of frame F's x-window.
5491 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity 5457 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
5492 for this size change and subsequent size changes. 5458 for this size change and subsequent size changes.
diff --git a/src/xterm.c b/src/xterm.c
index c563757e63b..c686824a003 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8337,8 +8337,11 @@ x_set_offset (f, xoff, yoff, change_gravity)
8337 8337
8338 if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A) 8338 if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A)
8339 { 8339 {
8340 modified_left += FRAME_X_OUTPUT (f)->x_pixels_outer_diff; 8340 /* Some WMs (twm, wmaker at least) has an offset that is smaller
8341 modified_top += FRAME_X_OUTPUT (f)->y_pixels_outer_diff; 8341 than the WM decorations. So we use the calculated offset instead
8342 of the WM decoration sizes here (x/y_pixels_outer_diff). */
8343 modified_left += FRAME_X_OUTPUT (f)->move_offset_left;
8344 modified_top += FRAME_X_OUTPUT (f)->move_offset_top;
8342 } 8345 }
8343 8346
8344 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 8347 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
@@ -8399,11 +8402,13 @@ x_check_expected_move (f)
8399 { 8402 {
8400 int expect_top = FRAME_X_OUTPUT (f)->expected_top; 8403 int expect_top = FRAME_X_OUTPUT (f)->expected_top;
8401 int expect_left = FRAME_X_OUTPUT (f)->expected_left; 8404 int expect_left = FRAME_X_OUTPUT (f)->expected_left;
8402 8405
8403 if (expect_top != f->top_pos || expect_left != f->left_pos) 8406 if (expect_top != f->top_pos || expect_left != f->left_pos)
8404 { 8407 {
8405 if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN) 8408 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A;
8406 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A; 8409 FRAME_X_OUTPUT (f)->move_offset_left = expect_left - f->left_pos;
8410 FRAME_X_OUTPUT (f)->move_offset_top = expect_top - f->top_pos;
8411
8407 x_set_offset (f, expect_left, expect_top, 1); 8412 x_set_offset (f, expect_left, expect_top, 1);
8408 } 8413 }
8409 else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN) 8414 else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN)
diff --git a/src/xterm.h b/src/xterm.h
index 5f8a1af0444..fbd268abda2 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -625,10 +625,14 @@ struct x_output
625 int focus_state; 625 int focus_state;
626 626
627 /* The latest move we made to FRAME_OUTER_WINDOW. Saved so we can 627 /* The latest move we made to FRAME_OUTER_WINDOW. Saved so we can
628 compensate for type A WMs (see wm_type in dpyinfo above. */ 628 compensate for type A WMs (see wm_type in dpyinfo above). */
629 int expected_top; 629 int expected_top;
630 int expected_left; 630 int expected_left;
631 631
632 /* The offset we need to add to compensate for type A WMs. */
633 int move_offset_top;
634 int move_offset_left;
635
632 /* Nonzero if we have made a move and needs to check if the WM placed us 636 /* Nonzero if we have made a move and needs to check if the WM placed us
633 at the right position. */ 637 at the right position. */
634 int check_expected_move; 638 int check_expected_move;