Details
-
Bug
-
Resolution: Out of scope
-
P4: Low
-
4.7.0
-
None
Description
QApplication::topLevelAt() and ::widgetAt() do not take the screen into consideration. Instead, they always return widgets from the screen with the current mouse cursor. This breaks on setups with multiple touch screens.
There's also no way to query a widget at coordinates for any given screen without manually moving the mouse cursor into that screen.
I created the following quick hack for the customer, but it would be nice if this could be fixed in Qt properly, e.g. by adding another parameter: QApplication::topLevelAt(const QPoint&, int screen).
diff --git a/src/gui/kernel/qapplication_x11.cpp
b/src/gui/kernel/qapplication_x11.cpp
index 3664743..bea83d5 100644
— a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2872,13 +2872,8 @@ Window QX11Data::findClientWindow(Window win, Atom
property, bool leaf)
return target;
}
-QWidget *QApplication::topLevelAt(const QPoint &p)
+Q_GUI_EXPORT QWidget *x11TopLevelAtScreen(const QPoint &p, int screen)
}
return w ? w->window() : 0;
+}
+
+QWidget *QApplication::topLevelAt(const QPoint &p)
+