[ksmserver/greeter] Show one logout greeter on each screen
ClosedPublic

Authored by graesslin on Jul 22 2016, 1:27 PM.

Details

Summary

This follows the approach of kscreenlocker and ksplash: in multi-screen
setups there is one dedicated greeter shown per screen. When the screen
changes resolution, the view gets adopted, when a screen is destroyed,
the view is removed and when a new screen gets added, a view gets
created.

This should make the logout dialog work reliable in multi-screen setups.

As an additional change it's no longer bound to X11 and can also create
views on Wayland, though further integration is required to have the
views positioned correctly and make the compositor aware of this being
a logout dialog (handle like popups).

Unfortunately this change does not work reliable on multiple screens:
only one of the views gets mouse events. This behavior is reproducable
with both X11 and Wayland.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 5443.Jul 22 2016, 1:27 PM
graesslin retitled this revision from to [ksmserver/greeter] Show one logout greeter on each screen.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptJul 22 2016, 1:27 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

only one of the views gets mouse events. This behavior is reproducable

with both X11 and Wayland.

Adding my investigation results:

  • in qtwayland everything is correct, the enter event is processed correctly
  • it goes into QWindowSystemInterface::handleEnterEvent
  • and then it vanishes somewhere

A possibility might be KWin sending an enter position outside the window:
Enter QPointF(889,253) / QPointF(888,666) QRect(-1,413 1920x252)

-> looks like below the window. Needs investigation in KWin

davidedmundson requested changes to this revision.Jul 22 2016, 2:35 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
ksmserver/shutdowndlg.cpp
186–190

What are you trying to do here?

(because I'm pretty sure this isn't going to do what you want, and you've got a possibility to infinite loop)

This revision now requires changes to proceed.Jul 22 2016, 2:35 PM
graesslin added inline comments.Aug 1 2016, 8:01 AM
ksmserver/shutdowndlg.cpp
186–190

Detect when setScreen(QScreen*) is done and then update the geometry based on that screen.

davidedmundson added inline comments.Aug 1 2016, 12:34 PM
ksmserver/shutdowndlg.cpp
186–190

setSecreen will be called when the QWindow geometry changes from code inside QWindow.
So you don't want to do a setGeometry() from inside that - especially if you also have the case of overlapping screens.

setScreen manually is only useful if you want to use initial screen data before your first show/setGeometry.
Otherwise calling it manually will get you in a messy state.

Either call reposition(QScreen*) from adoptScreen instead of setScreen (but leave this connect)

or get rid of the connect and make this an explicit method called from adoptScreen.

198

you don't have a disconnect on this in screenChanged

Unfortunately this change does not work reliable on multiple screens:
only one of the views gets mouse events. This behavior is reproducable
with both X11 and Wayland.

This is caused by
setModality(Qt::ApplicationModal);

which we now do not need any more.

graesslin updated this revision to Diff 5671.Aug 4 2016, 11:23 AM
graesslin edited edge metadata.

Reworked the code to not need the screenChanged connection.
Most of the init code went to method init() so that we can pass
the QScreen to the dialog before the window gets shown.

On Wayland it works fine now: both windows are correctly sized (of course not
positioned). X11 is something which still needs to be tested.

davidedmundson accepted this revision.Aug 12 2016, 2:07 PM
davidedmundson edited edge metadata.
This revision is now accepted and ready to land.Aug 12 2016, 2:07 PM
This revision was automatically updated to reflect the committed changes.