tray: Get rid of deprecation warnings

gdk_window_set_composited() is deprecated, and we don't need it as
we end up setting it to the default anyway.
We do need gtk_widget_set_double_buffered() though, which has been
deprecated as well because it is only meaningful on X11 - but so
is XEmbed, so just shut up that warning.
This commit is contained in:
Florian Müllner 2015-09-26 00:21:05 +02:00
parent 731d64e0e4
commit 9acdb8012c
3 changed files with 4 additions and 43 deletions

View File

@ -279,14 +279,6 @@ na_tray_icon_added (NaTrayManager *na_manager, GtkWidget *socket,
GtkWidget *win;
ShellTrayManagerChild *child;
/* We don't need the NaTrayIcon to be composited on the window we
* put it in: the window is the same size as the tray icon
* and transparent. We can just use the default X handling of
* subwindows as mode of SOURCE (replace the parent with the
* child) and then composite the parent onto the stage.
*/
na_tray_child_set_composited (NA_TRAY_CHILD (socket), FALSE);
win = shell_embedded_window_new ();
gtk_container_add (GTK_CONTAINER (win), socket);

View File

@ -53,7 +53,6 @@ na_tray_child_realize (GtkWidget *widget)
/* Set a transparent background */
cairo_pattern_t *transparent = cairo_pattern_create_rgba (0, 0, 0, 0);
gdk_window_set_background_pattern (window, transparent);
gdk_window_set_composited (window, TRUE);
cairo_pattern_destroy (transparent);
child->parent_relative_bg = FALSE;
@ -72,17 +71,19 @@ na_tray_child_realize (GtkWidget *widget)
child->parent_relative_bg = FALSE;
}
gdk_window_set_composited (window, child->composited);
gtk_widget_set_app_paintable (GTK_WIDGET (child),
child->parent_relative_bg || child->has_alpha);
/* Double-buffering will interfere with the parent-relative-background fake
* transparency, since the double-buffer code doesn't know how to fill in the
* background of the double-buffer correctly.
* The function is deprecated because it is only meaningful on X11 - the
* same is true for XEmbed of course, so just ignore the warning.
*/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_set_double_buffered (GTK_WIDGET (child),
child->parent_relative_bg);
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
@ -285,8 +286,6 @@ na_tray_child_new (GdkScreen *screen,
visual_has_alpha = red_prec + blue_prec + green_prec < depth;
child->has_alpha = visual_has_alpha;
child->composited = child->has_alpha;
return GTK_WIDGET (child);
}
@ -362,33 +361,6 @@ na_tray_child_has_alpha (NaTrayChild *child)
return child->has_alpha;
}
/**
* na_tray_child_set_composited;
* @child: a #NaTrayChild
* @composited: %TRUE if the child's window should be redirected
*
* Sets whether the #GdkWindow of the child should be set redirected
* using gdk_window_set_composited(). By default this is based off of
* na_tray_child_has_alpha(), but it may be useful to override it in
* certain circumstances; for example, if the #NaTrayChild is added
* to a parent window and that parent window is composited against the
* background.
*/
void
na_tray_child_set_composited (NaTrayChild *child,
gboolean composited)
{
g_return_if_fail (NA_IS_TRAY_CHILD (child));
if (child->composited == composited)
return;
child->composited = composited;
if (gtk_widget_get_realized (GTK_WIDGET (child)))
gdk_window_set_composited (gtk_widget_get_window (GTK_WIDGET (child)),
composited);
}
/* If we are faking transparency with a window-relative background, force a
* redraw of the icon. This should be called if the background changes or if
* the child is shifted with respect to the background.

View File

@ -42,7 +42,6 @@ struct _NaTrayChild
GtkSocket parent_instance;
Window icon_window;
guint has_alpha : 1;
guint composited : 1;
guint parent_relative_bg : 1;
};
@ -57,8 +56,6 @@ GtkWidget *na_tray_child_new (GdkScreen *screen,
Window icon_window);
char *na_tray_child_get_title (NaTrayChild *child);
gboolean na_tray_child_has_alpha (NaTrayChild *child);
void na_tray_child_set_composited (NaTrayChild *child,
gboolean composited);
void na_tray_child_force_redraw (NaTrayChild *child);
void na_tray_child_get_wm_class (NaTrayChild *child,
char **res_name,