diff options
-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); } |