summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2019-02-11 15:23:26 -0500
committerraveit65 <[email protected]>2019-03-10 15:11:45 +0100
commit3e403c6ca523fb0c47a1904cd555379fa1fc29a8 (patch)
tree72e85a03224001173764447bb6d844075dd13560
parentb75ce4314d8ed43d9d9df6f36b62a6a8b2fcde25 (diff)
downloadmate-panel-3e403c6ca523fb0c47a1904cd555379fa1fc29a8.tar.bz2
mate-panel-3e403c6ca523fb0c47a1904cd555379fa1fc29a8.tar.xz
Wayland support for panel-menu-bar.c
-rw-r--r--mate-panel/panel-menu-bar.c24
1 files changed, 19 insertions, 5 deletions
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 <X11/Xlib.h>
#include <gdk/gdkx.h>
+#endif
#include <string.h>
#include <glib/gi18n.h>
@@ -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