From: Po Lu Date: Tue, 15 Feb 2022 05:41:52 +0000 (+0800) Subject: Replace use of `DefaultRootWindow' with our recorded root window X-Git-Tag: emacs-29.0.90~2305 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6f566021edc637c0e17ad1717e55440ca73bad38;p=emacs.git Replace use of `DefaultRootWindow' with our recorded root window * src/xfns.c (x_relative_mouse_position): (x_set_parent_frame): (Fx_mouse_absolute_pixel_position): (Fx_set_mouse_absolute_pixel_position): * src/xterm.c (x_iconify_frame): Use dpyinfo->root_window instead of DefaultRootWindow. --- diff --git a/src/xfns.c b/src/xfns.c index c490dc1802a..0f8d6933b39 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -610,7 +610,7 @@ x_relative_mouse_position (struct frame *f, int *x, int *y) block_input (); XQueryPointer (FRAME_X_DISPLAY (f), - DefaultRootWindow (FRAME_X_DISPLAY (f)), + FRAME_DISPLAY_INFO (f)->root_window, /* The root window which contains the pointer. */ &root, @@ -910,7 +910,7 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu block_input (); XReparentWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), - p ? FRAME_X_WINDOW (p) : DefaultRootWindow (FRAME_X_DISPLAY (f)), + p ? FRAME_X_WINDOW (p) : FRAME_DISPLAY_INFO (f)->root_window, f->left_pos, f->top_pos); #ifdef USE_GTK if (EQ (x_gtk_resize_child_frames, Qresize_mode)) @@ -6372,7 +6372,7 @@ selected frame's display. */) block_input (); XQueryPointer (FRAME_X_DISPLAY (f), - DefaultRootWindow (FRAME_X_DISPLAY (f)), + FRAME_DISPLAY_INFO (f)->root_window, &root, &dummy_window, &x, &y, &dummy, &dummy, (unsigned int *) &dummy); unblock_input (); @@ -6406,14 +6406,15 @@ The coordinates X and Y are interpreted in pixels relative to a position &deviceid)) { XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None, - DefaultRootWindow (FRAME_X_DISPLAY (f)), + FRAME_DISPLAY_INFO (f)->root_window, 0, 0, 0, 0, xval, yval); } XUngrabServer (FRAME_X_DISPLAY (f)); } else #endif - XWarpPointer (FRAME_X_DISPLAY (f), None, DefaultRootWindow (FRAME_X_DISPLAY (f)), + XWarpPointer (FRAME_X_DISPLAY (f), None, + FRAME_DISPLAY_INFO (f)->root_window, 0, 0, 0, 0, xval, yval); unblock_input (); diff --git a/src/xterm.c b/src/xterm.c index 60d87ccbf09..23317bf6959 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -15075,7 +15075,7 @@ x_iconify_frame (struct frame *f) msg.xclient.data.l[0] = IconicState; if (! XSendEvent (FRAME_X_DISPLAY (f), - DefaultRootWindow (FRAME_X_DISPLAY (f)), + FRAME_DISPLAY_INFO (f)->root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &msg))