[kstyle] Implement window moving on Wayland
ClosedPublic

Authored by graesslin on Oct 11 2016, 9:47 AM.

Details

Summary

So far breeze hard disabled the window moving on Wayland. With this
change the required functionality gets added.

For that Breeze creates an additional Seat and a Pointer on it to track
all pointer button events on the window. That way the kstyle gets the
latest serial which needs to be passed to the move requests. This is not
available through QtWayland's native interface, thus Breeze needs to
interact with Wayland directly.

When the move is triggered Breeze gets the ShellSurface for the window
and triggers the move on the own Seat object with the tracked serial.

Test Plan

Tested with KWin and Weston, move triggered in both.

Diff Detail

Repository
R31 Breeze
Branch
kstyle-move-wayland
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin updated this revision to Diff 7299.Oct 11 2016, 9:47 AM
graesslin retitled this revision from to [kstyle] Implement window moving on Wayland.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma on Wayland.
Restricted Application added a project: Plasma on Wayland. · View Herald TranscriptOct 11 2016, 9:47 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sebas added a subscriber: sebas.Oct 16 2016, 2:40 PM

Looks good from my side. Let's have @hpereiradacosta have a look as well, though.

From here, code does not compile. Maybe I am missing something:
/home/hpereira/kf5/src/kde/workspace/breeze/kstyle/breezewindowmanager.cpp:874:29: error: ‘fromWindow’ is not a member of ‘KWayland::Client::ShellSurface’

I'm using kwayland from git master. Are there some commits missing ?

kstyle/breezewindowmanager.cpp
264 ↗(On Diff #7299)

mmm. I know delta functions are handy, but isn't this one a tad complicated ? Personnally I find this code quite hard to read. (especially the sequence of closing }s and )s later on ...

I'm using kwayland from git master. Are there some commits missing ?

yes, see the linked dependencies.

graesslin added inline comments.Oct 16 2016, 3:31 PM
kstyle/breezewindowmanager.cpp
264 ↗(On Diff #7299)

I can change it to be a private method, but it requires to also keep the registry around, although we later on don't need it.

graesslin updated this revision to Diff 7443.Oct 17 2016, 6:40 AM
graesslin edited edge metadata.

Moved the hasPointer lambda into an own method for better readability and less nesting.

The registry interfacesAnnounced is still a lambda to not need to keep the variable around
and the handling of the pointer button serial is also kept as a lambda.

hpereiradacosta accepted this revision.Oct 18 2016, 7:35 AM
hpereiradacosta edited edge metadata.

Thanks for changing the deltas. I find it much more readible now.
For me the is good to go. I could not test it though (no working wayland setup yet ... sorry)
Any plan for including the same to oxygen ?

(at some point I guess we could move all this common code to a common library, such as framework-integration/kstyle. My only worry with this is all the BIC, and API stability guaranty that come with it ... )

This revision is now accepted and ready to land.Oct 18 2016, 7:35 AM

Any plan for including the same to oxygen ?

Yes, will do the same change for Oxygen now.

This revision was automatically updated to reflect the committed changes.