From: Mikko Rasa Date: Sun, 2 Nov 2008 17:40:27 +0000 (+0000) Subject: Add Window::warp_pointer (No win32 support for now) X-Git-Tag: 1.1~7 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=746e5da7730baee990fb1e307d416e0593b3f083;p=libs%2Fgui.git Add Window::warp_pointer (No win32 support for now) Delete Window's private data in destructor --- diff --git a/source/gbase/window.cpp b/source/gbase/window.cpp index b9e3fa4..7d58fe4 100644 --- a/source/gbase/window.cpp +++ b/source/gbase/window.cpp @@ -96,6 +96,8 @@ Window::~Window() if(options.fullscreen) display.restore_mode(); + + delete priv; } void Window::set_title(const string &title) @@ -216,6 +218,13 @@ void Window::show_cursor(bool s) #endif } +void Window::warp_pointer(int x, int y) +{ +#ifndef WIN32 + XWarpPointer(display.get_private().display, None, priv->window, 0, 0, 0, 0, x, y); +#endif +} + void Window::show() { #ifdef WIN32 diff --git a/source/gbase/window.h b/source/gbase/window.h index 53c2d95..c48adc5 100644 --- a/source/gbase/window.h +++ b/source/gbase/window.h @@ -53,6 +53,7 @@ public: void set_title(const std::string &); void reconfigure(const WindowOptions &); void show_cursor(bool); + void warp_pointer(int, int); Display &get_display() const { return display; } const WindowOptions &get_options() const { return options; }