Browse Source

Allow to set X11 window icon for standalones

Signed-off-by: falkTX <falktx@falktx.com>
pull/443/head
falkTX 1 year ago
parent
commit
b9e027eeae
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 21 additions and 0 deletions
  1. +8
    -0
      Makefile.base.mk
  2. +13
    -0
      dgl/src/pugl.cpp

+ 8
- 0
Makefile.base.mk View File

@@ -601,6 +601,14 @@ ifneq ($(WINDOWS_ICON_ID),)
BUILD_CXX_FLAGS += -DDGL_WINDOWS_ICON_ID=$(WINDOWS_ICON_ID)
endif

ifneq ($(X11_WINDOW_ICON_NAME),)
BUILD_CXX_FLAGS += -DDGL_X11_WINDOW_ICON_NAME=$(X11_WINDOW_ICON_NAME)
endif

ifneq ($(X11_WINDOW_ICON_SIZE),)
BUILD_CXX_FLAGS += -DDGL_X11_WINDOW_ICON_SIZE=$(X11_WINDOW_ICON_SIZE)
endif

ifeq ($(USE_GLES2),true)
BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 -DDGL_USE_GLES -DDGL_USE_GLES2
endif


+ 13
- 0
dgl/src/pugl.cpp View File

@@ -120,6 +120,10 @@ END_NAMESPACE_DGL
# include "../../distrho/extra/FileBrowserDialogImpl.cpp"
#endif

#if defined(DGL_USING_X11) && defined(DGL_X11_WINDOW_ICON_NAME)
extern const ulong* DGL_X11_WINDOW_ICON_NAME;
#endif

#ifndef DISTRHO_OS_MAC
START_NAMESPACE_DGL
#endif
@@ -605,6 +609,15 @@ void puglX11SetWindowTypeAndPID(const PuglView* const view, const bool isStandal
const Atom _nwp = XInternAtom(display, "_NET_WM_PID", False);
XChangeProperty(display, impl->win, _nwp, XA_CARDINAL, 32, PropModeReplace, (const uchar*)&pid, 1);

#if defined(DGL_X11_WINDOW_ICON_NAME) && defined(DGL_X11_WINDOW_ICON_SIZE)
if (isStandalone)
{
const Atom _nwi = XInternAtom(display, "_NET_WM_ICON", False);
XChangeProperty(display, impl->win, _nwi, XA_CARDINAL, 32, PropModeReplace,
(const uchar*)DGL_X11_WINDOW_ICON_NAME, DGL_X11_WINDOW_ICON_SIZE);
}
#endif

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

Atom _wts[2];


Loading…
Cancel
Save