Skip to content

Commit 3f7cb0e

Browse files
authored
Fix a crash when meta_window is null (#780)
This may happen when there's an open menu and the user changes workspace. Fixes #766
1 parent 90c4726 commit 3f7cb0e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/WindowManager.vala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,9 +2106,10 @@ namespace Gala {
21062106
continue;
21072107
}
21082108

2109-
unowned Meta.Window meta_window = window.get_meta_window ();
2109+
unowned Meta.Window? meta_window = window.get_meta_window ();
21102110
if (!window.is_destroyed ()) {
2111-
if (meta_window.get_window_type () == Meta.WindowType.NOTIFICATION) {
2111+
if (meta_window != null
2112+
&& meta_window.get_window_type () == Meta.WindowType.NOTIFICATION) {
21122113
reparent_notification_window (actor, parents.nth_data (i));
21132114
} else {
21142115
clutter_actor_reparent (actor, parents.nth_data (i));
@@ -2119,7 +2120,8 @@ namespace Gala {
21192120

21202121
kill_window_effects (window);
21212122

2122-
if (meta_window.get_workspace () != active_workspace
2123+
if (meta_window != null
2124+
&& meta_window.get_workspace () != active_workspace
21232125
&& !meta_window.is_on_all_workspaces ())
21242126
window.hide ();
21252127

0 commit comments

Comments
 (0)