# HG changeset patch # User Sadrul Habib Chowdhury # Date 1154797487 0 # Node ID 143474e2b1cb6015b38cfa4794511704f86746ac # Parent 27182f83b79bc8e59bb359efa46eaabd6aa4ade4 [gaim-migrate @ 16648] Do not give focus to new windows. Instead, set the urgent-hint for them. committer: Tailor Script diff -r 27182f83b79b -r 143474e2b1cb console/gntblist.c --- a/console/gntblist.c Sat Aug 05 11:31:54 2006 +0000 +++ b/console/gntblist.c Sat Aug 05 17:04:47 2006 +0000 @@ -679,6 +679,7 @@ gnt_widget_set_position(box, x, y); GNT_WIDGET_UNSET_FLAGS(box, GNT_WIDGET_CAN_TAKE_FOCUS); + GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_TRANSIENT); gnt_widget_draw(box); g_free(title); diff -r 27182f83b79b -r 143474e2b1cb console/libgnt/gntcombobox.c --- a/console/libgnt/gntcombobox.c Sat Aug 05 11:31:54 2006 +0000 +++ b/console/libgnt/gntcombobox.c Sat Aug 05 17:04:47 2006 +0000 @@ -129,6 +129,7 @@ widget->priv.y - 9 + 1, widget->priv.x); } + GNT_WIDGET_SET_FLAGS(parent, GNT_WIDGET_TRANSIENT); gnt_widget_draw(parent); return TRUE; } diff -r 27182f83b79b -r 143474e2b1cb console/libgnt/gntmain.c --- a/console/libgnt/gntmain.c Sat Aug 05 11:31:54 2006 +0000 +++ b/console/libgnt/gntmain.c Sat Aug 05 17:04:47 2006 +0000 @@ -67,7 +67,7 @@ /* XXX: ew */ focus_list = g_list_first(focus_list); focus_list = g_list_append(focus_list, widget); - focus_list = g_list_find(focus_list, widget); + focus_list = g_list_find(focus_list, w ? w : widget); gnt_widget_set_focus(widget, TRUE); if (w) @@ -757,7 +757,14 @@ gnt_box_sync_children(GNT_BOX(widget)); node = g_hash_table_lookup(nodes, widget); if (node && !node->panel) + { node->panel = new_panel(node->me->window); + if (!GNT_WIDGET_IS_FLAG_SET(node->me, GNT_WIDGET_TRANSIENT)) + { + bottom_panel(node->panel); /* New windows should not grab focus */ + gnt_widget_set_urgent(node->me); + } + } if (window_list.window) { diff -r 27182f83b79b -r 143474e2b1cb console/libgnt/gntwidget.h --- a/console/libgnt/gntwidget.h Sat Aug 05 11:31:54 2006 +0000 +++ b/console/libgnt/gntwidget.h Sat Aug 05 17:04:47 2006 +0000 @@ -40,6 +40,7 @@ GNT_WIDGET_GROW_X = 1 << 8, GNT_WIDGET_GROW_Y = 1 << 9, GNT_WIDGET_INVISIBLE = 1 << 10, + GNT_WIDGET_TRANSIENT = 1 << 11, } GntWidgetFlags; /* XXX: I'll have to ask grim what he's using this for in guifications. */