i3/ipc: Use workspace id to handle rename event#817
Open
michaelPotter wants to merge 1 commit into
Open
Conversation
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.
Author
|
Well shoot. This must be what failed; it's upset about that 64 bit number getting converted: My fix didn't work in i3 without the qint64 though :/ Let me simmer on it. Any advice would be appreciated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usetoInteger(which returns a qint64) instead of thetoIntthat is used elsewhere. I'm not sure if there are other repercussions to this, but I thought you should know.