Commit b748273b4572e57edba2fd729521b1312239e202

Authored by ksamak
1 parent b5797c29

ezoom tracking: gave priority to the mouse in mousepoll

debian/control
... ... @@ -174,7 +174,6 @@ Depends: ${shlibs:Depends},
174 174 compiz-gnome,
175 175 mate-settings-daemon,
176 176 python
177   -Recommends: ubuntu-mate-wallpapers-utopic,
178 177 Description: OpenGL window and compositing manager - MATE integration
179 178 Compiz brings to life a variety of visual effects that make the Linux desktop
180 179 easier to use, more powerful and intuitive, and more accessible for users
... ...
plugins/ezoom/src/ezoom.cpp
... ... @@ -583,7 +583,7 @@ EZoomScreen::setCenter (int x,
583 583 if (zoomCorrection < 0.1) {
584 584 zoomCorrection = 0.1;
585 585 }
586   - if (optionGetAlwaysCenterMouse()) {
  586 + if (!optionGetAlwaysCenterMouse()) {
587 587 zoomCorrection = 1;
588 588 }
589 589  
... ... @@ -1861,7 +1861,7 @@ EZoomScreen::focusTrack (XEvent *event)
1861 1861 if (w == NULL ||
1862 1862 w->id () == screen->activeWindow () ||
1863 1863 time(NULL) - lastMouseChange < optionGetFollowFocusDelay () ||
1864   - !optionGetFollowFocus ())
  1864 + !optionGetFollowWindowFocus ())
1865 1865 return;
1866 1866  
1867 1867 int out = screen->outputDeviceForGeometry (w->geometry ());
... ...
plugins/mousepoll/src/accessibilitywatcher.cpp
... ... @@ -224,6 +224,11 @@ void AccessibilityWatcher::restartTerm() {
224 224 }
225 225 try {
226 226 role = getRole();
  227 + } catch (DbusException e) {
  228 + std::cerr << "caught exception: " << e.what() << std::endl << "Not switching active component to " << _curSender << ":" << _curPath << std::endl;
  229 + }
  230 +
  231 + try {
227 232 getPosition(&x, &y);
228 233 getSize(&width, &height);
229 234 } catch (DbusException e) {
... ... @@ -436,7 +441,7 @@ void AccessibilityWatcher::AtSpi2HandleEvent(const char* interface, DBusMessage*
436 441  
437 442 dbus_message_iter_next(&iter);
438 443 if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INT32) {
439   - std::cerr << "message detail1 not an int32 but " << dbus_message_iter_get_arg_type(&iter) <<std::cerr;
  444 + std::cerr << "message detail1 not an int32 but " << dbus_message_iter_get_arg_type(&iter) << std::endl;
440 445 return;
441 446 }
442 447 dbus_message_iter_get_basic(&iter, &detail1);
... ... @@ -450,7 +455,7 @@ void AccessibilityWatcher::AtSpi2HandleEvent(const char* interface, DBusMessage*
450 455  
451 456 dbus_message_iter_next(&iter);
452 457 if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT) {
453   - std::cerr << "message detail2 not a variant but " << dbus_message_iter_get_arg_type(&iter) <<std::cerr;
  458 + std::cerr << "message detail2 not a variant but " << dbus_message_iter_get_arg_type(&iter) << std::endl;
454 459 return;
455 460 }
456 461 dbus_message_iter_recurse(&iter, &iter_variant);
... ...
plugins/mousepoll/src/mousepoll.cpp
... ... @@ -68,22 +68,22 @@ MousepollScreen::updatePosition ()
68 68  
69 69 _has_mouse_moved = getMousePosition();
70 70  
71   - if (_has_focus_moved || _has_mouse_moved)
72   - {
73   - for (std::list<MousePoller *>::iterator it = pollers.begin ();
74   - it != pollers.end ();)
75   - {
76   - MousePoller *poller = *it;
77   -
78   - ++it;
79   - poller->mPoint = mousePos;
80   - poller->_has_mouse_moved = _has_mouse_moved;
81   - poller->fPoint = focusPos;
82   - poller->_has_focus_moved = _has_focus_moved;
83   - poller->mCallback (mousePos);
84   - }
  71 + if (_has_focus_moved || _has_mouse_moved) {
  72 + for (std::list<MousePoller *>::iterator it = pollers.begin (); it != pollers.end ();) {
  73 + MousePoller *poller = *it;
  74 +
  75 + ++it;
  76 + poller->mPoint = mousePos;
  77 + poller->_has_mouse_moved = _has_mouse_moved;
  78 + poller->fPoint = focusPos;
  79 + if (!_has_mouse_moved) {
  80 + poller->_has_focus_moved = _has_focus_moved;
  81 + } else {
  82 + poller->_has_focus_moved = false; // give mouse priority.
  83 + }
  84 + poller->mCallback (mousePos);
  85 + }
85 86 }
86   -
87 87 _has_focus_moved = false;
88 88 _has_mouse_moved = false;
89 89 return true;
... ...