]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: s/app_id/identifier/ for window-switcher field
authorJohan Malm <jgm323@gmail.com>
Sun, 20 Aug 2023 19:24:46 +0000 (20:24 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 20 Aug 2023 19:49:27 +0000 (20:49 +0100)
...to be consistent with window rules.

The use of 'app_id' for window-switcher fields is hereby deprecated.

docs/labwc-config.5.scd
docs/rc.xml.all
include/config/rcxml.h
src/config/rcxml.c
src/osd.c

index feddedb3a4605ef39d06d93a0147456f5e62185f..14485dc266c196b3befdfd3142b469bf1d811360 100644 (file)
@@ -143,7 +143,8 @@ Therefore, where multiple objects of the same kind are required (for example
 
                - *type* Show view type ("xdg-shell" or "xwayland")
 
-               - *app_id* Show app_id (class for XWayland)
+               - *identifier* Show identifier (app_id for native Wayland
+                 windows and WM_CLASS for XWayland clients)
 
                - *title* Show window title if different to app_id
 
index ce7020de8c59f2432c1bcdedd50e587f9c02d090..ea7bb0ba3f41e919ceaba09bffb1d4823d2f4b26 100644 (file)
     </font>
   </theme>
 
+  <!--
+    Just as for window-rules, 'identifier' relates to app_id for native Wayland
+    windows and WM_CLASS for XWayland clients.
+  -->
   <windowSwitcher show="yes" preview="yes" outlines="yes">
     <fields>
       <field content="type" width="25%" />
-      <field content="app_id" width="25%" />
+      <field content="identifier" width="25%" />
       <field content="title" width="50%" />
     </fields>
   </windowSwitcher>
index 10d74a97d836efe91218286620a3c77c6b1464f6..e15fcabf3e2fdc2595ebb65af62ee639c88fb5d6 100644 (file)
@@ -16,7 +16,7 @@
 enum window_switcher_field_content {
        LAB_FIELD_NONE = 0,
        LAB_FIELD_TYPE,
-       LAB_FIELD_APP_ID,
+       LAB_FIELD_IDENTIFIER,
        LAB_FIELD_TITLE,
 };
 
index d0d24d33b9ac7ccba8afff26788e15a0280292a2..b33edf8dace013d7574d6acc6e20af6c756bdae7 100644 (file)
@@ -183,8 +183,11 @@ fill_window_switcher_field(char *nodename, char *content)
        } else if (!strcmp(nodename, "content")) {
                if (!strcmp(content, "type")) {
                        current_field->content = LAB_FIELD_TYPE;
+               } else if (!strcmp(content, "identifier")) {
+                       current_field->content = LAB_FIELD_IDENTIFIER;
                } else if (!strcmp(content, "app_id")) {
-                       current_field->content = LAB_FIELD_APP_ID;
+                       wlr_log(WLR_ERROR, "window-switcher field 'app_id' is deprecated");
+                       current_field->content = LAB_FIELD_IDENTIFIER;
                } else if (!strcmp(content, "title")) {
                        current_field->content = LAB_FIELD_TITLE;
                } else {
@@ -1054,7 +1057,7 @@ static struct {
        int width;
 } fields[] = {
        { LAB_FIELD_TYPE, 25 },
-       { LAB_FIELD_APP_ID, 25 },
+       { LAB_FIELD_IDENTIFIER, 25 },
        { LAB_FIELD_TITLE, 50 },
        { LAB_FIELD_NONE, 0 },
 };
index 8e5f96e8bdcb205bc291f12e2a555a7805859e9a..ba52536c1edcabea4bebfa3cf35630739d50c261 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -352,7 +352,7 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
                        case LAB_FIELD_TYPE:
                                buf_add(&buf, get_type(*view));
                                break;
-                       case LAB_FIELD_APP_ID:
+                       case LAB_FIELD_IDENTIFIER:
                                buf_add(&buf, get_app_id(*view));
                                break;
                        case LAB_FIELD_TITLE: