1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:47:44 +00:00

WindowServer+LibGUI: Remove old "icon path" way of doing things.

Now that we can set icons directly "by bitmap", there's no need for passing
around the icon paths anymore, so get rid of all the IPC and API related
to that. :^)
This commit is contained in:
Andreas Kling 2019-07-28 10:24:58 +02:00
parent 841b2e5d13
commit d4892b3fdc
13 changed files with 3 additions and 158 deletions

View file

@ -86,25 +86,11 @@ void TaskbarWindow::wm_event(GWMEvent& event)
#endif
break;
}
case GEvent::WM_WindowIconChanged: {
auto& changed_event = static_cast<GWMWindowIconChangedEvent&>(event);
#ifdef EVENT_DEBUG
dbgprintf("WM_WindowIconChanged: client_id=%d, window_id=%d, icon_path=%s\n",
changed_event.client_id(),
changed_event.window_id(),
changed_event.icon_path().characters());
#endif
if (auto* window = WindowList::the().window(identifier)) {
window->set_icon_path(changed_event.icon_path());
window->button()->set_icon(window->icon());
}
break;
}
case GEvent::WM_WindowIconBitmapChanged: {
auto& changed_event = static_cast<GWMWindowIconBitmapChangedEvent&>(event);
#ifdef EVENT_DEBUG
dbgprintf("WM_WindowIconChanged: client_id=%d, window_id=%d, icon_buffer_id=%d\n",
dbgprintf("WM_WindowIconBitmapChanged: client_id=%d, window_id=%d, icon_buffer_id=%d\n",
changed_event.client_id(),
changed_event.window_id(),
changed_event.icon_buffer_id());

View file

@ -35,18 +35,6 @@ public:
void set_minimized(bool minimized) { m_minimized = minimized; }
bool is_minimized() const { return m_minimized; }
String icon_path() const { return m_icon_path; }
void set_icon_path(const String& icon_path)
{
if (m_icon_path == icon_path)
return;
auto icon = GraphicsBitmap::load_from_file(icon_path);
if (!icon)
return;
m_icon_path = icon_path;
m_icon = move(icon);
}
const GraphicsBitmap* icon() const { return m_icon.ptr(); }
private:
@ -54,7 +42,6 @@ private:
String m_title;
Rect m_rect;
GButton* m_button { nullptr };
String m_icon_path;
RefPtr<GraphicsBitmap> m_icon;
bool m_active { false };
bool m_minimized { false };