From a61d7f7acf93467d55a259dc6d837beef1f7e82d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 7 Nov 2016 11:23:53 -0500 Subject: [PATCH] Avoid deprecation warnings The recent round of deprecation additions has caused some warnings that we should avoid. --- gdk/x11/gdkwindow-x11.c | 2 ++ gtk/deprecated/gtktrayicon-x11.c | 4 ++++ gtk/gtkmenu.c | 4 ++++ gtk/gtknotebook.c | 2 ++ gtk/gtkscrolledwindow.c | 2 ++ gtk/gtksocket.c | 4 ++++ gtk/gtkstylecontext.c | 2 ++ 7 files changed, 20 insertions(+) diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 9215dbbae3..3d6fd3bf6c 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -4277,8 +4277,10 @@ gdk_x11_window_fullscreen_on_monitor (GdkWindow *window, !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gdk_screen_get_monitor_geometry (GDK_WINDOW_SCREEN (window), monitor, &monitor_geom); gdk_window_move (window, monitor_geom.x, monitor_geom.y); +G_GNUC_END_IGNORE_DEPRECATIONS gdk_window_set_fullscreen_mode (window, GDK_FULLSCREEN_ON_CURRENT_MONITOR); gdk_x11_window_fullscreen (window); diff --git a/gtk/deprecated/gtktrayicon-x11.c b/gtk/deprecated/gtktrayicon-x11.c index 556b9da696..bd84426b18 100644 --- a/gtk/deprecated/gtktrayicon-x11.c +++ b/gtk/deprecated/gtktrayicon-x11.c @@ -224,9 +224,11 @@ gtk_tray_icon_constructed (GObject *object) Display *xdisplay = gdk_x11_display_get_xdisplay (display); char buffer[256]; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_snprintf (buffer, sizeof (buffer), "_NET_SYSTEM_TRAY_S%d", gdk_screen_get_number (screen)); +G_GNUC_END_IGNORE_DEPRECATIONS icon->priv->selection_atom = XInternAtom (xdisplay, buffer, False); @@ -950,6 +952,7 @@ gtk_tray_icon_realize (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->realize (widget); window = gtk_widget_get_window (widget); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (icon->priv->manager_visual_rgba) { /* Set a transparent background */ @@ -961,6 +964,7 @@ gtk_tray_icon_realize (GtkWidget *widget) /* Set a parent-relative background pixmap */ gdk_window_set_background_pattern (window, NULL); } +G_GNUC_END_IGNORE_DEPRECATIONS GTK_NOTE (PLUGSOCKET, g_message ("GtkStatusIcon %p: realized, window: %lx, socket window: %lx", diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 663454a63d..da3707add6 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -1750,8 +1750,10 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu) gtk_widget_set_size_request (priv->tearoff_window, width, height); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS pattern = cairo_pattern_create_for_surface (surface); gdk_window_set_background_pattern (window, pattern); +G_GNUC_END_IGNORE_DEPRECATIONS cairo_pattern_destroy (pattern); cairo_surface_destroy (surface); @@ -2131,6 +2133,7 @@ gtk_menu_popup (GtkMenu *menu, { g_return_if_fail (GTK_IS_MENU (menu)); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_menu_popup_for_device (menu, NULL, parent_menu_shell, @@ -2138,6 +2141,7 @@ gtk_menu_popup (GtkMenu *menu, func, data, NULL, button, activate_time); +G_GNUC_END_IGNORE_DEPRECATIONS } static GdkDevice * diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 29e5b315ed..ce0887515d 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2960,7 +2960,9 @@ show_drag_window (GtkNotebook *notebook, &attributes, attributes_mask); gtk_widget_register_window (widget, priv->drag_window); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gdk_window_set_background_rgba (priv->drag_window, &transparent); +G_GNUC_END_IGNORE_DEPRECATIONS } gtk_widget_set_child_visible (page->tab_label, FALSE); diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 20c5d42c7b..96cd68c4c7 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -4178,7 +4178,9 @@ create_indicator_window (GtkScrolledWindow *scrolled_window, &attributes, attributes_mask); gtk_widget_register_window (widget, window); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gdk_window_set_background_rgba (window, &transparent); +G_GNUC_END_IGNORE_DEPRECATIONS if (scrolled_window->priv->use_indicators) gtk_widget_set_parent_window (child, window); diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index 1e19d0b3f7..ca5744daa3 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -1116,10 +1116,12 @@ gtk_socket_add_window (GtkSocket *socket, private->need_map = private->is_mapped; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS protocol = gdk_window_get_drag_protocol (private->plug_window, NULL); if (protocol) gtk_drag_dest_set_proxy (GTK_WIDGET (socket), private->plug_window, protocol, TRUE); +G_GNUC_END_IGNORE_DEPRECATIONS gdk_error_trap_pop_ignored (); @@ -1526,11 +1528,13 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent, (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_RECEIVER_INFO"))) { gdk_error_trap_push (); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS protocol = gdk_window_get_drag_protocol (private->plug_window, NULL); if (protocol) gtk_drag_dest_set_proxy (GTK_WIDGET (socket), private->plug_window, protocol, TRUE); +G_GNUC_END_IGNORE_DEPRECATIONS gdk_error_trap_pop_ignored (); return_val = GDK_FILTER_REMOVE; diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index aa80b7312c..b85b4732a1 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -2477,6 +2477,7 @@ gtk_style_context_set_background (GtkStyleContext *context, * * We could indeed just set black instead of the color we have. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (gtk_css_style_render_background_is_opaque (gtk_style_context_lookup_style (context))) { const GdkRGBA *color; @@ -2490,6 +2491,7 @@ gtk_style_context_set_background (GtkStyleContext *context, GdkRGBA transparent = { 0.0, 0.0, 0.0, 0.0 }; gdk_window_set_background_rgba (window, &transparent); } +G_GNUC_END_IGNORE_DEPRECATIONS } /**