WindowServer: Cleanup code and resize on fullscreen

This commit is contained in:
2025-05-05 16:40:09 +03:00
parent 2b0d198b05
commit c9057aa498
2 changed files with 215 additions and 158 deletions

View File

@@ -62,6 +62,8 @@ public:
private:
void mark_pending_sync(Rectangle area);
bool resize_window(BAN::RefPtr<Window> window, uint32_t width, uint32_t height) const;
private:
struct RangeList
{
@@ -70,6 +72,14 @@ private:
void add_range(const Range& range);
};
enum class State
{
Normal,
Fullscreen,
Moving,
Resizing,
};
private:
Framebuffer& m_framebuffer;
BAN::Vector<BAN::RefPtr<Window>> m_client_windows;
@@ -82,13 +92,12 @@ private:
BAN::UniqPtr<LibImage::Image> m_background_image;
State m_state { State::Normal };
bool m_is_mod_key_held { false };
bool m_is_moving_window { false };
bool m_is_fullscreen_window { false };
BAN::RefPtr<Window> m_focused_window;
Position m_cursor;
bool m_is_resizing_window { false };
Rectangle m_non_full_screen_rect;
Position m_resize_start;
bool m_is_mouse_captured { false };