diff src/xterm.h @ 52752:751a01f97570

Make (modify-frame-parameters nil '((top . 0))) work for all types of window managers in X.
author Jan Djärv <jan.h.d@swipnet.se>
date Sun, 05 Oct 2003 11:52:47 +0000
parents 695cf19ef79e
children d08832a11cfd
line wrap: on
line diff
--- a/src/xterm.h	Sat Oct 04 09:15:13 2003 +0000
+++ b/src/xterm.h	Sun Oct 05 11:52:47 2003 +0000
@@ -361,10 +361,22 @@
   XColor *color_cells;
   int ncolor_cells;
 
-  /* Bits and shifts to use to compose pixel values on Direct and TrueColor
-     visuals.  */
+  /* Bits and shifts to use to compose pixel values on TrueColor visuals.  */
   int red_bits, blue_bits, green_bits;
   int red_offset, blue_offset, green_offset;
+
+  /* The type of window manager we have.  If we move FRAME_OUTER_WINDOW
+     to x/y 0/0, some window managers (type A) puts the window manager
+     decorations outside the screen and FRAME_OUTER_WINDOW exactly at 0/0.
+     Other window managers (type B) puts the window including decorations
+     at 0/0, so FRAME_OUTER_WINDOW is a bit below 0/0.
+     Record the type of WM in use so we can compensate for type A WMs.  */
+  enum
+    {
+      X_WMTYPE_UNKNOWN,
+      X_WMTYPE_A,
+      X_WMTYPE_B
+    } wm_type;
 };
 
 #ifdef HAVE_X_I18N
@@ -611,6 +623,15 @@
      frame, or IMPLICIT if we received an EnterNotify.
      FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
   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.  */
+  int expected_top;
+  int expected_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;
 };
 
 #define No_Cursor (None)