summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-11-11 22:11:32 +0100
committerDave Davenport <qball@gmpclient.org>2016-11-11 22:11:32 +0100
commitcd0fedd0dbbc1bdfbaf2dd8fa8f52d401bac3b0c (patch)
tree4024044093928f9cdc0b7265a0d0c194721a2ae8
parent1d40782515fd7c9bcb84f8fe830663f9013da8c0 (diff)
If no fake background failed to load, still paint a background. Add debug info.
-rw-r--r--source/view.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/source/view.c b/source/view.c
index c27def7c..938c4941 100644
--- a/source/view.c
+++ b/source/view.c
@@ -476,6 +476,7 @@ static void rofi_view_setup_fake_transparency ( void )
* Select Background to use for fake transparency.
* Current options: 'screenshot','background'
*/
+ TICK_N("Fake start");
if ( g_strcmp0 ( config.fake_background, "screenshot" ) == 0 ) {
s = cairo_xcb_surface_create ( xcb->connection,
xcb_stuff_get_root_window ( xcb ),
@@ -488,12 +489,16 @@ static void rofi_view_setup_fake_transparency ( void )
}
else {
char *fpath = rofi_expand_path ( config.fake_background );
+ g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Opening %s to use as background.", fpath);
s = cairo_image_surface_create_from_png ( fpath );
CacheState.fake_bgrel = TRUE;
g_free ( fpath );
}
+ TICK_N("Get surface.");
if ( s != NULL ) {
if ( cairo_surface_status ( s ) != CAIRO_STATUS_SUCCESS ) {
+ g_log( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to open surface fake background: %s",
+ cairo_status_to_string ( cairo_surface_status ( s ) ));
cairo_surface_destroy ( s );
s = NULL;
}
@@ -738,21 +743,19 @@ void rofi_view_update ( RofiViewState *state )
TICK ();
cairo_t *d = CacheState.edit_draw;
cairo_set_operator ( d, CAIRO_OPERATOR_SOURCE );
- if ( config.fake_transparency ) {
- if ( CacheState.fake_bg != NULL ) {
- if ( CacheState.fake_bgrel ) {
- cairo_set_source_surface ( d, CacheState.fake_bg, 0.0, 0.0 );
- }
- else {
- cairo_set_source_surface ( d, CacheState.fake_bg,
- -(double) ( state->x - CacheState.mon.x ),
- -(double) ( state->y - CacheState.mon.y ) );
- }
- cairo_paint ( d );
- cairo_set_operator ( d, CAIRO_OPERATOR_OVER );
- color_background ( d );
- cairo_paint ( d );
+ if ( config.fake_transparency && CacheState.fake_bg != NULL ) {
+ if ( CacheState.fake_bgrel ) {
+ cairo_set_source_surface ( d, CacheState.fake_bg, 0.0, 0.0 );
}
+ else {
+ cairo_set_source_surface ( d, CacheState.fake_bg,
+ -(double) ( state->x - CacheState.mon.x ),
+ -(double) ( state->y - CacheState.mon.y ) );
+ }
+ cairo_paint ( d );
+ cairo_set_operator ( d, CAIRO_OPERATOR_OVER );
+ color_background ( d );
+ cairo_paint ( d );
}
else {
// Paint the background.