Disable deprecation warnings for gtk_window_fullscreen_on_monitor

We use GLIB_VERSION_MAX_ALLOWED to prevent use of functions from
GTK >= 3.12. When we do conditional compilation based on a GTK
version check, we must thus suppress the warning:

  CC       libvirt_viewer_la-virt-viewer-window.lo
../../src/virt-viewer-window.c: In function 'virt_viewer_window_enter_fullscreen':
../../src/virt-viewer-window.c:608:9: error: 'gtk_window_fullscreen_on_monitor' is deprecated: Not available before 3.18 [-Werror=deprecated-declarations]
         gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtkdialog.h:32,
                 from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:31,
                 from ../../src/virt-viewer-window.c:28:
/usr/include/gtk-3.0/gtk/gtkwindow.h:391:10: note: declared here
 void     gtk_window_fullscreen_on_monitor(GtkWindow *window,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-02-12 13:56:07 +00:00
parent 8d451999be
commit 455c9a2f36

View File

@ -605,8 +605,11 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
// just go fullscreen on the current monitor
gtk_window_fullscreen(GTK_WINDOW(priv->window));
} else {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
gdk_screen_get_default(), monitor);
#pragma GCC diagnostic pop
}
#else
gtk_window_fullscreen(GTK_WINDOW(priv->window));