mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
WindowServer+LibGUI: Pass window icons as shared buffers rather than paths.
Now that we support more than 2 clients per shared buffer, we can use them for window icons. I didn't do that previously since it would have made the Taskbar process unable to access the icons. This opens up some nice possibilities for programmatically generated icons.
This commit is contained in:
parent
63619b9f7c
commit
841b2e5d13
21 changed files with 193 additions and 19 deletions
|
@ -122,6 +122,9 @@ public:
|
|||
String icon_path() const { return m_icon_path; }
|
||||
void set_icon_path(const StringView&);
|
||||
|
||||
void set_icon(const GraphicsBitmap*);
|
||||
const GraphicsBitmap* icon() const { return m_icon.ptr(); }
|
||||
|
||||
Vector<GWidget*> focusable_widgets() const;
|
||||
|
||||
protected:
|
||||
|
@ -135,11 +138,13 @@ private:
|
|||
void collect_keyboard_activation_targets();
|
||||
|
||||
NonnullRefPtr<GraphicsBitmap> create_backing_bitmap(const Size&);
|
||||
NonnullRefPtr<GraphicsBitmap> create_shared_bitmap(GraphicsBitmap::Format, const Size&);
|
||||
void set_current_backing_bitmap(GraphicsBitmap&, bool flush_immediately = false);
|
||||
void flip(const Vector<Rect, 32>& dirty_rects);
|
||||
|
||||
RefPtr<GraphicsBitmap> m_front_bitmap;
|
||||
RefPtr<GraphicsBitmap> m_back_bitmap;
|
||||
RefPtr<GraphicsBitmap> m_icon;
|
||||
int m_window_id { 0 };
|
||||
float m_opacity_when_windowless { 1.0f };
|
||||
GWidget* m_main_widget { nullptr };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue