XdgV6 - Kwin side
ClosedPublic

Authored by davidedmundson on Jul 9 2017, 8:34 PM.

Details

Reviewers
graesslin
mart
Group Reviewers
Plasma
Commits
R108:e492f9e2980a: XdgV6 - Kwin side
Summary

Adds XDGV6 support for the kwin side.

Popup placement support is limited to the stuff v5 had, a simple offset, rather than the awesome new positioner. But Qt doesn't make use of it yet either. Also ideally we should do all the positioning before sending the first configure, but again Qt doesn't actually do anything with that anyway.

Some menus are broken, but they are broken with wl-shell integration too.

Test Plan

gtk3-demo works nicely.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Jul 9 2017, 8:34 PM
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJul 9 2017, 8:34 PM
davidedmundson retitled this revision from XdgV6 to XdgV6 - Kwin side.Jul 9 2017, 8:40 PM
davidedmundson edited the summary of this revision. (Show Details)
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson edited the summary of this revision. (Show Details)

Fix whitespace

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJul 9 2017, 9:07 PM

Lesson learned, don't try and use phab whilst rebasing it just explodes...

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJul 9 2017, 9:21 PM

Ping. Even if I now can't merge till 5.11 splits, it'd be nice to have this approved.

There's still a lot of work to be done on top of this, which is currently blocked.

graesslin requested changes to this revision.Sep 7 2017, 7:02 PM
graesslin added a subscriber: graesslin.
graesslin added inline comments.
shell_client.cpp
236

maybe instead of the three casts just store a local variable?

auto global = (static_cast<XdgShellInterface *>(m_xdgShellSurface->global());
245–253

You should only kill if the ping reason is close. This would also ping for focus, wouldn't it?

297–300

this needs to go through our PointerInputRedirection code, otherwise SeatInterface and PointerInputRedirection get out of sync. From my understanding that should be ::popupGrab?

642–645

just wondering: isn't there a close() missing? It's only pinging...

shell_client.h
52

please use enum class for new enums.

This revision now requires changes to proceed.Sep 7 2017, 7:02 PM
mart added a subscriber: mart.Sep 8 2017, 9:39 AM
mart added inline comments.
shell_client.cpp
642–645

the close is actually beaing done at line 244: at the pongReceived (if the ping reason was closewindow, then it closes it there)

mart commandeered this revision.Sep 8 2017, 9:40 AM
mart added a reviewer: davidedmundson.
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptSep 8 2017, 9:40 AM
mart updated this revision to Diff 19302.Sep 8 2017, 9:45 AM
mart edited edge metadata.
  • Temporary popup stuff
  • Update to signal rename
  • skip taskbar/pager/windowmanagement for xdgpopups
  • send configure on popup resize
  • Merge branch 'mart/xdgv6ping' into xdgv6
  • Connect XDG ping pong only in XDG specific code path
  • Fixup
  • Merge branch 'master' into xdgv6
  • move other xdg-only connect
  • Guard against assuming we're using xdgshell
  • disconnect ping timeout on shellclient destruction
  • Merge branch 'master' into xdgv6
  • ping changes
  • don't do 3 casts
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptSep 8 2017, 9:45 AM
davidedmundson commandeered this revision.Sep 8 2017, 12:32 PM
davidedmundson edited reviewers, added: mart; removed: davidedmundson.
davidedmundson added inline comments.
shell_client.cpp
297–300

Ack,

Initially I thought this event could happen at any time, but on re-reading it's to separate tooltips and menus, at which point it's on of the initial properties that should be sent before the first buffer. (I'll try to get that clarified in the spec for v7)

At which point it falls in nicely into how kwin already handles things checking hasPopupGrab when the toplevel is added.

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptSep 8 2017, 12:32 PM

popup changes

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptSep 8 2017, 12:49 PM
graesslin requested changes to this revision.Sep 9 2017, 7:04 AM
graesslin added inline comments.
shell_client.cpp
642–645

That logic I don't understand: why do we ping to close? Why a roundtrip to the app, when all we want to do is close it? Just send it a close?

898–904

This breaks the existing code: the setActive(true) is now only done for xdg shell surfaces, not for wl_shell surfaces.

This revision now requires changes to proceed.Sep 9 2017, 7:04 AM
mart added inline comments.Sep 10 2017, 4:48 PM
shell_client.cpp
642–645

i copied from the x11 client, where on client::CloseWindow it pings beforehand, but i can remove it and just close

mart commandeered this revision.Sep 10 2017, 5:04 PM
mart edited reviewers, added: davidedmundson; removed: mart.
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptSep 10 2017, 5:04 PM
mart updated this revision to Diff 19372.Sep 10 2017, 5:05 PM
mart edited edge metadata.
  • Temporary popup stuff
  • Update to signal rename
  • skip taskbar/pager/windowmanagement for xdgpopups
  • send configure on popup resize
  • Merge branch 'mart/xdgv6ping' into xdgv6
  • Connect XDG ping pong only in XDG specific code path
  • Fixup
  • Merge branch 'master' into xdgv6
  • move other xdg-only connect
  • Guard against assuming we're using xdgshell
  • disconnect ping timeout on shellclient destruction
  • Merge branch 'master' into xdgv6
  • ping changes
  • don't do 3 casts
  • don't ping a window before killing
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptSep 10 2017, 5:05 PM
mart added a comment.Sep 10 2017, 5:10 PM

i removed the ping to close window.. however it still doesn't sound right, as the client could not answer a close request, there may need a close and a ping at the same time, then whoever wins, either the window gets gracefully closed or brutally killed

mart updated this revision to Diff 19373.Sep 10 2017, 5:13 PM
  • don't ping a window before killing setActive works also for wl_shell
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptSep 10 2017, 5:13 PM
mart added a comment.Sep 10 2017, 5:14 PM

now pings and tries to close at the same time, so either will be closed cleanly or killed if not responsive

mart updated this revision to Diff 19394.Sep 11 2017, 7:09 AM
  • Redo popup grab handling
  • don't ping a window before killing setActive works also for wl_shell
  • move Ping Reason in own class
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptSep 11 2017, 7:09 AM
graesslin requested changes to this revision.Sep 12 2017, 3:17 PM

Now it looks good to me!

What I would like to see is unit tests for all of that. This should be fairly simple as the tests are prepared to be run for different kind of shell surfaces. Many tests already have a _data method where it is set to be run for wl_shell and xdg_shell_unstable_v5. This should be easy to be extended for additional v6.

This revision now requires changes to proceed.Sep 12 2017, 3:17 PM

I really would like to see this go in now into master! But we need to have at least a few unit tests. If that's too difficult I can write them, but I would prefer if one of you extends it. It's really not difficult in this case as we just need to add the basics to run the same tests also as xdg shell v6.

It's really not difficult

Ha. Extending those tests was not dificult, and if you look you'll see that was committed in the XDG branch mid last week.

But we also have ping mixed in here (something I now regret), and that proved much more "interesting".

Socket mode would have a fun crash as killWindow() will implicitly delete "this", also in the process I made a made the kill test represent a far more real blocked app, and that broke the existing killWindow socket mode test, as removing the connection doesn't actually kill a frozen app.

All fixed now.

davidedmundson commandeered this revision.Sep 25 2017, 1:49 PM
davidedmundson edited reviewers, added: mart; removed: davidedmundson.
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptSep 25 2017, 1:49 PM
  • Update tests to cover XDGv6
  • write a ping test
  • fix crash in ping with socket mode connections
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptSep 25 2017, 1:50 PM
graesslin accepted this revision.Sep 25 2017, 3:19 PM

And sorry, sorry, sorry that the review took so long.

This revision is now accepted and ready to land.Sep 25 2017, 3:19 PM
This revision was automatically updated to reflect the committed changes.