only pass key events to the focus widget if it is sensitive.

Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>

        * 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.
This commit is contained in:
Tim Janik 1999-01-11 12:22:52 +00:00 committed by Tim Janik
parent f3af00f450
commit e3ee9e9d7d
17 changed files with 210 additions and 33 deletions

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -1,3 +1,28 @@
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* 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 <lupus@debian.org>
* gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook().

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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))

View File

@ -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,6 +625,8 @@ gtk_menu_item_select_timeout (gpointer data)
menu_item = GTK_MENU_ITEM (data);
menu_item->timer = 0;
if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu))
{
gtk_menu_popup (GTK_MENU (menu_item->submenu),
GTK_WIDGET (menu_item)->parent,
GTK_WIDGET (menu_item),
@ -644,6 +644,7 @@ gtk_menu_item_select_timeout (gpointer data)
if (submenu->children)
gtk_menu_shell_select_item (submenu, submenu->children->data);
}
}
GDK_THREADS_LEAVE ();

View File

@ -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)

View File

@ -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))
{

View File

@ -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);
}

View File

@ -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"
{

View File

@ -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"
{