mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
screenshot: Do not wrongly enable window button
The window button is disabled when
- there are no windows
- we are in screen-recording mode
- the session mode doesn't allow windows
However the last condition is only taken into account when
opening the dialog, but not when switching from recording-
to screenshot mode.
Address this by updating the button's sensitivity in a separate
function, so the different conditions are considered consistently.
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6990
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2944>
(cherry picked from commit 521525948e)
This commit is contained in:
parent
2a46048663
commit
39b0c0030b
1 changed files with 12 additions and 7 deletions
|
|
@ -1390,6 +1390,16 @@ var ScreenshotUI = GObject.registerClass({
|
|||
this._castButton.reactive = Main.sessionMode.allowScreencast;
|
||||
}
|
||||
|
||||
_syncWindowButtonSensitivity() {
|
||||
const windows =
|
||||
this._windowSelectors.flatMap(selector => selector.windows());
|
||||
|
||||
this._windowButton.reactive =
|
||||
Main.sessionMode.hasWindows &&
|
||||
windows.length > 0 &&
|
||||
!this._castButton.checked;
|
||||
}
|
||||
|
||||
_refreshButtonLayout() {
|
||||
const buttonLayout = Meta.prefs_get_button_layout();
|
||||
|
||||
|
|
@ -1506,10 +1516,7 @@ var ScreenshotUI = GObject.registerClass({
|
|||
});
|
||||
}
|
||||
|
||||
this._windowButton.reactive =
|
||||
Main.sessionMode.hasWindows &&
|
||||
windows.length > 0 &&
|
||||
!this._castButton.checked;
|
||||
this._syncWindowButtonSensitivity();
|
||||
if (!this._windowButton.reactive)
|
||||
this._selectionButton.checked = true;
|
||||
|
||||
|
|
@ -1752,9 +1759,7 @@ var ScreenshotUI = GObject.registerClass({
|
|||
|
||||
this._captureButton.remove_style_pseudo_class('cast');
|
||||
|
||||
const windows =
|
||||
this._windowSelectors.flatMap(selector => selector.windows());
|
||||
this._windowButton.reactive = windows.length > 0;
|
||||
this._syncWindowButtonSensitivity();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue