Commit e3ee9e9d authored by Tim Janik's avatar Tim Janik Committed by Tim Janik
Browse files

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.
parent f3af00f4
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().
......
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().
......
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().
......
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().
......
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().
......
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().
......
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().
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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))
......
......@@ -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;
......
......@@ -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)
......
......@@ -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))
{
......
......@@ -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);
}
......
......@@ -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"
{
......
......@@ -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"
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment