D10236: [libinput] Ensure Event::device returns a proper Device
Fabian Vogt
noreply at phabricator.kde.org
Thu Feb 1 19:15:32 UTC 2018
fvogt added a comment.
Restricted Application edited projects, added KWin; removed Plasma.
In https://phabricator.kde.org/D10236#199259, @graesslin wrote:
> In https://phabricator.kde.org/D10236#199252, @fvogt wrote:
>
> > Now you can remove the initial setting of `m_device` as well.
>
>
> I thought about it while doing the change. I decided against it for the following reasons:
>
> - it would need to be inited with null instead
Alternatively just call `device()` once explicitly in the constructor to avoid code duplication.
That way the lazyness of `device()` is lost, but that's not a goal anyway.
> - the norm is not having this problem, the switch event is an exception
It's not, this can happen to literally any event if they get queued together.
> - device would have to lose the const-ness, the const_cast hack is in my opinion only a valid solution for exceptions, for the standard case it would have to be changed.
Just set `m_device` as `mutable` instead, that's what it's intended for.
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D10236
To: graesslin, #kwin, #plasma, fvogt
Cc: plasma-devel, kwin, iodelay, bwowk, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180201/bd9d060e/attachment-0001.html>
More information about the Plasma-devel
mailing list