Commit 64bd08b06c3d3a80e347fef02157a36c9dc03b44

Authored by ksamak
1 parent e1de9a19

focuspoll: added special workaround for mate alt-F2 spam textarea event

plugins/focuspoll/include/accessibilitywatcher/accessibilitywatcher.h
... ... @@ -55,6 +55,7 @@ class AccessibilityWatcher {
55 55 int screenHeight;
56 56 static bool ignoreLinks;
57 57 std::deque<FocusInfo> focusList;
  58 + FocusInfo lastFocus;
58 59 std::vector<FocusInfo> previouslyActiveMenus;
59 60 std::vector<std::vector<int>> optimizedPaths;
60 61  
... ...
plugins/focuspoll/src/accessibilitywatcher.cpp
... ... @@ -229,6 +229,7 @@ void AccessibilityWatcher::registerEvent (const AtspiEvent *event, const std::st
229 229 AccessibilityWatcher::getInstance ()->focusList.erase (AccessibilityWatcher::getInstance ()->focusList.begin ());
230 230 }
231 231 AccessibilityWatcher::getInstance ()->focusList.push_back (res);
  232 + AccessibilityWatcher::getInstance ()->lastFocus = res;
232 233 }
233 234  
234 235 bool AccessibilityWatcher::appSpecificFilter (FocusInfo& focus, const AtspiEvent* event)
... ... @@ -247,10 +248,14 @@ bool AccessibilityWatcher::appSpecificFilter (FocusInfo&amp; focus, const AtspiEvent
247 248 focus.active = true;
248 249 }
249 250  
250   - // Parasite event from mate-panel alt-F2 dialog. #494
  251 + // Spam event from mate-panel alt-F2 dialog. bug hypra #494
251 252 if (focus.application == "mate-panel" && focus.role == "text" && focus.w > 250)
252 253 {
253   - return true;
  254 + auto lastFocus = AccessibilityWatcher::getInstance()->lastFocus;
  255 + if (lastFocus.application == "mate-panel" && lastFocus.role == "text" && lastFocus.w < 100)
  256 + {
  257 + return true;
  258 + }
254 259 }
255 260  
256 261 if (focus.application == "soffice" && focus.role == "paragraph")
... ...