[wiki] [sites] [st][patch][alpha-focus-highlight]: update patch || Julius Huelsmann

From: <git_AT_suckless.org>
Date: Sun, 07 Jun 2020 19:22:19 +0200

commit 4d95679ac5f897346955d22492d239bc31794172
Author: Julius Huelsmann <juliusHuelsmann_AT_gmail.com>
Date: Sun Jun 7 19:20:46 2020 +0200

    [st][patch][alpha-focus-highlight]: update patch
    
    Ship patch-fix, unify the markdown format in index.md.

diff --git a/st.suckless.org/patches/alpha_focus_highlight/index.md b/st.suckless.org/patches/alpha_focus_highlight/index.md
index 6ad5af65..d251dc7d 100644
--- a/st.suckless.org/patches/alpha_focus_highlight/index.md
+++ b/st.suckless.org/patches/alpha_focus_highlight/index.md
_AT_@ -1,5 +1,6 @@
-Patch for suckless' simple terminal (`st`), which allows the user to specify two distinct opacity
-values / background colors; one for the focused- and one for unfocused windows' background.
+Alpha Focus Highlight
+=====================
+Patch for suckless' simple terminal (`st`), which allows the user to specify two distinct opacity values / background colors; one for the focused- and one for unfocused windows' background.
 This enables the user to spot the focused window at a glance.
 The patch is based on the [alpha patch](https://st.suckless.org/patches/alpha/); i.e. is to be
 applied after applying the alpha patch.
_AT__AT_ -8,11 +9,13 @@ The patch is released [on this release page](https://github.com/juliusHuelsmann/
 [on the suckless page](https://st.suckless.org/patches/alpha_focus_highlight/).
 Please [leave a star](https://github.com/juliusHuelsmann/st-focus).
 
-## Contributions & Bug Reports
+Contributions & Bug Reports
+---------------------------
 * [Report / Solve Patching issues](https://github.com/juliusHuelsmann/st) with a new version of `st`
 * [Contributions and Bug reports](https://github.com/juliusHuelsmann/st-focus)
 
-## Building, customizing and installing the patch
+Building, customizing and installing the patch
+----------------------------------------------
 **1. Optional Dependencies**
 The opacity functionality of this patch requires an `X composite manager` (e.g. `picom`, `compton`,
 `xcompmgr`), which can for instance be installed via `sudo pacman -S picom` on Arch Linux and
_AT_@ -29,7 +32,8 @@ pre-existing custom `config.h` file. The following four variables can be adapted
 
 **4. Build & install** `make; sudo make install`
 
-## Download
+Download
+--------
 If you want to try out the current version of the patch before patching your own build,
 check out [this repository](https://github.com/juliusHuelsmann/st), which contains a
 merged version of this patch with a reasonable configuration.
_AT_@ -45,8 +49,8 @@ make sure that you apply the latest version of the alpha patch.
 Note that patch errors can occur when the code in the st repo is updated.
 Please report an Issue or contribute a merged patch in that case.
 
-### Patch: alpha + focus
-
+Patch: alpha + focus
+--------------------
 
 **st-0.8.3**
 - [Version 1 (attached)](st-focus-20200530-43a395a.diff)
_AT_@ -54,14 +58,16 @@ Please report an Issue or contribute a merged patch in that case.
 
 ---
 
-### Patch: focus
+Patch: focus
+------------
 
 **st-0.8.3**
 - [Version 1 (attached)](st-focus-20200530-patch_alpha.diff)
 - Most recent release: [st-focus-20200530-patch_alpha.diff (Github)](https://github.com/juliusHuelsmann/st/releases/download/v2/st-focus-20200530-patch_alpha.diff)
 
 
-## MISC
+MISC
+----
 **Note:** The benefit of the `alpha` patch and the `Alpha Focus Highlight` patch are the ability to
 restrict the transparency only to the background color currently in use, hence keeping the font in
 the foreground solid and readable.
_AT_@ -80,7 +86,8 @@ other applications, but keep the benefits of the st alpha patches, have a look a
 file](https://github.com/juliusHuelsmann/Config/blob/master/.config/picom/picom.conf),
 in which opacity management configured to be performed by `st`.
 
-# Authors / Contributors
+Authors / Contributors
+----------------------
 * Julius Hülsmann - <juliusHuelsmann [at] gmail [dot] com>
 * [glpub](https://github.com/glpub): Fix: erroneous color reset
 * [Milos Stojanovic](https://github.com/M4444): Code Formatting
diff --git a/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-43a395a.diff b/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-43a395a.diff
index 5d2c23f9..d6f56895 100644
--- a/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-43a395a.diff
+++ b/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-43a395a.diff
_AT_@ -1,14 +1,14 @@
-From f4e9ea055675807817ba3648ee7f2de4cc1d0eca Mon Sep 17 00:00:00 2001
+From dfbb24bf5e02c9e365d4c0fe46aa8cbe27aed92f Mon Sep 17 00:00:00 2001
 From: Julius Huelsmann <juliusHuelsmann_AT_gmail.com>
-Date: Sat, 30 May 2020 12:18:59 +0200
+Date: Sat, 6 Jun 2020 13:12:28 +0200
 Subject: [PATCH] patch: focus
 
 ---
- config.def.h | 5 +++++
+ config.def.h | 5 ++++
  config.mk | 2 +-
  st.h | 1 +
- x.c | 62 +++++++++++++++++++++++++++++++++++++---------------
- 4 files changed, 51 insertions(+), 19 deletions(-)
+ x.c | 72 +++++++++++++++++++++++++++++++++++++++-------------
+ 4 files changed, 61 insertions(+), 19 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index 0895a1f..577d1f1 100644
_AT_@ -63,7 +63,7 @@ index d978458..b5f1cf6 100644
  extern unsigned int defaultbg;
 +extern float alpha, alphaUnfocused;
 diff --git a/x.c b/x.c
-index e5f1737..2de16cb 100644
+index e5f1737..a0c3223 100644
 --- a/x.c
 +++ b/x.c
 _AT_@ -105,6 +105,7 @@ typedef struct {
_AT_@ -204,7 +204,30 @@ index e5f1737..2de16cb 100644
          XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
          XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
  
-_AT_@ -1994,6 +2016,9 @@ main(int argc, char *argv[])
+_AT_@ -1730,12 +1752,22 @@ focus(XEvent *ev)
+ xseturgency(0);
+ if (IS_SET(MODE_FOCUS))
+ ttywrite("", 3, 0);
++ if (!focused) {
++ focused = 1;
++ xloadcols();
++ redraw();
++ }
+ } else {
+ if (xw.ime.xic)
+ XUnsetICFocus(xw.ime.xic);
+ win.mode &= ~MODE_FOCUSED;
+ if (IS_SET(MODE_FOCUS))
+ ttywrite("", 3, 0);
++ if (focused) {
++ focused = 0;
++ xloadcols();
++ redraw();
++ }
+ }
+ }
+
+_AT_@ -1994,6 +2026,9 @@ main(int argc, char *argv[])
          case 'a':
                  allowaltscreen = 0;
                  break;
_AT_@ -214,7 +237,7 @@ index e5f1737..2de16cb 100644
          case 'c':
                  opt_class = EARGF(usage());
                  break;
-_AT_@ -2045,6 +2070,7 @@ run:
+_AT_@ -2045,6 +2080,7 @@ run:
          XSetLocaleModifiers("");
          cols = MAX(cols, 1);
          rows = MAX(rows, 1);
_AT_@ -223,5 +246,5 @@ index e5f1737..2de16cb 100644
          xinit(cols, rows);
          xsetenv();
 --
-2.26.2
+2.27.0
 
diff --git a/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-patch_alpha.diff b/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-patch_alpha.diff
index 4796b52a..0bb91171 100644
--- a/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-patch_alpha.diff
+++ b/st.suckless.org/patches/alpha_focus_highlight/st-focus-20200530-patch_alpha.diff
_AT_@ -1,13 +1,13 @@
-From c6c814329bdfc419f50a27b538a1b983ea52a1d3 Mon Sep 17 00:00:00 2001
+From c2c9e874fa069bc24df0982505788ae14c3024f3 Mon Sep 17 00:00:00 2001
 From: Julius Huelsmann <juliusHuelsmann_AT_gmail.com>
-Date: Sat, 30 May 2020 12:18:59 +0200
+Date: Sat, 6 Jun 2020 13:12:28 +0200
 Subject: [PATCH] patch: focus
 
 ---
  config.def.h | 5 +++--
  st.h | 2 +-
- x.c | 34 ++++++++++++++++++++--------------
- 3 files changed, 24 insertions(+), 17 deletions(-)
+ x.c | 44 ++++++++++++++++++++++++++++++--------------
+ 3 files changed, 34 insertions(+), 17 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index b94b23c..577d1f1 100644
_AT_@ -45,7 +45,7 @@ index 2c656af..b5f1cf6 100644
 -extern float alpha;
 +extern float alpha, alphaUnfocused;
 diff --git a/x.c b/x.c
-index 50da23c..2de16cb 100644
+index 50da23c..a0c3223 100644
 --- a/x.c
 +++ b/x.c
 _AT_@ -254,6 +254,8 @@ static char *opt_line = NULL;
_AT_@ -110,7 +110,30 @@ index 50da23c..2de16cb 100644
          loaded = 1;
  }
  
-_AT_@ -2065,6 +2070,7 @@ run:
+_AT_@ -1747,12 +1752,22 @@ focus(XEvent *ev)
+ xseturgency(0);
+ if (IS_SET(MODE_FOCUS))
+ ttywrite("", 3, 0);
++ if (!focused) {
++ focused = 1;
++ xloadcols();
++ redraw();
++ }
+ } else {
+ if (xw.ime.xic)
+ XUnsetICFocus(xw.ime.xic);
+ win.mode &= ~MODE_FOCUSED;
+ if (IS_SET(MODE_FOCUS))
+ ttywrite("", 3, 0);
++ if (focused) {
++ focused = 0;
++ xloadcols();
++ redraw();
++ }
+ }
+ }
+
+_AT_@ -2065,6 +2080,7 @@ run:
          XSetLocaleModifiers("");
          cols = MAX(cols, 1);
          rows = MAX(rows, 1);
_AT_@ -119,5 +142,5 @@ index 50da23c..2de16cb 100644
          xinit(cols, rows);
          xsetenv();
 --
-2.26.2
+2.27.0
 
Received on Sun Jun 07 2020 - 19:22:19 CEST

This archive was generated by hypermail 2.3.0 : Sun Jun 07 2020 - 19:24:43 CEST