From 3947ceb4319bb6ccf3f1d812c1fb544194c1a817 Mon Sep 17 00:00:00 2001 From: Bakkeby Date: Wed, 24 Aug 2022 11:04:49 +0200 Subject: [PATCH] Adding the no window decorations patch --- README.md | 5 +++++ patches.def.h | 8 ++++++++ x.c | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/README.md b/README.md index e53de1d..9da4bd2 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the ### Changelog: +2022-08-24 - Added the no window decorations patch + 2022-04-11 - Added the background image reload patch 2022-03-10 - Added the background image patch @@ -203,6 +205,9 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the - allows you to spawn a new st terminal using Ctrl-Shift-Return - it will have the same CWD (current working directory) as the original st instance + - no-window-decorations + - makes st show without window decorations if the WM supports it + - [open-copied-url](https://st.suckless.org/patches/open_copied_url/) - open contents of the clipboard in a user-defined browser diff --git a/patches.def.h b/patches.def.h index 4345a4a..3f14745 100644 --- a/patches.def.h +++ b/patches.def.h @@ -237,6 +237,14 @@ */ #define NEWTERM_PATCH 0 +/* This patch will set the _MOTIF_WM_HINTS property for the st window which, if the window manager + * respects it, will show the st window without window decorations. + * + * In dwm, if the decoration hints patch is applied, then the st window will start out without a + * border. In GNOME and KDE the window should start without a window title. + */ +#define NO_WINDOW_DECORATIONS_PATCH 0 + /* Open contents of the clipboard in a user-defined browser. * https://st.suckless.org/patches/open_copied_url/ */ diff --git a/x.c b/x.c index 300e66d..2de3a1f 100644 --- a/x.c +++ b/x.c @@ -1580,6 +1580,13 @@ xinit(int cols, int rows) PropModeReplace, (uchar *)&icon, LEN(icon)); #endif //NETWMICON_PATCH + #if NO_WINDOW_DECORATIONS_PATCH + Atom motifwmhints = XInternAtom(xw.dpy, "_MOTIF_WM_HINTS", False); + unsigned int data[] = { 0x2, 0x0, 0x0, 0x0, 0x0 }; + XChangeProperty(xw.dpy, xw.win, motifwmhints, motifwmhints, 16, + PropModeReplace, (unsigned char *)data, 5); + #endif // NO_WINDOW_DECORATIONS_PATCH + xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False); XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32, PropModeReplace, (uchar *)&thispid, 1);