From b748273b4572e57edba2fd729521b1312239e202 Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 13 Apr 2016 17:41:24 +0200 Subject: [PATCH] ezoom tracking: gave priority to the mouse in mousepoll --- debian/control | 1 - plugins/ezoom/src/ezoom.cpp | 4 +-- .../mousepoll/src/accessibilitywatcher.cpp | 9 ++++-- plugins/mousepoll/src/mousepoll.cpp | 30 +++++++++---------- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/debian/control b/debian/control index d550bcccd..6c41be5da 100644 --- a/debian/control +++ b/debian/control @@ -174,7 +174,6 @@ Depends: ${shlibs:Depends}, compiz-gnome, mate-settings-daemon, python -Recommends: ubuntu-mate-wallpapers-utopic, Description: OpenGL window and compositing manager - MATE integration Compiz brings to life a variety of visual effects that make the Linux desktop easier to use, more powerful and intuitive, and more accessible for users diff --git a/plugins/ezoom/src/ezoom.cpp b/plugins/ezoom/src/ezoom.cpp index c46efc7d6..9f3bafbaa 100644 --- a/plugins/ezoom/src/ezoom.cpp +++ b/plugins/ezoom/src/ezoom.cpp @@ -583,7 +583,7 @@ EZoomScreen::setCenter (int x, if (zoomCorrection < 0.1) { zoomCorrection = 0.1; } - if (optionGetAlwaysCenterMouse()) { + if (!optionGetAlwaysCenterMouse()) { zoomCorrection = 1; } @@ -1861,7 +1861,7 @@ EZoomScreen::focusTrack (XEvent *event) if (w == NULL || w->id () == screen->activeWindow () || time(NULL) - lastMouseChange < optionGetFollowFocusDelay () || - !optionGetFollowFocus ()) + !optionGetFollowWindowFocus ()) return; int out = screen->outputDeviceForGeometry (w->geometry ()); diff --git a/plugins/mousepoll/src/accessibilitywatcher.cpp b/plugins/mousepoll/src/accessibilitywatcher.cpp index 496fed024..324bacc82 100644 --- a/plugins/mousepoll/src/accessibilitywatcher.cpp +++ b/plugins/mousepoll/src/accessibilitywatcher.cpp @@ -224,6 +224,11 @@ void AccessibilityWatcher::restartTerm() { } try { role = getRole(); + } catch (DbusException e) { + std::cerr << "caught exception: " << e.what() << std::endl << "Not switching active component to " << _curSender << ":" << _curPath << std::endl; + } + + try { getPosition(&x, &y); getSize(&width, &height); } catch (DbusException e) { @@ -436,7 +441,7 @@ void AccessibilityWatcher::AtSpi2HandleEvent(const char* interface, DBusMessage* dbus_message_iter_next(&iter); if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INT32) { - std::cerr << "message detail1 not an int32 but " << dbus_message_iter_get_arg_type(&iter) <::iterator it = pollers.begin (); - it != pollers.end ();) - { - MousePoller *poller = *it; - - ++it; - poller->mPoint = mousePos; - poller->_has_mouse_moved = _has_mouse_moved; - poller->fPoint = focusPos; - poller->_has_focus_moved = _has_focus_moved; - poller->mCallback (mousePos); - } + if (_has_focus_moved || _has_mouse_moved) { + for (std::list::iterator it = pollers.begin (); it != pollers.end ();) { + MousePoller *poller = *it; + + ++it; + poller->mPoint = mousePos; + poller->_has_mouse_moved = _has_mouse_moved; + poller->fPoint = focusPos; + if (!_has_mouse_moved) { + poller->_has_focus_moved = _has_focus_moved; + } else { + poller->_has_focus_moved = false; // give mouse priority. + } + poller->mCallback (mousePos); + } } - _has_focus_moved = false; _has_mouse_moved = false; return true; -- GitLab