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

Sublime Text disrespect OS dark mode for its title bar in GNOME 44 #5966

Closed
schnz opened this issue May 10, 2023 · 4 comments
Closed

Sublime Text disrespect OS dark mode for its title bar in GNOME 44 #5966

schnz opened this issue May 10, 2023 · 4 comments

Comments

@schnz
Copy link

schnz commented May 10, 2023

Description of the bug

Cheers!

I am using Linux with GNOME 44 and Wayland. I have the gtk_client_side_window_decorations option set to false. Judging from the name of the option, I would assume that sublime would use server-side window decorations from now on, but this doesn't seem to be the case (although I am not really an expert in that domain).

From what I understand, GNOME 44 uses GTK4 to render the default window decorations for applications that do not have client side decorations (used to be GTK3). And I can verify that this is the case for numerous apps (including, e.g., Thunderbird and VS code).

However, Sublime Text seems to continue to be using client side decorations. At least from what I see, the title bar is rendered as part of the application (and not applied by gnome-shell/mutter) and it also seems to (continue) to use GTK 3. This is essentially fine, if it wasn't for a regression that causes the title bar to ignore the operating systems dark-theme setting.

This is how the titlebar of Sublime Text is now rendered (since the GNOME 44 upgrade):
Screenshot from 2023-05-10 10-36-09

And this is how it used to be rendered (simulated by enabling the dark variant toggle):
Screenshot from 2023-05-10 10-36-13

(FYI: I've started Subnlime via GTK_DEBUG=interactive subl for the screenshots above)

Steps to reproduce

  1. Use Linux with GNOME 44 and Wayland
  2. In the OS, set Settings > Appearance > Style: Dark
  3. In Sublime Text, disable CSD via "gtk_client_side_window_decorations": false
  4. Restart Sublime Text

Expected behavior

Title bar should respect OS dark mode setting.

Actual behavior

Title bar is always rendered in "light" theme.

Sublime Text build number

4143

Operating system & version

ArchLinux

(Linux) Desktop environment and/or window manager

Gnome

Additional information

No response

OpenGL context information

No response

@smac89
Copy link

smac89 commented Nov 23, 2023

I experience the same issue where the color scheme does not follow the OS settings. I'm using KDE on Arch Linux as well.

I wrote a plugin which solves this by making use of dbus and the xdg-portal-api. It's still awaiting approval. It's my first time writing a plugin, so any suggestions would be welcome.

https://github.com/smac89/autodark-sublime-plugin

@BenjaminSchaaf
Copy link
Member

Server-side window decorations under GNOME/GTK3 have the following behavior: When the ST theme is light (eg. the Default theme) and the GNOME is light then the title bar is light. When either ST or GNOME are dark then the title bar is also dark. This is under GNOME 45 and working as expected.

My guess is the theme you're using is not configured to be a dark theme, which theme are you using?

@schnz
Copy link
Author

schnz commented Mar 19, 2024

TL;DR: You are correct - it seems to be caused by the custom theme that I am using (ayu-mirage).

Hey @BenjaminSchaaf, I wanted to clarify something following your comments. Initially, I had my operating system set to dark mode, as mentioned in my issue title and the steps to reproduce the problem. Your feedback made me revisit my report. You stated:

When the ST theme is light (eg. the Default theme) and the GNOME is light then the title bar is light. When either ST or GNOME are dark then the title bar is also dark. This is under GNOME 45 and working as expected.

I hadn't considered this before, but I use a custom theme, ayu-mirage, and following your input, I realized that when I switch to the default Sublime Text theme, the title bar does indeed turn dark. This suggests that the issue might lie within the custom theme rather than Sublime Text or GNOME itself. I previously thought this was unlikely because everything had been functioning correctly until a GNOME update caused what appeared to be a regression.

My understanding of how themes interact with Sublime Text is limited. If the title bar color is, in fact, determined by the theme, then my bug report might be invalid and should be closed. However, if themes are supposed to default to a setting provided by Sublime Text (as suggested by your statement "when either ST or GNOME are dark then the title bar is also dark") and that mechanism is failing, there could still be an underlying issue to address.

Disclaimer: (this response was created with the help of ChatGPT)

@BenjaminSchaaf
Copy link
Member

Whether the title bar is themed as dark is determined by the theme, eg:

		{
			"class": "title_bar",
			"style": "dark"
		},

So yea this issue is invalid.

@BenjaminSchaaf BenjaminSchaaf closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants