diff options
author | monsta <[email protected]> | 2016-01-12 13:01:54 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-05-26 11:53:20 +0300 |
commit | 6a2f8dec695108e86f9988f78ca1e37787daf8a3 (patch) | |
tree | f76fadef37b760b0f569c0e6770c4b02075a79e9 /src/terminal-window.c | |
parent | 7ac202c5d9cd7232fb2b56d4c0124f54f7a0593a (diff) | |
download | mate-terminal-6a2f8dec695108e86f9988f78ca1e37787daf8a3.tar.bz2 mate-terminal-6a2f8dec695108e86f9988f78ca1e37787daf8a3.tar.xz |
window: react on WM change only on X11
Diffstat (limited to 'src/terminal-window.c')
-rw-r--r-- | src/terminal-window.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c index 7415083..cfbe9d1 100644 --- a/src/terminal-window.c +++ b/src/terminal-window.c @@ -22,7 +22,9 @@ #include <string.h> #include <stdlib.h> #include <gtk/gtk.h> +#ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> +#endif #include <gdk/gdkkeysyms.h> #include <libmate-desktop/mate-aboutdialog.h> @@ -1677,9 +1679,18 @@ terminal_window_screen_update (TerminalWindow *window, { TerminalApp *app; - terminal_window_window_manager_changed_cb (screen, window); - g_signal_connect (screen, "window-manager-changed", - G_CALLBACK (terminal_window_window_manager_changed_cb), window); +#ifdef GDK_WINDOWING_X11 +#if GTK_CHECK_VERSION (3, 0, 0) + if (screen && GDK_IS_X11_SCREEN (screen)) +#else + if (screen) +#endif + { + terminal_window_window_manager_changed_cb (screen, window); + g_signal_connect (screen, "window-manager-changed", + G_CALLBACK (terminal_window_window_manager_changed_cb), window); + } +#endif if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (screen), "GT::HasSettingsConnection"))) return; @@ -1712,12 +1723,18 @@ terminal_window_screen_changed (GtkWidget *widget, if (previous_screen == screen) return; +#ifdef GDK_WINDOWING_X11 +#if GTK_CHECK_VERSION (3, 0, 0) + if (previous_screen && GDK_IS_X11_SCREEN (previous_screen)) +#else if (previous_screen) +#endif { g_signal_handlers_disconnect_by_func (previous_screen, G_CALLBACK (terminal_window_window_manager_changed_cb), window); } +#endif if (!screen) return; @@ -2266,13 +2283,19 @@ terminal_window_dispose (GObject *object) G_CALLBACK (update_edit_menu), window); +#ifdef GDK_WINDOWING_X11 screen = gtk_widget_get_screen (GTK_WIDGET (object)); +#if GTK_CHECK_VERSION (3, 0, 0) + if (screen && GDK_IS_X11_SCREEN (screen)) +#else if (screen) +#endif { g_signal_handlers_disconnect_by_func (screen, G_CALLBACK (terminal_window_window_manager_changed_cb), window); } +#endif G_OBJECT_CLASS (terminal_window_parent_class)->dispose (object); } |