]> git.eshelyaron.com Git - emacs.git/commitdiff
Set display size upon RRScreenChangeNotify
authorPo Lu <luangruo@yahoo.com>
Sun, 22 May 2022 01:38:21 +0000 (09:38 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 22 May 2022 01:38:21 +0000 (09:38 +0800)
* src/xterm.c (handle_one_xevent): Handle RRScreenChangeNotify
correctly.

src/xterm.c

index 05ede2e58030eaf9aba5e47077987dd6a9112793..5c2deb62e0df06da1a2c2b52403d91174080e23a 100644 (file)
@@ -20120,6 +20120,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          union buffered_input_event *ev;
          Time timestamp;
          Lisp_Object current_monitors;
+         XRRScreenChangeNotifyEvent *notify;
 
          if (event->type == (dpyinfo->xrandr_event_base
                              + RRScreenChangeNotify))
@@ -20127,7 +20128,13 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
          if (event->type == (dpyinfo->xrandr_event_base
                              + RRScreenChangeNotify))
-           timestamp = ((XRRScreenChangeNotifyEvent *) event)->timestamp;
+           {
+             notify = ((XRRScreenChangeNotifyEvent *) event);
+             timestamp = notify->timestamp;
+
+             dpyinfo->screen_width = notify->width;
+             dpyinfo->screen_height = notify->height;
+           }
          else
            timestamp = 0;