mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
WindowServer: Don't crash when trying to set invalid effects
This commit is contained in:
parent
7ce4cbfe1d
commit
522809032a
2 changed files with 8 additions and 2 deletions
|
@ -986,6 +986,10 @@ Messages::WindowServer::SetSystemFontsResponse ConnectionFromClient::set_system_
|
||||||
|
|
||||||
void ConnectionFromClient::set_system_effects(Vector<bool> const& effects, u8 geometry, u8 tile_window)
|
void ConnectionFromClient::set_system_effects(Vector<bool> const& effects, u8 geometry, u8 tile_window)
|
||||||
{
|
{
|
||||||
|
if (effects.size() != to_underlying(Effects::__Count) || geometry >= to_underlying(ShowGeometry::__Count) || tile_window >= to_underlying(TileWindow::__Count)) {
|
||||||
|
did_misbehave("SetSystemEffects: Bad values");
|
||||||
|
return;
|
||||||
|
}
|
||||||
WindowManager::the().apply_system_effects(effects, static_cast<ShowGeometry>(geometry), static_cast<TileWindow>(tile_window));
|
WindowManager::the().apply_system_effects(effects, static_cast<ShowGeometry>(geometry), static_cast<TileWindow>(tile_window));
|
||||||
ConnectionFromClient::for_each_client([&](auto& client) {
|
ConnectionFromClient::for_each_client([&](auto& client) {
|
||||||
client.async_update_system_effects(effects);
|
client.async_update_system_effects(effects);
|
||||||
|
|
|
@ -15,14 +15,16 @@ namespace WindowServer {
|
||||||
enum class TileWindow : u8 {
|
enum class TileWindow : u8 {
|
||||||
TileImmediately,
|
TileImmediately,
|
||||||
ShowTileOverlay,
|
ShowTileOverlay,
|
||||||
Never
|
Never,
|
||||||
|
__Count
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ShowGeometry : u8 {
|
enum class ShowGeometry : u8 {
|
||||||
OnMoveAndResize,
|
OnMoveAndResize,
|
||||||
OnMoveOnly,
|
OnMoveOnly,
|
||||||
OnResizeOnly,
|
OnResizeOnly,
|
||||||
Never
|
Never,
|
||||||
|
__Count
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Effects : size_t {
|
enum class Effects : size_t {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue