Skip to content

Commit 9453e65

Browse files
committed
cinnamon-window-tracker: Use a different method for matching
existing apps and new windows by pid. Muffin now emits workspace::window-added and ::removed for each workspace when a window is initially on-all-workspaces (stuck). This was resulting in things like the shutdown dialog window being associated with (2 * n_workspaces) CinnamonApps, then throwing lots of warnings when it closed. based on: https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/186f9b2e2c169f6625b363689e707d7f9befbc2f
1 parent 1001242 commit 9453e65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cinnamon-window-tracker.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ get_app_from_window_group (CinnamonWindowTracker *tracker,
409409
* @window: a #MetaWindow
410410
*
411411
* Check if the pid associated with @window corresponds to an
412-
* application we launched.
412+
* application.
413413
*
414414
* Return value: (transfer full): A newly-referenced #CinnamonApp, or %NULL
415415
*/
@@ -425,10 +425,10 @@ get_app_from_window_pid (CinnamonWindowTracker *tracker,
425425

426426
pid = meta_window_get_pid (window);
427427

428-
if (pid == -1)
428+
if (pid < 1)
429429
return NULL;
430430

431-
result = g_hash_table_lookup (tracker->launched_pid_to_app, GINT_TO_POINTER (pid));
431+
result = cinnamon_window_tracker_get_app_from_pid (tracker, pid);
432432
if (result != NULL)
433433
g_object_ref (result);
434434

0 commit comments

Comments
 (0)