Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-06-28 Thread Simon McVittie
On Thu, 28 Jun 2018 at 12:56:23 +0200, Alex ARNAUD wrote:
> Le 28/06/2018 à 11:52, Simon McVittie a écrit :
> > https://bugs.debian.org/899147  is another one that touches src:gtk+3.0.
> > It isn't clear to me whether it's a regression from earlier versions of
> > gtk+3.0, or just a bug that makes people particularly angry. It appears
> > that it is a regression when compared with gtk+2.0.
> 
> Indeed, It's a regression compared to GTK 2.0 and a really annoying bug for
> low-vision people using screen magnification software like Compiz.

Sorry, I wasn't clear: it isn't clear to me whether the other bug
#899147 "GTK3 file chooser does not allow Fuse-mounted locations anymore"
is a regression from earlier versions of gtk+3.0.

If there is any gtk+3.0 update in stable at all, then I think #870631
"wrong coordinates given to at-spi layer from GTK3 entries" should be
fixed in it, whether it's a regression or not. The impact is significant
and the patch doesn't look too scary.

smcv



Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-06-28 Thread Alex ARNAUD

Le 28/06/2018 à 11:52, Simon McVittie a écrit :

https://bugs.debian.org/899147  is another one that touches src:gtk+3.0.
It isn't clear to me whether it's a regression from earlier versions of
gtk+3.0, or just a bug that makes people particularly angry. It appears
that it is a regression when compared with gtk+2.0.


Indeed, It's a regression compared to GTK 2.0 and a really annoying bug 
for low-vision people using screen magnification software like Compiz.


I'm visual-impaired and user of a screen magnifier to write this message.

A concrete example of the bug is the password entry for the WiFi on 
Network Manager, the screen magnifier doesn't follow the text and 
follows the top of the screen so the only way to see the password is to 
type it on a text editor and copy-paste it on network manager field.
With the Samuel's patch I no longer have to do that :), it's really 
appreciable.


Best regards,
Alex.



Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-06-28 Thread Simon McVittie
On Thu, 28 Jun 2018 at 11:05:06 +0200, Alex ARNAUD wrote:
> Le 26/06/2018 à 17:51, Samuel Thibault a écrit :
> > Ping?

See also https://wiki.debian.org/Gnome/StretchUpdates where I've been
collecting other requests for backports of fixes to stretch.

https://bugs.debian.org/899147 is another one that touches src:gtk+3.0.
It isn't clear to me whether it's a regression from earlier versions of
gtk+3.0, or just a bug that makes people particularly angry. It appears
that it is a regression when compared with gtk+2.0.

smcv



Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-06-28 Thread Alex ARNAUD

Maybe Jeremy could answer to this?

Best regards,
Alex.

Le 26/06/2018 à 17:51, Samuel Thibault a écrit :

Ping?

Samuel Thibault, le ven. 25 mai 2018 11:52:56 +0200, a ecrit:

Ping gtk people?

Samuel

Samuel Thibault, le lun. 16 avril 2018 13:16:05 +0200, a ecrit:

Samuel Thibault, le dim. 15 oct. 2017 22:14:38 +0200, a ecrit:

Just wondering: considering that it's just a few lines (as attached to
this mail) and the following usability impact:

Alex ARNAUD, on jeu. 03 août 2017 17:53:31 +0200, wrote:

It is blocking for any a11y tool making these events accessible,
like software magnifiers such as gnome3 zoom or compiz's ezoom with
focus tracking. result is unreadable by visually impaired people.


how do [people] feel about including it stretch or even jessie?


because this is really a blocker for anybody who has to use a software
screen magnifier.

I can manage the stretch-pu upload etc. I just need confirmation from
gtk people.

Samuel



commit a2d78a2de72b84902a3ca21803ce334eb38743bd
Author: Samuel Thibault 
Date:   Thu Oct 5 15:49:00 2017 +

 a11y/entry: Fix text coords not adjusted for alloc
 
 What is missing is the "allocation" part of x/y coordinates. Since

 gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
 the coordinates returned by gdk_window_get_origin don't include it.
 
 This patch fixes this.
 
 https://bugzilla.gnome.org/show_bug.cgi?id=784509


---
  gtk/a11y/gtkentryaccessible.c |8 ++--
  1 file changed, 6 insertions(+), 2 deletions(-)

--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -25,6 +25,7 @@
  #include "gtkentryprivate.h"
  #include "gtkcomboboxaccessible.h"
  #include "gtkstylecontextprivate.h"
+#include "gtkwidgetprivate.h"
  
  #define GTK_TYPE_ENTRY_ICON_ACCESSIBLE  (gtk_entry_icon_accessible_get_type ())

  #define GTK_ENTRY_ICON_ACCESSIBLE(obj)  (G_TYPE_CHECK_INSTANCE_CAST 
((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
@@ -958,6 +959,7 @@ gtk_entry_accessible_get_character_exten
gint index, x_layout, y_layout;
GdkWindow *window;
gint x_window, y_window;
+  GtkAllocation allocation;
  
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));

if (widget == NULL)
@@ -973,11 +975,13 @@ gtk_entry_accessible_get_character_exten
pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, _rect);
pango_extents_to_pixels (_rect, NULL);
  
+  _gtk_widget_get_allocation (widget, );

+
window = gtk_widget_get_window (widget);
gdk_window_get_origin (window, _window, _window);
  
-  *x = x_window + x_layout + char_rect.x;

-  *y = y_window + y_layout + char_rect.y;
+  *x = x_window + allocation.x + x_layout + char_rect.x;
+  *y = y_window + allocation.y + y_layout + char_rect.y;
*width = char_rect.width;
*height = char_rect.height;
  



--
Samuel
"I once witnessed a long-winded, month-long flamewar over the use of
mice vs. trackballs...It was very silly."
(By Matt Welsh)






Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-06-26 Thread Samuel Thibault
Ping?

Samuel Thibault, le ven. 25 mai 2018 11:52:56 +0200, a ecrit:
> Ping gtk people?
> 
> Samuel
> 
> Samuel Thibault, le lun. 16 avril 2018 13:16:05 +0200, a ecrit:
> > Samuel Thibault, le dim. 15 oct. 2017 22:14:38 +0200, a ecrit:
> > > Just wondering: considering that it's just a few lines (as attached to
> > > this mail) and the following usability impact:
> > > 
> > > Alex ARNAUD, on jeu. 03 août 2017 17:53:31 +0200, wrote:
> > > > It is blocking for any a11y tool making these events accessible,
> > > > like software magnifiers such as gnome3 zoom or compiz's ezoom with
> > > > focus tracking. result is unreadable by visually impaired people.
> > > 
> > > how do [people] feel about including it stretch or even jessie?
> > 
> > because this is really a blocker for anybody who has to use a software
> > screen magnifier.
> > 
> > I can manage the stretch-pu upload etc. I just need confirmation from
> > gtk people.
> > 
> > Samuel
> 
> > commit a2d78a2de72b84902a3ca21803ce334eb38743bd
> > Author: Samuel Thibault 
> > Date:   Thu Oct 5 15:49:00 2017 +
> > 
> > a11y/entry: Fix text coords not adjusted for alloc
> > 
> > What is missing is the "allocation" part of x/y coordinates. Since
> > gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
> > the coordinates returned by gdk_window_get_origin don't include it.
> > 
> > This patch fixes this.
> > 
> > https://bugzilla.gnome.org/show_bug.cgi?id=784509
> > 
> > ---
> >  gtk/a11y/gtkentryaccessible.c |8 ++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > --- a/gtk/a11y/gtkentryaccessible.c
> > +++ b/gtk/a11y/gtkentryaccessible.c
> > @@ -25,6 +25,7 @@
> >  #include "gtkentryprivate.h"
> >  #include "gtkcomboboxaccessible.h"
> >  #include "gtkstylecontextprivate.h"
> > +#include "gtkwidgetprivate.h"
> >  
> >  #define GTK_TYPE_ENTRY_ICON_ACCESSIBLE  
> > (gtk_entry_icon_accessible_get_type ())
> >  #define GTK_ENTRY_ICON_ACCESSIBLE(obj)  (G_TYPE_CHECK_INSTANCE_CAST 
> > ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
> > @@ -958,6 +959,7 @@ gtk_entry_accessible_get_character_exten
> >gint index, x_layout, y_layout;
> >GdkWindow *window;
> >gint x_window, y_window;
> > +  GtkAllocation allocation;
> >  
> >widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
> >if (widget == NULL)
> > @@ -973,11 +975,13 @@ gtk_entry_accessible_get_character_exten
> >pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, 
> > _rect);
> >pango_extents_to_pixels (_rect, NULL);
> >  
> > +  _gtk_widget_get_allocation (widget, );
> > +
> >window = gtk_widget_get_window (widget);
> >gdk_window_get_origin (window, _window, _window);
> >  
> > -  *x = x_window + x_layout + char_rect.x;
> > -  *y = y_window + y_layout + char_rect.y;
> > +  *x = x_window + allocation.x + x_layout + char_rect.x;
> > +  *y = y_window + allocation.y + y_layout + char_rect.y;
> >*width = char_rect.width;
> >*height = char_rect.height;
> >  
> 
> 
> -- 
> Samuel
> "I once witnessed a long-winded, month-long flamewar over the use of
> mice vs. trackballs...It was very silly."
> (By Matt Welsh)

-- 
Samuel
The nice thing about Windows is - It does not just crash, it displays a
dialog box and lets you press 'OK' first.
(Arno Schaefer's .sig)



Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-05-25 Thread Samuel Thibault
Ping gtk people?

Samuel

Samuel Thibault, le lun. 16 avril 2018 13:16:05 +0200, a ecrit:
> Samuel Thibault, le dim. 15 oct. 2017 22:14:38 +0200, a ecrit:
> > Just wondering: considering that it's just a few lines (as attached to
> > this mail) and the following usability impact:
> > 
> > Alex ARNAUD, on jeu. 03 août 2017 17:53:31 +0200, wrote:
> > > It is blocking for any a11y tool making these events accessible,
> > > like software magnifiers such as gnome3 zoom or compiz's ezoom with
> > > focus tracking. result is unreadable by visually impaired people.
> > 
> > how do [people] feel about including it stretch or even jessie?
> 
> because this is really a blocker for anybody who has to use a software
> screen magnifier.
> 
> I can manage the stretch-pu upload etc. I just need confirmation from
> gtk people.
> 
> Samuel

> commit a2d78a2de72b84902a3ca21803ce334eb38743bd
> Author: Samuel Thibault 
> Date:   Thu Oct 5 15:49:00 2017 +
> 
> a11y/entry: Fix text coords not adjusted for alloc
> 
> What is missing is the "allocation" part of x/y coordinates. Since
> gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
> the coordinates returned by gdk_window_get_origin don't include it.
> 
> This patch fixes this.
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=784509
> 
> ---
>  gtk/a11y/gtkentryaccessible.c |8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> --- a/gtk/a11y/gtkentryaccessible.c
> +++ b/gtk/a11y/gtkentryaccessible.c
> @@ -25,6 +25,7 @@
>  #include "gtkentryprivate.h"
>  #include "gtkcomboboxaccessible.h"
>  #include "gtkstylecontextprivate.h"
> +#include "gtkwidgetprivate.h"
>  
>  #define GTK_TYPE_ENTRY_ICON_ACCESSIBLE  
> (gtk_entry_icon_accessible_get_type ())
>  #define GTK_ENTRY_ICON_ACCESSIBLE(obj)  (G_TYPE_CHECK_INSTANCE_CAST 
> ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
> @@ -958,6 +959,7 @@ gtk_entry_accessible_get_character_exten
>gint index, x_layout, y_layout;
>GdkWindow *window;
>gint x_window, y_window;
> +  GtkAllocation allocation;
>  
>widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
>if (widget == NULL)
> @@ -973,11 +975,13 @@ gtk_entry_accessible_get_character_exten
>pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, 
> _rect);
>pango_extents_to_pixels (_rect, NULL);
>  
> +  _gtk_widget_get_allocation (widget, );
> +
>window = gtk_widget_get_window (widget);
>gdk_window_get_origin (window, _window, _window);
>  
> -  *x = x_window + x_layout + char_rect.x;
> -  *y = y_window + y_layout + char_rect.y;
> +  *x = x_window + allocation.x + x_layout + char_rect.x;
> +  *y = y_window + allocation.y + y_layout + char_rect.y;
>*width = char_rect.width;
>*height = char_rect.height;
>  


-- 
Samuel
"I once witnessed a long-winded, month-long flamewar over the use of
mice vs. trackballs...It was very silly."
(By Matt Welsh)



Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-04-16 Thread Samuel Thibault
Samuel Thibault, le lun. 16 avril 2018 13:16:05 +0200, a ecrit:
> Samuel Thibault, le dim. 15 oct. 2017 22:14:38 +0200, a ecrit:
> > Just wondering: considering that it's just a few lines (as attached to
> > this mail) and the following usability impact:
> > 
> > Alex ARNAUD, on jeu. 03 août 2017 17:53:31 +0200, wrote:
> > > It is blocking for any a11y tool making these events accessible,
> > > like software magnifiers such as gnome3 zoom or compiz's ezoom with
> > > focus tracking. result is unreadable by visually impaired people.
> > 
> > how do [people] feel about including it stretch or even jessie?
> 
> because this is really a blocker for anybody who has to use a software
> screen magnifier.
> 
> I can manage the stretch-pu upload etc. I just need confirmation from
> gtk people.

(FTR, this is the upstream commit)
commit a2d78a2de72b84902a3ca21803ce334eb38743bd
Author: Samuel Thibault 
Date:   Thu Oct 5 15:49:00 2017 +

a11y/entry: Fix text coords not adjusted for alloc

What is missing is the "allocation" part of x/y coordinates. Since
gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
the coordinates returned by gdk_window_get_origin don't include it.

This patch fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784509

---
 gtk/a11y/gtkentryaccessible.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -25,6 +25,7 @@
 #include "gtkentryprivate.h"
 #include "gtkcomboboxaccessible.h"
 #include "gtkstylecontextprivate.h"
+#include "gtkwidgetprivate.h"
 
 #define GTK_TYPE_ENTRY_ICON_ACCESSIBLE  
(gtk_entry_icon_accessible_get_type ())
 #define GTK_ENTRY_ICON_ACCESSIBLE(obj)  (G_TYPE_CHECK_INSTANCE_CAST 
((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
@@ -958,6 +959,7 @@ gtk_entry_accessible_get_character_exten
   gint index, x_layout, y_layout;
   GdkWindow *window;
   gint x_window, y_window;
+  GtkAllocation allocation;
 
   widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
   if (widget == NULL)
@@ -973,11 +975,13 @@ gtk_entry_accessible_get_character_exten
   pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, _rect);
   pango_extents_to_pixels (_rect, NULL);
 
+  _gtk_widget_get_allocation (widget, );
+
   window = gtk_widget_get_window (widget);
   gdk_window_get_origin (window, _window, _window);
 
-  *x = x_window + x_layout + char_rect.x;
-  *y = y_window + y_layout + char_rect.y;
+  *x = x_window + allocation.x + x_layout + char_rect.x;
+  *y = y_window + allocation.y + y_layout + char_rect.y;
   *width = char_rect.width;
   *height = char_rect.height;
 


Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2018-04-16 Thread Samuel Thibault
Hello,

Raising the question again:

Samuel Thibault, le dim. 15 oct. 2017 22:14:38 +0200, a ecrit:
> Just wondering: considering that it's just a few lines (as attached to
> this mail) and the following usability impact:
> 
> Alex ARNAUD, on jeu. 03 août 2017 17:53:31 +0200, wrote:
> > It is blocking for any a11y tool making these events accessible,
> > like software magnifiers such as gnome3 zoom or compiz's ezoom with
> > focus tracking. result is unreadable by visually impaired people.
> 
> how do [people] feel about including it stretch or even jessie?

because this is really a blocker for anybody who has to use a software
screen magnifier.

I can manage the stretch-pu upload etc. I just need confirmation from
gtk people.

Samuel
commit a2d78a2de72b84902a3ca21803ce334eb38743bd
Author: Samuel Thibault 
Date:   Thu Oct 5 15:49:00 2017 +

a11y/entry: Fix text coords not adjusted for alloc

What is missing is the "allocation" part of x/y coordinates. Since
gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
the coordinates returned by gdk_window_get_origin don't include it.

This patch fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784509

---
 gtk/a11y/gtkentryaccessible.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -25,6 +25,7 @@
 #include "gtkentryprivate.h"
 #include "gtkcomboboxaccessible.h"
 #include "gtkstylecontextprivate.h"
+#include "gtkwidgetprivate.h"
 
 #define GTK_TYPE_ENTRY_ICON_ACCESSIBLE  
(gtk_entry_icon_accessible_get_type ())
 #define GTK_ENTRY_ICON_ACCESSIBLE(obj)  (G_TYPE_CHECK_INSTANCE_CAST 
((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
@@ -958,6 +959,7 @@ gtk_entry_accessible_get_character_exten
   gint index, x_layout, y_layout;
   GdkWindow *window;
   gint x_window, y_window;
+  GtkAllocation allocation;
 
   widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
   if (widget == NULL)
@@ -973,11 +975,13 @@ gtk_entry_accessible_get_character_exten
   pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, _rect);
   pango_extents_to_pixels (_rect, NULL);
 
+  _gtk_widget_get_allocation (widget, );
+
   window = gtk_widget_get_window (widget);
   gdk_window_get_origin (window, _window, _window);
 
-  *x = x_window + x_layout + char_rect.x;
-  *y = y_window + y_layout + char_rect.y;
+  *x = x_window + allocation.x + x_layout + char_rect.x;
+  *y = y_window + allocation.y + y_layout + char_rect.y;
   *width = char_rect.width;
   *height = char_rect.height;
 


Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2017-10-15 Thread Samuel Thibault
Control: tags -1 + fixed-upstream patch

Hello,

Alex ARNAUD, on jeu. 03 août 2017 17:53:31 +0200, wrote:
> Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=784509

Upstream commited a fix for this bug.

Just wondering: considering that it's just a few lines (as attached to
this mail) and the following usability impact:

> It is blocking for any a11y tool making these events accessible, like 
> software magnifiers such as gnome3 zoom or compiz's ezoom with focus tracking.
> result is unreadable by visually impaired people.

how do you feel about including the patch in sid already, and about
including it stretch or even jessie?

Samuel
commit 9af088693a5087a4d82fe14305d67444755b0fcc
Author: Samuel Thibault 
Date:   Thu Oct 5 15:49:00 2017 +

a11y/entry: Fix text coords not adjusted for alloc

What is missing is the "allocation" part of x/y coordinates. Since
gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
the coordinates returned by gdk_window_get_origin don't include it.

This patch fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784509

diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c
index abbaef8e9e..9519b091c5 100644
--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -971,11 +971,14 @@ gtk_entry_accessible_get_character_extents (AtkText  
*text,
   pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, _rect);
   pango_extents_to_pixels (_rect, NULL);
 
+  GtkAllocation allocation;
+  gtk_widget_get_allocation (widget, );
+
   window = gtk_widget_get_window (widget);
   gdk_window_get_origin (window, _window, _window);
 
-  *x = x_window + x_layout + char_rect.x;
-  *y = y_window + y_layout + char_rect.y;
+  *x = x_window + allocation.x + x_layout + char_rect.x;
+  *y = y_window + allocation.y + y_layout + char_rect.y;
   *width = char_rect.width;
   *height = char_rect.height;
 


Bug#870631: (entry_text_shifted) wrong coordinates given to at-spi layer from GTK3 entries

2017-08-03 Thread Alex ARNAUD

Package: gtk+3.0
Version: 3.22.11-1
Tags: a11y upstream
Owner: b...@hypra.fr
User: b...@hypra.fr
Usertags: hypra
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=784509

DESCRIPTION FROM UPSTREAM:

When trying to get position from entry text, after an event received through 
atspi a11y layer, the base text position is wrongly shifted.

It looks like the in-text offset of the caret is responsive, meaning when we 
type a couple letters, it increments the position in Y coordinates correctly. 
However, the base position of text is shifted to the north-west, like it's 
missing some in-grid offset, maybe the base text widget position inside the 
grid. It looks like the text is wrongly located to the north-west corner of the 
window (or grid), just under window decorations.

note: the base widget is rightly positioned, only the text inside is affected.

It is blocking for any a11y tool making these events accessible, like software 
magnifiers such as gnome3 zoom or compiz's ezoom with focus tracking.
result is unreadable by visually impaired people.

I can try and provide a reproducible example is needed.
please consider a quick fix. thank you for reading