From 672af0a5da6d13edc221f32c36a0b89bea9e799e Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 22 May 2022 09:38:21 +0800 Subject: [PATCH] Set display size upon RRScreenChangeNotify * src/xterm.c (handle_one_xevent): Handle RRScreenChangeNotify correctly. --- src/xterm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.39.2