[wiki] [sites] [dwm][patch][fullscreen] added fullscreen mode patch || cdarkly

From: <git_AT_suckless.org>
Date: Sat, 15 Jan 2022 21:28:48 +0100

commit 073a6fad941f863a850d196aad9204db0811b22a
Author: cdarkly <cdarkly_AT_protonmail.com>
Date: Sat Jan 15 15:25:42 2022 -0500

    [dwm][patch][fullscreen] added fullscreen mode patch

diff --git a/st.suckless.org/patches/fullscreen/index.md b/st.suckless.org/patches/fullscreen/index.md
new file mode 100644
index 00000000..67c135cb
--- /dev/null
+++ b/st.suckless.org/patches/fullscreen/index.md
_AT_@ -0,0 +1,21 @@
+fullscreen
+==========
+
+Description
+-----------
+Add the ability to toggle st into fullscreen mode. This is only useful if running st outside of a tiling window manager. With KDE or Gnome, the only option given is to maximize the window, which can still leave many graphical elements visible. For a pure terminal exeprience, fullscreen is the way to go.
+
+Two key bindings are defined: F11 which is typical with other applications and ALT+ENTER which matches default xterm behavior.
+
+Notes
+-----
+This patch is inspired by the go_fullscreen() patch included in this build: [https://github.com/mcaimi/st](https://github.com/mcaimi/st)
+However, by using the NET_WM_STATE_TOGGLE flag, as opposed to ADD and REMOVE, this implementation is simpler.
+
+Download
+--------
+* [st-fullscreen-0.8.5.diff](st-fullscreen-0.8.5.diff)
+
+Authors
+-------
+* cdarkly - <cdarkly_AT_protonmail.com>
diff --git a/st.suckless.org/patches/fullscreen/st-fullscreen-0.8.5.diff b/st.suckless.org/patches/fullscreen/st-fullscreen-0.8.5.diff
new file mode 100644
index 00000000..3e2868d1
--- /dev/null
+++ b/st.suckless.org/patches/fullscreen/st-fullscreen-0.8.5.diff
_AT_@ -0,0 +1,69 @@
+diff -r -u a/config.def.h b/config.def.h
+--- a/config.def.h 2022-01-07 06:41:35.000000000 -0500
++++ b/config.def.h 2022-01-15 13:32:01.644320198 -0500
+_AT_@ -201,6 +201,8 @@
+ { TERMMOD, XK_Y, selpaste, {.i = 0} },
+ { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
++ { XK_NO_MOD, XK_F11, fullscreen, {.i = 0} },
++ { MODKEY, XK_Return, fullscreen, {.i = 0} },
+ };
+
+ /*
+diff -r -u a/st.h b/st.h
+--- a/st.h 2022-01-07 06:41:35.000000000 -0500
++++ b/st.h 2022-01-15 13:32:40.084320514 -0500
+_AT_@ -81,6 +81,7 @@
+ void redraw(void);
+ void draw(void);
+
++void fullscreen(const Arg *);
+ void printscreen(const Arg *);
+ void printsel(const Arg *);
+ void sendbreak(const Arg *);
+diff -r -u a/x.c b/x.c
+--- a/x.c 2022-01-07 06:41:35.000000000 -0500
++++ b/x.c 2022-01-15 13:50:28.164329295 -0500
+_AT_@ -94,6 +94,7 @@
+ Drawable buf;
+ GlyphFontSpec *specbuf; /* font spec buffer used for rendering */
+ Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid;
++ Atom netwmstate, netwmfullscreen;
+ struct {
+ XIM xim;
+ XIC xic;
+_AT_@ -744,6 +745,24 @@
+ xw.specbuf = xrealloc(xw.specbuf, col * sizeof(GlyphFontSpec));
+ }
+
++void
++fullscreen(const Arg *arg)
++{
++ XEvent ev;
++
++ memset(&ev, 0, sizeof(ev));
++
++ ev.xclient.type = ClientMessage;
++ ev.xclient.message_type = xw.netwmstate;
++ ev.xclient.display = xw.dpy;
++ ev.xclient.window = xw.win;
++ ev.xclient.format = 32;
++ ev.xclient.data.l[0] = 2; /* _NET_WM_STATE_TOGGLE */
++ ev.xclient.data.l[1] = xw.netwmfullscreen;
++
++ XSendEvent(xw.dpy, DefaultRootWindow(xw.dpy), False, SubstructureNotifyMask|SubstructureRedirectMask, &ev);
++}
++
+ ushort
+ sixd_to_16bit(int x)
+ {
+_AT_@ -1208,6 +1227,9 @@
+ XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32,
+ PropModeReplace, (uchar *)&thispid, 1);
+
++ xw.netwmstate = XInternAtom(xw.dpy, "_NET_WM_STATE", False);
++ xw.netwmfullscreen = XInternAtom(xw.dpy, "_NET_WM_STATE_FULLSCREEN", False);
++
+ win.mode = MODE_NUMLOCK;
+ resettitle();
+ xhints();
Received on Sat Jan 15 2022 - 21:28:48 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 15 2022 - 21:36:44 CET