diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/osx/os_osx.h | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 16 |
3 files changed, 16 insertions, 4 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 144037b1cb..869997f190 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -170,7 +170,7 @@ public: virtual int get_screen_count() const; virtual int get_current_screen() const; virtual void set_current_screen(int p_screen); - virtual Point2 get_screen_position(int p_screen=0); + virtual Point2 get_screen_position(int p_screen=0) const; virtual Point2 get_window_position() const; virtual void set_window_position(const Point2& p_position); virtual void set_window_size(const Size2 p_size); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 72699366c4..abfe42beda 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1279,7 +1279,7 @@ void OS_OSX::set_current_screen(int p_screen) { current_screen = p_screen; }; -Point2 OS_OSX::get_screen_position(int p_screen) { +Point2 OS_OSX::get_screen_position(int p_screen) const { ERR_FAIL_INDEX_V(p_screen, screens.size(), Point2()); return screens[p_screen].pos; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 16632c6627..51f4392eb4 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -441,6 +441,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi net_wm_icon = XInternAtom(x11_display, "_NET_WM_ICON", False); + //printf("got map notify\n"); } @@ -671,17 +672,24 @@ void OS_X11::set_current_screen(int p_screen) { } Point2 OS_X11::get_screen_position(int p_screen) const { + // Using Xinerama Extension int event_base, error_base; const Bool ext_okay = XineramaQueryExtension(x11_display, &event_base, &error_base); - if( !ext_okay ) return Point2i(0,0); + if( !ext_okay ) { + return Point2i(0,0); + } int count; XineramaScreenInfo* xsi = XineramaQueryScreens(x11_display, &count); - if( p_screen >= count ) return Point2i(0,0); + if( p_screen >= count ) { + return Point2i(0,0); + } Point2i position = Point2i(xsi[p_screen].x_org, xsi[p_screen].y_org); + XFree(xsi); + return position; } @@ -715,6 +723,7 @@ Point2 OS_X11::get_window_position() const { void OS_X11::set_window_position(const Point2& p_position) { // Using EWMH -- Extended Window Manager Hints // to get the size of the decoration +#if 0 Atom property = XInternAtom(x11_display,"_NET_FRAME_EXTENTS", True); Atom type; int format; @@ -757,6 +766,9 @@ void OS_X11::set_window_position(const Point2& p_position) { top -= screen_position.y; XMoveWindow(x11_display,x11_window,p_position.x - left,p_position.y - top); +#else + XMoveWindow(x11_display,x11_window,p_position.x,p_position.y); +#endif } Size2 OS_X11::get_window_size() const { |