mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
WindowServer+LibGUI: Add ability to set per-window icons.
The icons are passed around as filesystem paths for now, since the shared memory bitmaps only support 2 sides.
This commit is contained in:
@@ -448,3 +448,19 @@ void GWindow::set_modal(bool modal)
|
||||
void GWindow::wm_event(GWMEvent&)
|
||||
{
|
||||
}
|
||||
|
||||
void GWindow::set_icon_path(const String& path)
|
||||
{
|
||||
if (m_icon_path == path)
|
||||
return;
|
||||
m_icon_path = path;
|
||||
if (!m_window_id)
|
||||
return;
|
||||
WSAPI_ClientMessage message;
|
||||
message.type = WSAPI_ClientMessage::Type::SetWindowIcon;
|
||||
message.window_id = m_window_id;
|
||||
ASSERT(path.length() < sizeof(message.text));
|
||||
strcpy(message.text, path.characters());
|
||||
message.text_length = path.length();
|
||||
GEventLoop::post_message_to_server(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user