diff --git a/intern/ghost/intern/GHOST_WindowX11.cc b/intern/ghost/intern/GHOST_WindowX11.cc index 23197389639..d8ef88ee7fe 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cc +++ b/intern/ghost/intern/GHOST_WindowX11.cc @@ -301,6 +301,11 @@ GHOST_WindowX11::GHOST_WindowX11(GHOST_SystemX11 *system, XSetWMHints(display, window_, xwmhints); XFree(xwmhints); } + /* Controlled via the `--no-window-frame` CLI argument and wont change at run-time. + * Set this once and never change. */ + if (GHOST_ISystem::getUseWindowFrame() == false) { + motifShowWindowFrame(false); + } /* set the icon */ { @@ -813,15 +818,17 @@ bool GHOST_WindowX11::netwmIsFullScreen() const return st; } -void GHOST_WindowX11::motifFullScreen(bool set) +void GHOST_WindowX11::motifShowWindowFrame(bool set) { MotifWmHints hints; hints.flags = MWM_HINTS_DECORATIONS; - if (set == True) { + if (set == false) { hints.decorations = 0; } else { + GHOST_ASSERT(GHOST_ISystem::getUseWindowFrame(), + "Only allowed when the window frame is shown."); hints.decorations = 1; } @@ -835,7 +842,7 @@ void GHOST_WindowX11::motifFullScreen(bool set) 4); } -bool GHOST_WindowX11::motifIsFullScreen() const +bool GHOST_WindowX11::motifIsShowWindowFrame() const { MotifWmHints *prop_ret; ulong bytes_after, num_ret; @@ -871,6 +878,25 @@ bool GHOST_WindowX11::motifIsFullScreen() const return state; } +void GHOST_WindowX11::motifFullScreen(bool set) +{ + if (set == true || (GHOST_ISystem::getUseWindowFrame() == false)) { + motifShowWindowFrame(false); + } + else { + motifShowWindowFrame(true); + } +} + +bool GHOST_WindowX11::motifIsFullScreen() const +{ + /* When false, the decorations can't be used to detect full-screen. */ + if (GHOST_ISystem::getUseWindowFrame() == false) { + return false; + } + return motifIsShowWindowFrame(); +} + GHOST_TWindowState GHOST_WindowX11::getState() const { GHOST_TWindowState state_ret; diff --git a/intern/ghost/intern/GHOST_WindowX11.hh b/intern/ghost/intern/GHOST_WindowX11.hh index b0237c1ce78..e396cc945d9 100644 --- a/intern/ghost/intern/GHOST_WindowX11.hh +++ b/intern/ghost/intern/GHOST_WindowX11.hh @@ -253,4 +253,7 @@ class GHOST_WindowX11 : public GHOST_Window { void motifFullScreen(bool set); bool motifIsFullScreen() const; + + void motifShowWindowFrame(bool set); + bool motifIsShowWindowFrame() const; }; diff --git a/source/creator/creator_args.cc b/source/creator/creator_args.cc index f46d089174a..02129e74f90 100644 --- a/source/creator/creator_args.cc +++ b/source/creator/creator_args.cc @@ -1907,7 +1907,7 @@ static int arg_handle_window_maximized(int /*argc*/, const char ** /*argv*/, voi static const char arg_handle_no_window_frame_doc[] = "\n\t" - "Disable all window decorations (Wayland only)."; + "Disable all window decorations (Linux only)."; static int arg_handle_no_window_frame(int /*argc*/, const char ** /*argv*/, void * /*data*/) { WM_init_window_frame_set(false);