RE: [g-a-devel]Top level windows



Mukund,

The problem I was looking at is different. What I do is when I receive initial 
notification of focus on an AtkObject is call atk_object_get_parent() until I 
get to the top of the tree. The AtkObject whose parent is NULL is the root. I 
then output the children of the root. 

When I did that for eog I got 5 AtkObjects for GtkWindows in addition to the one 
for EogWindow.

When I displayed the menu I got the behavior you describe.

I think I need to add a check in gailtoplevel.c that the window is not 
associated with a menu which is attached to a menu item and not report the 
window as a toplevel if that condition is true.

Proposed patch attached.

Padraig

> 
> Padraig,
> 
> Firstly, confirming if we are on the same page with regards to this
> problem -
> 
> When I choose an option from the menu bar, the menu items under that
> option get exposed as separate windows (role = frame) subsequently. That
> is, once selected, the menu-items along with the menu gets reported as
> frames even though they are not visible.
> 
> I am pasting the output for eog using my text tool -
> 
> -- output --
> 
> |- eog : invalid : |- Eye of Gnome : frame : Co:
>    |- null : panel : Co:
>       |- null : panel : Co:
>          |- null : panel : Co:
>             |- grip : separator : Ac:Co:
>             |- null : menu-bar : Co:Se:
>                |- File : menu : Ac:Co:
>                   |- null : menu : Co:Se:  <---
>                      |- New Window : menu-item : Ac:Co:
>                      |- null : menu-item : Ac:Co:
>                      |- Open... : menu-item : Ac:Co:
>                      |- null : menu-item : Ac:Co:
>                      |- null : menu-item : Ac:Co:
>                      |- Close : menu-item : Ac:Co:
>                      |- Exit : menu-item : Ac:Co:
>                |- View : menu : Ac:Co:
>                   |- null : menu : Co:Se:
>                      |- null : menu-item : Ac:Co:
>                      |- null : menu-item : Ac:Co:
>                |- Settings : menu : Ac:Co:
>                      |- Preferences : menu-item : Ac:Co:
>                |- Help : menu : Ac:Co:
>                   |- null : menu : Co:Se:
>                      |- About... : menu-item : Ac:Co:
>       |- null : panel : Co:
>          |- null : panel : Co:
>             |- grip : separator : Ac:Co:
>             |- null : panel : Co:
>                |- null : panel : Co:
>                   |- Open : push-button : Ac:Co:Im:
>                |- null : panel : Co:
>                   |- Close : push-button : Ac:Co:Im:
>                |- null : panel : Co:
>                   |- null : toggle-button : Ac:Co:Im:
>       |- null : filler : Co:
>          |- null : filler : Co:
>             |- null : filler : Co:
>                |- null : filler : Co:
>                   |- null : panel : Co:
>                      |- null : label : Co:Tx:
>          |- null : filler : Co:
> |- null : frame : Co:   <---- AGAIN REPORTED!!
>    |- null : menu : Co:Se:
>       |- New Window : menu-item : Ac:Co:
>       |- null : menu-item : Ac:Co:
>       |- Open... : menu-item : Ac:Co:
>       |- null : menu-item : Ac:Co:
>       |- null : menu-item : Ac:Co:
>       |- Close : menu-item : Ac:Co:
>       |- Exit : menu-item : Ac:Co:
> Finished querying children
> 
> -- End of output --
> 
> I initially thought it was some problem with my tool but at-poke reports
> the frame too (when it's not visible).
> 
> Is this what you are referring to ? If so, it would be desirable not to
> exporting them as separate windows (frames).
> 
> Cheers,
> Mukund.
> 
> 
> >
> >  While sniffing about at the panel I noticed that there are a
> >  lot of GtkWindows
> >  created during startup which are associated with menus and
> >  which are not
> >  visible. I assume that these should not be reported as
> >  existing, i.e.
> >  gail_toplevel_object_init() should check whether
> >  GTK_WIDGET_VISIBLE is set for a
> >  GtkWindow and remove it from its list of toplevel windows if
> >  it is not.
> >
> >  I will make this change if there are no objections.
> >
> >  Padraig
> >
> 
> 
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
Index: gailtoplevel.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtoplevel.c,v
retrieving revision 1.19
diff -u -p -r1.19 gailtoplevel.c
--- gailtoplevel.c	26 Mar 2002 10:30:40 -0000	1.19
+++ gailtoplevel.c	9 Apr 2002 11:00:04 -0000
@@ -50,6 +50,7 @@ static gboolean         gail_toplevel_sh
 static void      _gail_toplevel_remove_child            (GailToplevel           *toplevel,
                                                         GtkWindow               *window);
 static gboolean  is_tooltip_window                      (GtkWidget              *widget);
+static gboolean  is_attached_menu_window                (GtkWidget              *widget);
 
 
 static gpointer parent_class = NULL;
@@ -116,6 +117,7 @@ static void
 gail_toplevel_object_init (GailToplevel *toplevel)
 {
   GtkWindow *window;
+  GtkWidget *widget;
   GList *l;
   guint signal_id;
   
@@ -124,8 +126,13 @@ gail_toplevel_object_init (GailToplevel 
   while (l)
     {
       window = GTK_WINDOW (l->data);
-      if (!window || GTK_WIDGET (window)->parent || GTK_IS_PLUG (window) ||
-          is_tooltip_window (GTK_WIDGET (window)))
+      widget = GTK_WIDGET (window);
+      if (!window || 
+          !GTK_WIDGET_VISIBLE (widget) ||
+          is_attached_menu_window (widget) ||
+          GTK_WIDGET (window)->parent ||
+          GTK_IS_PLUG (window) ||
+          is_tooltip_window (widget))
         {
           GList *temp_l  = l->next;
 
@@ -138,8 +145,8 @@ gail_toplevel_object_init (GailToplevel 
                             "destroy",
                             G_CALLBACK (gail_toplevel_window_destroyed),
                             toplevel);
+          l = l->next;
         }
-      l = l->next;
     }
 
   gtk_type_class (GTK_TYPE_WINDOW);
@@ -225,7 +232,10 @@ gail_toplevel_show_event_watcher (GSigna
     return TRUE;
 
   widget = GTK_WIDGET (object);
-  if (widget->parent || GTK_IS_PLUG (widget) || is_tooltip_window (widget))
+  if (widget->parent || 
+      is_attached_menu_window (widget) ||
+      GTK_IS_PLUG (widget) || 
+      is_tooltip_window (widget))
     return TRUE;
 
   /* Add the window to the list & emit the signal */
@@ -316,3 +326,21 @@ is_tooltip_window (GtkWidget *widget)
   else
     return FALSE;
 }
+
+static gboolean
+is_attached_menu_window (GtkWidget *widget)
+{
+  GtkWidget *child = GTK_BIN (widget)->child;
+  gboolean ret = FALSE;
+
+  if (GTK_IS_MENU (child))
+    {
+      GtkWidget *attach;
+
+      attach = gtk_menu_get_attach_widget (GTK_MENU (child));
+      if (GTK_IS_MENU_ITEM (attach))
+        ret = TRUE;
+    }
+  return ret;
+}
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]