Don't go through the workaround introduced for X11 that makes it go mental.
BUG: 385693
davidedmundson |
Plasma |
Don't go through the workaround introduced for X11 that makes it go mental.
BUG: 385693
Have been a happy krunner user since
No Linters Available |
No Unit Test Coverage |
krunner/view.cpp | ||
---|---|---|
202–203 | This code here is definitely not designed for X11 |
For context, krunner inherits from Dialog.
Dialog does all this stuff. Duplicating it here is wrong.
Must have been ported first or something.
krunner/view.cpp | ||
---|---|---|
194–200 ↗ | (On Diff #26232) | This relates to the QXcbWindow comment that you removed, can you leave it. (I /think/ you can remove this code, it relates to David Rosca's patch that landed ages ago. Check first though) |
krunner/view.cpp | ||
---|---|---|
246 | Don't we still need this somewhere? |
I fear this broke some functionality of KRunner. It is important to be a dock window! Otherwise KRunner might not be able to go above fullscreen windows and won't be on all desktops. Also without being a PlasmaSurface the manual positioning cannot work. If it works for you, I fear it is pure chance.
I just verified with KWin's debug console: KRunner window is now marked as NET::Normal and not as NET::Dock. This is a problem, KRunner needs to be a dock.
Please read before freaking out. As David pointed out the surface code is already part of its parent class.
I really think this needs to be reverted. Krunner must be a dock, it must be set to windows go below and it must take focus. This is all functionality not provided by Plasma::Dialog. Just removing the code doesn't work unfortunately.
I have a hard time understanding what the actual problem was. For me KRunner was always working. The change says it's about workarounds for X11, but that doesn't match the change as everything what's red is Wayland only. Can someone elaborate on what the actual problem was which this change was trying to address.
The old code is clearly wrong.
It calls Dialog::event(event);
that will set up a shellsurface in the expose event
Then we process further and set up a shell surface in the expose event
PlasmaShellSurfaces are shared, but you still have two objects handling the move event simultaneously, and worst still
} else if (event->type() == QEvent::Hide) {
delete m_plasmaShellSurface;
is just screaming out for a crash as dialog is sharing that same object. We're just being very lucky at the moment.
I wouldn't want to see this reverted as-is.
But clearly we need the setRole and the setPanelTakesFocus. I missed that in my review.
That could mean just adding an if(Dock) in Dialog.cpp , only setting those parts in ExposeEvent here, or adding an extra virtual to configure dialog somehow.
As the commit went into the 5.12 branch we cannot build up on any functionality not yet available in Dialog.
To ensure we don't forget about it I created: https://bugs.kde.org/show_bug.cgi?id=389964
krunner/view.cpp | ||
---|---|---|
247 | And this too, it causes https://bugs.kde.org/show_bug.cgi?id=389964 |