get_screen_position() added
This commit is contained in:
parent
1445b6806b
commit
ce7c7a862e
7 changed files with 28 additions and 3 deletions
|
|
@ -561,7 +561,19 @@ int OS_X11::get_screen_count() const {
|
|||
return XScreenCount(x11_display);
|
||||
}
|
||||
|
||||
Point2 OS_X11::get_screen_position(int p_screen) const {
|
||||
if( p_screen >= XScreenCount(x11_display) )
|
||||
return Point2i(0,0);
|
||||
|
||||
Window root = XRootWindow(x11_display, p_screen);
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes(x11_display, root, &xwa);
|
||||
return Point2i(xwa.x, xwa.y);
|
||||
}
|
||||
|
||||
Size2 OS_X11::get_screen_size(int p_screen) const {
|
||||
if( p_screen >= XScreenCount(x11_display) )
|
||||
return Size2i(0,0);
|
||||
Window root = XRootWindow(x11_display, p_screen);
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes(x11_display, root, &xwa);
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ public:
|
|||
|
||||
#ifdef EXPERIMENTAL_WM_API
|
||||
virtual int get_screen_count() const;
|
||||
virtual Point2 get_screen_position(int p_screen=0) const;
|
||||
virtual Size2 get_screen_size(int p_screen=0) const;
|
||||
virtual Point2 get_window_position() const;
|
||||
virtual void set_window_position(const Point2& p_position);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue