mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
WindowServer: Use Gfx::ShareableBitmap for SetWindowIconBitmap
This commit is contained in:
parent
7cfe712f4d
commit
8c5fa05c39
Notes:
sideshowbarker
2024-07-19 08:03:59 +09:00
Author: https://github.com/awesomekling
Commit: 8c5fa05c39
3 changed files with 5 additions and 7 deletions
|
@ -587,7 +587,7 @@ void Window::apply_icon()
|
|||
if (!has_set_process_icon)
|
||||
set_process_icon(m_icon->shbuf_id());
|
||||
|
||||
WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowIconBitmap>(m_window_id, m_icon->shbuf_id(), m_icon->size());
|
||||
WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowIconBitmap>(m_window_id, m_icon->to_shareable_bitmap(WindowServerConnection::the().server_pid()));
|
||||
}
|
||||
|
||||
void Window::start_wm_resize()
|
||||
|
|
|
@ -361,12 +361,10 @@ OwnPtr<Messages::WindowServer::SetWindowIconBitmapResponse> ClientConnection::ha
|
|||
}
|
||||
auto& window = *(*it).value;
|
||||
|
||||
auto icon_buffer = SharedBuffer::create_from_shbuf_id(message.icon_buffer_id());
|
||||
|
||||
if (!icon_buffer) {
|
||||
window.set_default_icon();
|
||||
if (message.icon().is_valid()) {
|
||||
window.set_icon(*message.icon().bitmap());
|
||||
} else {
|
||||
window.set_icon(Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *icon_buffer, message.icon_size()));
|
||||
window.set_default_icon();
|
||||
}
|
||||
|
||||
window.frame().invalidate_title_bar();
|
||||
|
|
|
@ -79,7 +79,7 @@ endpoint WindowServer = 2
|
|||
SetWallpaperMode(String mode) => ()
|
||||
|
||||
SetResolution(Gfx::Size resolution) => (bool success, Gfx::Size resolution)
|
||||
SetWindowIconBitmap(i32 window_id, i32 icon_buffer_id, Gfx::Size icon_size) => ()
|
||||
SetWindowIconBitmap(i32 window_id, Gfx::ShareableBitmap icon) => ()
|
||||
|
||||
GetWallpaper() => (String path)
|
||||
SetWindowOverrideCursor(i32 window_id, i32 cursor_type) => ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue