diff options
author | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-01-11 17:36:56 +0800 |
---|---|---|
committer | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-01-11 17:36:56 +0800 |
commit | 466e251abecf3686f0caac40ab886155e43cc0a6 (patch) | |
tree | e3a85cca1434fe0e411d0afd91b4ba93cd8525c6 /platform | |
parent | ac558c15eaeb45b3e7ae2604e26ca1dffb60b779 (diff) |
get_window_size() + set_window_size() added
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/os_x11.cpp | 18 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 502d510f5b..f21ea4c9a2 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -537,8 +537,11 @@ Point2 OS_X11::get_window_position() const { } void OS_X11::set_window_position(const Point2& p_position) { - // _NET_FRAME_EXTENTS + if( current_videomode.fullscreen ) + return; + + // _NET_FRAME_EXTENTS Atom property = XInternAtom(x11_display,"_NET_FRAME_EXTENTS", True); Atom type; int format; @@ -579,6 +582,19 @@ void OS_X11::set_window_position(const Point2& p_position) { XMoveWindow(x11_display,x11_window,p_position.x - left,p_position.y - top); } +Size2 OS_X11::get_window_size() const { + XWindowAttributes xwa; + XGetWindowAttributes(x11_display, x11_window, &xwa); + return Size2i(xwa.width, xwa.height); +} + +void OS_X11::set_window_size(const Size2 p_size) { + if( current_videomode.fullscreen ) + return; + + XResizeWindow(x11_display, x11_window, p_size.x, p_size.y); +} + void OS_X11::set_fullscreen(bool p_enabled,int p_screen) { if(p_enabled) { diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index ad7364f999..1cedea4223 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -219,6 +219,8 @@ public: virtual Point2 get_window_position() const; virtual void set_window_position(const Point2& p_position); + virtual Size2 get_window_size() const; + virtual void set_window_size(const Size2 p_size); virtual void set_fullscreen(bool p_enabled,int p_screen=0); virtual bool is_fullscreen() const; |