mirror of https://github.com/davatorium/rofi.git
If no fake background failed to load, still paint a background. Add debug info.
This commit is contained in:
parent
1d40782515
commit
cd0fedd0db
|
@ -476,6 +476,7 @@ static void rofi_view_setup_fake_transparency ( void )
|
||||||
* Select Background to use for fake transparency.
|
* Select Background to use for fake transparency.
|
||||||
* Current options: 'screenshot','background'
|
* Current options: 'screenshot','background'
|
||||||
*/
|
*/
|
||||||
|
TICK_N("Fake start");
|
||||||
if ( g_strcmp0 ( config.fake_background, "screenshot" ) == 0 ) {
|
if ( g_strcmp0 ( config.fake_background, "screenshot" ) == 0 ) {
|
||||||
s = cairo_xcb_surface_create ( xcb->connection,
|
s = cairo_xcb_surface_create ( xcb->connection,
|
||||||
xcb_stuff_get_root_window ( xcb ),
|
xcb_stuff_get_root_window ( xcb ),
|
||||||
|
@ -488,12 +489,16 @@ static void rofi_view_setup_fake_transparency ( void )
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *fpath = rofi_expand_path ( config.fake_background );
|
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 );
|
s = cairo_image_surface_create_from_png ( fpath );
|
||||||
CacheState.fake_bgrel = TRUE;
|
CacheState.fake_bgrel = TRUE;
|
||||||
g_free ( fpath );
|
g_free ( fpath );
|
||||||
}
|
}
|
||||||
|
TICK_N("Get surface.");
|
||||||
if ( s != NULL ) {
|
if ( s != NULL ) {
|
||||||
if ( cairo_surface_status ( s ) != CAIRO_STATUS_SUCCESS ) {
|
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 );
|
cairo_surface_destroy ( s );
|
||||||
s = NULL;
|
s = NULL;
|
||||||
}
|
}
|
||||||
|
@ -738,21 +743,19 @@ void rofi_view_update ( RofiViewState *state )
|
||||||
TICK ();
|
TICK ();
|
||||||
cairo_t *d = CacheState.edit_draw;
|
cairo_t *d = CacheState.edit_draw;
|
||||||
cairo_set_operator ( d, CAIRO_OPERATOR_SOURCE );
|
cairo_set_operator ( d, CAIRO_OPERATOR_SOURCE );
|
||||||
if ( config.fake_transparency ) {
|
if ( config.fake_transparency && CacheState.fake_bg != NULL ) {
|
||||||
if ( CacheState.fake_bg != NULL ) {
|
if ( CacheState.fake_bgrel ) {
|
||||||
if ( CacheState.fake_bgrel ) {
|
cairo_set_source_surface ( d, CacheState.fake_bg, 0.0, 0.0 );
|
||||||
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 {
|
||||||
|
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 {
|
else {
|
||||||
// Paint the background.
|
// Paint the background.
|
||||||
|
|
Loading…
Reference in New Issue