mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
WindowServer: Fix visibility of WindowSwitcher constructor
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult. This commit is separate from the other Servives changes because it required additional adaption of the code. Note that the old code did precisely what these changes try to prevent: Create and handle a ref-counted object with a refcount of zero.
This commit is contained in:
parent
52a1ff4d4b
commit
0e3397aabe
4 changed files with 27 additions and 25 deletions
|
@ -26,7 +26,6 @@ public:
|
|||
};
|
||||
static WindowSwitcher& the();
|
||||
|
||||
WindowSwitcher();
|
||||
virtual ~WindowSwitcher() override;
|
||||
|
||||
bool is_visible() const { return m_visible; }
|
||||
|
@ -49,6 +48,8 @@ public:
|
|||
Mode mode() const { return m_mode; }
|
||||
|
||||
private:
|
||||
WindowSwitcher();
|
||||
|
||||
int thumbnail_width() const { return 40; }
|
||||
int thumbnail_height() const { return 40; }
|
||||
int item_height() const { return 10 + thumbnail_height(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue