diff --git a/examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp b/examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp index cfd0d0524e5..459d83651fa 100644 --- a/examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp +++ b/examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp @@ -77,7 +77,8 @@ auto X11KioskWindowManagerPolicy::place_new_window(ApplicationInfo const& app_in (!specification.parent().is_set() || !specification.parent().value().lock())) { specification.state() = mir_window_state_fullscreen; - specification.size() = mir::optional_value{}; // Ignore requested size (if any) when we maximize + specification.size() = mir::optional_value{}; // Ignore requested size (if any) when we fullscreen + specification.top_left() = mir::optional_value{}; // Ignore requested position (if any) when we fullscreen tools.place_and_size_for_state(specification, WindowInfo{}); if (!request.state().is_set() || request.state().value() != mir_window_state_restored) @@ -94,8 +95,20 @@ void X11KioskWindowManagerPolicy::handle_modify_window(WindowInfo& window_info, if ((window_info.type() == mir_window_type_normal || window_info.type() == mir_window_type_freestyle) && !window_info.parent()) { + if (window_info.state() == mir_window_state_fullscreen && modifications.state().is_set()) + { + // If the window is already fullscreen, then first restore it + // as otherwise the client may not repaint + WindowSpecification mods; + mods.state() = mir_window_state_restored; + + tools.place_and_size_for_state(mods, window_info); + tools.modify_window(window_info, mods); + } + specification.state() = mir_window_state_fullscreen; - specification.size() = mir::optional_value{}; // Ignore requested size (if any) when we maximize + specification.size() = mir::optional_value{}; // Ignore requested size (if any) when we fullscreen + specification.top_left() = mir::optional_value{}; // Ignore requested position (if any) when we fullscreen tools.place_and_size_for_state(specification, window_info); if (!modifications.state().is_set() || modifications.state().value() != mir_window_state_restored)