[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: D10291: Add a recursion blocker in Pointer/TouchInputRedirection::update
From: Roman Gilg <noreply () phabricator ! kde ! org>
Date: 2018-02-25 12:04:43
Message-ID: 20180225120443.1.7D6D509F413D0063 () phabricator ! kde ! org
[Download RAW message or body]
romangg added a comment.
Restricted Application edited projects, added KWin; removed Plasma.
Note that it gave me some error, when I tried to compile this branch.
`UpdateRecursionBlocker` has a generic name, but it is dependent on receiving as \
`T` one of the input classes with `input` as an instance and having a member function \
`update`. I would make it fully generic by adding a std::function type argument to \
the constructer (that in our current application encapsulates `input->update()`) and \
that gets called in the destructor just like it is now. The template parameter `T` \
would then be the template argument of the std::function argument and m_input would \
be replaced by a member variable `m_fct` storing the std::function
The class does not directly block recursions, but delays additional calls to the \
end of the first call (and then does the call only once). Therefore I would name it \
differently. Something like `BlockAndDelayCallsToOne`?
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D10291
To: graesslin, #kwin, #plasma
Cc: romangg, plasma-devel, kwin, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, \
hardening, jensreuterberg, abetts, sebas, apol, mart
[Attachment #3 (unknown)]
<table><tr><td style="">romangg added a comment.<br />Restricted Application edited \
projects, added KWin; removed Plasma. </td><a style="text-decoration: none; padding: \
4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; \
border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to \
bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" \
href="https://phabricator.kde.org/D10291" rel="noreferrer">View \
Revision</a></tr></table><br /><div><div><p>Note that it gave me some error, when I \
tried to compile this branch.</p>
<p><tt style="background: #ebebeb; font-size: 13px;">UpdateRecursionBlocker</tt> has \
a generic name, but it is dependent on receiving as <tt style="background: #ebebeb; \
font-size: 13px;">T</tt> one of the input classes with <tt style="background: \
#ebebeb; font-size: 13px;">input</tt> as an instance and having a member function <tt \
style="background: #ebebeb; font-size: 13px;">update</tt>. I would make it fully \
generic by adding a std::function type argument to the constructer (that in our \
current application encapsulates <tt style="background: #ebebeb; font-size: \
13px;">input->update()</tt>) and that gets called in the destructor just like it \
is now. The template parameter <tt style="background: #ebebeb; font-size: \
13px;">T</tt> would then be the template argument of the std::function argument and \
m_input would be replaced by a member variable <tt style="background: #ebebeb; \
font-size: 13px;">m_fct</tt> storing the std::function</p>
<p>The class does not directly block recursions, but delays additional calls to the \
end of the first call (and then does the call only once). Therefore I would name it \
differently. Something like <tt style="background: #ebebeb; font-size: \
13px;">BlockAndDelayCallsToOne</tt>?</p></div></div><br \
/><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br \
/><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D10291" \
rel="noreferrer">https://phabricator.kde.org/D10291</a></div></div><br \
/><div><strong>To: </strong>graesslin, KWin, Plasma<br /><strong>Cc: \
</strong>romangg, plasma-devel, kwin, iodelay, bwowk, ZrenBot, lesliezhai, \
ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart<br /></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic