]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
fix for wxComboBox::GetSelection from inside event handler
[wxWidgets.git] / src / mgl / window.cpp
index 6b6c5df6e5d57126fa7b17fdf836993f518356b0..830b19167d6990126a95893ed3f4fc350bc2c8bf 100644 (file)
@@ -466,6 +466,11 @@ END_EVENT_TABLE()
 
 void wxWindowMGL::Init()
 {
+    // First of all, make sure window manager is up and running. If it is
+    // not the case, initialize it in default display mode
+    if ( !g_winMng )
+        wxTheApp->SetDisplayMode(wxDisplayModeInfo(wxSize(640, 480), 16));
+
     // generic:
     InitBase();
 
@@ -924,11 +929,15 @@ void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags)
         }
     }
 
-    DoMoveWindow(x, y, width, height);
+    if ( m_wnd->x != x || m_wnd->y != y || 
+         (int)m_wnd->width != width || (int)m_wnd->height != height )
+    {
+        DoMoveWindow(x, y, width, height);
 
-    wxSizeEvent event(wxSize(width, height), GetId());
-    event.SetEventObject(this);
-    GetEventHandler()->ProcessEvent(event);
+        wxSizeEvent event(wxSize(width, height), GetId());
+        event.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(event);
+    }
 }
 
 void wxWindowMGL::DoSetClientSize(int width, int height)