Skip to content
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] Various issues with IPC #2368

Open
marcusbritanicus opened this issue May 26, 2024 · 0 comments
Open

[IPC] Various issues with IPC #2368

marcusbritanicus opened this issue May 26, 2024 · 0 comments
Labels
bug easy Issues that do not require knowledge about the whole codebase PRs-welcome Issues which are unlikely to be fixed unless someone sends a PR

Comments

@marcusbritanicus
Copy link
Contributor

Clear description of the problem
One of the common problems I am facing with IPC is garbage values for various properties. this generally happens because the said property is not set by wayfire. A good example is view-app-id-changed event. The first time this event is emitted, Wayfire has not yet "placed" the view. Therefore, it does not have a wset-index. And the json data contains garbage values like: "wset-index": 18446744073709551615.

This is not an isolated incident. Such behaviour can be observed in cases like moving a window with click-and-drag. The move plugin does not (probably, cannot) set the "from" workspace. Therefore when a window is moved, view-workspace-changed is emitted with garbage values for "from" workspace, much like the example above.

What can be done
For events like view-app-id-changed, we can completely ignore all the fields other than "app-id", but that is not the most ideal solution.

In general, it would be preferable to explicitly tell the user that the value of a field is invalid. For example, "wset-index" is, as a rule, never zero. The workspace indices can never be negative. So instead of letting garbage values being filled in, we can simply set them to these invalid values. This way, the events can be safely parsed and invalid values can be ignored.

@ammen99 ammen99 added easy Issues that do not require knowledge about the whole codebase PRs-welcome Issues which are unlikely to be fixed unless someone sends a PR labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug easy Issues that do not require knowledge about the whole codebase PRs-welcome Issues which are unlikely to be fixed unless someone sends a PR
Projects
None yet
Development

No branches or pull requests

2 participants