]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
fixup for last commit
[wxWidgets.git] / src / gtk / window.cpp
index f828018064629816014d3252f9b9d6ac6bcfc345..dbc991b9b21a00ef8195976cf49a809829ebfde7 100644 (file)
@@ -1000,6 +1000,8 @@ static void wxFillOtherKeyEventFields(wxKeyEvent& event,
 #if wxUSE_UNICODE
     event.m_uniChar = gdk_keyval_to_unicode(gdk_event->keyval);
 #endif
+    wxGetMousePosition( &x, &y );
+    win->ScreenToClient( &x, &y );
     event.m_x = x;
     event.m_y = y;
     event.SetEventObject( win );
@@ -3977,12 +3979,10 @@ void wxWindowGTK::GtkSendPaintEvents()
     // widget to draw on
     GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
 
-    if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM) && !IsTopLevel())
+    if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM))
     {
         // find ancestor from which to steal background
-        wxWindow *parent = GetParent();
-        while (parent && !parent->IsTopLevel())
-            parent = parent->GetParent();
+        wxWindow *parent = wxGetTopLevelParent((wxWindow *)this);
         if (!parent)
             parent = (wxWindow*)this;