aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2023-05-22 21:53:03 +0000
committerpsykose <alice@ayaya.dev>2023-05-22 23:53:03 +0200
commit1c9bd49254e9d45fefea4dd0d8402ada2a55dc89 (patch)
tree07b9640c03065d1d8792df60ca3a704caca1be65
parent2814e40299414d2fa97f45f666fb0addd9547208 (diff)
community/foot: backport other startupwmclass patch
-rw-r--r--community/foot/APKBUILD4
-rw-r--r--community/foot/startup-wm-class-2.patch178
2 files changed, 181 insertions, 1 deletions
diff --git a/community/foot/APKBUILD b/community/foot/APKBUILD
index 5a5da25ad2f..5d6b33ed758 100644
--- a/community/foot/APKBUILD
+++ b/community/foot/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Alex McGrath <amk@amk.ie>
pkgname=foot
pkgver=1.14.0
-pkgrel=5
+pkgrel=6
pkgdesc="Fast, lightweight and minimalistic Wayland terminal emulator"
url="https://codeberg.org/dnkl/foot"
license="MIT"
@@ -38,6 +38,7 @@ source="
0001-quirks-sway-does-not-damage-surface-beneath-sub-surface-when-unmapped.patch::https://codeberg.org/dnkl/foot/commit/3b41379be43a21a00a776d0d136c5d1b2fe4007e.diff
0002-regress-sway-damage.patch::https://codeberg.org/dnkl/foot/commit/738deb236853ebf1e19843e536b9bda053b69bf7.diff
startup-wm-class.patch
+ startup-wm-class-2.patch
"
options="!check" # ran during profiling
builddir="$srcdir/foot"
@@ -84,4 +85,5 @@ sha512sums="
a192faf641fcf9e76e1783497f40d1bf0dc11e45e02fd06816254b06df48742968b932ea78f1902dc5e0767317ed9254657f8c32934a1180c58e6901a6bfa08c 0001-quirks-sway-does-not-damage-surface-beneath-sub-surface-when-unmapped.patch
630b69514d7b36cf8c6c949a397475a75e34291bf81985c072b0de164fc655d1b3e32aa565781c0dcfa35eeadd5aca25fce260d1f1edc9c8a35982431604c7a6 0002-regress-sway-damage.patch
01631f6ed5e03182739f9da54500214bdb0dac6cf4a6d5398a6d35b13ab024f021c53762e68c2a56c61485a7bc4dabb6707bd775ff7f076d4ea714f3f2da12fd startup-wm-class.patch
+ebde5d5b1be667b415c75d2367bd995730ba3fa9fb985cc734e544f0799ff919875b4ae80284e7a6f4e219f5330ccbb676b20f3908104b433b2846dfaedb2267 startup-wm-class-2.patch
"
diff --git a/community/foot/startup-wm-class-2.patch b/community/foot/startup-wm-class-2.patch
new file mode 100644
index 00000000000..7dc1b5695c5
--- /dev/null
+++ b/community/foot/startup-wm-class-2.patch
@@ -0,0 +1,178 @@
+Patch-Source: https://codeberg.org/dnkl/foot/commit/134b54dfe0e4d142ac4b6b7fe25e84485ba63387
+--
+From 134b54dfe0e4d142ac4b6b7fe25e84485ba63387 Mon Sep 17 00:00:00 2001
+From: jdevdevdev <jdevdevdev@noreply.codeberg.org>
+Date: Tue, 2 May 2023 01:53:01 +1000
+Subject: [PATCH] .desktop: remove StartupWMClass from server, use distinct
+ StartupWMClass for foot and footclient
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+For this to work, the default app-id of footclient has been changed
+from ‘foot’ to ‘footclient’.
+
+By using distinct StartupWMClasses, the compositor can connect a
+running foot/footclient instance to the correct .desktop-file. This
+ensures the correct icon is being used in e.g. docks, and that actions
+like “open another window” works correctly.
+
+Note that the user can override the app-id, either by setting app-id
+in foot.ini, or with the -a,--app-id command line option.
+
+Closes #1355
+---
+ CHANGELOG.md | 5 ++++-
+ config.c | 7 ++++---
+ config.h | 3 ++-
+ doc/foot.1.scd | 2 +-
+ doc/foot.ini.5.scd | 6 ++++--
+ doc/footclient.1.scd | 2 +-
+ foot.ini | 2 +-
+ main.c | 2 +-
+ org.codeberg.dnkl.foot-server.desktop | 1 -
+ org.codeberg.dnkl.footclient.desktop | 2 +-
+ 10 files changed, 19 insertions(+), 13 deletions(-)
+
+ ### Security
+diff --git a/config.c b/config.c
+index c3ab61e2..1d9f200b 100644
+--- a/config.c
++++ b/config.c
+@@ -2905,7 +2905,8 @@ config_font_list_clone(struct config_font_list *dst,
+ bool
+ config_load(struct config *conf, const char *conf_path,
+ user_notifications_t *initial_user_notifications,
+- config_override_t *overrides, bool errors_are_fatal)
++ config_override_t *overrides, bool errors_are_fatal,
++ bool as_server)
+ {
+ bool ret = false;
+ enum fcft_capabilities fcft_caps = fcft_capabilities();
+@@ -2914,7 +2915,7 @@ config_load(struct config *conf, const char *conf_path,
+ .term = xstrdup(FOOT_DEFAULT_TERM),
+ .shell = get_shell(),
+ .title = xstrdup("foot"),
+- .app_id = xstrdup("foot"),
++ .app_id = (as_server ? xstrdup("footclient") : xstrdup("foot")),
+ .word_delimiters = xc32dup(U",│`|:\"'()[]{}<>"),
+ .size = {
+ .type = CONF_SIZE_PX,
+@@ -3348,7 +3349,7 @@ UNITTEST
+ user_notifications_t nots = tll_init();
+ config_override_t overrides = tll_init();
+
+- bool ret = config_load(&original, "/dev/null", &nots, &overrides, false);
++ bool ret = config_load(&original, "/dev/null", &nots, &overrides, false, false);
+ xassert(ret);
+
+ struct config *clone = config_clone(&original);
+diff --git a/config.h b/config.h
+index 34517019..ce1ee536 100644
+--- a/config.h
++++ b/config.h
+@@ -355,7 +355,8 @@ bool config_override_apply(struct config *conf, config_override_t *overrides,
+ bool config_load(
+ struct config *conf, const char *path,
+ user_notifications_t *initial_user_notifications,
+- config_override_t *overrides, bool errors_are_fatal);
++ config_override_t *overrides, bool errors_are_fatal,
++ bool as_server);
+ void config_free(struct config *conf);
+ struct config *config_clone(const struct config *old);
+
+diff --git a/doc/foot.1.scd b/doc/foot.1.scd
+index 6f63d4c8..60420bef 100644
+--- a/doc/foot.1.scd
++++ b/doc/foot.1.scd
+@@ -65,7 +65,7 @@ the foot command line
+
+ *-a*,*--app-id*=_ID_
+ Value to set the *app-id* property on the Wayland window
+- to. Default: _foot_.
++ to. Default: _foot_ (normal mode), or _footclient_ (server mode).
+
+ *-m*,*--maximized*
+ Start in maximized mode. If both *--maximized* and *--fullscreen*
+diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
+index 6a820892..32c493be 100644
+--- a/doc/foot.ini.5.scd
++++ b/doc/foot.ini.5.scd
+@@ -289,7 +289,8 @@ empty string to be set, but it must be quoted: *KEY=""*)
+ *app-id*
+ Value to set the *app-id* property on the Wayland window to. The
+ compositor can use this value to e.g. group multiple windows, or
+- apply window management rules. Default: _foot_.
++ apply window management rules. Default: _foot_ (normal mode), or
++ _footclient_ (server mode).
+
+ *bold-text-in-bright*
+ Semi-boolean. When enabled, bold text is rendered in a brighter
+@@ -314,7 +315,8 @@ empty string to be set, but it must be quoted: *KEY=""*)
+ and _body_ (message content).
+
+ _${app-id}_ is replaced with the value of the command line option
+- _--app-id_, and defaults to *foot*.
++ _--app-id_, and defaults to *foot* (normal mode), or
++ *footclient* (server mode).
+
+ _${window-title}_ is replaced with the current window title.
+
+diff --git a/doc/footclient.1.scd b/doc/footclient.1.scd
+index 63235134..1464700c 100644
+--- a/doc/footclient.1.scd
++++ b/doc/footclient.1.scd
+@@ -31,7 +31,7 @@ terminal has terminated.
+
+ *-a*,*--app-id*=_ID_
+ Value to set the *app-id* property on the Wayland window
+- to. Default: _foot_.
++ to. Default: _foot_ (normal mode), or _footclient_ (server mode).
+
+ *-w*,*--window-size-pixels*=_WIDTHxHEIGHT_
+ Set initial window width and height, in pixels. Default: _700x500_.
+diff --git a/foot.ini b/foot.ini
+index 4b2218a4..fcaef4a9 100644
+--- a/foot.ini
++++ b/foot.ini
+@@ -4,7 +4,7 @@
+ # term=foot (or xterm-256color if built with -Dterminfo=disabled)
+ # login-shell=no
+
+-# app-id=foot
++# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
+ # title=foot
+ # locked-title=no
+
+diff --git a/main.c b/main.c
+index 4af200fd..3f9846f3 100644
+--- a/main.c
++++ b/main.c
+@@ -487,7 +487,7 @@ main(int argc, char *const *argv)
+
+ struct config conf = {NULL};
+ bool conf_successful = config_load(
+- &conf, conf_path, &user_notifications, &overrides, check_config);
++ &conf, conf_path, &user_notifications, &overrides, check_config, as_server);
+
+ tll_free(overrides);
+ if (!conf_successful) {
+diff --git a/org.codeberg.dnkl.foot-server.desktop b/org.codeberg.dnkl.foot-server.desktop
+index a40117c7..6e8891c0 100644
+--- a/org.codeberg.dnkl.foot-server.desktop
++++ b/org.codeberg.dnkl.foot-server.desktop
+@@ -9,4 +9,3 @@ Keywords=shell;prompt;command;commandline;
+ Name=Foot Server
+ GenericName=Terminal
+ Comment=A wayland native terminal emulator (server)
+-StartupWMClass=foot
+diff --git a/org.codeberg.dnkl.footclient.desktop b/org.codeberg.dnkl.footclient.desktop
+index dc8bc5dc..b65790b4 100644
+--- a/org.codeberg.dnkl.footclient.desktop
++++ b/org.codeberg.dnkl.footclient.desktop
+@@ -9,4 +9,4 @@ Keywords=shell;prompt;command;commandline;
+ Name=Foot Client
+ GenericName=Terminal
+ Comment=A wayland native terminal emulator (client)
+-StartupWMClass=foot
++StartupWMClass=footclient