diff --git a/ChangeLog b/ChangeLog index 719cd47983..fd6528f241 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 719cd47983..fd6528f241 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 719cd47983..fd6528f241 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 719cd47983..fd6528f241 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 719cd47983..fd6528f241 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 719cd47983..fd6528f241 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 719cd47983..fd6528f241 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,28 @@ +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. + Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index f5570dd4f7..0d1c6773e7 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -254,7 +254,8 @@ gtk_accel_group_activate (GtkAccelGroup *accel_group, g_return_val_if_fail (accel_group != NULL, FALSE); entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods); - if (entry && entry->signal_id) + if (entry && entry->signal_id && + (!GTK_IS_WIDGET (entry->object) || GTK_WIDGET_IS_SENSITIVE (entry->object))) { gtk_signal_emit (entry->object, entry->signal_id); return TRUE; diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index a201f39dc2..ab6acb6a56 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -6446,7 +6446,7 @@ gtk_clist_focus (GtkContainer *container, g_return_val_if_fail (container != NULL, FALSE); g_return_val_if_fail (GTK_IS_CLIST (container), FALSE); - if (!GTK_WIDGET_SENSITIVE (container)) + if (!GTK_WIDGET_IS_SENSITIVE (container)) return FALSE; clist = GTK_CLIST (container); diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index f375ae268f..ce8cc9ba2f 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1394,7 +1394,7 @@ gtk_container_real_focus (GtkContainer *container, /* Fail if the container is inappropriate for focus movement */ if (!GTK_WIDGET_DRAWABLE (container) || - !GTK_WIDGET_SENSITIVE (container)) + !GTK_WIDGET_IS_SENSITIVE (container)) return FALSE; return_val = FALSE; @@ -1422,7 +1422,7 @@ gtk_container_real_focus (GtkContainer *container, tmp_list = children; while (tmp_list) { - if (GTK_WIDGET_SENSITIVE (tmp_list->data) && + if (GTK_WIDGET_IS_SENSITIVE (tmp_list->data) && GTK_WIDGET_DRAWABLE (tmp_list->data) && (GTK_IS_CONTAINER (tmp_list->data) || GTK_WIDGET_CAN_FOCUS (tmp_list->data))) tmp_list = tmp_list->next; diff --git a/gtk/gtklist.c b/gtk/gtklist.c index d0049ec7e6..2d4f3ccbb6 100644 --- a/gtk/gtklist.c +++ b/gtk/gtklist.c @@ -953,7 +953,7 @@ gtk_list_focus (GtkContainer *container, g_return_val_if_fail (container != NULL, FALSE); g_return_val_if_fail (GTK_IS_LIST (container), FALSE); - if (!GTK_WIDGET_SENSITIVE (container)) + if (!GTK_WIDGET_IS_SENSITIVE (container)) return_val = FALSE; else if (container->focus_child == NULL || !GTK_WIDGET_HAS_FOCUS (container->focus_child)) diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index a42893cd4e..4b506e0157 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -423,8 +423,6 @@ gtk_menu_item_paint (GtkWidget *widget, menu_item = GTK_MENU_ITEM (widget); state_type = widget->state; - if (!GTK_WIDGET_IS_SENSITIVE (widget)) - state_type = GTK_STATE_INSENSITIVE; x = GTK_CONTAINER (menu_item)->border_width; y = GTK_CONTAINER (menu_item)->border_width; @@ -627,24 +625,27 @@ gtk_menu_item_select_timeout (gpointer data) menu_item = GTK_MENU_ITEM (data); menu_item->timer = 0; - gtk_menu_popup (GTK_MENU (menu_item->submenu), - GTK_WIDGET (menu_item)->parent, - GTK_WIDGET (menu_item), - gtk_menu_item_position_menu, - menu_item, - GTK_MENU_SHELL (GTK_WIDGET (menu_item)->parent)->button, - 0); - - /* This is a bit of a hack - we want to select the first item - * of menus hanging of a menu bar, but not for cascading submenus - */ - if (GTK_IS_MENU_BAR (GTK_WIDGET (menu_item)->parent)) + if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu)) { - GtkMenuShell *submenu = GTK_MENU_SHELL (menu_item->submenu); - if (submenu->children) - gtk_menu_shell_select_item (submenu, submenu->children->data); + gtk_menu_popup (GTK_MENU (menu_item->submenu), + GTK_WIDGET (menu_item)->parent, + GTK_WIDGET (menu_item), + gtk_menu_item_position_menu, + menu_item, + GTK_MENU_SHELL (GTK_WIDGET (menu_item)->parent)->button, + 0); + + /* This is a bit of a hack - we want to select the first item + * of menus hanging of a menu bar, but not for cascading submenus + */ + if (GTK_IS_MENU_BAR (GTK_WIDGET (menu_item)->parent)) + { + GtkMenuShell *submenu = GTK_MENU_SHELL (menu_item->submenu); + if (submenu->children) + gtk_menu_shell_select_item (submenu, submenu->children->data); + } } - + GDK_THREADS_LEAVE (); return FALSE; diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index e6883aa089..0f6555d1b4 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -869,7 +869,7 @@ gtk_menu_shell_move_selected (GtkMenuShell *menu_shell, node = node->next; while (node != start_node && (!node || - !GTK_WIDGET_SENSITIVE (node->data) || + !GTK_WIDGET_IS_SENSITIVE (node->data) || !GTK_WIDGET_VISIBLE (node->data) )) { if (!node) @@ -883,7 +883,7 @@ gtk_menu_shell_move_selected (GtkMenuShell *menu_shell, node = node->prev; while (node != start_node && (!node || - !GTK_WIDGET_SENSITIVE (node->data) || + !GTK_WIDGET_IS_SENSITIVE (node->data) || !GTK_WIDGET_VISIBLE (node->data) )) { if (!node) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 5165bf35f5..7181e957a7 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1522,7 +1522,7 @@ gtk_notebook_focus (GtkContainer *container, notebook = GTK_NOTEBOOK (container); - if (!GTK_WIDGET_DRAWABLE (notebook) || !GTK_WIDGET_SENSITIVE (container) || + if (!GTK_WIDGET_DRAWABLE (notebook) || !GTK_WIDGET_IS_SENSITIVE (container) || !notebook->children || !notebook->cur_page) return FALSE; @@ -1532,7 +1532,7 @@ gtk_notebook_focus (GtkContainer *container, if (!notebook->show_tabs) { if (GTK_WIDGET_DRAWABLE (notebook->cur_page->child) && - GTK_WIDGET_SENSITIVE (notebook->cur_page->child)) + GTK_WIDGET_IS_SENSITIVE (notebook->cur_page->child)) { if (GTK_IS_CONTAINER (notebook->cur_page->child)) { diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index b4c29219a6..21b997fcd5 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); } diff --git a/gtk/testgtkrc b/gtk/testgtkrc index 582b83d4c6..fa8cbab45b 100644 --- a/gtk/testgtkrc +++ b/gtk/testgtkrc @@ -123,8 +123,8 @@ binding "test2" # application (for hard coded bindings on application basis) # rc (used implicitel by rc files) # highest -class "GtkWindow" binding "test1" # implicit : rc -class "GtkWindow" binding : highest "test2" # override "rc" priority +class "GtkCList" binding "test1" # implicit : rc +#class "GtkWindow" binding : highest "test2" # override "rc" priority binding "clist-test" { diff --git a/tests/testgtkrc b/tests/testgtkrc index 582b83d4c6..fa8cbab45b 100644 --- a/tests/testgtkrc +++ b/tests/testgtkrc @@ -123,8 +123,8 @@ binding "test2" # application (for hard coded bindings on application basis) # rc (used implicitel by rc files) # highest -class "GtkWindow" binding "test1" # implicit : rc -class "GtkWindow" binding : highest "test2" # override "rc" priority +class "GtkCList" binding "test1" # implicit : rc +#class "GtkWindow" binding : highest "test2" # override "rc" priority binding "clist-test" {