diff options
author | Wolfgang Ulbrich <[email protected]> | 2015-12-10 20:42:58 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2015-12-11 03:12:38 +0100 |
commit | adfc2809795fa6b740c34120bb0438ddd07e8dff (patch) | |
tree | bb406a9ab4c881fb3fe0b24daba16472f10b36e0 | |
parent | 1ddc241afa5cff81bac8876869974cb43f9cbf2e (diff) | |
download | mate-screensaver-adfc2809795fa6b740c34120bb0438ddd07e8dff.tar.bz2 mate-screensaver-adfc2809795fa6b740c34120bb0438ddd07e8dff.tar.xz |
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
-rw-r--r-- | src/gs-window-x11.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 |