Mercurial > pidgin
comparison finch/libgnt/gntmain.c @ 17698:56d2ae9cbb5c
Initial workspace support. refs #51
author | Richard Nelson <wabz@pidgin.im> |
---|---|
date | Fri, 27 Apr 2007 01:51:20 +0000 |
parents | 82b6fdd899a9 |
children | 4d4a396a478c |
comparison
equal
deleted
inserted
replaced
16412:f7c5a1cf2f9c | 17698:56d2ae9cbb5c |
---|---|
89 static int offset = 0; | 89 static int offset = 0; |
90 GntMouseEvent event; | 90 GntMouseEvent event; |
91 GntWidget *widget = NULL; | 91 GntWidget *widget = NULL; |
92 PANEL *p = NULL; | 92 PANEL *p = NULL; |
93 | 93 |
94 if (!wm->ordered || buffer[0] != 27) | 94 if (!wm->cws->ordered || buffer[0] != 27) |
95 return FALSE; | 95 return FALSE; |
96 | 96 |
97 buffer++; | 97 buffer++; |
98 if (strlen(buffer) < 5) | 98 if (strlen(buffer) < 5) |
99 return FALSE; | 99 return FALSE; |
145 if (gnt_wm_process_click(wm, event, x, y, widget)) | 145 if (gnt_wm_process_click(wm, event, x, y, widget)) |
146 return TRUE; | 146 return TRUE; |
147 | 147 |
148 if (event == GNT_LEFT_MOUSE_DOWN && widget && widget != wm->_list.window && | 148 if (event == GNT_LEFT_MOUSE_DOWN && widget && widget != wm->_list.window && |
149 !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT)) { | 149 !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT)) { |
150 if (widget != wm->ordered->data) { | 150 if (widget != wm->cws->ordered->data) { |
151 gnt_wm_raise_window(wm, widget); | 151 gnt_wm_raise_window(wm, widget); |
152 } | 152 } |
153 if (y == widget->priv.y) { | 153 if (y == widget->priv.y) { |
154 offset = x - widget->priv.x; | 154 offset = x - widget->priv.x; |
155 remember = widget; | 155 remember = widget; |
156 button = MOUSE_LEFT; | 156 button = MOUSE_LEFT; |
157 } | 157 } |
158 } else if (event == GNT_MOUSE_UP) { | 158 } else if (event == GNT_MOUSE_UP) { |
159 if (button == MOUSE_NONE && y == getmaxy(stdscr) - 1) { | 159 if (button == MOUSE_NONE && y == getmaxy(stdscr) - 1) { |
160 /* Clicked on the taskbar */ | 160 /* Clicked on the taskbar */ |
161 int n = g_list_length(wm->list); | 161 int n = g_list_length(wm->cws->list); |
162 if (n) { | 162 if (n) { |
163 int width = getmaxx(stdscr) / n; | 163 int width = getmaxx(stdscr) / n; |
164 gnt_bindable_perform_action_named(GNT_BINDABLE(wm), "switch-window-n", x/width, NULL); | 164 gnt_bindable_perform_action_named(GNT_BINDABLE(wm), "switch-window-n", x/width, NULL); |
165 } | 165 } |
166 } else if (button == MOUSE_LEFT && remember) { | 166 } else if (button == MOUSE_LEFT && remember) { |
435 while (widget->parent) | 435 while (widget->parent) |
436 widget = widget->parent; | 436 widget = widget->parent; |
437 | 437 |
438 if (widget == wm->_list.window) | 438 if (widget == wm->_list.window) |
439 return TRUE; | 439 return TRUE; |
440 if (wm->ordered && wm->ordered->data == widget) { | 440 if (wm->cws->ordered && wm->cws->ordered->data == widget) { |
441 if (GNT_IS_BOX(widget) && | 441 if (GNT_IS_BOX(widget) && |
442 (GNT_BOX(widget)->active == w || widget == w)) | 442 (GNT_BOX(widget)->active == w || widget == w)) |
443 return TRUE; | 443 return TRUE; |
444 } | 444 } |
445 return FALSE; | 445 return FALSE; |
448 void gnt_widget_set_urgent(GntWidget *widget) | 448 void gnt_widget_set_urgent(GntWidget *widget) |
449 { | 449 { |
450 while (widget->parent) | 450 while (widget->parent) |
451 widget = widget->parent; | 451 widget = widget->parent; |
452 | 452 |
453 if (wm->ordered && wm->ordered->data == widget) | 453 if (wm->cws->ordered && wm->cws->ordered->data == widget) |
454 return; | 454 return; |
455 | 455 |
456 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_URGENT); | 456 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_URGENT); |
457 | 457 |
458 gnt_wm_update_window(wm, widget); | 458 gnt_wm_update_window(wm, widget); |