linux: Fix process PID to window mapping for X11 #22348
Open
+13
−0
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.
Closes #22326
This PR adds process PID information to window created by X11, so that window manager can identify which process this window belongs to. Without this property, the window manager would have no reliable way to know which process created this window.
In original issue,
robotgo
throws error onx, y, w, h := robotgo.GetBounds(pid)
this method. If we go deeper into the source code ofrobotgo
, it callsGetXidFromPid
which goes through all windows, and tries to check for provided pid. Hence, when it tries to do that for Zed, it fails and returns0, err
to caller.Querying for pid for active Zed window:
Before:
After:
Correct zed process PID (below) assosiated with zed window (shown above):
Release Notes:
robotgo
failing when Zed window is open on Linux