mirror of
https://github.com/labwc/labwc.git
synced 2026-03-09 05:33:53 -04:00
src/osd.c: prevent crash with theme setting osd.window-switcher.width: 0
Fixes: #1050 Reported-by: @4ffy (thanks)
This commit is contained in:
parent
ef8709d7fe
commit
a3a5d9a21b
1 changed files with 5 additions and 1 deletions
|
|
@ -425,6 +425,10 @@ display_osd(struct output *output)
|
||||||
wlr_buffer_drop(&output->osd_buffer->base);
|
wlr_buffer_drop(&output->osd_buffer->base);
|
||||||
}
|
}
|
||||||
output->osd_buffer = buffer_create_cairo(w, h, scale, true);
|
output->osd_buffer = buffer_create_cairo(w, h, scale, true);
|
||||||
|
if (!output->osd_buffer) {
|
||||||
|
wlr_log(WLR_ERROR, "Failed to allocate cairo buffer for the window switcher");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Render OSD image */
|
/* Render OSD image */
|
||||||
cairo_t *cairo = output->osd_buffer->cairo;
|
cairo_t *cairo = output->osd_buffer->cairo;
|
||||||
|
|
@ -462,7 +466,7 @@ osd_update(struct server *server)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc.window_switcher.show) {
|
if (rc.window_switcher.show && rc.theme->osd_window_switcher_width > 0) {
|
||||||
/* Display the actual OSD */
|
/* Display the actual OSD */
|
||||||
struct output *output;
|
struct output *output;
|
||||||
wl_list_for_each(output, &server->outputs, link) {
|
wl_list_for_each(output, &server->outputs, link) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue