gtk+ r21674 - in branches/gtk-2-14: . gdk/win32



Author: tml
Date: Fri Oct 17 22:13:22 2008
New Revision: 21674
URL: http://svn.gnome.org/viewvc/gtk+?rev=21674&view=rev

Log:
2008-10-18  Tor Lillqvist  <tml novell com>

	Bug 556578 - GIMP windows stay on top of other windows

	* gdk/win32/gdkevents-win32.c (ensure_stacking_on_unminimize)
	(ensure_stacking_on_window_pos_changing)
	(ensure_stacking_on_activate_app): Ignore unmapped windows in the
	loops where we look for the lowest "transient-type" window.

	(gdk_event_translate): Don't call
	ensure_stacking_on_window_pos_changing() or
	ensure_stacking_on_activate_app() for unmapped windows.



Modified:
   branches/gtk-2-14/ChangeLog
   branches/gtk-2-14/gdk/win32/gdkevents-win32.c

Modified: branches/gtk-2-14/gdk/win32/gdkevents-win32.c
==============================================================================
--- branches/gtk-2-14/gdk/win32/gdkevents-win32.c	(original)
+++ branches/gtk-2-14/gdk/win32/gdkevents-win32.c	Fri Oct 17 22:13:22 2008
@@ -2116,9 +2116,10 @@
 	  GdkWindowImplWin32 *rover_impl =
 	    (GdkWindowImplWin32 *)((GdkWindowObject *)rover_gdkw)->impl;
 
-	  if (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
-	      rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
-	      rover_impl->transient_owner != NULL)
+	  if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
+	      (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
+	       rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+	       rover_impl->transient_owner != NULL))
 	    {
 	      lowest_transient = rover;
 	    }
@@ -2166,9 +2167,10 @@
 	      GdkWindowImplWin32 *rover_impl =
 		(GdkWindowImplWin32 *)((GdkWindowObject *)rover_gdkw)->impl;
 
-	      if (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
-		  rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
-		  rover_impl->transient_owner != NULL)
+	      if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
+		  (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
+		   rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+		   rover_impl->transient_owner != NULL))
 		{
 		  restacking = TRUE;
 		  windowpos->hwndInsertAfter = rover;
@@ -2222,9 +2224,10 @@
 	      GdkWindowImplWin32 *rover_impl =
 		(GdkWindowImplWin32 *)((GdkWindowObject *)rover_gdkw)->impl;
 
-	      if (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
-		  rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
-		  rover_impl->transient_owner != NULL)
+	      if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
+		  (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
+		   rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+		   rover_impl->transient_owner != NULL))
 		{
 		  GDK_NOTE (EVENTS, g_print (" restacking: %p", rover));
 		  SetWindowPos (msg->hwnd, rover, 0, 0, 0, 0,
@@ -3175,7 +3178,8 @@
 				 windowpos->cx, windowpos->cy, windowpos->x, windowpos->y,
 				 GetNextWindow (msg->hwnd, GW_HWNDPREV)));
 
-      return_val = ensure_stacking_on_window_pos_changing (msg, window);
+      if (GDK_WINDOW_IS_MAPPED (window))
+	return_val = ensure_stacking_on_window_pos_changing (msg, window);
       break;
 
     case WM_WINDOWPOSCHANGED:
@@ -3656,7 +3660,8 @@
 				 msg->wParam ? "YES" : "NO",
 				 (gint64) msg->lParam));
 
-      ensure_stacking_on_activate_app (msg, window);
+      if (GDK_WINDOW_IS_MAPPED (window))
+	ensure_stacking_on_activate_app (msg, window);
       break;
 
       /* Handle WINTAB events here, as we know that gdkinput.c will



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]