Skip to content
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

What self.psuedo_line is for? #39

Closed
fxmarty opened this issue Mar 27, 2021 · 7 comments
Closed

What self.psuedo_line is for? #39

fxmarty opened this issue Mar 27, 2021 · 7 comments

Comments

@fxmarty
Copy link

fxmarty commented Mar 27, 2021

Hello,

Thank you for this great addon, it is awesome. I am working on something based on it and had a small question.

I was wondering what the attribute self.psuedo_line was for in the class drawing_layer:

in

self.psuedo_line = 0

It happens that I had an issue similar to #12 where the first subtitle after pressing F5 would be visible, but not the following ones. Even though the following subtitles would be invisible, I could hover over them and see translations.

removing this bit of code

interSubs/interSubs.py

Lines 1353 to 1355 in 4387336

if not self.psuedo_line:
self.psuedo_line = 1
return

and hence always triggering draw_text_n_outline allowed me to solve the problem and now I can see all subtitles, not only the first one.

Hence my question: what is this self.psuedo_line and why do we want to trigger draw_text_n_outline only once at the beginning?

Edit: I wonder if this has to do with the compositor. If this is useful, I use KDE, with those configs

image

and I have xcompmgr package install, but I don't know at all if it is used or not.

Thanks again for the great script!

@oltodosel
Copy link
Owner

oltodosel commented Mar 27, 2021

It prevents calling of paintEvent() for the second time. I don't remember why exactly it is called again, something to do with how Qt works or smth...
Try adding os.system('notify-send %s' % time.time()) after those 3 lines you removed and see for yourself.

Edit:
As far as I remember this was to prevent barely noticeable flickering of subtitles when paintEvent() was triggered the second time.

@fxmarty
Copy link
Author

fxmarty commented Mar 28, 2021

Thanks a lot! I managed to do something simpler, still have to test it with mpv, closing.

Edit: BTW, up to now I did not find how to disable the fading there is by default with interSubs.

@fxmarty fxmarty closed this as completed Mar 28, 2021
@oltodosel
Copy link
Owner

What fading?

@fxmarty
Copy link
Author

fxmarty commented Mar 28, 2021

Oh, so maybe it is only on my side... Basically, when a subtitle disappears and also when a subtitle appears, it fades in/fades out. This is not an "instantaneous" apparition/disappearance.

@oltodosel
Copy link
Owner

Definitely smth to do with your compositor or WM.

@fxmarty
Copy link
Author

fxmarty commented Mar 28, 2021

I see thanks a lot, I will investigate that :-)

@fxmarty
Copy link
Author

fxmarty commented Mar 30, 2021

Just in case somebody has the fading issue one day: in KDE, you have a fading option in "Desktop Effects" options that you must disable. Alternatively, it would be nice to not destroy the widget at every subs, but that does the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants