From 2e74bf488b93efa6f0a8431584943ec178abd7db Mon Sep 17 00:00:00 2001 From: "Felix M. Cobos" Date: Sun, 10 Sep 2017 06:41:34 +0200 Subject: [PATCH] Adding borders back to a borderless window was not working. --- platform/x11/os_x11.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index f96343c92cc..767ede85404 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -712,6 +712,16 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) { XSetWMNormalHints(x11_display, x11_window, xsh); XFree(xsh); } + + if (!p_enabled && !get_borderless_window()) { + // put decorations back if the window wasn't suppoesed to be borderless + Hints hints; + Atom property; + hints.flags = 2; + hints.decorations = 1; + property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True); + XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5); + } } int OS_X11::get_screen_count() const {