comparison console/libgnt/wms/s.c @ 14931:d7732681329b

[gaim-migrate @ 17703] There's no default mouse-click handler in GntWM. So let's not crash trying to call that. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 08 Nov 2006 05:19:21 +0000
parents 065e7ac30338
children d08d7b7375c7
comparison
equal deleted inserted replaced
14930:ad64947f81c8 14931:d7732681329b
22 22
23 GType s_get_gtype(void); 23 GType s_get_gtype(void);
24 void gntwm_init(GntWM **wm); 24 void gntwm_init(GntWM **wm);
25 25
26 static void (*org_new_window)(GntWM *wm, GntWidget *win); 26 static void (*org_new_window)(GntWM *wm, GntWidget *win);
27 static gboolean (*org_mouse_clicked)(GntWM *wm, GntMouseEvent event, int cx, int cy, GntWidget *widget);
28 27
29 static void 28 static void
30 envelope_buddylist(GntWidget *win) 29 envelope_buddylist(GntWidget *win)
31 { 30 {
32 int w, h; 31 int w, h;
137 s_mouse_clicked(GntWM *wm, GntMouseEvent event, int cx, int cy, GntWidget *widget) 136 s_mouse_clicked(GntWM *wm, GntMouseEvent event, int cx, int cy, GntWidget *widget)
138 { 137 {
139 int x, y, w, h; 138 int x, y, w, h;
140 139
141 if (!widget) 140 if (!widget)
142 return org_mouse_clicked(wm, event, cx, cy, widget); 141 return FALSE;
143 /* This might be a place to bring up a context menu */ 142 /* This might be a place to bring up a context menu */
144 143
145 if (event != GNT_LEFT_MOUSE_DOWN || 144 if (event != GNT_LEFT_MOUSE_DOWN ||
146 GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER)) 145 GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER))
147 return org_mouse_clicked(wm, event, cx, cy, widget); 146 return FALSE;
148 147
149 gnt_widget_get_position(widget, &x, &y); 148 gnt_widget_get_position(widget, &x, &y);
150 gnt_widget_get_size(widget, &w, &h); 149 gnt_widget_get_size(widget, &w, &h);
151 150
152 if (cy == y && cx == x + w - 3) { 151 if (cy == y && cx == x + w - 3) {
153 gnt_widget_destroy(widget); 152 gnt_widget_destroy(widget);
154 return TRUE; 153 return TRUE;
155 } 154 }
156 155
157 return org_mouse_clicked(wm, event, cx, cy, widget); 156 return FALSE;
158 } 157 }
159 158
160 static gboolean 159 static gboolean
161 toggle_buddylist(GntBindable *bindable, GList *null) 160 toggle_buddylist(GntBindable *bindable, GList *null)
162 { 161 {
173 s_class_init(SClass *klass) 172 s_class_init(SClass *klass)
174 { 173 {
175 GntWMClass *pclass = GNT_WM_CLASS(klass); 174 GntWMClass *pclass = GNT_WM_CLASS(klass);
176 175
177 org_new_window = pclass->new_window; 176 org_new_window = pclass->new_window;
178 org_mouse_clicked = pclass->mouse_clicked;
179 177
180 pclass->new_window = s_new_window; 178 pclass->new_window = s_new_window;
181 pclass->decorate_window = s_decorate_window; 179 pclass->decorate_window = s_decorate_window;
182 pclass->window_update = s_window_update; 180 pclass->window_update = s_window_update;
183 pclass->mouse_clicked = s_mouse_clicked; 181 pclass->mouse_clicked = s_mouse_clicked;