summaryrefslogtreecommitdiff
path: root/libraries/compiz-plugins-main/fix_focus_position.patch
blob: d774f12b834354f3303d69fbe5ecf6040b798645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/src/focuspoll/accessibilitywatcher.cpp b/src/focuspoll/accessibilitywatcher.cpp
index 9952755..840763e 100644
--- a/src/focuspoll/accessibilitywatcher.cpp
+++ b/src/focuspoll/accessibilitywatcher.cpp
@@ -595,7 +595,7 @@ AccessibilityWatcher::activityEvent (const AtspiEvent *event, const gchar *type)
 	}
 
 	// still no offset, it's probably a newline and we're at bugzilla #1319273 (with new paragraph obj)
-	if (res->x == 0 && res->y == 0 &&
+	if (((res->x == 0 && res->y == 0) || (res->x == -1 && res->y == -1)) &&
 	    (strcmp (event->type, "object:text-changed:insert") == 0 ||
 	     strcmp (event->type, "object:text-changed:removed") == 0 ||
 	     strcmp (event->type, "object:text-caret-moved") == 0 ||
@@ -698,7 +698,7 @@ AccessibilityWatcher::appSpecificFilter (FocusInfo *focus, const AtspiEvent* eve
 		focus->w = focus->wAlt;
 		focus->h = focus->hAlt;
 	    }
-	    if (!(focus->x == 0 && focus->y == 0))
+	    if (!((focus->x == 0 && focus->y == 0) || (focus->x == -1 && focus->y == -1)))
 	    { // prevents compose window loss of tracking in HTML mode (active flag ok, but no focused flag)
 		queueFocus (focus);
 		return true;
@@ -743,14 +743,14 @@ AccessibilityWatcher::appSpecificFilter (FocusInfo *focus, const AtspiEvent* eve
 	    isEditableText = atspi_state_set_contains (stateSet.get (), ATSPI_STATE_EDITABLE);
 	}
 	if ((strcmp (focus->type, "caret") == 0 || isEditableText) &&
-	    !(focus->x == 0 && focus->y == 0))
+	    !((focus->x == 0 && focus->y == 0) || (focus->x == -1 && focus->y == -1)))
 	{
 	    queueFocus (focus);
 	    return true;
 	}
 	getAlternativeCaret (focus, event);
 	if ((strcmp (focus->type, "caret") == 0 || isEditableText) &&
-	    !(focus->xAlt == 0 && focus->yAlt == 0))
+	    !((focus->xAlt == 0 && focus->yAlt == 0) || (focus->xAlt == -1 && focus->yAlt == -1)))
 	{
 	    focus->x = focus->xAlt;
 	    focus->y = focus->yAlt;
@@ -865,7 +865,7 @@ AccessibilityWatcher::getAlternativeCaret (FocusInfo *focus, const AtspiEvent* e
 	    string = unique_gmem (atspi_text_get_string_at_offset (text.get (), offset - charIndex, ATSPI_TEXT_GRANULARITY_CHAR, NULL));
 	    caretChar = string.get ()->content[0];
 	    // if we found a caret, check we're at beginning of line (or of text) to extrapolate position
-	    if (size.get ()->x != 0 || size.get ()->y != 0)
+	    if ((size.get ()->x != 0 || size.get ()->y != 0) && (size.get ()->x != -1 || size.get ()->y != -1))
 	    {
 		if (offset - charIndex -1 >= 0 && unique_gmem (atspi_text_get_string_at_offset (text.get (), offset - charIndex -1, ATSPI_TEXT_GRANULARITY_CHAR, NULL)).get ()->content[0] == '\n')
 		{