diff options
author | Richard Nelson <wabz@pidgin.im> | 2007-06-08 12:41:30 +0000 |
---|---|---|
committer | Richard Nelson <wabz@pidgin.im> | 2007-06-08 12:41:30 +0000 |
commit | e26cebcd45cdaede29a1e7f005b32bef30c1565f (patch) | |
tree | a39f030969f069048999805a35ea561651127e94 | |
parent | 15d5afa65d4d8b32d889bc1ae966e018a8f73f75 (diff) | |
download | pidgin-e26cebcd45cdaede29a1e7f005b32bef30c1565f.tar.gz |
add gnt_window_present
-rw-r--r-- | finch/libgnt/gnt.h | 1 | ||||
-rw-r--r-- | finch/libgnt/gntmain.c | 4 | ||||
-rw-r--r-- | finch/libgnt/gntwm.c | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/finch/libgnt/gnt.h b/finch/libgnt/gnt.h index 9c71af698f..16b4f02049 100644 --- a/finch/libgnt/gnt.h +++ b/finch/libgnt/gnt.h @@ -43,6 +43,7 @@ void gnt_main(void); */ gboolean gnt_ascii_only(void); +void gnt_window_present(GntWidget *window); /** * * @param widget diff --git a/finch/libgnt/gntmain.c b/finch/libgnt/gntmain.c index c5ab5f535c..bc49ecb9cd 100644 --- a/finch/libgnt/gntmain.c +++ b/finch/libgnt/gntmain.c @@ -484,6 +484,10 @@ void gnt_main() * Stuff for 'window management' * *********************************/ +void gnt_window_present(GntWidget *window) { + gnt_wm_raise_window(wm, window); +} + void gnt_screen_occupy(GntWidget *widget) { gnt_wm_new_window(wm, widget); diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c index 67e1034168..81ab6c6367 100644 --- a/finch/libgnt/gntwm.c +++ b/finch/libgnt/gntwm.c @@ -186,7 +186,7 @@ update_act_msg() return; for (iter = act; iter; iter = iter->next) { GntWS *ws = iter->data; - g_string_sprintfa(text, "%s, ", gnt_ws_get_name(ws)); + g_string_append_printf(text, "%s, ", gnt_ws_get_name(ws)); } g_string_erase(text, text->len - 2, 2); message = gnt_vbox_new(FALSE); @@ -562,9 +562,6 @@ window_list_activate(GntTree *tree, GntWM *wm) if (GNT_IS_WS(sel)) { gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, sel)); } else { - GntNode *node = g_hash_table_lookup(wm->nodes, sel); - if (node && node->ws != wm->cws) - gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, node->ws)); gnt_wm_raise_window(wm, GNT_WIDGET(sel)); } } @@ -1550,8 +1547,6 @@ gnt_wm_new_window_real(GntWM *wm, GntWidget *widget) } if (wm->event_stack || node->me == wm->_list.window) { - if (wm->cws != ws) - gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws)); gnt_wm_raise_window(wm, node->me); } else { bottom_panel(node->panel); /* New windows should not grab focus */ @@ -1928,6 +1923,9 @@ gboolean gnt_wm_process_click(GntWM *wm, GntMouseEvent event, int x, int y, GntW void gnt_wm_raise_window(GntWM *wm, GntWidget *widget) { + GntWS *ws = gnt_wm_widget_find_workspace(wm, widget); + if (wm->cws != ws) + gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws)); g_signal_emit(wm, signals[SIG_GIVE_FOCUS], 0, widget); } |