Skip to content

Commit

Permalink
Allow vmware-view to "restore" windows and submit a buffer before for…
Browse files Browse the repository at this point in the history
…cing "fullscreen"
  • Loading branch information
AlanGriffiths committed Nov 14, 2024
1 parent 8739872 commit 6b1855e
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,22 @@ void X11KioskWindowManagerPolicy::handle_modify_window(WindowInfo& window_info,
(int)modifications.state().value());
}

specification.state() = mir_window_state_fullscreen;
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 (window_info.is_visible() || !modifications.state().is_set() || modifications.state().value() != mir_window_state_restored)
{
specification.state() = mir_window_state_fullscreen;
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)
specification.state() = modifications.state();
if (!modifications.state().is_set() || modifications.state().value() != mir_window_state_restored)
specification.state() = modifications.state();
}
else
{
// We have one X11 application (vmware-view) that doesn't submit any buffers unless it
// can first "restore" its window
tools.place_and_size_for_state(specification, window_info);
}
}

CanonicalWindowManagerPolicy::handle_modify_window(window_info, specification);
Expand Down Expand Up @@ -165,6 +174,16 @@ void X11KioskWindowManagerPolicy::handle_window_ready(miral::WindowInfo& window_
mir::log_debug("** arg ** Ready toplevel window %p, Current state is %d",
(void*)window_info.window().operator std::shared_ptr<mir::scene::Surface>().get(),
(int)window_info.state());

// We have one X11 application (vmware-view) that doesn't submit any buffers unless it
// can first "restore" its window. We've got a buffer now, so we can fullscreen it
if (window_info.state() == mir_window_state_restored)
{
WindowSpecification specification;
specification.state() = mir_window_state_fullscreen;
tools.place_and_size_for_state(specification, WindowInfo{});
tools.modify_window(window_info, specification);
}
}
CanonicalWindowManagerPolicy::handle_window_ready(window_info);
}

0 comments on commit 6b1855e

Please sign in to comment.