Syncplay / syncplay

Client/server to synchronize media playback on mpv/VLC/MPC-HC/MPC-BE on many computers
http://syncplay.pl/
Apache License 2.0
2.11k stars 215 forks source link

Dark mode bug in Linux #557

Closed ExTBH closed 1 year ago

ExTBH commented 1 year ago

Describe the bug Dark mode not being enabled

To Reproduce Steps to reproduce the behavior:

  1. open app and see white mode

Expected behavior should set dark mode

Screenshots If applicable, add screenshots to help explain your problem.

Version and platform:

Additional context I think its being caused bu this line https://github.com/Syncplay/syncplay/blob/e9f506f7131d5efbf69588896478aeeb34cc3958/syncplay/vendor/darkdetect/_linux_detect.py#L21 it detects dark mode by running this https://github.com/Syncplay/syncplay/blob/e9f506f7131d5efbf69588896478aeeb34cc3958/syncplay/vendor/darkdetect/_linux_detect.py#L14 which return theme name so i tried running it

>> gsettings get org.gnome.desktop.interface gtk-theme
<< 'Arc-Dark'

It is failing because .endwith() is case sensitive, .upper() or .lower() should get called before it

i don't know how to run or build from source so i can't check it

ExTBH commented 1 year ago

i have set another theme Adwaita-dark and ran syncplay from source and changed the method to force dark mode and im still getting white, so i think its not the reason

albertosottile commented 1 year ago

The theme name case issue is solved in Darkdetect v0.7.0, but at the moment Syncplay still bundles v0.5.2. Hence, this could be solved by upgrading the vendor copy of this dependency.

However, I am a little concerned about your last message. In your test system, could you install Darkdetect from PyPI (pip install darkdetect) and report here the output of python -m darkdetect) with various themes? Thank you.

ExTBH commented 1 year ago

i tried 1 light, 4 dark output

(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Light
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$

Also im getting this, i dont think i saw it before while starting in a dark or light theme set

(venv) [natheer@arco syncplay]$ python3 syncplayClient.py
QApplication: invalid style override 'kvantum' passed, ignoring it.
    Available styles: Windows, Fusion
Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.

Thing is when i was on Mint last month all was fine, it got broken on Arch

albertosottile commented 1 year ago

i tried 1 light, 4 dark output

(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Light
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$ python3 -m darkdetect
Current theme: Dark
(venv) [natheer@arco syncplay]$

So, this does mean that the latest version of Darkdetect is working as expected on your system. Am I reading this right?

Also im getting this, i dont think i saw it before while starting in a dark or light theme set

These messages should not be related to the dark-light theme.

ExTBH commented 1 year ago

Yes latest Darkdetect is getting it right but syncplay is still in light, im about to go sleep ill see if i have time to reinstall from source and update darkdetect manually and post my results

ExTBH commented 1 year ago

well that was fast, so herew what i did

  1. cloned syncplay in new venv
  2. cloned darkdetect source
  3. copied dark detect folder and pasted in inside syncplay/vendor

ran app and still getting light mode, started thinking this is just a me problem

albertosottile commented 1 year ago

I take this issue as a note that we have to update our vendor copy of darkdetect before the next release. Nevertheless, I am not entirely sure of what is happening on your system, hope you can figure it out.

ExTBH commented 1 year ago

this can be closed then, i would suggest linking to darkdetect repo instead of saving the module and placing, will make syncplay in sync with it https://github.blog/2016-02-01-working-with-submodules/

albertosottile commented 1 year ago

I'd prefer not to, the whole point of the vendor is to make sure we have our own fixed copy of darkdetect, as we do for other small dependencies. We could also use PyPI and pin the version, later down the road.

albertosottile commented 1 year ago

The next beta of version 1.7.0 will include an updated copy of darkdetect.

VVhitehead commented 2 weeks ago

I found that qt6ct worked for me. Xorg & bspwm no DE. Setting Color scheme: darker under the first tab, Appearance