gtkatspicomponent: Don't return unitialized stack data as screen positions of widgets
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Thu, 15 Jun 2023 07:06:30 +0000 (09:06 +0200)
committerLukáš Tyrychtr <ltyrycht@redhat.com>
Thu, 15 Jun 2023 07:06:30 +0000 (09:06 +0200)
We can not compute the correct value, but that does not mean we should return
basically random values from an unitialized stack space.

Rather than that behavior, return zeros concistently.

gtk/a11y/gtkatspicomponent.c

index beb65a89f5b3cb9ceee697c9a1fa7bd3d09d3276..30bb676c505279d473fab095a1ad2e55e59f9e1e 100644 (file)
@@ -87,6 +87,8 @@ translate_coordinates_from_widget (GtkWidget      *widget,
     {
     case ATSPI_COORD_TYPE_SCREEN:
       g_warning ("Screen coordinates not supported, reported positions will be wrong");
+      *xo = 0;
+      *yo = 0;
       return;
 
     case ATSPI_COORD_TYPE_WINDOW: