From: Po Lu Date: Sun, 22 May 2022 01:38:21 +0000 (+0800) Subject: Set display size upon RRScreenChangeNotify X-Git-Tag: emacs-29.0.90~1910^2~536 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=672af0a5da6d13edc221f32c36a0b89bea9e799e;p=emacs.git Set display size upon RRScreenChangeNotify * src/xterm.c (handle_one_xevent): Handle RRScreenChangeNotify correctly. --- diff --git a/src/xterm.c b/src/xterm.c index 05ede2e5803..5c2deb62e0d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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;