[virt-tools-list] [PATCH virt-viewer] Relax Gtk+ requirement slightly
Eduardo Lima (Etrunko)
etrunko at redhat.com
Tue Nov 6 18:47:14 UTC 2018
On 11/6/18 2:18 PM, Jonathon Jongsma wrote:
> 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.
> ---
> configure.ac | 4 ++--
> src/virt-viewer-window.c | 4 ++++
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 55aa2fa..bfbf27d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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"
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index aace0f8..8e2589d 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -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
>
Acked-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
--
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com
More information about the virt-tools-list
mailing list