mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-10 08:20:59 -04:00
main: SIGUSR1 selects the first color theme, SIGUSR2 the second
Before this patch, SIGUSR1 toggled between [colors] and [colors2]. Now, SIGUSR1 changes to [colors], regardless of what the current color theme is, and SIGUSR2 changes to [colors2]. Closes #2144
This commit is contained in:
parent
cc290fa9b0
commit
01387f9593
2 changed files with 21 additions and 5 deletions
|
|
@ -71,8 +71,12 @@
|
||||||
* URL labels are now assigned in reverse order, from bottom to
|
* URL labels are now assigned in reverse order, from bottom to
|
||||||
top. This ensures the **last** URL (which is often the one you are
|
top. This ensures the **last** URL (which is often the one you are
|
||||||
interested in) is always assigned the same key ([#2140][2140]).
|
interested in) is always assigned the same key ([#2140][2140]).
|
||||||
|
* Sending `SIGUSR1` no longer **toggles** between `[colors]` and
|
||||||
|
`[colors2]`, but explicitly changes to `[colors]`. `SIGUSR2` changes
|
||||||
|
to `[colors2]` ([#2144][2144]).
|
||||||
|
|
||||||
[2140]: https://codeberg.org/dnkl/foot/issues/2140
|
[2140]: https://codeberg.org/dnkl/foot/issues/2140
|
||||||
|
[2144]: https://codeberg.org/dnkl/foot/issues/2144
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
22
main.c
22
main.c
|
|
@ -46,13 +46,22 @@ fdm_sigint(struct fdm *fdm, int signo, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
fdm_sigusr1(struct fdm *fdm, int signo, void *data)
|
fdm_sigusr(struct fdm *fdm, int signo, void *data)
|
||||||
{
|
{
|
||||||
struct wayland *wayl = data;
|
struct wayland *wayl = data;
|
||||||
|
|
||||||
tll_foreach(wayl->terms, it) {
|
xassert(signo == SIGUSR1 || signo == SIGUSR2);
|
||||||
struct terminal *term = it->item;
|
|
||||||
term_theme_toggle(term);
|
if (signo == SIGUSR1) {
|
||||||
|
tll_foreach(wayl->terms, it) {
|
||||||
|
struct terminal *term = it->item;
|
||||||
|
term_theme_switch_to_1(term);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tll_foreach(wayl->terms, it) {
|
||||||
|
struct terminal *term = it->item;
|
||||||
|
term_theme_switch_to_2(term);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -621,8 +630,11 @@ main(int argc, char *const *argv)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fdm_signal_add(fdm, SIGUSR1, &fdm_sigusr1, wayl))
|
if (!fdm_signal_add(fdm, SIGUSR1, &fdm_sigusr, wayl) ||
|
||||||
|
!fdm_signal_add(fdm, SIGUSR2, &fdm_sigusr, wayl))
|
||||||
|
{
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
struct sigaction sig_ign = {.sa_handler = SIG_IGN};
|
struct sigaction sig_ign = {.sa_handler = SIG_IGN};
|
||||||
sigemptyset(&sig_ign.sa_mask);
|
sigemptyset(&sig_ign.sa_mask);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue