| 37 #define LONG_EMBED_TIMEOUT 15000 |
37 #define LONG_EMBED_TIMEOUT 15000 |
| 38 |
38 |
| 39 /* globals */ |
39 /* globals */ |
| 40 static EggTrayIcon *docklet = NULL; |
40 static EggTrayIcon *docklet = NULL; |
| 41 static GtkWidget *image = NULL; |
41 static GtkWidget *image = NULL; |
| |
42 #if !GTK_CHECK_VERSION(2,12,0) |
| 42 static GtkTooltips *tooltips = NULL; |
43 static GtkTooltips *tooltips = NULL; |
| |
44 #endif |
| 43 static GdkPixbuf *blank_icon = NULL; |
45 static GdkPixbuf *blank_icon = NULL; |
| 44 static int embed_timeout = 0; |
46 static int embed_timeout = 0; |
| 45 static int docklet_height = 0; |
47 static int docklet_height = 0; |
| 46 |
48 |
| 47 /* protos */ |
49 /* protos */ |
| 162 } |
164 } |
| 163 |
165 |
| 164 static void |
166 static void |
| 165 docklet_x11_set_tooltip(gchar *tooltip) |
167 docklet_x11_set_tooltip(gchar *tooltip) |
| 166 { |
168 { |
| |
169 #if GTK_CHECK_VERSION(2,12,0) |
| |
170 if (tooltip) { |
| |
171 gtk_widget_set_tooltip_text(image->parent, tooltip); |
| |
172 } else { |
| |
173 gtk_widget_set_tooltip_text(image->parent, ""); /* NULL? */ |
| |
174 } |
| |
175 #else |
| 167 if (!tooltips) |
176 if (!tooltips) |
| 168 tooltips = gtk_tooltips_new(); |
177 tooltips = gtk_tooltips_new(); |
| 169 |
178 |
| 170 /* image->parent is a GtkEventBox */ |
179 /* image->parent is a GtkEventBox */ |
| 171 if (tooltip) { |
180 if (tooltip) { |
| 173 gtk_tooltips_set_tip(tooltips, image->parent, tooltip, NULL); |
182 gtk_tooltips_set_tip(tooltips, image->parent, tooltip, NULL); |
| 174 } else { |
183 } else { |
| 175 gtk_tooltips_set_tip(tooltips, image->parent, "", NULL); |
184 gtk_tooltips_set_tip(tooltips, image->parent, "", NULL); |
| 176 gtk_tooltips_disable(tooltips); |
185 gtk_tooltips_disable(tooltips); |
| 177 } |
186 } |
| |
187 #endif |
| 178 } |
188 } |
| 179 |
189 |
| 180 #if GTK_CHECK_VERSION(2,2,0) |
190 #if GTK_CHECK_VERSION(2,2,0) |
| 181 static void |
191 static void |
| 182 docklet_x11_position_menu(GtkMenu *menu, int *x, int *y, gboolean *push_in, |
192 docklet_x11_position_menu(GtkMenu *menu, int *x, int *y, gboolean *push_in, |