mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
WindowServer: Implement tile window overlay
This adds a tiling mode that will show a tile window overlay rather than immediately tiling a window, triggering window resizes.
This commit is contained in:
parent
035b0f9df6
commit
fe54a0ca27
15 changed files with 279 additions and 71 deletions
|
@ -12,6 +12,12 @@
|
|||
|
||||
namespace WindowServer {
|
||||
|
||||
enum class TileWindow : u8 {
|
||||
TileImmediately,
|
||||
ShowTileOverlay,
|
||||
Never
|
||||
};
|
||||
|
||||
enum class ShowGeometry : u8 {
|
||||
OnMoveAndResize,
|
||||
OnMoveOnly,
|
||||
|
@ -66,12 +72,42 @@ namespace ShowGeometryTools {
|
|||
|
||||
};
|
||||
|
||||
namespace TileWindowTools {
|
||||
|
||||
[[maybe_unused]] static StringView enum_to_string(TileWindow tile_window)
|
||||
{
|
||||
switch (tile_window) {
|
||||
case TileWindow::Never:
|
||||
return "Never"sv;
|
||||
case TileWindow::TileImmediately:
|
||||
return "TileImmediately"sv;
|
||||
case TileWindow::ShowTileOverlay:
|
||||
return "ShowTileOverlay"sv;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]] static TileWindow string_to_enum(StringView tile_window)
|
||||
{
|
||||
if (tile_window == "Never"sv)
|
||||
return TileWindow::Never;
|
||||
else if (tile_window == "TileImmediately"sv)
|
||||
return TileWindow::TileImmediately;
|
||||
else if (tile_window == "ShowTileOverlay"sv)
|
||||
return TileWindow::ShowTileOverlay;
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class SystemEffects {
|
||||
public:
|
||||
SystemEffects() = default;
|
||||
SystemEffects(Vector<bool> effects, ShowGeometry show)
|
||||
SystemEffects(Vector<bool> effects, ShowGeometry show, TileWindow tile_window)
|
||||
: m_effects(effects)
|
||||
, m_geometry(show)
|
||||
, m_tile_window(tile_window)
|
||||
{
|
||||
}
|
||||
SystemEffects(Vector<bool> effects)
|
||||
|
@ -107,14 +143,18 @@ public:
|
|||
void set_geometry(ShowGeometry g) { m_geometry = g; }
|
||||
ShowGeometry geometry() const { return m_geometry; }
|
||||
|
||||
void set_tile_window(TileWindow tile_window) { m_tile_window = tile_window; }
|
||||
TileWindow tile_window() const { return m_tile_window; }
|
||||
|
||||
bool operator==(SystemEffects const& other) const
|
||||
{
|
||||
return m_effects == other.m_effects && m_geometry == other.m_geometry;
|
||||
return m_effects == other.m_effects && m_geometry == other.m_geometry && m_tile_window == other.m_tile_window;
|
||||
}
|
||||
|
||||
private:
|
||||
Vector<bool> m_effects;
|
||||
ShowGeometry m_geometry { ShowGeometry::Never };
|
||||
TileWindow m_tile_window { TileWindow::ShowTileOverlay };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue