Pass a dedicated fd to each keyboard for the xkb keymap
ClosedPublic

Authored by graesslin on Aug 17 2018, 7:20 PM.

Details

Summary

To better isolate the clients from each other eachh KeyboardInterface
creates it's own dedicated temporary file and sends the fd for this
temporary file to the client. This means the memory for the keymap is no
longer shared between all clients, every client has an own copy.

To support this the existing API to set the keymap is deprecated and
replaced by a new method setKeymapData which takes the content of the
keymap as a byte array. The now deprecated method which takes a file
descriptor is changed to use the new setKeymapData method. For that it
reads the content of the file.

The implementation in KeyboardInterface to create the file descriptor is
based on the implementation of KWin. As I implemented the change in KWin
(see 3b4c508ee36ac74c37e77fcaa14d106397ad2994) it is not a problem from
GPL vs LGPL perspective.

The change includes test cases to verify that the content of the keymap
is properly passed to the client and that the memory is no longer shared.

BUG: 381674

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Aug 17 2018, 7:20 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 17 2018, 7:20 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
graesslin requested review of this revision.Aug 17 2018, 7:20 PM

Sorry for strange upload, arc decided to no longer like me.

I created the patch on Jun 30, 2017. Unfortunately the issue was embargo on freedesktop.org with the idea of a coordinated release. Today the patch for weston landed so I consider the embargo as lifted. I had send the patch already to security@kde.org last year. Relevant freedesktop org bug is: https://bugs.freedesktop.org/show_bug.cgi?id=101595 - it might be that it's still private, if that's the case, please leave a note and I'll try to add to cc.

Personal note: we are expecting our child any day now. So I cannot guarantee that I will have time to follow up or to push it. If you see inactivity: feel free to take over the patch and push it.

zzag accepted this revision.Apr 26 2019, 2:31 PM
This revision is now accepted and ready to land.Apr 26 2019, 2:31 PM
zzag updated this revision to Diff 77916.Mar 18 2020, 2:03 PM

Rebase on master

This revision was automatically updated to reflect the committed changes.
zzag added a comment.Mar 19 2020, 2:06 PM

Urgh, the authorship information is screwed up. :/