NO MERGE: render: whole-window transparency when unfocused #676

Open
dnkl wants to merge 1 commits from unfocused-alpha into master
dnkl commented 3 months ago
Owner

This adds a new option, colors.unfocused-alpha. When set to a value < 1.0, the entire window (everything - all bg/fg colors, images etc) are made transparent while the window does not have keyboard focus.

The way this is implemented (trying to keep the patch small), we need to do full-screen repaints while in this mode.

That is, all screen updates result in full-screen repaints when:

  • The window does not have keyboard focus
  • The window just gained keyboard focus (i.e. last frame was rendered with transparency)

As such, one can expect a fairly large performance impact when there’s large amount of output while the window is unfocused.

Focused windows are unaffected, as are unfocused windows when colors.unfocused-alpha == 1.0.

I haven't decided if I want to merge this or not, as it might be too "flashy" for foot; feedback is welcome ;)

edit: thinking about this some more, this is something better done server side. I'll keep this PR open for the time being, and will try to keep it up to date. But I don't think I'll merge it.

note: tested and works in KDE, Sway and River (and all other wlroots based compositors, I would guess), but does not work in GNOME or Weston. Go blame them.

This adds a new option, colors.unfocused-alpha. When set to a value < 1.0, the entire window (*everything* - all bg/fg colors, images etc) are made transparent while the window does not have keyboard focus. The way this is implemented (trying to keep the patch small), we need to do full-screen repaints while in this mode. That is, all screen updates result in full-screen repaints when: * The window does not have keyboard focus * The window *just* gained keyboard focus (i.e. last frame was rendered with transparency) As such, one can expect a fairly large performance impact when there’s large amount of output while the window is unfocused. Focused windows are unaffected, as are unfocused windows when `colors.unfocused-alpha == 1.0`. I haven't decided if I want to merge this or not, as it might be too "flashy" for foot; feedback is welcome ;) **edit**: thinking about this some more, this is something better done server side. I'll keep this PR open for the time being, and will try to keep it up to date. But I don't think I'll merge it. **note**: tested and works in KDE, Sway and River (and all other wlroots based compositors, I would guess), but does **not** work in GNOME or Weston. Go blame them.
dnkl added the
enhancement
label 3 months ago
dnkl force-pushed unfocused-alpha from da288c83c4 to 60dffc0466 3 months ago
dnkl changed title from render: whole-window transparency when unfocused to NO MERGE: render: whole-window transparency when unfocused 3 months ago
dnkl force-pushed unfocused-alpha from 60dffc0466 to e539dd95d3 3 months ago
dnkl force-pushed unfocused-alpha from e539dd95d3 to aa530df0bb 2 months ago
sv commented 2 months ago

Looks useful to signify the focus, but I still see the error in stdout:

 err: config.c:1226: /home/sv/.config/foot/foot.ini:32: [colors]: unfocused-alpha: invalid key

Key in question, replacing - with _ does not make a difference:

unfocused-alpha=0.5

Alpha-blending is good.

Looks useful to signify the focus, but I still see the error in stdout: ``` err: config.c:1226: /home/sv/.config/foot/foot.ini:32: [colors]: unfocused-alpha: invalid key ``` Key in question, replacing `-` with `_` does not make a difference: ``` unfocused-alpha=0.5 ``` Alpha-blending is good.
Poster
Owner

@sv make sure you're actually running this branch. foot --version will tell you which branch it was built from.

@sv make sure you're actually running this branch. `foot --version` will tell you which branch it was built from.
sv commented 2 months ago

@dnkl, well I can see alpha effect working... Built after the regular git checkout && git reset --hard:

foot version 1.8.2-107-gaa530df0
@dnkl, well I can see alpha effect working... Built after the regular `git checkout && git reset --hard`: ``` foot version 1.8.2-107-gaa530df0 ```
Poster
Owner

How did you build? The output you posted doesn't look like the full version output.

How did you build? The output you posted doesn't look like the full version output.
Poster
Owner

Oh well, aa530df0 is the correct commit, so I guess the build is ok.

Are you saying you're still getting the error message, but that it does change the alpha when you focus/unfocus?

Oh well, aa530df0 is the correct commit, so I guess the build is ok. Are you saying you're still getting the error message, but that it **does** change the alpha when you focus/unfocus?
sv commented 2 months ago

Are you saying you're still getting the error message, but that it does change the alpha when you focus/unfocus?

Correct. I should have copy-pasted:

foot version 1.8.2-107-gaa530df0 (Aug 17 2021, branch 'HEAD') +pgo +ime +graphems

Binary attached. Here is how it looks focused:

image

And unfocused, revealing the desktop gadget:

image

> Are you saying you're still getting the error message, but that it does change the alpha when you focus/unfocus? Correct. I should have copy-pasted: ``` foot version 1.8.2-107-gaa530df0 (Aug 17 2021, branch 'HEAD') +pgo +ime +graphems ``` Binary attached. Here is how it looks focused: ![image](/attachments/6c7e3cd2-b565-41c7-a841-d08030d6d5f4) And unfocused, revealing the desktop gadget: ![image](/attachments/d08a06c3-97c3-4358-93a0-890ed5acf36b)
403 KiB
8.1 KiB
11 KiB
Poster
Owner

I don't see how it's possible to both have working alpha, and get the error message. It's just not possible. When foot prints that error message it does not update the unfocused alpha value.

You're seeing this error message from the same foot instance where focus/unfocus alpha is working? Not from a footclient running against a foot server that hasn't been restarted?

Inside a running foot, that did generate the error log, what does echo -e '\e[>q' say?

I don't see how it's possible to both have working alpha, and get the error message. It's just not possible. When foot prints that error message it does not update the unfocused alpha value. You're seeing this error message from the **same** foot instance where focus/unfocus alpha is working? Not from a footclient running against a foot server that hasn't been restarted? Inside a running foot, that **did** generate the error log, what does `echo -e '\e[>q'` say?
dnkl force-pushed unfocused-alpha from aa530df0bb to 3cce76cae0 2 months ago
dnkl force-pushed unfocused-alpha from 3cce76cae0 to 9f8cca0321 2 months ago
dnkl force-pushed unfocused-alpha from 9f8cca0321 to 4cb43f1a38 2 months ago
sv commented 2 months ago

I don't see how it's possible to both have working alpha, and get the error message. It's just not possible. When foot prints that error message it does not update the unfocused alpha value. You're seeing this error message from echo -e '\e[>q'the same foot instance where focus/unfocus alpha is working? Not from a footclient running against a foot server that hasn't been restarted?

There was definitely no server running (I generally don't use it), but at the same time I can't reproduce it now... Unfortunately, I haven't saved that config.

Inside a running foot, that did generate the error log, what does echo -e '\e[>q' say?

The output is messy:

image

> I don't see how it's possible to both have working alpha, and get the error message. It's just not possible. When foot prints that error message it does not update the unfocused alpha value. You're seeing this error message from echo -e '\e[>q'the same foot instance where focus/unfocus alpha is working? Not from a footclient running against a foot server that hasn't been restarted? There was definitely no server running (I generally don't use it), but at the same time I can't reproduce it now... Unfortunately, I haven't saved that config. > Inside a running foot, that did generate the error log, what does echo -e '\e[>q' say? The output is messy: ![image](/attachments/a3500ed3-b22a-414f-9a24-e7e2589f1ad8)
8.8 KiB
Poster
Owner

The output is messy:

That's expected; the response isn't meant to be human-readable, and consists of a full escape sequence. It just happens to be readable enough, that it is the best way of checking the actual version of a running terminal.

> The output is messy: That's expected; the response isn't meant to be human-readable, and consists of a full escape sequence. It just happens to be readable enough, that it is the best way of checking the **actual** version of a running terminal.
dnkl force-pushed unfocused-alpha from 4cb43f1a38 to 24c14ae2d7 2 months ago
dnkl force-pushed unfocused-alpha from 24c14ae2d7 to 05115ada3e 2 months ago
dnkl force-pushed unfocused-alpha from 05115ada3e to ecf7c4c60d 2 months ago
dnkl force-pushed unfocused-alpha from ecf7c4c60d to 6a921b4fdd 2 months ago
dnkl force-pushed unfocused-alpha from 6a921b4fdd to 86b19aaf9e 2 months ago
dnkl force-pushed unfocused-alpha from 86b19aaf9e to f4aa8ecac1 2 months ago
dnkl force-pushed unfocused-alpha from f4aa8ecac1 to 392bf820af 2 months ago
dnkl force-pushed unfocused-alpha from 392bf820af to 060f8e5d63 2 months ago
dnkl force-pushed unfocused-alpha from 060f8e5d63 to eb2a25a1c0 2 months ago
dnkl force-pushed unfocused-alpha from eb2a25a1c0 to 17f3eeb6c5 2 months ago
dnkl force-pushed unfocused-alpha from 17f3eeb6c5 to 4b3e3a5906 1 month ago
dnkl force-pushed unfocused-alpha from 4b3e3a5906 to 5aeddc7e25 1 month ago
dnkl force-pushed unfocused-alpha from 5aeddc7e25 to a53ee907e9 1 month ago
dnkl force-pushed unfocused-alpha from a53ee907e9 to 67d9f64ed1 1 month ago
dnkl force-pushed unfocused-alpha from 67d9f64ed1 to 88015a5443 1 month ago
dnkl force-pushed unfocused-alpha from 88015a5443 to 78f6a4d5e6 4 weeks ago
dnkl force-pushed unfocused-alpha from 78f6a4d5e6 to 5bbc99288a 4 weeks ago
dnkl force-pushed unfocused-alpha from 5bbc99288a to 8284deca74 4 weeks ago
dnkl force-pushed unfocused-alpha from 8284deca74 to b99df7256d 4 weeks ago
dnkl force-pushed unfocused-alpha from b99df7256d to f1fa9275fc 4 weeks ago
dnkl force-pushed unfocused-alpha from f1fa9275fc to 0023d0b92f 4 weeks ago
dnkl force-pushed unfocused-alpha from 0023d0b92f to 12b6444947 3 weeks ago
dnkl force-pushed unfocused-alpha from 12b6444947 to 18a15eae69 3 weeks ago
dnkl force-pushed unfocused-alpha from 18a15eae69 to ab510c0a3c 1 week ago
dnkl force-pushed unfocused-alpha from ab510c0a3c to 9013a810f1 6 days ago
All checks were successful
continuous-integration/woodpecker the build was successful
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
Loading…
There is no content yet.