emacs-diffs
[Top][All Lists]
Advanced

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

master 689be0bdd5: Only send fallback MONITORS_CHANGED_EVENT when dimens


From: Po Lu
Subject: master 689be0bdd5: Only send fallback MONITORS_CHANGED_EVENT when dimensions really changed
Date: Mon, 23 May 2022 20:31:09 -0400 (EDT)

branch: master
commit 689be0bdd5ba0a619fd97c435f75d43c15b164e2
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Only send fallback MONITORS_CHANGED_EVENT when dimensions really changed
    
    * src/xterm.c (handle_one_xevent): Test that root window
    configure width and height are not the same as the previously
    recorded ones.
---
 src/xterm.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index dc1daaf6e1..f86ec0fad3 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -16657,13 +16657,17 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          /* Catch screen size changes even if RandR is not available
             on the client.  GTK does this internally.  */
 
-         inev.ie.kind = MONITORS_CHANGED_EVENT;
-         XSETTERMINAL (inev.ie.arg, dpyinfo->terminal);
+         if (configureEvent.xconfigure.width != dpyinfo->screen_width
+             || configureEvent.xconfigure.height != dpyinfo->screen_height)
+           {
+             inev.ie.kind = MONITORS_CHANGED_EVENT;
+             XSETTERMINAL (inev.ie.arg, dpyinfo->terminal);
 
-         /* Store this event now since inev.ie.type could be set to
-            MOVE_FRAME_EVENT later.  */
-         kbd_buffer_store_event (&inev.ie);
-         inev.ie.kind = NO_EVENT;
+             /* Store this event now since inev.ie.type could be set to
+                MOVE_FRAME_EVENT later.  */
+             kbd_buffer_store_event (&inev.ie);
+             inev.ie.kind = NO_EVENT;
+           }
 #endif
 
          dpyinfo->screen_width = configureEvent.xconfigure.width;



reply via email to

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