[Xfce4-commits] [apps/xfce4-screensaver] 223/425: GTK3 window: don't use GtkRC to override drawing area's background
noreply at xfce.org
noreply at xfce.org
Mon Oct 15 01:51:10 CEST 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-screensaver.
commit adfc2809795fa6b740c34120bb0438ddd07e8dff
Author: Wolfgang Ulbrich <chat-to-me at raveit.de>
Date: Thu Dec 10 20:42:58 2015 +0100
GTK3 window: don't use GtkRC to override drawing area's background
That won't work correctly with GTK3, even more so given that we set
app_paintable = TRUE on the drawing area.
Instead, set the background GdkRGBA to black directly
on the GtkDrawingArea's GdkWindow.
taken from:
https://git.gnome.org/browse/gnome-screensaver/commit/?id=43ee32e
---
src/gs-window-x11.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 20acf82..231d8fc 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -203,6 +203,7 @@ gs_window_override_user_time (GSWindow *window)
gdk_x11_window_set_user_time (gtk_widget_get_window (GTK_WIDGET (window)), ev_time);
}
+#if !GTK_CHECK_VERSION (3, 0, 0)
static void
force_no_pixmap_background (GtkWidget *widget)
{
@@ -230,7 +231,6 @@ force_no_pixmap_background (GtkWidget *widget)
gtk_widget_set_name (widget, "gs-window-drawing-area");
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
static void
clear_children (Window window)
{
@@ -2726,6 +2726,10 @@ create_info_bar (GSWindow *window)
static void
gs_window_init (GSWindow *window)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
+
+#endif
window->priv = GS_WINDOW_GET_PRIVATE (window);
window->priv->geometry.x = -1;
@@ -2767,9 +2771,16 @@ gs_window_init (GSWindow *window)
gtk_widget_set_app_paintable (window->priv->drawing_area, TRUE);
#endif
gtk_box_pack_start (GTK_BOX (window->priv->vbox), window->priv->drawing_area, TRUE, TRUE, 0);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_realize (window->priv->drawing_area);
+ gdk_window_set_background_rgba (gtk_widget_get_window (window->priv->drawing_area), &black);
+
+#endif
create_info_bar (window);
+#if !GTK_CHECK_VERSION (3, 0, 0)
force_no_pixmap_background (window->priv->drawing_area);
+#endif
}
static void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list