-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make visual bell flash much more gentle #2937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Right now visual bell makes background flash sharply with bright white (when configured with darkish color theme). This causes eye strain, especially prominent in unlit environments. This change makes background bounce smoothly between regular bg color and highlight (selection) bg color for the configured visual bell duration. Intensity is animated with cubic easing functions. It currently peaks at 20% of the duration, this is hardcoded.
In principle, looks ok. Some comments:
|
Spot on, not great at all. I guess light theme users are also affected. I'll come up with some robust solution.
That seems fine.
Done. |
Blend highlight color with pegtop's softlight mode over both background and half as much over foreground. This should help with flash visibility in light themed and inverted colors contexts.
Doesnt seem very smooth to me, see attached screencast |
You know, stepping outside the box, a little. I dont see why we need to |
I have no objections. Thought of something similar, had a question though: when a bell fires in an inactive tab kitty does not start visual bell duration timer, is that right? |
On Thu, Aug 27, 2020 at 09:16:55AM -0700, Andrew Mayorov wrote:
> Why not just
> render a semi-transparent overlay color over the entire window? Might
> look much better and have zero performance impact when a visual bell is
> not occurring.
I have no objections. Thought of something similar, had a question though: when a bell fires in an inactive tab kitty does **not** start visual bell duration timer, is that right?
Yes, I think that is the case instead it shows a bell in the tab bar. Try it and see.
sleep 5s; print '\a'
should work
|
MacOS? Seems to me this is happening because screen repaints are effectively limited by cursor blink frequency. Is there some way I can request repaints more often? Also wondering why am I not seeing the same under Linux + Wayland. |
Great, I'll try to add a seprate pass for the flash then. |
On Thu, Aug 27, 2020 at 09:32:25AM -0700, Andrew Mayorov wrote:
> Doesnt seem very smooth to me, see attached screencast
> [screencast.zip](https://github.com/kovidgoyal/kitty/files/5137497/screencast.zip)
MacOS? Seems to me this is happening because screen repaints are effectively limited by cursor blink frequency. Is there some way I can request repaints more often? Also wondering why am I not seeing the same under Linux + Wayland.
No linux + x11, just wake up the main loop with self->dirty = true and
wakeup_main_loop(). This will cause continuous repainting and high cpu
usage so, better to use a timer.
But I think just using a single overlay color with no need for these
complications would be easier. And look fine.
To do it, you will need to add a step to the end of draw_cells() that
checks for a color to overlay and does it if set.
--
…_____________________________________
Dr. Kovid Goyal
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________
|
Another idea: rather than an overlay color, maybe just draw a big exclamation mark or bell symbol centered over the window. It should be fairly easy to draw an exclamation mark in GLSL. |
To make it less disruptive maybe just a red rectangle over the window edges, so the content is not obsucred. There are lots of options now that we are thinking outside the box :) |
Made an attempt. Looks nice and a bit more consistent. There's one little issue I found though. No matter what I try this effect seems to affect background opacity for some reason. For example if you run
This may be even better, that's right. I would propose to flash color of a screen border though, this way it's much clearer which screen in a multiscreen layout wants your attention. My only doubt is that user might have turned off border completely so this wouldn't work. I want to give it a try, so we have at least two options to choose from. |
@kovidgoyal did you mean to close this PR? |
Yes, since it is merged. |
@kovidgoyal not sure what you mean. It's closed, not merged. Am I missing something about how GitHub works? |
Read the commit that closed it. |
I did, and have no idea what it means. It's linking to this PR, which is closed (not merged).
Oof, interesting. |
Right now visual bell makes background flash sharply with bright white (when configured with darkish color theme). This causes eye strain, especially prominent in unlit environments.
This change makes background bounce smoothly between regular bg color and highlight (selection) bg color for the configured visual bell duration. Intensity is animated with cubic easing functions. It currently peaks at 20% of the duration, this is hardcoded.
Overall I acknowledge this change as quick and somewhat dirty starting point. For example I chose not to introduce any new configuration options yet. I'm wholly open to your suggestions on how to improve it.