]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/window.cpp
forward port from 2.8
[wxWidgets.git] / src / x11 / window.cpp
index a2ea6261c2beb33013ba5f7ee57a1e0fc2553312..7026b5aa658b9b4951f34d913b25fb0f830bc58f 100644 (file)
@@ -160,6 +160,8 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
     if (pos2.y == wxDefaultCoord)
         pos2.y = 0;
 
+    AdjustForParentClientOrigin(pos2.x, pos2.y);
+
 #if wxUSE_TWO_WINDOWS
     bool need_two_windows =
         ((( wxSUNKEN_BORDER | wxRAISED_BORDER | wxSIMPLE_BORDER | wxHSCROLL | wxVSCROLL ) & m_windowStyle) != 0);
@@ -674,8 +676,8 @@ void wxWindowX11::ScrollWindow(int dx, int dy, const wxRect *rect)
 
         if (dx < 0) s_x += -dx;
         if (dy < 0) s_y += -dy;
-        if (dx > 0) d_x = dx + offset.x;
-        if (dy > 0) d_y = dy + offset.y;
+        if (dx > 0) d_x += dx + offset.x;
+        if (dy > 0) d_y += dy + offset.y;
 
         XCopyArea( xdisplay, xwindow, xwindow, xgc, s_x, s_y, w, h, d_x, d_y );
 
@@ -1310,7 +1312,7 @@ void wxWindowX11::OnInternalIdle()
 
     // This calls the UI-update mechanism (querying windows for
     // menu/toolbar/control state information)
-    if (wxUpdateUIEvent::CanUpdate((wxWindow*) this))
+    if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 
     // Set the input focus if couldn't do it before
@@ -1414,7 +1416,10 @@ WXWindow wxWindowX11::GetClientAreaWindow() const
 // TranslateXXXEvent() functions
 // ----------------------------------------------------------------------------
 
-bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent)
+bool wxTranslateMouseEvent(wxMouseEvent& wxevent,
+                           wxWindow *win,
+                           Window WXUNUSED(window),
+                           XEvent *xevent)
 {
     switch (XEventGetType(xevent))
     {
@@ -1646,7 +1651,8 @@ wxWindow *wxWindowBase::GetCapture()
 // position.
 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
 {
-    return wxFindWindowAtPoint(wxGetMousePosition());
+    pt = wxGetMousePosition();
+    return wxFindWindowAtPoint(pt);
 }
 
 void wxGetMouseState(int& rootX, int& rootY, unsigned& maskReturn)