diff options
author | William Wold <[email protected]> | 2019-02-11 15:28:57 -0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-03-10 15:11:45 +0100 |
commit | d602706d8c6486a3f2b43535b3b3b3407b44e882 (patch) | |
tree | 85a99bd8c740ff10ee2f93a5ae82fe627cc4fba2 | |
parent | c0b33db1de315c0fa8932c4870b686dd37a6e81b (diff) | |
download | mate-panel-d602706d8c6486a3f2b43535b3b3b3407b44e882.tar.bz2 mate-panel-d602706d8c6486a3f2b43535b3b3b3407b44e882.tar.xz |
Wayland support for panel-action-button.c
-rw-r--r-- | mate-panel/panel-action-button.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/mate-panel/panel-action-button.c b/mate-panel/panel-action-button.c index e0612b21..e535c19e 100644 --- a/mate-panel/panel-action-button.c +++ b/mate-panel/panel-action-button.c @@ -46,7 +46,6 @@ #include "panel-config-global.h" #include "panel-profile.h" #include "panel-typebuiltins.h" -#include "panel-force-quit.h" #include "panel-util.h" #include "panel-session.h" #include "panel-globals.h" @@ -56,6 +55,11 @@ #include "panel-icon-names.h" #include "panel-schemas.h" +#ifdef HAVE_X11 +#include <gdk/gdkx.h> +#include "panel-force-quit.h" +#endif + G_DEFINE_TYPE (PanelActionButton, panel_action_button, BUTTON_TYPE_WIDGET) #define PANEL_ACTION_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_ACTION_BUTTON, PanelActionButtonPrivate)) @@ -281,8 +285,24 @@ panel_action_search (GtkWidget *widget) static void panel_action_force_quit (GtkWidget *widget) { - panel_force_quit (gtk_widget_get_screen (widget), - gtk_get_current_event_time ()); + GtkWidget *dialog; + GtkDialogFlags flags; + +#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (widget))) { + panel_force_quit (gtk_widget_get_screen (widget), + gtk_get_current_event_time ()); + return; + } +#endif + flags = GTK_DIALOG_DESTROY_WITH_PARENT; + dialog = gtk_message_dialog_new (GTK_WINDOW (widget), + flags, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + "Force quit only available in X11"); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } /* Connect Server |