Add GUI Area Selector #89
Draft
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 PR adds a GUI area selector, able to select either screens (outputs) or windows (toplevels). It's started from
waysipwith the flag-g, and it was added tolibwaysipto be used by external applications as well. For each output and toplevel it attemps to take a screenshot to show, but it handles the cases where the capture fails (for example, if there's no toplevel capture support, which is my case).Please see a demonstration below. There might be a bug in
iced_layershellthat results in the theme being applied only after a first interaction from the user (as can be seen from the video, the background is initially white). The dark theme could be removed to avoid the bug being shown, but I think it makes sense as buttons are better distinguishable from the background with a dark theme.Right now the dimensions of the selector are hardcoded, which might result in it being very small on high resolution screens.
gui_selector.mp4