From 3e403c6ca523fb0c47a1904cd555379fa1fc29a8 Mon Sep 17 00:00:00 2001 From: William Wold Date: Mon, 11 Feb 2019 15:23:26 -0500 Subject: Wayland support for panel-menu-bar.c --- mate-panel/panel-menu-bar.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'mate-panel') diff --git a/mate-panel/panel-menu-bar.c b/mate-panel/panel-menu-bar.c index 06fca819..e570892d 100644 --- a/mate-panel/panel-menu-bar.c +++ b/mate-panel/panel-menu-bar.c @@ -28,8 +28,10 @@ #include "panel-menu-bar.h" +#ifdef HAVE_X11 #include #include +#endif #include #include @@ -69,7 +71,9 @@ struct _PanelMenuBarPrivate { PanelOrientation orientation; - Window interrupted_window; +#ifdef HAVE_X11 + Window interrupted_x11_window; +#endif }; enum { @@ -91,8 +95,14 @@ static gboolean panel_menu_bar_reinit_tooltip(GtkWidget* widget, PanelMenuBar* m static gboolean panel_menu_bar_deactivate (GtkWidget* widget, PanelMenuBar* menubar) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - panel_util_set_current_active_window (toplevel, menubar->priv->interrupted_window); - menubar->priv->interrupted_window = None; + +#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (widget))) + { + panel_util_set_current_active_x11_window (toplevel, menubar->priv->interrupted_x11_window); + menubar->priv->interrupted_x11_window = None; + } +#endif return FALSE; } @@ -434,9 +444,13 @@ void panel_menu_bar_popup_menu(PanelMenuBar* menubar, guint32 activate_time) menu = GTK_MENU(menubar->priv->applications_menu); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menubar)); - menubar->priv->interrupted_window = panel_util_get_current_active_window (toplevel); window = gtk_widget_get_window (toplevel); - panel_util_set_current_active_window (toplevel, GDK_WINDOW_XID(window)); +#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (gdk_window_get_display (window))) { + menubar->priv->interrupted_x11_window = panel_util_get_current_active_x11_window (toplevel); + panel_util_set_current_active_x11_window (toplevel, GDK_WINDOW_XID(window)); + } +#endif /* * We need to call _gtk_menu_shell_activate() here as is done in -- cgit v1.2.1