wavexx / screenkey

A screencast tool to display your keys inspired by Screenflick
https://www.thregr.org/~wavexx/software/screenkey/
GNU General Public License v3.0
757 stars 66 forks source link

Option to always show the text #37

Closed Invertisment closed 5 years ago

wavexx commented 7 years ago

If this is to show the window, then --persist is there already.

Invertisment commented 7 years ago

Nope. This is for the text itself. It hides inside of the window

wavexx commented 7 years ago

On Fri, Nov 18 2016, Martin wrote:

Nope. This is for the text itself. It hides inside of the window

This will incur in bad performance in a few minutes of usage though, and the rendering of the gtk label is by far not fast.

If the width is larger than displayed, we should truncate the internal buffer appropriately.

Invertisment commented 7 years ago

Hmm. I googled a bit and found these two functions:

pango_glyph_string_extents
pango_glyph_string_get_width

https://sourcecodebrowser.com/pango1.0/1.14.8/glyphstring_8c.html#a0ea1dc42170be3e867affba7bd869faf

Can we use them to determine the length of the visible string and then manually trim it away? I don't know how to get PangoGlyphString from label

wavexx commented 7 years ago

On Fri, Nov 18 2016, Martin wrote:

Have you tried it? Does it cause flickering?

I'm a bit busy this weekend, I hope to try in the following days.

Invertisment commented 7 years ago

Alright. I made a change to limit the buffer size if there is no timeout specified. Actually I decided to make a separate buffer with key press counts. It looked broken if user inputs same key many times and with new keys the count decreases.

For now user may decide what buffer size is sufficient. Later it may be possible to determine it automatically (if we bump the GTK version for those functions that I mentioned earlier).

What I may have broken is the code that is commented out. If you could verify that everything works, I will be able to remove it. It is in the file Screenkey/labelmanager.py, lines 293 and 299. I would appreciate if you could verify if all features still work and the code that was removed was replaced properly.

wavexx commented 6 years ago

What if we handle a timeout of "0" as "no timeout"? I'd like to avoid an extra option.

Invertisment commented 6 years ago

"0" as no timeout is fine.