Skip to content

i3/ipc: Use workspace id to handle rename event#817

Open
michaelPotter wants to merge 1 commit into
quickshell-mirror:masterfrom
michaelPotter:master
Open

i3/ipc: Use workspace id to handle rename event#817
michaelPotter wants to merge 1 commit into
quickshell-mirror:masterfrom
michaelPotter:master

Conversation

@michaelPotter
Copy link
Copy Markdown

@michaelPotter michaelPotter commented May 22, 2026

This fixes an issue where i3 rename events aren't being handled.

When a rename event comes in, the value of data.current.name is the NEW name value. When we search quickshell's internal workspace state, we can't find the workspace since quickshell still has the old name. This updates the rename event handler to find the workspace by id instead.

I've tested under sway and i3.

Side note: I don't really know C or C++, but afiact it looks like i3 is using pointer addresses for workspace ids (see code below) however it looks like quickshell stores them as qint32. They were definitely coming out as 64 bit ints on my system. I had to use toInteger (which returns a qint64) instead of the toInt that is used elsewhere. I'm not sure if there are other repercussions to this, but I thought you should know.

    # src/ipc.c:363 in i3
    ystr("id");
    y(integer, (uintptr_t)con);

When a rename event comes in, the value of data.current.name is the NEW
name value so it can't be used to find the existing workspace data which
still has the old value.
@michaelPotter
Copy link
Copy Markdown
Author

michaelPotter commented May 22, 2026

Well shoot. This must be what failed; it's upset about that 64 bit number getting converted:

/home/runner/work/quickshell/quickshell/src/x11/i3/ipc/controller.cpp:297:45: error: narrowing conversion from 'qint64' (aka 'long long') to signed type 'qint32' (aka 'int') is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions,-warnings-as-errors]
2026-05-22T03:51:14.3289648Z   297 |                 auto* workspace = this->findWorkspaceByID(id);

My fix didn't work in i3 without the qint64 though :/ Let me simmer on it. Any advice would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant