]> git.saurik.com Git - wxWidgets.git/commitdiff
Show(): Send a wxWindows size event just before calling makeKeyAndOrderFront:
authorDavid Elliott <dfe@tgwbd.org>
Fri, 22 Aug 2003 21:54:43 +0000 (21:54 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Fri, 22 Aug 2003 21:54:43 +0000 (21:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/toplevel.mm

index 3b5bf13131dd8f28f1305d20c6ecf77450abb3ca..02a017515b03c3c9393c1748ab9839379e5b76b6 100644 (file)
@@ -177,7 +177,16 @@ bool wxTopLevelWindowCocoa::Show(bool show)
 {
     wxAutoNSAutoreleasePool pool;
     if(show)
+    {
+        // Send the window a size event because wxWindows apps expect it
+        // NOTE: This should really only be done the first time a window
+        // is shown.  I doubt this will cause any problems though.
+        wxSizeEvent event(GetSize(), GetId());
+        event.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(event);
+
         [m_cocoaNSWindow makeKeyAndOrderFront:m_cocoaNSWindow];
+    }
     else
         [m_cocoaNSWindow orderOut:m_cocoaNSWindow];
     return true;