diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-07-08 11:02:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-08 11:02:29 +0200 |
commit | 79992a4a721347d64e3ea8f9a1563a21821295fb (patch) | |
tree | 9a1f401fa8dd72ded0004bc5a465bf11963b3f1e /platform | |
parent | 752d0c0bcf7f012ad140657859e58514ce509188 (diff) | |
parent | c3563b266f854f8374f5fed7b547695d387f669a (diff) |
Merge pull request #9515 from marcelofg55/master
Implemented borderless window functions on Linux.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/os_x11.cpp | 26 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 383abffe46..f2754cc180 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -278,6 +278,13 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au xev.xclient.data.l[2] = 0; XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev); + } else if (current_videomode.borderless_window) { + Hints hints; + Atom property; + hints.flags = 2; + hints.decorations = 0; + property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True); + XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5); } // disable resizable window @@ -1018,6 +1025,25 @@ bool OS_X11::is_window_maximized() const { return false; } +void OS_X11::set_borderless_window(int p_borderless) { + + if (current_videomode.borderless_window == p_borderless) + return; + + current_videomode.borderless_window = p_borderless; + + Hints hints; + Atom property; + hints.flags = 2; + hints.decorations = current_videomode.borderless_window ? 0 : 1; + property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True); + XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5); +} + +bool OS_X11::get_borderless_window() { + return current_videomode.borderless_window; +} + void OS_X11::request_attention() { // Using EWMH -- Extended Window Manager Hints // diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index b253934a05..39c512b6bd 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -251,6 +251,9 @@ public: virtual bool is_window_maximized() const; virtual void request_attention(); + virtual void set_borderless_window(int p_borderless); + virtual bool get_borderless_window(); + virtual void move_window_to_foreground(); virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); |