From e3ee9e9d7dab56082480e2c77191d00f2e559670 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Mon, 11 Jan 1999 12:22:52 +0000 Subject: only pass key events to the focus widget if it is sensitive. Mon Jan 11 13:18:37 1999 Tim Janik * gtk/gtkwindow.c: (gtk_window_key_release_event): (gtk_window_key_press_event): only pass key events to the focus widget if it is sensitive. * gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): don't popup the submenu if it isn't sensitive. (gtk_menu_item_paint): state_type doesn't need to be reset to GTK_STATE_INSENSITIVE if the widget is insensitive anyways. * gtk/gtkcontainer.c (gtk_container_real_focus): * gtk/gtklist.c (gtk_list_focus): * gtk/gtkmenushell.c (gtk_menu_shell_move_selected): * gtk/gtknotebook.c (gtk_notebook_focus): s/GTK_WIDGET_SENSITIVE/GTK_WIDGET_IS_SENSITIVE/ since a widgets sensitivity is determined through the parent as well, GTK_WIDGET_SENSITIVE is only of interest inside gtkwidget.c, everywhere else GTK_WIDGET_IS_SENSITIVE (widget) needs to be used to check for sensitivity. * gtk/gtkaccelgroup.c (gtk_accel_group_activate): don't activate object if it is an insensitive widget. --- gtk/gtkwindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gtk/gtkwindow.c') diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index b4c29219a..21b997fcd 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1012,7 +1012,7 @@ gtk_window_key_press_event (GtkWidget *widget, handled = FALSE; - if (window->focus_widget) + if (window->focus_widget && GTK_WIDGET_IS_SENSITIVE (window->focus_widget)) { handled = gtk_widget_event (window->focus_widget, (GdkEvent*) event); } @@ -1104,7 +1104,7 @@ gtk_window_key_release_event (GtkWidget *widget, window = GTK_WINDOW (widget); handled = FALSE; - if (window->focus_widget) + if (window->focus_widget && GTK_WIDGET_SENSITIVE (window->focus_widget)) { handled = gtk_widget_event (window->focus_widget, (GdkEvent*) event); } -- cgit v1.2.1