Relax Gtk+ requirement slightly

We previously bumped the gtk+ requirement to 3.18 for the function
gtk_window_fullscreen_on_monitor(). But this function is only necessary
in Wayland. So add some preprocessor version checks to allow it to
compile on older distributions if they don't care about wayland support.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This commit is contained in:
Jonathon Jongsma 2018-11-06 10:12:15 -06:00
parent e1186e0c92
commit 2e76dbb65c
2 changed files with 6 additions and 2 deletions

View File

@ -17,8 +17,8 @@ GLIB2_REQUIRED="2.40"
GLIB2_ENCODED_VERSION="GLIB_VERSION_2_40"
# Keep these two definitions in agreement.
GTK_REQUIRED="3.18"
GTK_ENCODED_VERSION="GDK_VERSION_3_18"
GTK_REQUIRED="3.12"
GTK_ENCODED_VERSION="GDK_VERSION_3_12"
LIBXML2_REQUIRED="2.6.0"
LIBVIRT_REQUIRED="0.10.0"

View File

@ -525,6 +525,7 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
}
virt_viewer_window_move_to_monitor(self);
#if GTK_CHECK_VERSION(3, 18, 0)
if (monitor == -1) {
// just go fullscreen on the current monitor
gtk_window_fullscreen(GTK_WINDOW(priv->window));
@ -532,6 +533,9 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
gdk_screen_get_default(), monitor);
}
#else
gtk_window_fullscreen(GTK_WINDOW(priv->window));
#endif /* GTK_CHECK_VERSION */
}
#define MAX_KEY_COMBO 4