Browse Source

Fixed the behaviour of love.window.requestAttention on Windows.

Alex Szpakowski 10 years ago
parent
commit
91e2227124
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/modules/window/sdl/Window.cpp

+ 6 - 0
src/modules/window/sdl/Window.cpp

@@ -974,6 +974,9 @@ void Window::requestAttention(bool continuous)
 {
 #if defined(LOVE_WINDOWS)
 
+	if (hasFocus())
+		return;
+
 	SDL_SysWMinfo wminfo = {};
 	SDL_VERSION(&wminfo.version);
 
@@ -986,7 +989,10 @@ void Window::requestAttention(bool continuous)
 		flashinfo.dwFlags = FLASHW_ALL;
 
 		if (continuous)
+		{
+			flashinfo.uCount = 0;
 			flashinfo.dwFlags |= FLASHW_TIMERNOFG;
+		}
 
 		FlashWindowEx(&flashinfo);
 	}