Hide the Annotator window during portal screenshots.#122
Merged
phase1geo merged 1 commit intoApr 20, 2026
Conversation
The toolbar's Take Screenshot button always uses the XDG portal path, which previously did not hide the Annotator window before invoking the portal's interactive selector. As a result the window appeared in the captured area on single-monitor setups, forcing users to shrink or move it manually before each screenshot. The non-portal path already honors the screenshot-include-win GSetting via hide() / show(). Mirror that behavior in do_screenshot_portal: when the setting is false (the default), hide the window before issuing the portal call and re-show it from the existing response handler (or from the catch block if the D-Bus call itself fails). On Wayland, hide() returns before the compositor has actually unmapped the window, so a 200 ms async wait is inserted between hide() and the portal call. Without it the window was still visible (and capturable) when the portal selector appeared. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
Thank you again. The change looks good. |
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.
Summary
The toolbar's Take Screenshot button always uses the XDG portal path, which previously did not hide the Annotator window before invoking the portal's interactive selector. As a result the window appeared in the captured area on single-monitor setups, forcing users to shrink or move it manually before each screenshot.
The non-portal path already honors the
screenshot-include-winGSetting viahide()/show(). This PR mirrors that behavior indo_screenshot_portal: when the setting isfalse(the default), hide the window before issuing the portal call and re-show it from the existing response handler (or from the catch block if the D-Bus call itself fails).On Wayland,
hide()returns before the compositor has actually unmapped the window, so a 200 ms async wait is inserted betweenhide()and the portal call. Without it the window is still visible (and capturable) when the portal selector appears. The wait is gated on the same!includecondition so it doesn't affect users who explicitly opt to include the window.Test plan
show()inhandle_screenshot_callback.screenshot-include-wintotrueviagsettingskeeps the window visible (no regression vs. previous behavior).