-
Notifications
You must be signed in to change notification settings - Fork 188
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
Text selection color problem with Tk applications #3767
Comments
just to be sure by tk applications you don't mean gtk applications right? |
That is correct, it's about Tk as in Tcl/Tk (and probably others like Python tkinter), and not GTK. When reporting this issue, this was the closest option. If this is not the right place, do you know where I should file the bug report instead? |
I just realised that my statements above are not quite right. I am sorry about the confusion. I have disabled the workarounds I was using:
Afterwards, I repeated the tests under those conditions (the default). If I switch to the Yaru theme, then I can no longer see the text selection in Git Gui, as described above. The colours are as listed above. However, I not only get this problem with Git Gui, which is a Tcl/Tk application, but with Emacs, which I configured with "--with-x-toolkit=gtk3", so it should be using GTK3. The theme change is immediately visible in Emacs (no need to relogin). I have installed package "mate-themes", which pulls some GTK2 dependencies. If I select the older Menta theme from that package, then the text selection is visible again. After relogin, I get now these colours:
Note that *Text.selectBackground is different from the other background colours. It is a kind of green, which is what the text selection background looks like. The problem is that *Text.background is #d4d4d4, a kind of gray. I do not understand where this comes from, because applications like Pluma or gedit display a white text background. That gray colour is what bothers me in Git Gui. |
yes, it's not related to yaru as we don't theme tk applications. If anyone is willing to contribute to making yaru theme possible for tk based applications, then they can open a pr |
One of the problems with the text selection I mentioned also applies to Emacs, a GTK 3 application, see my comments further above. When I select a different theme, Menta, does not have such problems. I can understand that Yaru does not feel directly responsible, but I guess that something is not working well together. If not Yaru, does anybody know what component I should file a bug against? |
I'm sorry, I have no idea. |
I would like pin-point the problem. Which variant of Ubuntu are you using? I am using Ubuntu MATE, which is still using X11, as reported by:
If you are using "plain" Ubuntu, then you are probably using Wayland. May this kind of issue does not happen on Wayland. I just tried again on 2 computers running Ubuntu MATE 22.04.1. One of them is running the Emacs that comes with the distribution. I checked with This system has no ~/.Xresources file at all. On this computer, I see or stop seeing the text selection in Emacs straightaway as I click on the different themes under "Appearance". With Yaru, I would expect the text selection background to be orange, instead of not being visible (same a non-selected text). The other computer is running Ubuntu MATE 22.04.1 too, has a ~/.Xresources file with the Tk workarounds, and I built Emacs myself from sources, but also with When I select Menta (a GTK 2 theme), the text selection on Emacs becomes green. On Pluma (MATE's text editor), it's the same green. On Git Gui (a Tk application), it is a strong gray, due to the work-around in ~/.Xresources . When I select Yaru, the text selection on Emacs changes to a very pale gray (not very usable). Maybe it is the same colour on the other system, but the monitor is different, so I may have missed it. On Pluma, the text selection is orange, as expected. Git Gui is not affected, due to the work-around in ~/.Xresources, so it remains a strong gray. I have a third Ubuntu MATE at work with a similar behaviour. I dug a bit deeper. In Emacs, I ran |
I have done some more tests: Theme Numix (package Theme Clearlooks-Phénix (package |
Thanks for all your very detailed description @rdiez, but can you provide some screenshots of the problem(s) you are trying to report? 🙂 |
This first screenshot shows theme Clearlooks-Phénix. I highlighted the word "bbbbb" in Pluma editor, so its background colour is blue. On Emacs, setting gtk_selection_bg_color shows the word "sample" in the same blue colour, as expected. This second screenshot shows theme Yaru. In the Pluma editor, the background of the selected word "bbbbb" is now orange. But in Emacs, the word "sample" next to gtk_selection_bg_color is no longer visible. However, if you zoom in the area where it should be (for example, with Gimp), you will see that the word "sample" is still there, only with a barely visible pale gray colour. |
Thanks for the screenshots @rdiez Can you try to select the same text, but with using the Adwaita theme:
This is the default Gtk theme, and we are based on it. |
I tested it, and the problem is the same. I also tried with a wrong theme name, and it's the same:
It is as if Emacs wouldn't find the GTK theme at all. I wonder whether that is what is happening with Yaru too, and also with the Tk applications. Mind you, theme Adwaita should be currently installed on my system via package I find it a little worrying that you supply the name of an invalid GTK theme, and you do not get warning at all on the console. The same happens with Pluma:
|
So you don't have the Adwaita theme 🤔 Just to be sure, even if you get a warning, is the theme different than Yaru, and with blue accent? |
I am not quite following you. I am not getting any warnings at all that the theme is not available, even if the theme name is obviously wrong. It's hard to say whether the theme has a blue accent. First of all, I just switched the desktop to Yaru. This is what Emacs looks like (I had to disable my config, because otherwise I am using a newer, a self-compiled Emacs, like I mentioned above):
And this is Pluma:
I am now trying to find a way to list all installed themes. I have installed and removed quite a few while testing this issue. |
I do not really know where to look. I found some common directories on the Internet:
Adwaita
The list of themes is shorter in the "Appearence Preferences" window: Custom Some themes, like Yaru-MATE or Yaru-xhdpi, are missing there. |
Oh okay, so I had misunderstood, sorry. I was thinking you got a warning. Looking at your screenshots and your theme folders, I can affirm that you are using Adwaita. Thanks a lot for your patience 🙂 |
Going further upstream looks like more work. I am sorry, but I am not prepared to invest any more time in this issue at the moment. I am facing so many little issues lately since the upgrade to Ubuntu MATE 22.04 (on 3 different systems), that I am considering switching distribution altogether. Feel free to close this issue. In the meantime, if anybody else is having the same problem with Emacs or with Tk applications, I would say they should stop using Yaru and switch to Theme Clearlooks-Phénix (package |
I use Git Gui (a Tcl/Tk application), and I have always had problems with the text colour, see this GitHub issue for details:
prati0100/git-gui#44
I recently upgraded my Ubuntu MATE system from version 20.04 to 22.04, and I started having trouble with the colours again in Git Gui.
After the upgrade, the Theme under "Appearance" was set to "Custom", which I do not remember doing myself. I as far as I know, I never actually customised any theme.
I then changed the Theme to Yaru, and when selecting text with the mouse, the selection is no longer visible inside Git Gui. This is a short list of colours:
Note that *Text.selectBackground is set to #fafafa, which is the same colour as other text backgrounds. Is that not a problem?
I had to change it to lightgray, in order for the text selection to be visible again in Git Gui.
This may not be a problem with Yaru only. I installed Menta, an older theme, and the same issue remains. The output of the command above is exactly the same.
Note that you seem to have to log out and in again for such theme changes to take effect in Tk applications.
The text was updated successfully, but these errors were encountered: