| 227 |
227 |
| 228 purple_debug(PURPLE_DEBUG_INFO, "docklet", "destroyed\n"); |
228 purple_debug(PURPLE_DEBUG_INFO, "docklet", "destroyed\n"); |
| 229 } |
229 } |
| 230 |
230 |
| 231 static gboolean |
231 static gboolean |
| 232 docklet_x11_get_geometry(gint *x, gint *y, gint *w, gint *h) |
|
| 233 { |
|
| 234 int lx,ly; |
|
| 235 GtkWidget *widget = GTK_WIDGET(docklet); |
|
| 236 |
|
| 237 if(docklet==NULL) return FALSE; |
|
| 238 |
|
| 239 gdk_window_get_origin(GDK_WINDOW(widget->window), &lx, &ly); |
|
| 240 |
|
| 241 if(x!=NULL) *x = lx + widget->allocation.x; |
|
| 242 if(y!=NULL) *y = ly + widget->allocation.y; |
|
| 243 |
|
| 244 if(w!=NULL) *w = widget->allocation.width; |
|
| 245 if(h!=NULL) *h = widget->allocation.height; |
|
| 246 |
|
| 247 return TRUE; |
|
| 248 } |
|
| 249 |
|
| 250 static GObject * |
|
| 251 docklet_x11_get_gdk_screen() |
|
| 252 { |
|
| 253 #if GTK_CHECK_VERSION(2,2,0) |
|
| 254 return (GObject *)gtk_widget_get_screen(GTK_WIDGET(docklet)); |
|
| 255 #else |
|
| 256 return NULL; |
|
| 257 #endif |
|
| 258 } |
|
| 259 |
|
| 260 static gboolean |
|
| 261 docklet_x11_embed_timeout_cb() |
232 docklet_x11_embed_timeout_cb() |
| 262 { |
233 { |
| 263 /* The docklet was not embedded within the timeout. |
234 /* The docklet was not embedded within the timeout. |
| 264 * Remove it as a visibility manager, but leave the plugin |
235 * Remove it as a visibility manager, but leave the plugin |
| 265 * loaded so that it can embed automatically if/when a notification |
236 * loaded so that it can embed automatically if/when a notification |
| 340 docklet_x11_destroy, |
311 docklet_x11_destroy, |
| 341 docklet_x11_update_icon, |
312 docklet_x11_update_icon, |
| 342 docklet_x11_blank_icon, |
313 docklet_x11_blank_icon, |
| 343 docklet_x11_set_tooltip, |
314 docklet_x11_set_tooltip, |
| 344 #if GTK_CHECK_VERSION(2,2,0) |
315 #if GTK_CHECK_VERSION(2,2,0) |
| 345 docklet_x11_position_menu, |
316 docklet_x11_position_menu |
| 346 #else |
317 #else |
| 347 NULL, |
318 NULL |
| 348 #endif |
319 #endif |
| 349 docklet_x11_get_geometry, |
|
| 350 docklet_x11_get_gdk_screen |
|
| 351 }; |
320 }; |
| 352 |
321 |
| 353 void |
322 void |
| 354 docklet_ui_init() |
323 docklet_ui_init() |
| 355 { |
324 { |