Implement PlasmaShellSurface::popupBehavior in kwin
Needs ReviewPublic

Authored by davidedmundson on Jan 20 2019, 5:54 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

Allows a plasma surface to stay on top. Primary use case is the "pin"
icon in the plasma calendar/system tray.

FIXED-IN: 5.16.0
BUG: 400317

Test Plan

Relevant unit test + set/unset pin in calendar

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7348
Build 7366: arc lint + arc unit
davidedmundson created this revision.Jan 20 2019, 5:54 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 20 2019, 5:54 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jan 20 2019, 5:54 PM

I'm not totally happy with calling it popup behavior. In X speak this is not a popup.

Fair enough. I want some name that hints it doesn't include panels.

I'm open to suggestions.

Stupid question: the popups are transient to the panel? If yes we can fix in layer. A panel transient should be in panel layer and thus above the windows without any client side tricks.

The default state works fine without tricks.

There's a magic button on the system tray/calendar with a little icon of a pin. When clicked this window should remain on top even when focus goes to somewhere else. This is unlike a normal popup.

Currently this is done via QWindow::setFlags(Qt::WindowStaysOnTopHint) which on the wayland QPA goes nowhere.

Somehow we need to negotiate whether we're in that mode or the normal mode.

Stays on top is wrong. The window needs to be in the dock layer, not in the above layer. With keep above other keep above windows can still go on top of it.

It's one of the many cases where Plasma is not really correct. Many such features where implemented without consulting KWin devs. IMHO it should be a transient to the panel and inherit the parent's layer.

There's an extra twist.
You can put the digital-clock on the desktop. You can then open the popup, and then pin it so that it's above windows.
Being transient to the desktop won't help there.

You are right that I could keep it always on top rather than only when the pin is set and that does allow some other options.
I'll do a bit more investigation rather than just going for a direct X port.

graesslin added a comment.EditedJan 22 2019, 5:25 PM

That's an evil twist. Idea: make the windows panels with windows go below?