comparison finch/libgnt/gntwm.c @ 19153:58743fae0db2

merge of '8e1c0ef9ebb6ce5efc6fad6c18ad02f6f83f220e' and 'db793e506dda38bd8d837986f60cfcbe027860e4'
author Eric Polino <aluink@pidgin.im>
date Wed, 11 Jul 2007 20:03:24 +0000
parents 700fe77a79b3
children 3432d37a4a77
comparison
equal deleted inserted replaced
19151:700fe77a79b3 19153:58743fae0db2
733 bg.r, bg.g, bg.b, fg.r, fg.g, fg.b); 733 bg.r, bg.g, bg.b, fg.r, fg.g, fg.b);
734 } 734 }
735 print = ch; 735 print = ch;
736 #ifndef NO_WIDECHAR 736 #ifndef NO_WIDECHAR
737 if (wch.chars[0] > 255) { 737 if (wch.chars[0] > 255) {
738 /* XXX This lines throws a warning, can we quiet it? */
738 snprintf(unicode, sizeof(unicode), "&#x%x;", wch.chars[0]); 739 snprintf(unicode, sizeof(unicode), "&#x%x;", wch.chars[0]);
739 print = unicode; 740 print = unicode;
740 } 741 }
741 #endif 742 #endif
742 if (now & A_ALTCHARSET) 743 if (now & A_ALTCHARSET)
801 { 802 {
802 GntWM *wm = GNT_WM(bindable); 803 GntWM *wm = GNT_WM(bindable);
803 if (wm->_list.window) 804 if (wm->_list.window)
804 return TRUE; 805 return TRUE;
805 806
807 if(!wm->cws->ordered)
808 return FALSE;
809
806 shift_window(wm, wm->cws->ordered->data, -1); 810 shift_window(wm, wm->cws->ordered->data, -1);
807 return TRUE; 811 return TRUE;
808 } 812 }
809 813
810 static gboolean 814 static gboolean
811 shift_right(GntBindable *bindable, GList *null) 815 shift_right(GntBindable *bindable, GList *null)
812 { 816 {
813 GntWM *wm = GNT_WM(bindable); 817 GntWM *wm = GNT_WM(bindable);
818
814 if (wm->_list.window) 819 if (wm->_list.window)
815 return TRUE; 820 return TRUE;
821
822 if(!wm->cws->ordered)
823 return FALSE;
816 824
817 shift_window(wm, wm->cws->ordered->data, 1); 825 shift_window(wm, wm->cws->ordered->data, 1);
818 return TRUE; 826 return TRUE;
819 } 827 }
820 828
1144 1152
1145 static gboolean 1153 static gboolean
1146 help_for_window(GntBindable *bindable, GList *null) 1154 help_for_window(GntBindable *bindable, GList *null)
1147 { 1155 {
1148 GntWM *wm = GNT_WM(bindable); 1156 GntWM *wm = GNT_WM(bindable);
1149 GntWidget *widget = wm->cws->ordered->data; 1157 GntWidget *widget;
1158
1159
1160 if(!wm->cws->ordered)
1161 return FALSE;
1162
1163 widget = wm->cws->ordered->data;
1150 1164
1151 return help_for_bindable(wm,GNT_BINDABLE(widget)); 1165 return help_for_bindable(wm,GNT_BINDABLE(widget));
1152 } 1166 }
1153 1167
1154 static gboolean 1168 static gboolean
1945 { 1959 {
1946 GntNode *node = g_hash_table_lookup(wm->nodes, widget); 1960 GntNode *node = g_hash_table_lookup(wm->nodes, widget);
1947 1961
1948 if (!node) 1962 if (!node)
1949 return; 1963 return;
1950 1964
1965 /* XXX Should there be a check before access to 'data' to make sure 'ordered' isn't NULL? */
1951 if (widget != wm->_list.window && !GNT_IS_MENU(widget) && 1966 if (widget != wm->_list.window && !GNT_IS_MENU(widget) &&
1952 wm->cws->ordered->data != widget) { 1967 wm->cws->ordered->data != widget) {
1953 GntWidget *w = wm->cws->ordered->data; 1968 GntWidget *w = wm->cws->ordered->data;
1954 wm->cws->ordered = g_list_bring_to_front(wm->cws->ordered, widget); 1969 wm->cws->ordered = g_list_bring_to_front(wm->cws->ordered, widget);
1955 gnt_widget_set_focus(w, FALSE); 1970 gnt_widget_set_focus(w, FALSE);
2007 void gnt_wm_raise_window(GntWM *wm, GntWidget *widget) 2022 void gnt_wm_raise_window(GntWM *wm, GntWidget *widget)
2008 { 2023 {
2009 GntWS *ws = gnt_wm_widget_find_workspace(wm, widget); 2024 GntWS *ws = gnt_wm_widget_find_workspace(wm, widget);
2010 if (wm->cws != ws) 2025 if (wm->cws != ws)
2011 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws)); 2026 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws));
2027 /* XXX Should there be a check before access to 'data' to make sure 'ordered' isn't NULL? */
2012 if (widget != wm->cws->ordered->data) { 2028 if (widget != wm->cws->ordered->data) {
2013 GntWidget *wid = wm->cws->ordered->data; 2029 GntWidget *wid = wm->cws->ordered->data;
2014 wm->cws->ordered = g_list_bring_to_front(wm->cws->ordered, widget); 2030 wm->cws->ordered = g_list_bring_to_front(wm->cws->ordered, widget);
2015 gnt_widget_set_focus(wid, FALSE); 2031 gnt_widget_set_focus(wid, FALSE);
2016 gnt_widget_draw(wid); 2032 gnt_widget_draw(wid);