diff --git a/ui/app/toolkits/gtkmm/BreakWindow.cc b/ui/app/toolkits/gtkmm/BreakWindow.cc index a98baaf61..f8b68d79f 100644 --- a/ui/app/toolkits/gtkmm/BreakWindow.cc +++ b/ui/app/toolkits/gtkmm/BreakWindow.cc @@ -79,8 +79,12 @@ BreakWindow::BreakWindow(std::shared_ptr app, #if defined(PLATFORM_OS_UNIX) if (Platform::running_on_wayland()) { - window_manager = std::make_shared(); - window_manager->init(); + auto wm = std::make_shared(); + bool success = wm->init(); + if (success) + { + window_manager = wm; + } } #endif diff --git a/ui/app/toolkits/gtkmm/PreludeWindow.cc b/ui/app/toolkits/gtkmm/PreludeWindow.cc index 990e6eac3..bb5130f52 100644 --- a/ui/app/toolkits/gtkmm/PreludeWindow.cc +++ b/ui/app/toolkits/gtkmm/PreludeWindow.cc @@ -49,8 +49,12 @@ PreludeWindow::PreludeWindow(HeadInfo head, BreakId break_id) #if defined(PLATFORM_OS_UNIX) if (Platform::running_on_wayland()) { - window_manager = std::make_shared(); - window_manager->init(); + auto wm = std::make_shared(); + bool success = wm->init(); + if (success) + { + window_manager = wm; + } } #endif diff --git a/ui/app/toolkits/gtkmm/platforms/unix/WaylandWindowManager.cc b/ui/app/toolkits/gtkmm/platforms/unix/WaylandWindowManager.cc index 74baaf4c7..da62f9202 100644 --- a/ui/app/toolkits/gtkmm/platforms/unix/WaylandWindowManager.cc +++ b/ui/app/toolkits/gtkmm/platforms/unix/WaylandWindowManager.cc @@ -103,8 +103,11 @@ void WaylandWindowManager::init_surface(Gtk::Widget >k_window, Glib::RefPtr monitor, bool keyboard_focus) { TRACE_ENTRY(); - auto layer = std::make_shared(layer_shell, gtk_window, monitor, keyboard_focus); - surfaces.push_back(layer); + if (layer_shell != nullptr) + { + auto layer = std::make_shared(layer_shell, gtk_window, monitor, keyboard_focus); + surfaces.push_back(layer); + } } void