slackbuilds_ponce/libraries/compiz-plugins-main/fix_focus_position.patch
M.Dinslage ebdc308f03 libraries/compiz-plugins-main: Updated for version 0.8.18.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2021-07-25 20:40:56 -05:00

49 lines
2.6 KiB
Diff

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')
{