screenshot: Add SCREENSHOT_ONLY UI mode

Add a screenshot-exclusive mode that makes the screencast button
unreactive, and therefore disables screencasting. It doesn't change
the visibility of the button though, as that's done by the codepath
that checks if screencasting is supported.

This will be used by the D-Bus callback to take interactive
screenshots.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
This commit is contained in:
Georges Basile Stavracas Neto 2023-12-15 17:23:51 -03:00 committed by Marge Bot
parent 52a7ee7590
commit 75dafd8d9c

View File

@ -1048,6 +1048,7 @@ class UIWindowSelector extends St.Widget {
const UIMode = { const UIMode = {
SCREENSHOT: 0, SCREENSHOT: 0,
SCREENCAST: 1, SCREENCAST: 1,
SCREENSHOT_ONLY: 2,
}; };
export const ScreenshotUI = GObject.registerClass({ export const ScreenshotUI = GObject.registerClass({
@ -1542,6 +1543,7 @@ export const ScreenshotUI = GObject.registerClass({
return; return;
this._castButton.checked = mode === UIMode.SCREENCAST; this._castButton.checked = mode === UIMode.SCREENCAST;
this._castButton.reactive = mode !== UIMode.SCREENSHOT_ONLY;
if (!this.visible) { if (!this.visible) {
// Screenshot UI is opening from completely closed state // Screenshot UI is opening from completely closed state