Avoid deprecation warnings

The recent round of deprecation additions has caused some
warnings that we should avoid.
This commit is contained in:
Matthias Clasen 2016-11-07 11:23:53 -05:00
parent 4add92a431
commit a61d7f7acf
7 changed files with 20 additions and 0 deletions

View File

@ -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);

View File

@ -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",

View File

@ -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 *

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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
}
/**