Browse Source

Cleanup for _NET_WM_WINDOW_TYPE_DIALOG, add it to DGL too

tags/v2.1-alpha1-winvst
falkTX 7 years ago
parent
commit
a21e740612
2 changed files with 19 additions and 7 deletions
  1. +13
    -2
      source/modules/dgl/src/Window.cpp
  2. +6
    -5
      source/utils/CarlaPluginUI.cpp

+ 13
- 2
source/modules/dgl/src/Window.cpp View File

@@ -241,9 +241,20 @@ struct Window::PrivateData {


if (! fUsingEmbed) if (! fUsingEmbed)
{ {
pid_t pid = getpid();
Atom _nwp = XInternAtom(xDisplay, "_NET_WM_PID", True);
const pid_t pid = getpid();
const Atom _nwp = XInternAtom(xDisplay, "_NET_WM_PID", False);
XChangeProperty(xDisplay, xWindow, _nwp, XA_CARDINAL, 32, PropModeReplace, (const uchar*)&pid, 1); XChangeProperty(xDisplay, xWindow, _nwp, XA_CARDINAL, 32, PropModeReplace, (const uchar*)&pid, 1);

const Atom _wt = XInternAtom(xDisplay, "_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
const Atom _wts[2] = {
XInternAtom(xDisplay, "_NET_WM_WINDOW_TYPE_DIALOG", False),
XInternAtom(xDisplay, "_NET_WM_WINDOW_TYPE_NORMAL", False)
};
XChangeProperty(xDisplay, xWindow, _wt, XA_ATOM, 32, PropModeReplace, (const uchar*)&_wts, 2);

} }
#endif #endif
puglEnterContext(fView); puglEnterContext(fView);


+ 6
- 5
source/utils/CarlaPluginUI.cpp View File

@@ -104,13 +104,14 @@ public:
XChangeProperty(fDisplay, fHostWindow, _nwi, XA_CARDINAL, 32, PropModeReplace, (const uchar*)sCarlaX11Icon, sCarlaX11IconSize); XChangeProperty(fDisplay, fHostWindow, _nwi, XA_CARDINAL, 32, PropModeReplace, (const uchar*)sCarlaX11Icon, sCarlaX11IconSize);


const Atom _wt = XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE", False); const Atom _wt = XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE", False);

// Setting the window to both dialog and normal will produce a decorated floating dialog // Setting the window to both dialog and normal will produce a decorated floating dialog
// Order is important: DIALOG needs to come before NORMAL // 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);
const Atom _wts[2] = {
XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE_DIALOG", False),
XInternAtom(fDisplay, "_NET_WM_WINDOW_TYPE_NORMAL", False)
};
XChangeProperty(fDisplay, fHostWindow, _wt, XA_ATOM, 32, PropModeReplace, (const uchar*)&_wts, 2);


if (parentId != 0) if (parentId != 0)
setTransientWinId(parentId); setTransientWinId(parentId);


Loading…
Cancel
Save