D5461: Don't update the focused pointer Surface if a button is pressed

Martin Gräßlin noreply at phabricator.kde.org
Sat Apr 15 15:23:44 UTC 2017


graesslin added a subscriber: broulik.
graesslin added inline comments.

INLINE COMMENTS

> markg wrote in pointer_input.cpp:440
> Just curious, why do you define end as opposed tho this:
> for (auto it = m_buttons.constBegin(); it != m_buttons.constEnd(); it++) {
> 
> }
> 
> Another route you can go which looks much cleaner imho (requires Qt 5.7 because of qAsConst):
> for (auto entry, qAsConst(m_buttons)) {
> 
> }
> 
> Just my 2 cents.

> Just curious, why do you define end as opposed tho this:

Because @broulik tends to point out that it is not cached.

> Another route you can go which looks much cleaner imho (requires Qt 5.7 because of qAsConst):

does that work in a sensible way for a QHash? The most lean way would have been:

  if (std::any_of(m_buttons.constBegin(), m_buttons.constEnd(), [] ...))

But that doesn't work with QHash. So I kind of doubt QHash and qAsConst do something sensible.

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: broulik, markg, plasma-devel, kwin, spstarr, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170415/4aaa8bb5/attachment.html>


More information about the Plasma-devel mailing list