Right-clicking item in XFCE Thunar turns it blank on certain themes after 2025-02-04 update

I am on Stable Branch and using XFCE.

Since the 2025-02-04 update, selecting an item in a Thunar window and taking the focus away from that window turns the item blank if the window has two or more tabs (but not if the window has only one tab) and on certain themes (as below).

An example of “taking the focus away” is right-clicking the item. (Focus goes to the context menu.)

Another example is the F2 key for renaming. (Focus goes to the renaming popup.)

Well, that’s how I discovered the problem. But just selecting an item and clicking another window will do too.

The affected themes are e.g. Cloudy-Grey (what I am using) and the “Matcha” ones (I get to themes in Appearance > Style).

Questions

  1. How can I fix that?
  2. One fix may be to edit the theme. I figured out that the theme might be in e.g. /usr/share/themes/Cloudy-Grey/gtk-3.0/gtk.css. If I am on the right track, which of the lines in that file would be the relevant ones? I wanted to cut and paste the lines here, but they exceed maximum character count. You may be able to see them here (in “Files” tab): Cloudy Gtk Themes - Gnome-look.org
  3. Maybe I don’t edit the theme css, but create a separate file at ~/.config/gtk-3.0/gtk.css to supersede theme css. (See How to change theme font colors? or this linuxmint forum page or this Github page.) Here the question would be what code to put in so the “blank” is a different color. I see that it may involve two colors: foreground (letters) and background.
  4. Some links refer to a GUI means of changing color scheme. Maybe it is called “theme configuration.” If there is a GUI method, please let me know where to find it. See e.g.: https://www.reddit.com/r/xfce/comments/279lyr/is_there_a_way_to_change_the_color_of_the/
  5. I am considering a switch to a theme not affected by the problem; e.g. Fluent and Fluent-compact seem fine. For these, however, I want to change tab color and active tab color (too similar, too bright). How could I do that by either editing the theme css (in /usr/share/themes/) or the superseding file ~/.config/gtk-3.0/gtk.css.

Thanks

Likely you are using a - for xfce 4.20 - unsupported theme - so use a supported theme.

1 Like

Thank you. Would you consider my question 5? (I chose a supported theme, but would like to edit it.)

Here’s the answer to question 5.

Put the following lines into ~/.config/gtk-3.0/gtk.css (create it if it does not exit). You may have to reboot for the effect.

/* Color of inactive TAB */
notebook tab {
    color: white;
    background-color:#59574E;
}

/* Color of active TAB */
notebook tab:checked {
    color: black;
    background-color: #F0F0F0;
    border-color: #59574E;
    border-width: 1px;
}

Some comments:

  • I believe item color is that of the text. If this item is missing, background-color alone seems to have no effect.
  • Without the border, the tab background blended into its background.

Sources

Alternatively, or more generally:

  • install a colorpicker tool
  • use colorpicker to identify the rgb value number of the item you want to change
  • search the css sheet for that string
1 Like

To create a CSS snippet to change Thunar main window text color to black:

tee ~/.config/gtk-3.0/gtk.css <<< .thunar .standard-view .view {color:#000000;}

How to customize Thunar classes on gtk3 theme? - Xfce Forums

XFCE topic also has good information about using GTK Inspector to view CSS

1 Like

That was a great idea in principle, but when I tried the method there were too many hits for the color (I didn’t count, but may 30 to 40) and none of theme screamed out to me, “Hey, I am the one. Change me.”


Your solution to another post (as above) worked for me too!

But only sort of: that’s the color of selected item background for the active window (one with “focus”).

What would be the code for color for when the window is inactive?

I hope I am making sense. In case I’m not, here’s more detail.

  • Before your code: When I selected an item in Thunar, the item got a dark blue background. If I click another window, then that color became a lighter blue. (Theme in question: Fluent-compact, i.e. not Cloudy-gray as was used to generate the pictures in original post.)
  • Your code: I used #888888.
  • After the code: Selection in a window under focus is gray (as expected). Without focus, the color is still light blue (I suppose also as expected).

Also would there be code for the selected item’s text color? (A dark background color may benefit from a light text color.) This too would have separate code for active and inactive windows.

I can tell you entering these lines did not work:

@define-color theme_selected_bg_color #555555;
@define-color theme_selected_fg_color #ffffff;

–even though I’d opened a gtk.css file and found this bit:

/*
base background color of selections */
@define-color theme_selected_bg_color #1A73E8;
/*
text/foreground color of selections */
@define-color theme_selected_fg_color white;

One (or more) of these CSS variables should deal with that

[nik@gnomic ~]$ grep "bg_color" /usr/share/themes/Matcha-sea/gtk-3.0/gtk.css
@define-color theme_bg_color #f7f7f7;
@define-color theme_selected_bg_color #2eb398;
@define-color bg_color #f7f7f7;
@define-color selected_bg_color #2eb398;
@define-color insensitive_bg_color #fcfcfc;
@define-color theme_unfocused_bg_color #f7f7f7;

Or use GTK Inspector to check/modify your preferred theme

thunar -q && GTK_DEBUG=interactive thunar &

Thank you. I will experiment with each of those. But would it be correct form to enter:

@define-color theme_selected_bg_color #555555;
@define-color theme_unfocused_bg_color #888888;

–and not (for example)

@define-color theme_selected_bg_color #555555, theme_unfocused_bg_color #888888;

I don’t want to run all my experiments in the wrong format.

ADDED LATER

The code for darker selected’s background for active window and lighter for inactive was:

@define-color theme_selected_bg_color #555555;
@define-color theme_unfocused_selected_bg_color #888888;

If I figure out how to set the text color for selected, I will update this reply.

1 Like

Here is the answer to 3.

Keep Cloudy-grey (or the theme that began giving you the problem after update).

Put the following line into ~/.config/gtk-3.0/gtk.css (create it if it does not exit). You may have to reboot for the effect.

@define-color theme_unfocused_selected_bg_color #555555;

–substituting obviously the color you want for #555555.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.