From 8d2d0809235dc7ed34afaf2b32ccc3755ce8278b Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 21 Feb 2021 15:41:49 -0700 Subject: [PATCH] CatDog: Fix wake-sleep "loop" when cursor is over right-top of head Because re-evaluation of the hovered window may trigger sending a MouseMove event to a window we should only wake it if the mouse position actually has changed. --- Userland/Demos/CatDog/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Demos/CatDog/main.cpp b/Userland/Demos/CatDog/main.cpp index 105c8d3292..7238b2c0a7 100644 --- a/Userland/Demos/CatDog/main.cpp +++ b/Userland/Demos/CatDog/main.cpp @@ -137,6 +137,8 @@ public: void mousemove_event(GUI::MouseEvent& event) override { + if (m_temp_pos == event.position()) + return; m_temp_pos = event.position(); m_timer.start(); if (m_sleeping) {