gnome-shell/src
Simon McVittie 78d6ccd804 ShellApp: Use g_signal_connect_object for window signals
A window being unmanaged can cause the ShellApp to be removed from
the ShellAppSystem, which if we are unlucky is the app's last
reference, causing it to be disposed and freed. It would be bad if this
happened before we finished handling the signal.

Use g_signal_connect_object to ensure that a reference is held to
the ShellApp for the duration of the signal handler, delaying its
last-unref.

In particular, when a signal handler calls _shell_app_remove_window(),
there is a brief period for which ShellApp breaks the intended
invariant (see !497) that app->running_state is non-NULL if and only if
app->running_state->windows is also non-NULL (non-empty). Freeing the
ShellApp at this point would cause a crash. This seems likely to be the
root cause of <https://gitlab.gnome.org/GNOME/gnome-shell/issues/750>,
<https://gitlab.gnome.org/GNOME/gnome-shell/issues/822> and
<https://bugs.debian.org/926212>.

Signed-off-by: Simon McVittie <smcv@debian.org>


(cherry picked from commit 0f531d8c44)
2019-04-23 13:10:32 +00:00
..
calendar-server calendar-server: Update views only after the time range is set 2018-05-02 16:10:33 +02:00
hotplug-sniffer build: Support the meson build system 2017-07-20 00:20:54 +02:00
st st: Only emit ::style-changed on actual changes 2019-04-22 18:09:26 +00:00
tray na-tray-child: Silence gdk_window_set_background_pattern warnings 2019-03-04 19:57:47 +00:00
data-to-c.pl build: Fix the path of perl for data-to-c.pl 2015-05-22 19:03:44 +08:00
gnome-shell-extension-prefs.c build: Don't modify typelib search path in tools 2018-08-14 17:28:03 +00:00
gnome-shell-extension-tool.in build: Support the meson build system 2017-07-20 00:20:54 +02:00
gnome-shell-perf-tool.in perf-tool: Fix default value for --extra-filter 2018-04-29 16:15:16 +00:00
gnome-shell-plugin.c plugin: Style consistency fix 2019-03-02 11:57:21 +00:00
gnome-shell-portal-helper.c build: Don't modify typelib search path in tools 2018-08-14 17:28:03 +00:00
gtkactionmuxer.c build: Fix build with clang -Werror 2016-02-26 02:06:55 +08:00
gtkactionmuxer.h Also update gtkaction* 2014-01-09 14:59:31 -05:00
gtkactionobservable.c Update copy/paste code from upstream 2013-05-13 18:34:26 -04:00
gtkactionobservable.h Update copy/paste code from upstream 2013-05-13 18:34:26 -04:00
gtkactionobserver.c Also update gtkaction* 2014-01-09 14:59:31 -05:00
gtkactionobserver.h Also update gtkaction* 2014-01-09 14:59:31 -05:00
main.c shell: Drop some unused headers and Gdk variables 2019-01-30 22:50:01 +01:00
meson.build build: Don't introspect ShellMenu 2019-02-06 18:29:15 +01:00
org.gtk.Application.xml Generate GDBus proxy object for org.gtk.Application 2014-11-27 10:59:55 +00:00
run-js-test.c Don't set clutters 'window-scaling-factor' property 2017-04-07 22:30:35 +08:00
shell-action-modes.h Drop MESSAGE_TRAY action mode 2015-02-26 01:41:18 +01:00
shell-app-private.h shell: Use MetaStartupNotification 2018-11-23 13:58:35 +01:00
shell-app-system-private.h apps: Ensure running apps override new .desktop file data 2011-09-05 17:29:41 -04:00
shell-app-system.c shell-app-system: Cache GAppInfos around 2019-01-26 22:55:31 +01:00
shell-app-system.h shell-app-system: Cache GAppInfos around 2019-01-26 22:55:31 +01:00
shell-app-usage.c app-usage: Remove more unused things 2018-11-17 12:08:33 +00:00
shell-app-usage.h app-usage: Remove crufty old "context"s idea 2018-11-17 12:08:33 +00:00
shell-app.c ShellApp: Use g_signal_connect_object for window signals 2019-04-23 13:10:32 +00:00
shell-app.h app: Remove :menu property 2019-02-06 18:29:15 +01:00
shell-embedded-window-private.h shell-embedded-window: Remove hacks for old and fixed Clutter bug 2012-07-13 17:28:50 -04:00
shell-embedded-window.c shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-embedded-window.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-global-private.h main: Destroy GjsContext before exit 2016-12-07 11:34:15 -08:00
shell-global.c shell-global: Use MetaLaunchContext instead of GdkLaunchContext 2019-01-30 13:11:29 +01:00
shell-global.h global: Drop API to play sounds 2019-01-09 23:09:18 +00:00
shell-glsl-quad.c build: Fix build with clang -Werror 2016-02-26 02:06:55 +08:00
shell-glsl-quad.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-gtk-embed.c gtk-embed: Hide window actors from pick 2019-03-04 19:52:24 +00:00
shell-gtk-embed.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-invert-lightness-effect.c Remove deprecated CoglHandle 2019-01-16 17:54:29 +00:00
shell-invert-lightness-effect.h shell: Define COGL_ENABLE_EXPERIMENTAL_API and related defines globally 2014-08-07 14:49:54 -04:00
shell-keyring-prompt.c shell: Port to GTask 2015-10-15 22:59:49 +02:00
shell-keyring-prompt.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-mount-operation.c shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-mount-operation.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-network-agent.c network: port to libnm 2018-01-12 11:48:49 +01:00
shell-network-agent.h network: port to libnm 2018-01-12 11:48:49 +01:00
shell-perf-helper.c shell: Don't mix declarations and code 2015-09-23 21:32:50 +02:00
shell-perf-log.c shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-perf-log.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-polkit-authentication-agent.c polkit: Only unregister registered handles 2018-11-06 13:05:29 -02:00
shell-polkit-authentication-agent.h polkit: Port to G_DECLARE_FINAL_CLASS 2018-11-06 13:05:15 -02:00
shell-recorder-src.c recorder-src: Rewrite switch statement 2015-09-23 21:32:49 +02:00
shell-recorder-src.h Add emacs modelines to all .c and .h files that were missing them 2009-10-27 11:27:45 -04:00
shell-recorder.c st/settings: Add magnifier activation property and bind to settings 2019-04-02 20:28:54 +00:00
shell-recorder.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-screenshot.c st/settings: Add magnifier activation property and bind to settings 2019-04-02 20:28:54 +00:00
shell-screenshot.h screenshot: Add pick_color() method 2018-07-30 16:55:10 +00:00
shell-secure-text-buffer.c shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-secure-text-buffer.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-stack.c st: Add StDirectionType enum 2019-01-30 22:50:01 +01:00
shell-stack.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-tray-icon.c shell-tray-icon: Silence some deprecation warnings 2019-02-26 01:37:46 +01:00
shell-tray-icon.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-tray-manager.c shell-tray-manager: Silence gdk_window_set_background_pattern warning 2019-03-04 19:57:47 +00:00
shell-tray-manager.h Remove usage of MetaScreen 2018-07-06 19:56:19 +02:00
shell-util.c shell-util: Apply resource_scale on clipping when getting the meta texture image 2019-03-01 17:12:53 +00:00
shell-util.h shell-recorder: Use clutter-computed sizes and scaling for the capture 2019-03-01 17:12:53 +00:00
shell-window-tracker-private.h apps: Ensure running apps override new .desktop file data 2011-09-05 17:29:41 -04:00
shell-window-tracker.c app: Remove :menu property 2019-02-06 18:29:15 +01:00
shell-window-tracker.h shell: Hide/drop unused public API 2018-11-23 13:58:35 +01:00
shell-wm-private.h ui: Add InhibitShortcutsDialog 2017-08-02 11:27:42 +01:00
shell-wm.c ui: Add InhibitShortcutsDialog 2017-08-02 11:27:42 +01:00
shell-wm.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00