#pragma implementation "window.h"
#endif
+#ifdef __VMS
+#define XWarpPointer XWARPPOINTER
+#endif
+
#include "wx/defs.h"
#include "wx/window.h"
#include "wx/dc.h"
}
*/
- win->GetUpdateRegion().Union( gdk_event->area.x,
- gdk_event->area.y,
- gdk_event->area.width,
- gdk_event->area.height );
+ GtkPizza *pizza = GTK_PIZZA (widget);
+
+ if (win->IsTopLevel())
+ {
+ gtk_paint_flat_box (widget->style, pizza->bin_window, GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE, &gdk_event->area, widget, "base", 0, 0, -1, -1);
+ }
+
+ win->GetUpdateRegion().Union( gdk_event->area.x,
+ gdk_event->area.y,
+ gdk_event->area.width,
+ gdk_event->area.height );
if (gdk_event->count == 0)
{
paint *anything* because it will then be allowed to paint
over the window-less widgets */
- GtkPizza *pizza = GTK_PIZZA (widget);
-
GList *children = pizza->children;
while (children)
{
*/
GtkPizza *pizza = GTK_PIZZA (widget);
+
+ if (win->IsTopLevel())
+ {
+ gtk_paint_flat_box (widget->style, pizza->bin_window, GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE, rect, widget, "base", 0, 0, -1, -1);
+ }
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
(pizza->clear_on_draw))
}
*/
}
+
+// 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);
+
+}
+