summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2019-02-11 16:21:13 -0500
committerraveit65 <[email protected]>2019-03-10 15:11:45 +0100
commit7f72e0ad603cd76c7b65ce31af4afb691da36f88 (patch)
tree8872fecaab8933ed25a2d720b6894168219f89db
parentd9f3c3646006d5405d51f04d6b1d7d2889d366ab (diff)
downloadmate-panel-7f72e0ad603cd76c7b65ce31af4afb691da36f88.tar.bz2
mate-panel-7f72e0ad603cd76c7b65ce31af4afb691da36f88.tar.xz
Wayland support for panel.c
-rw-r--r--mate-panel/panel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mate-panel/panel.c b/mate-panel/panel.c
index ba384217..58727bf0 100644
--- a/mate-panel/panel.c
+++ b/mate-panel/panel.c
@@ -19,7 +19,10 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+
+#ifdef HAVE_X11
#include <gtk/gtkx.h> /* for GTK_IS_SOCKET */
+#endif
#include <libpanel-util/panel-glib.h>
#include <libpanel-util/panel-gtk.h>
@@ -364,6 +367,8 @@ panel_popup_menu (PanelToplevel *toplevel,
gtk_menu_set_screen (GTK_MENU (menu),
gtk_window_get_screen (GTK_WINDOW (toplevel)));
+ gtk_window_set_attached_to (GTK_WINDOW (gtk_widget_get_toplevel (menu)),
+ GTK_WIDGET (toplevel));
gtk_menu_popup_at_pointer (GTK_MENU (menu), NULL);
return TRUE;
@@ -389,11 +394,14 @@ static gboolean
panel_key_press_event (GtkWidget *widget,
GdkEventKey *event)
{
+#ifdef HAVE_X11
/*
* If the focus widget is a GtkSocket, i.e. the
* focus is in an applet in another process, then key
* bindings do not work. We get around this by
* activating the key bindings here.
+ *
+ * Will always be false when not using X
*/
if (GTK_IS_SOCKET (gtk_window_get_focus (GTK_WINDOW (widget))) &&
event->keyval == GDK_KEY_F10 &&
@@ -401,6 +409,7 @@ panel_key_press_event (GtkWidget *widget,
return gtk_bindings_activate (G_OBJECT (widget),
event->keyval,
event->state);
+#endif
return FALSE;
}