mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
LibCore+LibGUI: Don't fire timers in non-visible windows by default
LibCore timers now have a TimerShouldFireWhenNotVisible flag which is set to "No" by default. If "No", the timer will not be fired by the event loop if it's within a CObject tree whose nearest GWindow ancestor is currently not visible for timer purposes. (Specificially, this means that the window is either minimized or fully occluded, and so does not want to fire timers just to update the UI.) This is another nice step towards a calm and serene operating system.
This commit is contained in:
parent
f8f2b8b520
commit
411d293961
6 changed files with 42 additions and 9 deletions
|
@ -139,6 +139,8 @@ public:
|
|||
static void update_all_windows(Badge<GWindowServerConnection>);
|
||||
void notify_state_changed(Badge<GWindowServerConnection>, bool minimized, bool occluded);
|
||||
|
||||
virtual bool is_visible_for_timer_purposes() const override { return m_visible_for_timer_purposes; }
|
||||
|
||||
protected:
|
||||
GWindow(CObject* parent = nullptr);
|
||||
virtual void wm_event(GWMEvent&);
|
||||
|
@ -176,4 +178,5 @@ private:
|
|||
bool m_fullscreen { false };
|
||||
bool m_show_titlebar { true };
|
||||
bool m_layout_pending { false };
|
||||
bool m_visible_for_timer_purposes { true };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue