Require both mouse and keyboard grabs for some grabs to be successful
Commit 7419674b
changed some grabs from requiring both mouse and
keyboard grabs to be considered successful to only requiring either of
them.
Due to this it was possible for example to open the overview or the
screenshot UI with a client (such as Chrome when opening a menu) holding
the mouse grab. This then made it impossible to interact with the UI
using the mouse (or keyboard) and if attempted could result in an
unresponsive UI.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5414
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2287>
This commit is contained in:
parent
3e8164cc36
commit
23b4eb459e
@ -154,7 +154,7 @@ var GrabHelper = class GrabHelper {
|
|||||||
let firstGrab = this._modalCount == 0;
|
let firstGrab = this._modalCount == 0;
|
||||||
if (firstGrab) {
|
if (firstGrab) {
|
||||||
let grab = Main.pushModal(this._owner, this._modalParams);
|
let grab = Main.pushModal(this._owner, this._modalParams);
|
||||||
if (grab.get_seat_state() === Clutter.GrabState.NONE) {
|
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
|
||||||
Main.popModal(grab);
|
Main.popModal(grab);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -453,7 +453,7 @@ class ObjInspector extends St.ScrollView {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
|
const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
|
||||||
if (grab.get_seat_state() === Clutter.GrabState.NONE) {
|
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
|
||||||
Main.popModal(grab);
|
Main.popModal(grab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1612,7 +1612,7 @@ class LookingGlass extends St.BoxLayout {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
let grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
|
let grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
|
||||||
if (grab.get_seat_state() === Clutter.GrabState.NONE) {
|
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
|
||||||
Main.popModal(grab);
|
Main.popModal(grab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ var ModalDialog = GObject.registerClass({
|
|||||||
if (timestamp)
|
if (timestamp)
|
||||||
params['timestamp'] = timestamp;
|
params['timestamp'] = timestamp;
|
||||||
let grab = Main.pushModal(this, params);
|
let grab = Main.pushModal(this, params);
|
||||||
if (grab.get_seat_state() === Clutter.GrabState.NONE) {
|
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
|
||||||
Main.popModal(grab);
|
Main.popModal(grab);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -456,14 +456,14 @@ var Overview = class {
|
|||||||
const grab = Main.pushModal(global.stage, {
|
const grab = Main.pushModal(global.stage, {
|
||||||
actionMode: Shell.ActionMode.OVERVIEW,
|
actionMode: Shell.ActionMode.OVERVIEW,
|
||||||
});
|
});
|
||||||
if (grab.get_seat_state() !== Clutter.GrabState.NONE) {
|
if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
|
||||||
this._grab = grab;
|
|
||||||
this._modal = true;
|
|
||||||
} else {
|
|
||||||
Main.popModal(grab);
|
Main.popModal(grab);
|
||||||
this.hide();
|
this.hide();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._grab = grab;
|
||||||
|
this._modal = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line no-lonely-if
|
// eslint-disable-next-line no-lonely-if
|
||||||
|
Loading…
Reference in New Issue
Block a user