1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

WindowServer+LibGUI: Yank out window-global opacity

From what I can tell, this facility was added to WSWindow/GWindow in
2019 in 9b71307. I only found a single place in the codebase still using
this facility: `WindowServer::Menu::start_activation_animation()`. A
subtle fade-out animation that happens when a menu item is selected, and
the menu disappears.
I think our compositing facilities have improved enough to make this
facility redundant. The remaining use mentioned above was ported to just
directly blit the fade-out animation instead of requesting it from
WindowServer.
This commit is contained in:
Valtteri Koskivuori 2023-06-21 23:16:26 +03:00 committed by Jelle Raaijmakers
parent 4fd71e3c3a
commit 6931a5a0a8
9 changed files with 18 additions and 70 deletions

View file

@ -322,16 +322,6 @@ void ConnectionFromClient::set_forced_shadow(i32 window_id, bool shadow)
Compositor::the().invalidate_occlusions();
}
void ConnectionFromClient::set_window_opacity(i32 window_id, float opacity)
{
auto it = m_windows.find(window_id);
if (it == m_windows.end()) {
did_misbehave("SetWindowOpacity: Bad window ID");
return;
}
it->value->set_opacity(opacity);
}
Messages::WindowServer::SetWallpaperResponse ConnectionFromClient::set_wallpaper(Gfx::ShareableBitmap const& bitmap)
{
return Compositor::the().set_wallpaper(bitmap.bitmap());
@ -613,7 +603,7 @@ Window* ConnectionFromClient::window_from_id(i32 window_id)
void ConnectionFromClient::create_window(i32 window_id, Gfx::IntRect const& rect,
bool auto_position, bool has_alpha_channel, bool minimizable, bool closeable, bool resizable,
bool fullscreen, bool frameless, bool forced_shadow, float opacity,
bool fullscreen, bool frameless, bool forced_shadow,
float alpha_hit_threshold, Gfx::IntSize base_size, Gfx::IntSize size_increment,
Gfx::IntSize minimum_size, Optional<Gfx::IntSize> const& resize_aspect_ratio, i32 type, i32 mode,
DeprecatedString const& title, i32 parent_window_id, Gfx::IntRect const& launch_origin_rect)
@ -675,7 +665,6 @@ void ConnectionFromClient::create_window(i32 window_id, Gfx::IntRect const& rect
window->set_rect(Screen::bounding_rect());
window->recalculate_rect();
}
window->set_opacity(opacity);
window->set_alpha_hit_threshold(alpha_hit_threshold);
window->set_size_increment(size_increment);
window->set_base_size(base_size);