emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115521: Hack frame resizing on Windows (Bug#16028).


From: Martin Rudalics
Subject: [Emacs-diffs] trunk r115521: Hack frame resizing on Windows (Bug#16028).
Date: Sat, 14 Dec 2013 11:06:10 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115521
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Sat 2013-12-14 12:06:00 +0100
message:
  Hack frame resizing on Windows (Bug#16028).
  
  * w32term.c (w32_enable_frame_resize_hack): New variable.
  (x_set_window_size): Use it to hack frame resizing on Windows
  (Bug#16028).
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/w32term.c                  w32term.c-20091113204419-o5vbwnq5f7feedwu-950
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-12-14 09:57:53 +0000
+++ b/src/ChangeLog     2013-12-14 11:06:00 +0000
@@ -1,3 +1,9 @@
+2013-12-14  Martin Rudalics  <address@hidden>
+
+       * w32term.c (w32_enable_frame_resize_hack): New variable.
+       (x_set_window_size): Use it to hack frame resizing on Windows
+       (Bug#16028).
+
 2013-12-14  Eli Zaretskii  <address@hidden>
 
        * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-12-11 17:06:29 +0000
+++ b/src/w32term.c     2013-12-14 11:06:00 +0000
@@ -5747,8 +5747,12 @@
                       SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
   }
 
-#if 0
-  /* The following mirrors what is done in xterm.c. It appears to be
+  /* If w32_enable_frame_resize_hack is non-nil, immediately apply the
+     new pixel sizes to the frame and its subwindows.  See discussion
+     of Bug#16028 for why we need this.  */
+
+  if (w32_enable_frame_resize_hack)
+    /* The following mirrors what is done in xterm.c. It appears to be
      for informing lisp of the new size immediately, while the actual
      resize will happen asynchronously. But on Windows, the menu bar
      automatically wraps when the frame is too narrow to contain it,
@@ -5775,25 +5779,19 @@
 
      We pass 1 for DELAY since we can't run Lisp code inside of
      a BLOCK_INPUT.  */
-  change_frame_size (f, width, height, 0, 1, 0, 0);
-  FRAME_PIXEL_WIDTH (f) = pixelwidth;
-  FRAME_PIXEL_HEIGHT (f) = pixelheight;
-
-  /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
-     receive in the ConfigureNotify event; if we get what we asked
-     for, then the event won't cause the screen to become garbaged, so
-     we have to make sure to do it here.  */
-  SET_FRAME_GARBAGED (f);
-
-  /* If cursor was outside the new size, mark it as off.  */
-  mark_window_cursors_off (XWINDOW (f->root_window));
-
-  /* Clear out any recollection of where the mouse highlighting was,
-     since it might be in a place that's outside the new frame size.
-     Actually checking whether it is outside is a pain in the neck,
-     so don't try--just let the highlighting be done afresh with new size.  */
-  cancel_mouse_face (f);
-#endif
+    {
+      change_frame_size (f, width, height, 0, 1, 0, pixelwise);
+      SET_FRAME_GARBAGED (f);
+
+      /* If cursor was outside the new size, mark it as off.  */
+      mark_window_cursors_off (XWINDOW (f->root_window));
+
+      /* Clear out any recollection of where the mouse highlighting was,
+        since it might be in a place that's outside the new frame size.
+        Actually checking whether it is outside is a pain in the neck,
+        so don't try--just let the highlighting be done afresh with new size.  
*/
+      cancel_mouse_face (f);
+    }
 
   unblock_input ();
 }
@@ -6673,6 +6671,16 @@
 Windows 8.  It is set to nil on Windows 9X.  */);
   w32_unicode_filenames = 0;
 
+  DEFVAR_BOOL ("w32-enable-frame-resize-hack",
+              w32_enable_frame_resize_hack,
+     doc: /* Non-nil means enable hack for frame resizing on Windows.
+A value of nil means to resize frames by sending a corresponding request
+to the Windows API and changing the pixel sizes of the frame and its
+windows after the latter calls back.  If this is non-nil, Emacs changes
+the pixel sizes of the frame and its windows at the time it sends the
+resize request to the API.  */);
+  w32_enable_frame_resize_hack = 0;
+
   /* Tell Emacs about this window system.  */
   Fprovide (Qw32, Qnil);
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]