xapp-status-icon.c: Get rid of the dead 'shadow' region around menus,
as they can interfere with clicking on the icon to close the menu.
This removes the "csd" style class which causes this (it's the only way
to fix this, as
Remove 'csd' style class from menus, it interferes with clicking on the
panel when they're open.
dsds
Michael Webster
3 years ago
269 | 269 | |
270 | 270 | g_debug ("XAppStatusIcon: Popup menu on behalf of application"); |
271 | 271 | |
272 | if (!gtk_widget_get_realized (GTK_WIDGET (menu))) | |
273 | { | |
274 | GtkWidget *toplevel; | |
275 | GtkStyleContext *context; | |
276 | ||
277 | gtk_widget_realize (GTK_WIDGET (menu)); | |
278 | toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu)); | |
279 | context = gtk_widget_get_style_context (toplevel); | |
280 | ||
281 | /* GtkMenu uses a GtkWindow as its toplevel that is explicitly set to | |
282 | * be client-decorated, and applies shadows outside the visible part of | |
283 | * the menu. They interfere with clicks on the icon while the menu is open, | |
284 | * as the invisible part takes the events instead (and this ends up doing | |
285 | * nothing). It makes the menu a littly ugly, so here's a new class name we | |
286 | * can use for themes to restore things bit if we want. Just avoid shadows. */ | |
287 | gtk_style_context_remove_class (context, "csd"); | |
288 | gtk_style_context_add_class (context, "xapp-status-icon-menu-window"); | |
289 | } | |
290 | ||
272 | 291 | event = synthesize_event (self, |
273 | 292 | x, y, button, _time, panel_position, |
274 | 293 | &rect_window, &win_rect, &rect_anchor, &menu_anchor); |