]> git.eshelyaron.com Git - emacs.git/commitdiff
Call XRRUpdateConfiguration when the root window geometry changes
authorPo Lu <luangruo@yahoo.com>
Sat, 21 May 2022 03:34:51 +0000 (11:34 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 21 May 2022 03:34:51 +0000 (11:34 +0800)
* src/xterm.c (handle_one_xevent): Call XRRUpdateConfiguration
on RRScreenChangeNotify and upon ConfigureNotify events for the
root window.

src/xterm.c

index b321f43da16a396befd5a3b44c3ec9279a87166b..add0c848db9be9d6e73c28b261ea9cacb4762ba7 100644 (file)
@@ -16613,6 +16613,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
       if (configureEvent.xconfigure.window == dpyinfo->root_window)
        {
+#ifdef HAVE_XRANDR
+         /* This function is OK to call even if the X server doesn't
+            support RandR.  */
+         XRRUpdateConfiguration (&configureEvent);
+#endif
+
          dpyinfo->screen_width = configureEvent.xconfigure.width;
          dpyinfo->screen_height = configureEvent.xconfigure.height;
        }
@@ -20114,6 +20120,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          union buffered_input_event *ev;
          Time timestamp;
 
+         if (event->type == (dpyinfo->xrandr_event_base
+                             + RRScreenChangeNotify))
+           XRRUpdateConfiguration (event);
+
          if (event->type == (dpyinfo->xrandr_event_base
                              + RRScreenChangeNotify))
            timestamp = ((XRRScreenChangeNotifyEvent *) event)->timestamp;