Summary:
This call is added for the window rules kcm which has a detect
functionality. As that detect functionality cannot query any Wayland
windows we need to have some functionality in KWin core. Furthermore
this allows to simplify the code in the kcm as all the custom X11
interaction can be removed. KWin internally has the functionality to
find a window at a given position.
From a security perspective adding this dbus method is fine as the user
stays in control of the functionality. It requires active click to
select a window.
The new dbus call is already used in the rules kcm replacing the
X11 based detect functionality. That a detect is now able to get
information for both X11 and Wayland windows. So far only X11 windows
on X11 were supported. So this fills an important gap in the Wayland
offerings. It should now be possible to create rules for Wayland
windows (though may not be fully functional).
Test Plan: Run the kwin_rules_dialog and it detected the window correctly
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10490
The reason for this change is that the default ctor of KWindowInfo
creates a broken object. Calling any method in it will result in a
crush. Thus it is scheduled for removal in kwindowsystem framework
causing this code to no longer compile.
The solution is to use a pointer and set it to null as long as the
window has not been detected yet. To ensure that this doesn't fail
badly an assert is added to the getter in DetectWidget.
The event filtering on Qt level does not work any more. The information
is not updated properly. Grabbing the mouse through QWidget resets the
cursor shape to the default shape, so it cannot be used.
As we don't want Qt to ever see the events it's a good idea to use a
native event filter to filter the events away before they are delivered
to Qt.
To simplify the handling the grabber widget is put into a QScopedPointer.
svn+ssh://coolo@svn.kde.org/home/kde/branches/work/kde4/kdebase
.
I couldn't resolve one kicker conflict that results from different
development directions, so I rely on Aaron to sort it out - the file
is commited with conflicts
svn path=/trunk/KDE/kdebase/kwin/; revision=439627