From 7fca77254b511dc973f63d19c22c540fcc49eff4 Mon Sep 17 00:00:00 2001 From: diovudau <1045984+diovudau@users.noreply.github.com> Date: Fri, 21 Sep 2018 14:54:47 +0200 Subject: [PATCH] Add X _NET_WM_WINDOW_TYPE flags to plugin windows so they work equally well on tiling window manages and floating WM (#751) --- source/utils/CarlaPluginUI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 11ca59727..6f3dec519 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -103,6 +103,15 @@ public: const Atom _nwi = XInternAtom(fDisplay, "_NET_WM_ICON", False); XChangeProperty(fDisplay, fHostWindow, _nwi, XA_CARDINAL, 32, PropModeReplace, (const uchar*)sCarlaX11Icon, sCarlaX11IconSize); + const Atom _wt = XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE", False); + // Setting the window to both dialog and normal will produce a decorated floating dialog + // Order is important: DIALOG needs to come before NORMAL + long _wtd = XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE_DIALOG", False); + XChangeProperty(fDisplay, fHostWindow, _wt, XA_ATOM, 32, PropModeReplace, (const uchar*) &_wtd, 1); + long _wtn = XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE_NORMAL", False); + XChangeProperty(fDisplay, fHostWindow, _wt, XA_ATOM, 32, PropModeAppend, (const uchar*) &_wtn, 1); + + if (parentId != 0) setTransientWinId(parentId); }