comparison finch/libgnt/gntwm.c @ 18070:2b757aadddc9

add gnt_window_present
author Richard Nelson <wabz@pidgin.im>
date Fri, 08 Jun 2007 12:41:30 +0000
parents 08776fc5c06f
children 34e011c8ed2b ac904659104f
comparison
equal deleted inserted replaced
18069:08776fc5c06f 18070:2b757aadddc9
184 gnt_widget_destroy(message); 184 gnt_widget_destroy(message);
185 if (g_list_length(act) == 0) 185 if (g_list_length(act) == 0)
186 return; 186 return;
187 for (iter = act; iter; iter = iter->next) { 187 for (iter = act; iter; iter = iter->next) {
188 GntWS *ws = iter->data; 188 GntWS *ws = iter->data;
189 g_string_sprintfa(text, "%s, ", gnt_ws_get_name(ws)); 189 g_string_append_printf(text, "%s, ", gnt_ws_get_name(ws));
190 } 190 }
191 g_string_erase(text, text->len - 2, 2); 191 g_string_erase(text, text->len - 2, 2);
192 message = gnt_vbox_new(FALSE); 192 message = gnt_vbox_new(FALSE);
193 label = gnt_label_new_with_format(text->str, GNT_TEXT_FLAG_BOLD | GNT_TEXT_FLAG_HIGHLIGHT); 193 label = gnt_label_new_with_format(text->str, GNT_TEXT_FLAG_BOLD | GNT_TEXT_FLAG_HIGHLIGHT);
194 GNT_WIDGET_UNSET_FLAGS(GNT_BOX(message), GNT_WIDGET_CAN_TAKE_FOCUS); 194 GNT_WIDGET_UNSET_FLAGS(GNT_BOX(message), GNT_WIDGET_CAN_TAKE_FOCUS);
560 return; 560 return;
561 561
562 if (GNT_IS_WS(sel)) { 562 if (GNT_IS_WS(sel)) {
563 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, sel)); 563 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, sel));
564 } else { 564 } else {
565 GntNode *node = g_hash_table_lookup(wm->nodes, sel);
566 if (node && node->ws != wm->cws)
567 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, node->ws));
568 gnt_wm_raise_window(wm, GNT_WIDGET(sel)); 565 gnt_wm_raise_window(wm, GNT_WIDGET(sel));
569 } 566 }
570 } 567 }
571 568
572 static void 569 static void
1548 if (w) 1545 if (w)
1549 gnt_widget_set_focus(w, FALSE); 1546 gnt_widget_set_focus(w, FALSE);
1550 } 1547 }
1551 1548
1552 if (wm->event_stack || node->me == wm->_list.window) { 1549 if (wm->event_stack || node->me == wm->_list.window) {
1553 if (wm->cws != ws)
1554 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws));
1555 gnt_wm_raise_window(wm, node->me); 1550 gnt_wm_raise_window(wm, node->me);
1556 } else { 1551 } else {
1557 bottom_panel(node->panel); /* New windows should not grab focus */ 1552 bottom_panel(node->panel); /* New windows should not grab focus */
1558 gnt_widget_set_urgent(node->me); 1553 gnt_widget_set_urgent(node->me);
1559 if (wm->cws != ws) 1554 if (wm->cws != ws)
1926 return ret; 1921 return ret;
1927 } 1922 }
1928 1923
1929 void gnt_wm_raise_window(GntWM *wm, GntWidget *widget) 1924 void gnt_wm_raise_window(GntWM *wm, GntWidget *widget)
1930 { 1925 {
1926 GntWS *ws = gnt_wm_widget_find_workspace(wm, widget);
1927 if (wm->cws != ws)
1928 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws));
1931 g_signal_emit(wm, signals[SIG_GIVE_FOCUS], 0, widget); 1929 g_signal_emit(wm, signals[SIG_GIVE_FOCUS], 0, widget);
1932 } 1930 }
1933 1931
1934 void gnt_wm_set_event_stack(GntWM *wm, gboolean set) 1932 void gnt_wm_set_event_stack(GntWM *wm, gboolean set)
1935 { 1933 {