Skip to content

Commit 8e7940c

Browse files
authored
Revert "WindowManager: Remove Meta.Later" (#1713)
Fixes #1712
1 parent 3cf1d5c commit 8e7940c

File tree

2 files changed

+71
-55
lines changed

2 files changed

+71
-55
lines changed

data/gala.metainfo.xml.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
</ul>
3434
</description>
3535
<issues>
36+
<issue url="https://github.com/elementary/gala/issues/1331">Dialog dim won't go off on gtk app</issue>
3637
<issue url="https://github.com/elementary/gala/issues/1700">PiP doesn't become visible by changing workspaces</issue>
38+
<issue url="https://github.com/elementary/gala/issues/1712">gala 7.1.0-1 crashes on Arch</issue>
3739
</issues>
3840
</release>
3941

src/WindowManager.vala

Lines changed: 69 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ namespace Gala {
196196
var color = background_settings.get_string ("primary-color");
197197
stage.background_color = Clutter.Color.from_string (color);
198198

199-
WorkspaceManager.init (this);
199+
unowned var laters = display.get_compositor ().get_laters ();
200+
laters.add (Meta.LaterType.BEFORE_REDRAW, () => {
201+
WorkspaceManager.init (this);
202+
return false;
203+
});
200204

201205
/* our layer structure:
202206
* stage
@@ -287,71 +291,81 @@ namespace Gala {
287291

288292
zoom = new Zoom (this);
289293

290-
accent_color_manager = new AccentColorManager ();
294+
// Most things inside this "later" depend on GTK. We get segfaults if we try to do GTK stuff before the window manager
295+
// is initialized, so we hold this stuff off until we're ready to draw
296+
laters.add (Meta.LaterType.BEFORE_REDRAW, () => {
297+
string[] args = {};
298+
unowned string[] _args = args;
299+
Gtk.init (ref _args);
291300

292-
// initialize plugins and add default components if no plugin overrides them
293-
var plugin_manager = PluginManager.get_default ();
294-
plugin_manager.initialize (this);
295-
plugin_manager.regions_changed.connect (update_input_area);
301+
accent_color_manager = new AccentColorManager ();
296302

297-
if (plugin_manager.workspace_view_provider == null
298-
|| (workspace_view = (plugin_manager.get_plugin (plugin_manager.workspace_view_provider) as ActivatableComponent)) == null) {
299-
workspace_view = new MultitaskingView (this);
300-
ui_group.add_child ((Clutter.Actor) workspace_view);
301-
}
303+
// initialize plugins and add default components if no plugin overrides them
304+
var plugin_manager = PluginManager.get_default ();
305+
plugin_manager.initialize (this);
306+
plugin_manager.regions_changed.connect (update_input_area);
302307

303-
Meta.KeyBinding.set_custom_handler ("show-desktop", () => {
304-
if (workspace_view.is_opened ())
305-
workspace_view.close ();
306-
else
307-
workspace_view.open ();
308-
});
308+
if (plugin_manager.workspace_view_provider == null
309+
|| (workspace_view = (plugin_manager.get_plugin (plugin_manager.workspace_view_provider) as ActivatableComponent)) == null) {
310+
workspace_view = new MultitaskingView (this);
311+
ui_group.add_child ((Clutter.Actor) workspace_view);
312+
}
309313

310-
if (plugin_manager.window_switcher_provider == null) {
311-
winswitcher = new WindowSwitcher (this);
312-
ui_group.add_child (winswitcher);
314+
Meta.KeyBinding.set_custom_handler ("show-desktop", () => {
315+
if (workspace_view.is_opened ())
316+
workspace_view.close ();
317+
else
318+
workspace_view.open ();
319+
});
313320

314-
Meta.KeyBinding.set_custom_handler ("switch-applications", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
315-
Meta.KeyBinding.set_custom_handler ("switch-applications-backward", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
316-
Meta.KeyBinding.set_custom_handler ("switch-windows", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
317-
Meta.KeyBinding.set_custom_handler ("switch-windows-backward", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
318-
Meta.KeyBinding.set_custom_handler ("switch-group", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
319-
Meta.KeyBinding.set_custom_handler ("switch-group-backward", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
320-
}
321+
if (plugin_manager.window_switcher_provider == null) {
322+
winswitcher = new WindowSwitcher (this);
323+
ui_group.add_child (winswitcher);
321324

322-
if (plugin_manager.window_overview_provider == null
323-
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null) {
324-
window_overview = new WindowOverview (this);
325-
ui_group.add_child ((Clutter.Actor) window_overview);
326-
}
325+
Meta.KeyBinding.set_custom_handler ("switch-applications", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
326+
Meta.KeyBinding.set_custom_handler ("switch-applications-backward", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
327+
Meta.KeyBinding.set_custom_handler ("switch-windows", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
328+
Meta.KeyBinding.set_custom_handler ("switch-windows-backward", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
329+
Meta.KeyBinding.set_custom_handler ("switch-group", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
330+
Meta.KeyBinding.set_custom_handler ("switch-group-backward", (Meta.KeyHandlerFunc) winswitcher.handle_switch_windows);
331+
}
327332

328-
notification_group = new Clutter.Actor ();
329-
ui_group.add_child (notification_group);
333+
if (plugin_manager.window_overview_provider == null
334+
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null) {
335+
window_overview = new WindowOverview (this);
336+
ui_group.add_child ((Clutter.Actor) window_overview);
337+
}
330338

331-
pointer_locator = new PointerLocator (this);
332-
ui_group.add_child (pointer_locator);
333-
ui_group.add_child (new DwellClickTimer (this));
339+
notification_group = new Clutter.Actor ();
340+
ui_group.add_child (notification_group);
334341

335-
ui_group.add_child (screen_shield);
342+
pointer_locator = new PointerLocator (this);
343+
ui_group.add_child (pointer_locator);
344+
ui_group.add_child (new DwellClickTimer (this));
336345

337-
display.add_keybinding ("expose-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
338-
if (window_overview.is_opened ()) {
339-
window_overview.close ();
340-
} else {
341-
window_overview.open ();
342-
}
343-
});
344-
display.add_keybinding ("expose-all-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
345-
if (window_overview.is_opened ()) {
346-
window_overview.close ();
347-
} else {
348-
var hints = new HashTable<string,Variant> (str_hash, str_equal);
349-
hints.@set ("all-windows", true);
350-
window_overview.open (hints);
351-
}
352-
});
346+
ui_group.add_child (screen_shield);
347+
348+
display.add_keybinding ("expose-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
349+
if (window_overview.is_opened ()) {
350+
window_overview.close ();
351+
} else {
352+
window_overview.open ();
353+
}
354+
});
355+
display.add_keybinding ("expose-all-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
356+
if (window_overview.is_opened ()) {
357+
window_overview.close ();
358+
} else {
359+
var hints = new HashTable<string,Variant> (str_hash, str_equal);
360+
hints.@set ("all-windows", true);
361+
window_overview.open (hints);
362+
}
363+
});
364+
365+
plugin_manager.load_waiting_plugins ();
353366

354-
plugin_manager.load_waiting_plugins ();
367+
return false;
368+
});
355369

356370
update_input_area ();
357371

0 commit comments

Comments
 (0)