After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 122912 - gtk_window_mnemonic_activate() shouldn't look at MAPPED
gtk_window_mnemonic_activate() shouldn't look at MAPPED
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.2.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-09-22 03:34 UTC by Tim Evans
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
suggested patch against gtk+-2.2.4 to fix this bug (440 bytes, patch)
2003-09-22 03:35 UTC, Tim Evans
none Details | Review

Description Tim Evans 2003-09-22 03:34:33 UTC
The code for gtk_container_unmap calls gtk_widget_unmap on its children if
and only if GTK_WIDGET_NO_WINDOW(widget) is true.  Otherwise it just calls
gdk_window_hide(widget->window).  But gdk_window_hide does not cause the
children of the container to get unmapped.

This bug shows up when with mnemonics inside a GtkNotebook in a rather
strange way.  GtkNotebook unmaps its pages when they are not selected, and
GtkWindow ignores mnemonics that point to unmapped widgets.  Combined, this
means that mnemonics that point to anything other the the current notebook
page are ignorred, as they should be.  But with the problem described
above, if the mnemonic widget is inside a GtkContainer with a window (e.g.
GtkEventBox) then it does get unmapped, so its mnemonic is still active.

Changing gtk_container_unmap to always unmap its children seems to fix this
bug.
Comment 1 Tim Evans 2003-09-22 03:35:11 UTC
Created attachment 20175 [details] [review]
suggested patch against gtk+-2.2.4 to fix this bug
Comment 2 Owen Taylor 2004-02-24 22:05:28 UTC
Bug here is rather that gtk_widget_mnemonic_activate() needs
to do something like

       if (GTK_WIDGET_IS_SENSITIVE (widget) &&
           GTK_WIDGET_MAPPED (widget) && 
           widget->window &&
           gdk_window_is_viewable (widget->window))

Cf. gtk_widget_real_can_activate_accel().
Comment 3 Owen Taylor 2004-03-03 22:36:27 UTC
Wed Mar  3 17:30:18 2004  Owen Taylor  <otaylor@redhat.com>
                                                                     
                                                           
        * gtk/gtkwindow.c (gtk_window_mnemonic_activate): Check
        whether widgets are viewable, not just if they are
        mapped. (#122912, reported by Tim Evans)