[gtk+/client-side-windows: 122/284] Update gdk_window_focus



commit ff861567622036caa5f58cd43baef142fff60333
Author: Richard Hult <richard imendio com>
Date:   Mon Jan 5 19:36:24 2009 +0100

    Update gdk_window_focus
---
 gdk/quartz/gdkwindow-quartz.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 9da42f3..9a12077 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2298,20 +2298,19 @@ gdk_window_focus (GdkWindow *window,
   GdkWindowObject *private;
   GdkWindowImplQuartz *impl;
 	
-  g_return_if_fail (GDK_IS_WINDOW (window));
-
   private = (GdkWindowObject*) window;
   impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
 
-  if (impl->toplevel)
+  if (GDK_WINDOW_DESTROYED (window) ||
+      !WINDOW_IS_TOPLEVEL (window))
+    return;
+
+  if (private->accept_focus && private->window_type != GDK_WINDOW_TEMP)
     {
-      if (private->accept_focus && private->window_type != GDK_WINDOW_TEMP) 
-        {
-          GDK_QUARTZ_ALLOC_POOL;
-          [impl->toplevel makeKeyAndOrderFront:impl->toplevel];
-          clear_toplevel_order ();
-          GDK_QUARTZ_RELEASE_POOL;
-        }
+      GDK_QUARTZ_ALLOC_POOL;
+      [impl->toplevel makeKeyAndOrderFront:impl->toplevel];
+      clear_toplevel_order ();
+      GDK_QUARTZ_RELEASE_POOL;
     }
 }
 



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