mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:15:07 +00:00
WindowServer+LibGUI: Allow switching windows in/out of fullscreen mode
You can now call GWindow::set_fullscreen(bool) and it will go in or out of fullscreen mode. WindowServer will also remember the previous window rect when switching to fullscreen, and restore it when switching back. :^)
This commit is contained in:
parent
a34f3a3729
commit
d92e26d023
8 changed files with 78 additions and 1 deletions
|
@ -714,3 +714,18 @@ void GWindow::save_to(AK::JsonObject& json)
|
|||
json.set("size_increment", size_increment().to_string());
|
||||
CObject::save_to(json);
|
||||
}
|
||||
|
||||
void GWindow::set_fullscreen(bool fullscreen)
|
||||
{
|
||||
if (m_fullscreen == fullscreen)
|
||||
return;
|
||||
m_fullscreen = fullscreen;
|
||||
if (!m_window_id)
|
||||
return;
|
||||
|
||||
WSAPI_ClientMessage request;
|
||||
request.type = WSAPI_ClientMessage::Type::SetFullscreen;
|
||||
request.window_id = m_window_id;
|
||||
request.value = fullscreen;
|
||||
GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidSetFullscreen);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue