You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: