Skip to content

Commit 923398c

Browse files
committed
application: Close any open dialogs when switching views
Specifically with gnome-extensions protocol.
1 parent 0e5da1c commit 923398c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/exm-application.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ exm_application_open (GApplication *app,
117117
const gchar *hint G_GNUC_UNUSED)
118118
{
119119
ExmWindow *window;
120-
const char *scheme;
121-
const char *uuid;
122120
GUri *uri;
123121
GError *error = NULL;
122+
const char *scheme;
123+
const char *uuid;
124+
AdwDialog *dialog;
124125

125126
// Activate the application first
126127
exm_application_activate (app);
@@ -145,6 +146,10 @@ exm_application_open (GApplication *app,
145146
return;
146147
}
147148

149+
dialog = adw_application_window_get_visible_dialog (ADW_APPLICATION_WINDOW (window));
150+
if (dialog)
151+
adw_dialog_close (dialog);
152+
148153
uuid = g_uri_get_host (uri);
149154
g_info ("Opening extension with UUID: '%s'\n", uuid);
150155
gtk_widget_activate_action (GTK_WIDGET (window), "win.show-detail", "s", uuid);

0 commit comments

Comments
 (0)