Skip to content

Commit

Permalink
Don't generate a title texture if it's empty
Browse files Browse the repository at this point in the history
gedit has an empty title for the unsaved changes dialog,
which causes an assertion failure and a crash because of 0 width/
height (so skip texture generation if that's the case)

Fixes iridescent-desktop#6 (?)

All reported bugs should be fixed now 👀
  • Loading branch information
TheComputerGuy96 committed Nov 13, 2022
1 parent 7ac1bd6 commit 458def1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/compositor/hopalong-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,15 @@ hopalong_view_generate_title_texture(struct hopalong_output *output, struct hopa
const char *title_data = hopalong_view_getprop(view, HOPALONG_VIEW_TITLE);
if (title_data == NULL)
title_data = hopalong_view_getprop(view, HOPALONG_VIEW_APP_ID);
if (title_data != NULL)
strlcpy(title, title_data, sizeof title);

/* Fix for gedit dialog's empty title which causes an assertion failure */
if (title_data == NULL || title_data[0] == '\0')
{
view->title_dirty = false;
return false;
}

strlcpy(title, title_data, sizeof title);

float scale = output->wlr_output->scale;
int w = 400;
Expand Down

0 comments on commit 458def1

Please sign in to comment.