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

LibDesktop: Do not quit screensaver on immediate mouse move

Let's delay this way of quitting the screensavers by 750ms. :^)
This commit is contained in:
Jelle Raaijmakers 2022-12-27 00:50:57 +01:00 committed by Andreas Kling
parent 18b6bdb563
commit 7d5839f793
2 changed files with 13 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include <AK/Function.h>
#include <AK/NonnullRefPtr.h>
#include <AK/Optional.h>
#include <AK/Time.h>
#include <LibGUI/Widget.h>
#include <LibGUI/Window.h>
#include <LibGfx/Point.h>
@ -27,10 +28,17 @@ public:
virtual void mousedown_event(GUI::MouseEvent& event) override;
virtual void mousemove_event(GUI::MouseEvent& event) override;
protected:
Screensaver()
: m_start_time(AK::Time::now_monotonic())
{
}
private:
void trigger_exit();
Optional<Gfx::IntPoint> m_mouse_origin;
AK::Time m_start_time;
};
}