Skip to content
Commit 152d7250 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Pass a dedicated fd to each keyboard for the xkb keymap

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 3b4c508e) 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

Reviewers: #kwin, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, zzag

Subscribers: plasma-devel, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D14910
parent f073c773
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment