]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/window.cpp
added missing headers to fix compilation without PCH
[wxWidgets.git] / src / x11 / window.cpp
index cd6575da0c1d4ca8de8d7e1f834d9abe322b5006..270bb56364edd3b9b512ff163ecc49db3f5d25d5 100644 (file)
@@ -251,7 +251,17 @@ void wxWindowX11::SetFocus()
     Window xwindow = (Window) GetMainWindow();
     
     wxCHECK_RET( xwindow, wxT("invalid window") );
-
+    
+    wxCHECK_RET( AcceptsFocus(), wxT("set focus on window that doesn't accept the focus") );
+    
+#if 0
+    if (GetName() == "scrollBar")
+    {
+        char *crash = NULL;
+        *crash = 0;
+    }
+#endif
+    
     if (wxWindowIsVisible(xwindow))
     {
         XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
@@ -960,6 +970,7 @@ void wxWindowX11::Update()
 {
     if (!m_updateRegion.IsEmpty())
     {
+        //        wxLogDebug("wxWindowX11::Update: %s", GetClassInfo()->GetClassName());
         // Actually send erase events.
         SendEraseEvents();
         
@@ -987,7 +998,7 @@ void wxWindowX11::SendEraseEvents()
         
         wxEraseEvent erase_event( GetId(), &dc );
         erase_event.SetEventObject( this );
-    
+
         if (!GetEventHandler()->ProcessEvent(erase_event))
         {
             Window xwindow = (Window) GetMainWindow();
@@ -1022,9 +1033,8 @@ void wxWindowX11::SendPaintEvents()
     wxPaintEvent paint_event( GetId() );
     paint_event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( paint_event );
-
-    m_updateRegion.Clear();
     
+    m_updateRegion.Clear();
     m_clipPaintRegion = FALSE;
 }
 
@@ -1062,7 +1072,9 @@ void wxWindowX11::OnInternalIdle()
 
     // Set the input focus if couldn't do it before
     if (m_needsInputFocus)
+    {
        SetFocus();
+    }
 }
 
 // ----------------------------------------------------------------------------