]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/menu.c: Clamp separator width
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 20 Sep 2022 00:04:57 +0000 (02:04 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 20 Sep 2022 20:06:31 +0000 (21:06 +0100)
Reported-by: @Flrian
src/menu/menu.c

index 9c990927b7cd4600752f19ed2b73e77c0f5be969..7e09626a2d49fe6404aa72588dfd7318183ae43b 100644 (file)
@@ -178,9 +178,10 @@ separator_create(struct menu *menu, const char *label)
                theme->menu_items_bg_color)->node;
 
        /* theme->menu_separator_width is the line-thickness (so height here) */
+       int width = MENUWIDTH - 2 * theme->menu_separator_padding_width;
        menuitem->normal.text = &wlr_scene_rect_create(
                menuitem->normal.tree,
-               MENUWIDTH - 2 * theme->menu_separator_padding_width,
+               width > 0 ? width : 0,
                theme->menu_separator_width,
                theme->menu_separator_color)->node;