]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/window.cpp
move wxMGL's wxTimer to src/generic
[wxWidgets.git] / src / x11 / window.cpp
index 296ceb73c768849aef753cec00a46cc2c329c61a..31875c8e7db9f385e4867241f551583d66656df5 100644 (file)
@@ -253,6 +253,21 @@ wxWindow *wxWindowBase::FindFocus()
     return NULL;
 }
 
+#if 0
+wxWindow *wxWindowX11::GetFocusWidget()
+{
+   wxWindow *win = (wxWindow*) this;
+   while (!win->IsTopLevel())
+   {
+       win = win->GetParent();
+       if (!win)
+           return (wxWindow*) NULL;
+   }
+   
+   return win;
+}
+#endif
+
 // Enabling/disabling handled by event loop, and not sending events
 // if disabled.
 bool wxWindowX11::Enable(bool enable)
@@ -460,6 +475,29 @@ void wxWindowX11::WarpPointer (int x, int y)
 // Does a physical scroll
 void wxWindowX11::ScrollWindow(int dx, int dy, const wxRect *rect)
 {
+    // No scrolling requested.
+    if ((dx == 0) && (dy == 0)) return;
+    
+    if (!m_updateRegion.IsEmpty())
+    {
+        m_updateRegion.Offset( dx, dy );
+        
+        int cw = 0;
+        int ch = 0;
+        GetSize( &cw, &ch );  // GetClientSize() ??
+        m_updateRegion.Intersect( 0, 0, cw, ch );
+    }
+    
+    if (!m_clearRegion.IsEmpty())
+    {
+        m_clearRegion.Offset( dx, dy );
+        
+        int cw = 0;
+        int ch = 0;
+        GetSize( &cw, &ch );  // GetClientSize() ??
+        m_clearRegion.Intersect( 0, 0, cw, ch );
+    }
+    
     Window xwindow = (Window) GetMainWindow();
 
     wxCHECK_RET( xwindow, wxT("invalid window") );
@@ -933,7 +971,6 @@ void wxWindowX11::X11SendPaintEvents()
     
         if (!GetEventHandler()->ProcessEvent(erase_event))
         {
-            printf( "Hallo!\n" );
             Window xwindow = (Window) GetMainWindow();
             Display *xdisplay = wxGlobalDisplay();
             GC xgc = XCreateGC( xdisplay, xwindow, 0, NULL );
@@ -946,6 +983,7 @@ void wxWindowX11::X11SendPaintEvents()
                                 upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
                 upd ++;
             }
+            XFreeGC( xdisplay, xgc );
         }
         m_clearRegion.Clear();
     }