drawin: Update the drawing-stuff less often
We don't need an up-to-date pixmap and cairo surface for a drawin which isn't visible. Thus, only bring those up-to-date when the drawin is visible. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
2f406a9385
commit
61fde273ca
|
@ -94,6 +94,10 @@ drawin_unref_simplified(drawin_t **item)
|
||||||
static void
|
static void
|
||||||
drawin_update_drawing(drawin_t *w)
|
drawin_update_drawing(drawin_t *w)
|
||||||
{
|
{
|
||||||
|
/* If this drawin isn't visible, we don't need an up-to-date cairo surface
|
||||||
|
* for it. (drawin_map() will later make sure we are called again) */
|
||||||
|
if(w->screen == NULL)
|
||||||
|
return;
|
||||||
/* Clean up old stuff */
|
/* Clean up old stuff */
|
||||||
if(w->surface)
|
if(w->surface)
|
||||||
{
|
{
|
||||||
|
@ -150,8 +154,6 @@ drawin_init(drawin_t *w)
|
||||||
globalconf.default_cmap
|
globalconf.default_cmap
|
||||||
});
|
});
|
||||||
|
|
||||||
drawin_update_drawing(w);
|
|
||||||
|
|
||||||
/* Set the right type property */
|
/* Set the right type property */
|
||||||
ewmh_update_window_type(w->window, window_translate_type(w->type));
|
ewmh_update_window_type(w->window, window_translate_type(w->type));
|
||||||
}
|
}
|
||||||
|
@ -269,6 +271,7 @@ drawin_map(drawin_t *drawin)
|
||||||
client_ignore_enterleave_events();
|
client_ignore_enterleave_events();
|
||||||
/* Map the drawin */
|
/* Map the drawin */
|
||||||
xcb_map_window(globalconf.connection, drawin->window);
|
xcb_map_window(globalconf.connection, drawin->window);
|
||||||
|
drawin_update_drawing(drawin);
|
||||||
/* Deactivate BMA */
|
/* Deactivate BMA */
|
||||||
client_restore_enterleave_events();
|
client_restore_enterleave_events();
|
||||||
/* Stack this drawin correctly */
|
/* Stack this drawin correctly */
|
||||||
|
|
Loading…
Reference in New Issue