| 122 |
122 |
| 123 gtk_image_set_from_pixbuf(GTK_IMAGE(image), blank_icon); |
123 gtk_image_set_from_pixbuf(GTK_IMAGE(image), blank_icon); |
| 124 } |
124 } |
| 125 |
125 |
| 126 static void |
126 static void |
| |
127 docklet_x11_position_menu(GtkMenu *menu, int *x, int *y, gboolean *push_in, |
| |
128 gpointer user_data) |
| |
129 { |
| |
130 GtkWidget *widget = GTK_WIDGET(docklet); |
| |
131 GtkRequisition req; |
| |
132 gint menu_xpos, menu_ypos; |
| |
133 |
| |
134 gtk_widget_size_request(GTK_WIDGET(menu), &req); |
| |
135 gdk_window_get_origin(widget->window, &menu_xpos, &menu_ypos); |
| |
136 |
| |
137 menu_xpos += widget->allocation.x; |
| |
138 menu_ypos += widget->allocation.y; |
| |
139 |
| |
140 if (menu_ypos > gdk_screen_get_height(gtk_widget_get_screen(widget)) / 2) |
| |
141 menu_ypos -= req.height; |
| |
142 else |
| |
143 menu_ypos += widget->allocation.height; |
| |
144 |
| |
145 *x = menu_xpos; |
| |
146 *y = menu_ypos; |
| |
147 |
| |
148 *push_in = TRUE; |
| |
149 } |
| |
150 |
| |
151 static void |
| 127 docklet_x11_destroy() |
152 docklet_x11_destroy() |
| 128 { |
153 { |
| 129 docklet_remove(GTK_WIDGET_VISIBLE(docklet)); |
154 docklet_remove(GTK_WIDGET_VISIBLE(docklet)); |
| 130 |
155 |
| 131 g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL); |
156 g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL); |