WindowServer/LibGUI: Allow windows to set minimum size
This commit is contained in:
@@ -306,6 +306,16 @@ namespace LibGUI
|
||||
return on_socket_error(__FUNCTION__);
|
||||
}
|
||||
|
||||
void Window::set_min_size(uint32_t width, uint32_t height)
|
||||
{
|
||||
WindowPacket::WindowSetMinSize packet;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
|
||||
if (auto ret = packet.send_serialized(m_server_fd); ret.is_error())
|
||||
return on_socket_error(__FUNCTION__);
|
||||
}
|
||||
|
||||
void Window::set_attributes(Attributes attributes)
|
||||
{
|
||||
WindowPacket::WindowSetAttributes packet;
|
||||
|
||||
@@ -164,6 +164,7 @@ namespace LibGUI
|
||||
WindowSetAttributes,
|
||||
WindowSetMouseCapture,
|
||||
WindowSetSize,
|
||||
WindowSetMinSize,
|
||||
WindowSetFullscreen,
|
||||
WindowSetTitle,
|
||||
|
||||
@@ -227,6 +228,12 @@ namespace LibGUI
|
||||
uint32_t, height
|
||||
);
|
||||
|
||||
DEFINE_PACKET(
|
||||
WindowSetMinSize,
|
||||
uint32_t, width,
|
||||
uint32_t, height
|
||||
);
|
||||
|
||||
DEFINE_PACKET(
|
||||
WindowSetFullscreen,
|
||||
bool, fullscreen
|
||||
|
||||
@@ -76,6 +76,8 @@ namespace LibGUI
|
||||
Attributes get_attributes() const { return m_attributes; }
|
||||
void set_attributes(Attributes attributes);
|
||||
|
||||
void set_min_size(uint32_t width, uint32_t height);
|
||||
|
||||
// send resize request to window server
|
||||
// actual resize is only done after resize callback is called
|
||||
void request_resize(uint32_t width, uint32_t height);
|
||||
|
||||
Reference in New Issue
Block a user