D28085: Adapt to new KScreenLocker API

Roman Gilg noreply at phabricator.kde.org
Wed Mar 18 23:10:16 GMT 2020


romangg added inline comments.

INLINE COMMENTS

> davidedmundson wrote in wayland_server.cpp:526
> why do we do this on every lock?

Because the client connection is reset after every lock/unlock and I'm not sure it's possible to reuse the same socket for a new client. The connection is accessed by the greeter. And if the greeter exits the client connection is destroyed by callback.

> davidedmundson wrote in wayland_server.cpp:529
> Can this be done the other way round in the seat constructor
> 
> then we get rid of all these connects and disconnects

Yea, when the KSldApp is a undestroyed singleton sure. Having it here improves locality imo but I can also put it in the constructors.

> davidedmundson wrote in wayland_server.cpp:578
> who deletes m_screenLockerClientConnection in this case?

When the client goes down libwayland calls into the client connection destroy callback and that deletes the client here:
https://cgit.kde.org/kwayland.git/tree/src/server/clientconnection.cpp#n61

At this point trying to delete the connection from KWin's side would be a double-free.

If you think this API is not so intuitive don't look in the Client lib. :)

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D28085

To: romangg, #kwin
Cc: davidedmundson, apol, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20200318/c6f04e81/attachment-0001.html>


More information about the kwin mailing list