-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC feature documentation improvement for dwl patching #3
Comments
I've added the link to the pending diff in the README. This is probably not an optimal long-term solution, however, so I'll keep this issue open. Thank you. |
While working on displaying the number of clients for the monocle layout is positive (djpohly/dwl#388), I realized that it didn't work once the IPC feature got added (if IPC is enabled).
diff --git a/dwlb.c b/dwlb.c
index a053d38..31081fb 100644
--- a/dwlb.c
+++ b/dwlb.c
@@ -140,6 +140,7 @@ struct Bar {
uint32_t layout_idx;
uint32_t last_layout_idx;
char title[1024];
+ char ltsymbol[16];
char status[1024];
StatusColor *status_colors;
@@ -418,7 +419,7 @@ draw_frame(Bar *bar)
bar->width, bar->height, bar->textpadding, NULL, 0);
}
- x = draw_text(bar->layout, x, y, foreground, background,
+ x = draw_text(bar->ltsymbol, x, y, foreground, background,
&inactive_fg_color, &inactive_bg_color, bar->width,
bar->height, bar->textpadding, NULL, 0);
@@ -808,6 +809,18 @@ dwl_wm_monitor_layout(void *data, struct znet_tapesoftware_dwl_wm_monitor_v1 *dw
}
}
+static void
+dwl_wm_monitor_ltsymbol(void *data, struct znet_tapesoftware_dwl_wm_monitor_v1 *dwl_wm_monitor,
+ const char *ltsymbol)
+{
+ Bar *bar = (Bar *)data;
+
+ if (strcmp(bar->ltsymbol, ltsymbol) != 0) {
+ snprintf(bar->ltsymbol, sizeof bar->ltsymbol, "%s", ltsymbol);
+ bar->redraw = true;
+ }
+}
+
static void
dwl_wm_monitor_title(void *data, struct znet_tapesoftware_dwl_wm_monitor_v1 *dwl_wm_monitor,
const char *title)
@@ -829,6 +842,7 @@ static const struct znet_tapesoftware_dwl_wm_monitor_v1_listener dwl_wm_monitor_
.selected = dwl_wm_monitor_selected,
.tag = dwl_wm_monitor_tag,
.layout = dwl_wm_monitor_layout,
+ .ltsymbol = dwl_wm_monitor_ltsymbol,
.title = dwl_wm_monitor_title,
.frame = dwl_wm_monitor_frame
};
@@ -875,8 +889,10 @@ setup_bar(Bar *bar)
bar->bottom = bottom;
bar->hidden = hidden;
- if (!ipc)
+ if (!ipc) {
snprintf(bar->layout, sizeof bar->layout, "[]=");
+ snprintf(bar->ltsymbol, sizeof bar->ltsymbol, "[]=");
+ }
bar->xdg_output = zxdg_output_manager_v1_get_xdg_output(output_manager, bar->wl_output);
if (!bar->xdg_output)
diff --git a/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml b/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
index 4fe5b73..1b333d0 100644
--- a/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
+++ b/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
@@ -121,6 +121,13 @@
<arg name="layout" type="uint" summary="index of a layout received by the dwl_wm_v1.layout event."/>
</event>
+ <event name="ltsymbol">
+ <description summary="The layout symbol">
+ Announces the update of the layout symbol.
+ </description>
+ <arg name="ltsymbol" type="string"/>
+ </event>
+
<event name="title">
<description summary="updates the focused client">
Announces the update of the selected client. |
Once your pull request is merged with dwl, open one here so we can discuss these changes. |
hey @yveszoundi, this has been merged with dwl. i was just about to update my dwl when i noticed this commit, would this mean that it would break the IPC behaviour in dwlb, or has that been fixed in the dwl implemtation? |
@podit My
If my approach makes sense and the changes are desirable, I can create a pull request relatively soon. |
great, thanks i'll give it a go |
Summary
Patching
dwl
for the IPC feature is not clear, per current documentation.Current problem and ambiguity
If dwl is patched appropriately, dwlb is capable of communicating directly with dwl
doesn't really tell what is required, especially for people who have never used/tried somebar:somebar
. However, most people wont likely notice proposed updates.wayland-ipc
patch, but incomplete as far as I can tell (no XML file in the diff or whatsoever)Request
Indicate clearly which
dwl
patch to apply to enjoy thedwlb
IPC feature, in the README.I think that even a link to the pending diff is fine, until it's updated in the
somebar
repository.The text was updated successfully, but these errors were encountered: