From f06d814d5b26e9206675522e91bef785662dd6ae Mon Sep 17 00:00:00 2001 From: Olivier Fourdan <fourdan@xfce.org> Date: Sun, 12 May 2019 17:33:42 +0200 Subject: [PATCH] screen: We always query the root window We always query the root window for pointer location, there is no point in passing it around through the API really. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> --- src/compositor.c | 2 +- src/misc.c | 5 +++-- src/misc.h | 1 - src/placement.c | 2 +- src/screen.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 5877f2201..85818f8e1 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -3332,7 +3332,7 @@ zoom_timeout_cb (gpointer data) return FALSE; /* stop calling this callback */ } - getMouseXY (screen_info, screen_info->xroot, &x_root, &y_root); + getMouseXY (screen_info, &x_root, &y_root); if (screen_info->cursorLocation.x + screen_info->cursorOffsetX != x_root || screen_info->cursorLocation.y + screen_info->cursorOffsetY != y_root) diff --git a/src/misc.c b/src/misc.c index 080b1f096..05db3dbb6 100644 --- a/src/misc.c +++ b/src/misc.c @@ -45,7 +45,7 @@ #include "misc.h" guint -getMouseXY (ScreenInfo *screen_info, Window w, gint *x2, gint *y2) +getMouseXY (ScreenInfo *screen_info, gint *x2, gint *y2) { Window w1, w2; guint mask; @@ -54,8 +54,9 @@ getMouseXY (ScreenInfo *screen_info, Window w, gint *x2, gint *y2) TRACE ("window (0x%lx)", w); myDisplayErrorTrapPush (screen_info->display_info); - XQueryPointer (myScreenGetXDisplay (screen_info), w, &w1, &w2, &x1, &y1, x2, y2, &mask); + XQueryPointer (myScreenGetXDisplay (screen_info), screen_info->xroot, &w1, &w2, &x1, &y1, x2, y2, &mask); myDisplayErrorTrapPopIgnored (screen_info->display_info); + return mask; } diff --git a/src/misc.h b/src/misc.h index 292401412..73b864daf 100644 --- a/src/misc.h +++ b/src/misc.h @@ -61,7 +61,6 @@ #endif guint getMouseXY (ScreenInfo *, - Window, gint *, gint *); GC createGC (ScreenInfo *, diff --git a/src/placement.c b/src/placement.c index 15975b390..3fb1294f3 100644 --- a/src/placement.c +++ b/src/placement.c @@ -800,7 +800,7 @@ clientInitPosition (Client * c) } else { - getMouseXY (screen_info, screen_info->xroot, &msx, &msy); + getMouseXY (screen_info, &msx, &msy); myScreenFindMonitorAtPoint (screen_info, msx, msy, &rect); place = TRUE; } diff --git a/src/screen.c b/src/screen.c index 5349e312c..f18c0d70b 100644 --- a/src/screen.c +++ b/src/screen.c @@ -606,7 +606,7 @@ myScreenGetModifierPressed (ScreenInfo *screen_info) { int rx, ry; - return (int) getMouseXY (screen_info, screen_info->xroot, &rx, &ry); + return (int) getMouseXY (screen_info, &rx, &ry); } Client * -- GitLab