changeset 52754:d08832a11cfd

* 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.
author Jan Djärv <jan.h.d@swipnet.se>
date Sun, 05 Oct 2003 13:42:04 +0000
parents 551e8ebadb62
children 6c7cae7ce71a
files src/ChangeLog src/frame.c src/frame.h src/w32term.c src/xterm.c src/xterm.h
diffstat 6 files changed, 32 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Oct 05 12:15:39 2003 +0000
+++ b/src/ChangeLog	Sun Oct 05 13:42:04 2003 +0000
@@ -1,5 +1,19 @@
 2003-10-05  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
+	* 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.
+
 	* frame.c (Fdelete_frame): Free decode_mode_spec_buffer.
 
 	* xterm.c (x_delete_display): Free font names and font_encoder
--- a/src/frame.c	Sun Oct 05 12:15:39 2003 +0000
+++ b/src/frame.c	Sun Oct 05 13:42:04 2003 +0000
@@ -2593,30 +2593,6 @@
 }
 
 
-/* Really try to move where we want to be in case of fullscreen.  Some WMs
-   moves the window where we tell them.  Some (mwm, twm) moves the outer
-   window manager window there instead.
-   Try to compensate for those WM here. */
-
-static void
-x_fullscreen_move (f, new_top, new_left)
-     struct frame *f;
-     int new_top;
-     int new_left;
-{
-  if (new_top != f->top_pos || new_left != f->left_pos)
-    {
-      int move_x = new_left;
-      int move_y = new_top;
-
-#ifndef HAVE_X_WINDOWS
-      f->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
-#endif
-
-      x_set_offset (f, move_x, move_y, 1);
-    }
-}
-
 /* Change the parameters of frame F as specified by ALIST.
    If a parameter is not specially recognized, do nothing special;
    otherwise call the `x_set_...' function for that parameter.
@@ -2812,7 +2788,8 @@
       int new_left, new_top;
 
       x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
-      x_fullscreen_move (f, new_top, new_left);
+      if (new_top != f->top_pos || new_left != f->left_pos)
+        x_set_offset (f, new_left, new_top, 1);
     }
 #endif
 
--- a/src/frame.h	Sun Oct 05 12:15:39 2003 +0000
+++ b/src/frame.h	Sun Oct 05 13:42:04 2003 +0000
@@ -1023,7 +1023,6 @@
   FULLSCREEN_HEIGHT     = 2,
   FULLSCREEN_BOTH       = 3,
   FULLSCREEN_WAIT       = 4,
-  FULLSCREEN_MOVE_WAIT  = 8,
 };
 
 
--- a/src/w32term.c	Sun Oct 05 12:15:39 2003 +0000
+++ b/src/w32term.c	Sun Oct 05 13:42:04 2003 +0000
@@ -3064,7 +3064,6 @@
 static struct scroll_bar *x_window_to_scroll_bar ();
 static void x_scroll_bar_report_motion ();
 static void x_check_fullscreen P_ ((struct frame *));
-static void x_check_fullscreen_move P_ ((struct frame *));
 static int glyph_rect P_ ((struct frame *f, int, int, RECT *));
 
 
@@ -4476,7 +4475,6 @@
 	  f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
 	  if (f)
 	    {
-	      x_check_fullscreen_move(f);
 	      if (f->want_fullscreen & FULLSCREEN_WAIT)
 		f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH);
 	    }
@@ -5442,9 +5440,7 @@
       x_fullscreen_adjust (f, &width, &height, &ign, &ign);
 
       /* We do not need to move the window, it shall be taken care of
-         when setting WM manager hints.
-         If the frame is visible already, the position is checked by
-         x_check_fullscreen_move. */
+         when setting WM manager hints.  */
       if (FRAME_COLS (f) != width || FRAME_LINES (f) != height)
         {
           change_frame_size (f, height, width, 0, 1, 0);
@@ -5457,36 +5453,6 @@
     }
 }
 
-/* If frame parameters are set after the frame is mapped, we need to move
-   the window.  This is done in xfns.c.
-   Some window managers moves the window to the right position, some
-   moves the outer window manager window to the specified position.
-   Here we check that we are in the right spot.  If not, make a second
-   move, assuming we are dealing with the second kind of window manager. */
-static void
-x_check_fullscreen_move (f)
-     struct frame *f;
-{
-  if (f->want_fullscreen & FULLSCREEN_MOVE_WAIT)
-  {
-    int expect_top = f->top_pos;
-    int expect_left = f->left_pos;
-
-    if (f->want_fullscreen & FULLSCREEN_HEIGHT)
-      expect_top = 0;
-    if (f->want_fullscreen & FULLSCREEN_WIDTH)
-      expect_left = 0;
-
-    if (expect_top != f->top_pos
-        || expect_left != f->left_pos)
-      x_set_offset (f, expect_left, expect_top, 1);
-
-    /* Just do this once */
-    f->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT;
-  }
-}
-
-
 /* Call this to change the size of frame F's x-window.
    If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
    for this size change and subsequent size changes.
--- a/src/xterm.c	Sun Oct 05 12:15:39 2003 +0000
+++ b/src/xterm.c	Sun Oct 05 13:42:04 2003 +0000
@@ -8337,8 +8337,11 @@
 
   if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A)
     {
-      modified_left += FRAME_X_OUTPUT (f)->x_pixels_outer_diff;
-      modified_top += FRAME_X_OUTPUT (f)->y_pixels_outer_diff;
+      /* Some WMs (twm, wmaker at least) has an offset that is smaller
+         than the WM decorations.  So we use the calculated offset instead
+         of the WM decoration sizes here (x/y_pixels_outer_diff).  */
+      modified_left += FRAME_X_OUTPUT (f)->move_offset_left;
+      modified_top += FRAME_X_OUTPUT (f)->move_offset_top;
     }
 
   XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
@@ -8399,11 +8402,13 @@
   {
     int expect_top = FRAME_X_OUTPUT (f)->expected_top;
     int expect_left = FRAME_X_OUTPUT (f)->expected_left;
-    
+
     if (expect_top != f->top_pos || expect_left != f->left_pos)
       {
-        if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN)
-          FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A;
+        FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A;
+        FRAME_X_OUTPUT (f)->move_offset_left = expect_left - f->left_pos;
+        FRAME_X_OUTPUT (f)->move_offset_top = expect_top - f->top_pos;
+
         x_set_offset (f, expect_left, expect_top, 1);
       }
     else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN)
--- a/src/xterm.h	Sun Oct 05 12:15:39 2003 +0000
+++ b/src/xterm.h	Sun Oct 05 13:42:04 2003 +0000
@@ -625,10 +625,14 @@
   int focus_state;
 
   /* The latest move we made to FRAME_OUTER_WINDOW.  Saved so we can
-     compensate for type A WMs (see wm_type in dpyinfo above.  */
+     compensate for type A WMs (see wm_type in dpyinfo above).  */
   int expected_top;
   int expected_left;
 
+  /* The offset we need to add to compensate for type A WMs.  */
+  int move_offset_top;
+  int move_offset_left;
+
   /* Nonzero if we have made a move and needs to check if the WM placed us
      at the right position.  */
   int check_expected_move;