LibGUI: Add support for focusable windows and mouse capturing

These are essential parts of a window server! This allows making TaskBar
non-focusable.
This commit is contained in:
2024-11-08 02:54:27 +02:00
parent 12bc7480e0
commit da8170c5b6
9 changed files with 164 additions and 46 deletions

View File

@@ -14,12 +14,14 @@ namespace LibGUI
class Window
{
public:
struct Attributes
{
bool title_bar { true };
bool movable { true };
bool rounded_corners { true };
bool alpha_channel { false };
using Attributes = WindowPacket::WindowSetAttributes::Attributes;
static constexpr Attributes default_attributes = {
.title_bar = true,
.movable = true,
.focusable = true,
.rounded_corners = true,
.alpha_channel = false,
};
public:
@@ -58,6 +60,8 @@ namespace LibGUI
bool invalidate(int32_t x, int32_t y, uint32_t width, uint32_t height);
bool invalidate() { return invalidate(0, 0, width(), height()); }
bool set_mouse_capture(bool captured);
bool set_position(int32_t x, int32_t y);
Attributes get_attributes() const { return m_attributes; }