Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure windows are placed and repainted on X11 "CONFIGURE" #3619

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Size>{}; // Ignore requested size (if any) when we maximize
specification.size() = mir::optional_value<Size>{}; // Ignore requested size (if any) when we fullscreen
specification.top_left() = mir::optional_value<Point>{}; // 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)
Expand All @@ -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<Size>{}; // Ignore requested size (if any) when we maximize
specification.size() = mir::optional_value<Size>{}; // Ignore requested size (if any) when we fullscreen
specification.top_left() = mir::optional_value<Point>{}; // 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)
Expand Down
Loading