From f3974658c87c8730c91d9df73f72d0cadc90fb34 Mon Sep 17 00:00:00 2001 From: Michael Kogan Date: Wed, 27 Mar 2024 07:49:36 +0100 Subject: [PATCH 1/3] Add debug output --- bin/shutter | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/shutter b/bin/shutter index 6e4cecb1..8576739c 100755 --- a/bin/shutter +++ b/bin/shutter @@ -8442,6 +8442,13 @@ sub STARTUP { $menu_windows->append(Gtk3::SeparatorMenuItem->new); #add all windows to menu to capture it directly + + print "\n\n\nDEBUG\n\n\n"; + print $wnck_screen; + print "\n\n\nDEBUG\n\n\n"; + print @{$wnck_screen->get_windows_stacked}; + print "\n\n\nDEBUG\n\n\n"; + foreach my $win (@{$wnck_screen->get_windows_stacked}) { if ($active_workspace && $win->is_on_workspace($active_workspace)) { my $win_name = $win->get_name; From b43cc1908849b6632804b0f2b406c80fdbd06c49 Mon Sep 17 00:00:00 2001 From: Michael Kogan Date: Tue, 2 Apr 2024 01:15:25 +0200 Subject: [PATCH 2/3] Try to get rid of the crash --- bin/shutter | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/shutter b/bin/shutter index 8576739c..9caca774 100755 --- a/bin/shutter +++ b/bin/shutter @@ -8443,6 +8443,8 @@ sub STARTUP { #add all windows to menu to capture it directly + return $menu_windows unless $wnck_screen->get_windows_stacked; + print "\n\n\nDEBUG\n\n\n"; print $wnck_screen; print "\n\n\nDEBUG\n\n\n"; From 3b7328c521c901dd3fe428067ec75dbfbe5335d2 Mon Sep 17 00:00:00 2001 From: Michael Kogan Date: Wed, 28 Aug 2024 08:30:05 +0200 Subject: [PATCH 3/3] Added error output --- bin/shutter | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/shutter b/bin/shutter index 9caca774..8392333a 100755 --- a/bin/shutter +++ b/bin/shutter @@ -8441,15 +8441,14 @@ sub STARTUP { $menu_windows->append($active_window_item); $menu_windows->append(Gtk3::SeparatorMenuItem->new); - #add all windows to menu to capture it directly - - return $menu_windows unless $wnck_screen->get_windows_stacked; + # Check if we can retrieve the list of stacked windows first, otherwise we will run into a crash, see issue 659 + + unless ($wnck_screen->get_windows_stacked) { + print "ERROR: The window list could not be retrieved and has been disabled, see https://github.com/shutter-project/shutter/issues/659"; + return $menu_windows; + } - print "\n\n\nDEBUG\n\n\n"; - print $wnck_screen; - print "\n\n\nDEBUG\n\n\n"; - print @{$wnck_screen->get_windows_stacked}; - print "\n\n\nDEBUG\n\n\n"; + #add all windows to menu to capture it directly foreach my $win (@{$wnck_screen->get_windows_stacked}) { if ($active_workspace && $win->is_on_workspace($active_workspace)) {