accessDialog: Allow displaying a dialog when no focus_app is found

This allows the g-r-d daemon (which is not a window and can't be
considered a focus app) to display a dialog to inform when the
connection is insecure.
This commit is contained in:
Joan Torres 2024-05-21 13:26:55 +02:00
parent 1bab7b32e5
commit 86443e7220

View file

@ -150,7 +150,7 @@ export class AccessDialogDBus {
let [handle, appId, parentWindow_, title, description, body, options] = params;
// We probably want to use parentWindow and global.display.focus_window
// for this check in the future
if (appId && `${appId}.desktop` !== this._windowTracker.focus_app.id) {
if (appId && this._windowTracker.focus_app && `${appId}.desktop` !== this._windowTracker.focus_app.id) {
invocation.return_error_literal(
Gio.DBusError,
Gio.DBusError.ACCESS_DENIED,