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

set-dark-theme-variant.py relies on theme variants that themes may not have #236

Open
TomiOhl opened this issue Apr 13, 2023 · 13 comments
Open

Comments

@TomiOhl
Copy link

TomiOhl commented Apr 13, 2023

The title bar - which used to be dark themed on this flatpak version - became light themed since the updates on 4th April. Closing and reopening doesn't help (it used to when it happened with the previous versions).
I'm using elementary os 7, switching on the system-wide dark mode doesn't help (freedesktop color scheme preference), however, forcing dark mode from "Elementary tweaks" does make it dark.

@TingPing TingPing changed the title Title bar became light set-dark-theme-variant.py doesn't respect xdg-desktop-portal's color-scheme setting Apr 13, 2023
@TomiOhl
Copy link
Author

TomiOhl commented Apr 14, 2023

Note: while the updated title is true, probably it doesn't have to respect that setting, I've just provided that additional info. As the Spotify app itself is always dark, probably it should just be dark all the time, as before.

@voedev
Copy link

voedev commented Apr 14, 2023

I am using Fedora 37 with Gnome 43.4. I cannot confirm this problem

screen

@TingPing
Copy link
Member

@TomiOhl Oh I think the elementary theme just doesn't provide a dark variant anymore?

@TingPing TingPing changed the title set-dark-theme-variant.py doesn't respect xdg-desktop-portal's color-scheme setting set-dark-theme-variant.py relies on theme variants that themes may not have Apr 14, 2023
@TomiOhl
Copy link
Author

TomiOhl commented Apr 14, 2023

Not sure. I don't think it's a change on elementary's side either, I follow the PRs in their org. The last stylesheet update was three weeks ago, but that didn't affect Spotify. The first time I noticed the issue was after the updates last week. It's worth noting that there is an updated Spotify UI, too, that differs from the screenshots:
image
Coincidentally, there is a new glitch while opening: first, a small window appears on the top left, then it closes and the normal window opens. This might also be related, maybe the script terminates when the small window closes?
I mentioned that I'm able to open Spotify with dark title bar if I force the gtk dark theme via pantheon tweaks. It relies on gtk-application-prefer-dark-theme, I think the related code is here.

@TingPing
Copy link
Member

I think you could test variants like so.

env GTK_THEME='Adwaita' gtk3-demo
env GTK_THEME='Adwaita:dark' gtk3-demo

Just replace Adwaita with the name of the Elementary theme.

@TomiOhl
Copy link
Author

TomiOhl commented Apr 15, 2023

Well, interesting. So the command that the .desktop file uses to run spotify is:
flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client
I've added the basic adwaita theme setting:
flatpak run --env=GTK_THEME='Adwaita' --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client
Spotify opened with light title bar, but as soon as I started playing something, the title bar switched to dark.
Later I've tried with Adwaita:dark and even with one of elementary's stylesheets, the result is the same.
In fact, the same behavior could be observed regardless of the env.
Then I rebooted the laptop. Opened Spotify. It was light. Started playing music. Still light.
Then I closed and re-opened it. It was light, but switched to dark as soon as I've started playing music.

Note: later I've noticed the reason why playing music helps: as soon as I play something, a notification appears. Changes in the active windows do seem to be the cause. If I disable the notifications, I can start playing music but the title bar will stay light. However, if I open/focus another window, the title bar's color will change.


TL;DR: after system startup, opening Spotify -> closing it -> opening it again -> focusing other window is the sequence which seems to produce a dark title bar now. No idea if this really didn't work for me two days ago or I missed something.

@TomiOhl
Copy link
Author

TomiOhl commented Apr 20, 2023

Update: after #237 two things changed:

  • Spotify opens in normal size now (on previous version it opened in a small window first, and immediately changed to normal size)
  • the above workaround for dark theme doesn't work anymore. Couldn't get it to open with dark title bar even when specifying Adwaita:dark in env

@alex-pex
Copy link

I just wanted to say I'm using Zorin OS with light theme (ZorinBlue) and Spotify doesn't switch to dark theme no matter which workaround I try
image
The only way to have a dark titlebar is to switch my system to a dark theme

@TingPing
Copy link
Member

I don't really think there is anything we can do. The whole reason the script exists is because the titlebar isn't controlled by us so its always light by default. If your theme has a dark variant it gets used, if not its the default light.

@ahydronous
Copy link

@TingPing this problem is happening for me despite having Adwaita + Adwaita dark as system themes, and Adwaita + Adwaita Dark installed via Gnome Software too. So it is not just a "is a dark theme available" issue.

@TingPing
Copy link
Member

A "variant" is not "a dark theme" its a specific version of the current theme.

This script was removed in b1ff36b anyway.

@ahydronous
Copy link

Ah, that is too bad.

Are there no plans to default the Flatpak to always be dark theme (if available)?

@TingPing
Copy link
Member

It was always a hack with edge cases. Spotify should just fix this, its a very simple issue, they already use client side headers on other platforms.

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

5 participants