]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
compile fix for Mac
[wxWidgets.git] / src / gtk / window.cpp
index a18ed12377d571085bd9e2cd7365e86b3a61e089..3d6fb6f937e8c59e9c936221298aa4bcdbdb9324 100644 (file)
@@ -78,8 +78,6 @@
     #undef HAVE_XIM
 #endif
 
-extern GtkContainerClass *pizza_parent_class;
-
 //-----------------------------------------------------------------------------
 // documentation on internals
 //-----------------------------------------------------------------------------
@@ -404,13 +402,9 @@ gtk_window_own_expose_callback( GtkWidget *widget,
                                 GdkEventExpose *gdk_event,
                                 wxWindowGTK *win )
 {
-    if (gdk_event->count > 0) return FALSE;
-
-    draw_frame( widget, win );
-
-    (* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, gdk_event);
-
-    return TRUE;
+    if (gdk_event->count == 0)
+        draw_frame(widget, win);
+    return false;
 }
 }
 
@@ -517,8 +511,6 @@ gtk_window_expose_callback( GtkWidget *widget,
     win->GtkSendPaintEvents();
 
     // Let parent window draw window-less widgets
-    (* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, gdk_event);
-
     return FALSE;
 }
 }
@@ -1286,10 +1278,7 @@ template<typename T> void InitMouseEvent(wxWindowGTK *win,
     if ((win->m_wxwindow) && (win->GetLayoutDirection() == wxLayout_RightToLeft))
     {
         // origin in the upper right corner
-        int virtual_width = win->GetVirtualSize().x;
         int window_width = gtk_pizza_get_rtl_offset( GTK_PIZZA(win->m_wxwindow) );
-        //wxPrintf( wxT("event.m_x %d virtual_width %d window_width %d m_xoffset %d\n"), 
-        //              event.m_x, virtual_width, window_width, GTK_PIZZA(win->m_wxwindow)->m_xoffset );
         event.m_x = window_width - event.m_x;
     }
 
@@ -2611,8 +2600,6 @@ void wxWindowGTK::PostCreation()
         {
             // these get reported to wxWidgets -> wxPaintEvent
 
-            gtk_pizza_set_external( GTK_PIZZA(m_wxwindow), TRUE );
-
             g_signal_connect (m_wxwindow, "expose_event",
                               G_CALLBACK (gtk_window_expose_callback), this);
 
@@ -3069,6 +3056,28 @@ void wxWindowGTK::DoGetPosition( int *x, int *y ) const
         dy = gtk_pizza_get_yoffset( pizza );
     }
 
+    if (m_x == -1 && m_y == -1)
+    {
+        GdkWindow *source = (GdkWindow *) NULL;
+        if (m_wxwindow)
+            source = GTK_PIZZA(m_wxwindow)->bin_window;
+        else
+            source = m_widget->window;
+
+        if (source)
+        {
+            int org_x = 0;
+            int org_y = 0;
+            gdk_window_get_origin( source, &org_x, &org_y );
+
+            if (GetParent())
+                GetParent()->ScreenToClient(&org_x, &org_y);
+
+            ((wxWindowGTK*) this)->m_x = org_x;
+            ((wxWindowGTK*) this)->m_y = org_y;
+       }
+    }
+
     if (x) (*x) = m_x - dx;
     if (y) (*y) = m_y - dy;
 }