GNOME Bugzilla – Bug 122912
gtk_window_mnemonic_activate() shouldn't look at MAPPED
Last modified: 2011-02-04 16:16:03 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.
Created attachment 20175 [details] [review] suggested patch against gtk+-2.2.4 to fix this bug
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().
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)