+ m_clipPaintRegion = FALSE;
+
+/*
+ if (m_children.GetCount() > 0)
+ {
+ gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
+ }
+ else
+ {
+ GtkPizza *pizza = GTK_PIZZA(m_wxwindow);
+
+ pizza->xoffset -= dx;
+ pizza->yoffset -= dy;
+
+ GdkGC *m_scrollGC = gdk_gc_new( pizza->bin_window );
+ gdk_gc_set_exposures( m_scrollGC, TRUE );
+
+ int cw = 0;
+ int ch = 0;
+ GetClientSize( &cw, &ch );
+ int w = cw - abs(dx);
+ int h = ch - abs(dy);
+
+ if ((h < 0) || (w < 0))
+ {
+ Refresh();
+ }
+ else
+ {
+ int s_x = 0;
+ int s_y = 0;
+ if (dx < 0) s_x = -dx;
+ if (dy < 0) s_y = -dy;
+ int d_x = 0;
+ int d_y = 0;
+ if (dx > 0) d_x = dx;
+ if (dy > 0) d_y = dy;
+
+ gdk_window_copy_area( pizza->bin_window, m_scrollGC, d_x, d_y,
+ pizza->bin_window, s_x, s_y, w, h );
+
+ wxRect rect;
+ if (dx < 0) rect.x = cw+dx; else rect.x = 0;
+ if (dy < 0) rect.y = ch+dy; else rect.y = 0;
+ if (dy != 0) rect.width = cw; else rect.width = abs(dx);
+ if (dx != 0) rect.height = ch; else rect.height = abs(dy);
+
+ Refresh( TRUE, &rect );
+ }
+
+ gdk_gc_unref( m_scrollGC );
+ }
+*/
+}
+
+// Find the wxWindow at the current mouse position, also returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(wxPoint& pt)
+{
+ pt = wxGetMousePosition();
+ wxWindow* found = wxFindWindowAtPoint(pt);
+ return found;
+}
+
+// Get the current mouse position.
+wxPoint wxGetMousePosition()
+{
+ /* This crashes when used within wxHelpContext,
+ so we have to use the X-specific implementation below.
+ gint x, y;
+ GdkModifierType *mask;
+ (void) gdk_window_get_pointer(NULL, &x, &y, mask);
+
+ return wxPoint(x, y);
+ */
+
+ int x, y;
+ GdkWindow* windowAtPtr = gdk_window_at_pointer(& x, & y);
+ if (!windowAtPtr)
+ return wxPoint(-999, -999);
+
+ Display *display = GDK_WINDOW_XDISPLAY(windowAtPtr);
+ Window rootWindow = RootWindowOfScreen (DefaultScreenOfDisplay(display));
+ Window rootReturn, childReturn;
+ int rootX, rootY, winX, winY;
+ unsigned int maskReturn;
+
+ XQueryPointer (display,
+ rootWindow,
+ &rootReturn,
+ &childReturn,
+ &rootX, &rootY, &winX, &winY, &maskReturn);
+ return wxPoint(rootX, rootY);
+