From 8f6149b04b6e373987b9fac40673fc98d028998a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 12 May 2023 16:13:32 -0400 Subject: X11: Use the root provided by XGetWindowAttributes() --- src/x11.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/x11.c') diff --git a/src/x11.c b/src/x11.c index a5b0389..e4c0aab 100644 --- a/src/x11.c +++ b/src/x11.c @@ -1066,12 +1066,11 @@ getCurrentConfiguration(PuglView* const view) XGetWindowAttributes(display, view->impl->win, &attrs); // Get window position relative to the root window - const Window root = RootWindow(display, view->impl->screen); - Window ignoredChild = 0; - int rootX = 0; - int rootY = 0; + Window ignoredChild = 0; + int rootX = 0; + int rootY = 0; XTranslateCoordinates( - display, view->impl->win, root, 0, 0, &rootX, &rootY, &ignoredChild); + display, view->impl->win, attrs.root, 0, 0, &rootX, &rootY, &ignoredChild); // Build a configure event based on the current window configuration PuglEvent configureEvent = {{PUGL_CONFIGURE, 0}}; -- cgit v1.2.1