[gnome-shell/wip/fmuellner/replace-app-menu: 3/8] app: Don't rely on app menu to check for GtkApplications
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/replace-app-menu: 3/8] app: Don't rely on app menu to check for GtkApplications
- Date: Tue, 5 Feb 2019 02:08:52 +0000 (UTC)
commit 7c17dab4b6bde3be46a64fc60ddffd65c5748cd5
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Oct 4 19:11:05 2018 +0200
app: Don't rely on app menu to check for GtkApplications
As the app menu is being phased out, it is no longer a good indicator
for GtkApplications. Instead, base the check directly on the appropriate
D-Bus properties.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
src/shell-app.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 108bb4d11..1be6287c0 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -602,6 +602,7 @@ gboolean
shell_app_can_open_new_window (ShellApp *app)
{
ShellAppRunningState *state;
+ MetaWindow *window;
/* Apps that are not running can always open new windows, because
activating them would open the first one */
@@ -635,11 +636,13 @@ shell_app_can_open_new_window (ShellApp *app)
Activate() knows nothing about the other instances, so it will show a
new window.
*/
- if (state->remote_menu)
+
+ window = g_slist_nth_data (state->windows, 0);
+
+ if (state->unique_bus_name != NULL &&
+ meta_window_get_gtk_application_object_path (window) != NULL)
{
- const char *application_id;
- application_id = meta_window_get_gtk_application_id (state->windows->data);
- if (application_id != NULL)
+ if (meta_window_get_gtk_application_id (window) != NULL)
return FALSE;
else
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]