Commit 69075043f16e8fe29eb292946562db2f52399e3d

Authored by samuel thibault
1 parent 7c7ad596
Exists in jessie-master-old

Fix uninitialized AccessibilityWatcher::mActive variable

This fixes the lost of focus tracking when zooming in/out several times.

mActive is tested in AccessibilityWatcher::setActive() but was never
initialized or updated, and thus basically random.  By luck it'd be 0, and
thus AccessibilityWatcher::setActive would always accept to reactivate
and never accept to deactivate.  But without luck it'd be non-0, and thus
AccessibilityWatcher::setActive would always accept to desactivate, but
always refuse to reactivate (e.g. when zooming in).
plugins/focuspoll/src/accessibilitywatcher.cpp
... ... @@ -33,6 +33,7 @@ bool AccessibilityWatcher::ignoreLinks = false;
33 33  
34 34 AccessibilityWatcher::AccessibilityWatcher () :
35 35 initialized (false),
  36 + mActive (false),
36 37 screenWidth (0),
37 38 screenHeight (0),
38 39 optimizedPaths ({{}}),
... ... @@ -686,6 +687,7 @@ void AccessibilityWatcher::addWatches () {
686 687 atspi_event_listener_register (selectedListener, "object:state-changed:selected", NULL);
687 688 atspi_event_listener_register (descendantChangedListener, "object:active-descendant-changed", NULL);
688 689 atspi_event_listener_register (globalListener, "object:", NULL);
  690 + mActive = true;
689 691 }
690 692  
691 693 void AccessibilityWatcher::removeWatches () {
... ... @@ -698,6 +700,7 @@ void AccessibilityWatcher::removeWatches () {
698 700 atspi_event_listener_deregister (selectedListener, "object:state-changed:selected", NULL); // deprecation in stretch?
699 701 atspi_event_listener_deregister (descendantChangedListener, "object:active-descendant-changed", NULL);
700 702 atspi_event_listener_deregister (globalListener, "object:", NULL);
  703 + mActive = false;
701 704 }
702 705  
703 706 void AccessibilityWatcher::init () {
... ...