]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rcxml: replace 'icon' with 'menu' when libsfdo is not linked
authortokyo4j <hrak1529@gmail.com>
Sun, 12 Jan 2025 07:18:39 +0000 (16:18 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Mon, 13 Jan 2025 23:41:00 +0000 (08:41 +0900)
src/config/rcxml.c

index 3dbecc177c9870033eca390d05022af22c466fc8..21ce2f8aa17b96608fadf3a1c8803376f68afc4d 100644 (file)
@@ -157,7 +157,13 @@ fill_section(const char *content, struct wl_list *list, uint32_t *found_buttons)
                }
                enum ssd_part_type type = LAB_SSD_NONE;
                if (!strcmp(identifier, "icon")) {
+#if HAVE_LIBSFDO
                        type = LAB_SSD_BUTTON_WINDOW_ICON;
+#else
+                       wlr_log(WLR_ERROR, "libsfdo is not linked. "
+                               "Replacing 'icon' in titlebar layout with 'menu'.");
+                       type = LAB_SSD_BUTTON_WINDOW_MENU;
+#endif
                } else if (!strcmp(identifier, "menu")) {
                        type = LAB_SSD_BUTTON_WINDOW_MENU;
                } else if (!strcmp(identifier, "iconify")) {
@@ -1672,7 +1678,16 @@ post_processing(void)
        }
 
        if (!rc.title_layout_loaded) {
+#if HAVE_LIBSFDO
                fill_title_layout("icon:iconify,max,close");
+#else
+               /*
+                * 'icon' is replaced with 'menu' in fill_title_layout() when
+                * libsfdo is not linked, but we also replace it here not to
+                * show error message with default settings.
+                */
+               fill_title_layout("menu:iconify,max,close");
+#endif
        }
 
        /*