Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-07-02 18:44:03

luvr
Member
From: Boom ("Tomorrowland"), Belgium
Registered: 2016-09-25
Posts: 20

Cosmetic issue with Mousepad context menu (Devuan 5)

I’m noticing that, on Devuan 5, the Mousepad context (right-click) menu is drawn with a Monospace font—the same font that is used on the main text canvas.
I had seen this happen before on different distributions—e.g., Slackware, Ubuntu—and I’m not sure how it ever got resolved; was it with some software update, or with a reinstall—I had certainly never consciously made any attempt to do anything about it.

Since it’s a fairly inconsequential and purely cosmetic issue, I had ignored it until now; I’m now seeing this issue on Devuan 5, but not on Ubuntu 20.04 or Debian 11 (I currently don’t have a Slackware installation at hand, so cannot be sure about that).

I have just done a new install of Devuan 5 on a laptop (I had been planning on doing so one of these days anyway), and even on that, the same issue occurs.

Having gotten curious, I decided to try and find some info on this funny little issue; after some searching, I found Ubuntu Launchpad Bug #1950947: “Using system monospace font affects context menus”; the strange thing is, that the last message in the bug report claims that it is fixed with Mousepad 0.5.10—but the Mousepad version in Devuan 5 is… 0.5.10, and that is affected by the issue. Perhaps Ubuntu applied some sort of fix to the Mousepad version that they install?

An earlier message in the bug report explains the cause of the problem:

The reason is that GtkMenu being spawned inside GtkTextView and the font-family property is inherited from parent. If GtkTextView is set to monospace font, GtkMenu also inherits that font.

It also suggests a work-around:

The fix would be setting its value to initial. The following Gtk code does that:

.context-menu {
font: initial;
}

Right… That looks suspiciously like a snippet of CSS, doesn’t it?

Actually, I remember reading something about Gtk 3 and how its appearance can be customised with the use of CSS—but I don’t recall any of the details.

Back to searching, then; I find a forum topic on Font sizes within gtk3 programs, where one of the posts mentions a ‘gtk.css’ file, located at “$HOME/.config/gtk-3.0/gtk.css”. There’s also the Xfce 4.18 Documentation page on “Panelbar Theming”; although this is not precisely what I’m looking for, the page does include a section on “GTK3 Theme testing and debugging”, where it says:

For testing, you can make modifications in the override file located at ~/.config/gtk-3.0/gtk.css. If the directory path doesn't exist, then you will have to create it.

So, I create a ‘.config/gtk-3.0’ under my home location, and, in that new directory, a ‘gtk.css’ file with the following contents:

.context-menu {
 font: initial;
}

That gets rid of the issue.

To demonstrate the difference between the two appearances of the Mousepad context menu, I include an image showing the menu drawn with the Monospace font on the left, and the menu with what is apparently called the “initial” font on the right:Mousepad Context Menu Comparison

Offline

#2 2024-07-02 20:28:22

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,481

Re: Cosmetic issue with Mousepad context menu (Devuan 5)

I believe this is an issue with the GTK Appearance theme that you are using (the default seems to be Clearlooks-Phenix-Sapphire). If you test the system with the built-in Gtk3 Adwaita theme:

xfconf-query -c xsettings -p /Net/ThemeName -s ""

...you'll see the issue doesn't occur.

Have you been able to replicate this issue with any other GTK theme? Note: I just tested Greybird and the issue isn't present there either.

Since you've found the fix, I would suggest reaching out to the theme developers and letting them know.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-07-02 21:03:10

luvr
Member
From: Boom ("Tomorrowland"), Belgium
Registered: 2016-09-25
Posts: 20

Re: Cosmetic issue with Mousepad context menu (Devuan 5)

ToZ wrote:

I believe this is an issue with the GTK Appearance theme that you are using (the default seems to be Clearlooks-Phenix-Sapphire).

Thanks for that info; and, yes “Clearlooks-Phenix-Sapphire” is the default one (it’s apparently even the only one available, by default).

If you test the system with the built-in Gtk3 Adwaita theme:

xfconf-query -c xsettings -p /Net/ThemeName -s ""

...you'll see the issue doesn't occur.

Well, that’s good know!

Have you been able to replicate this issue with any other GTK theme? Note: I just tested Greybird and the issue isn't present there either.

Given that no other themes are available on this system at the moment, no, I haven’t tried any other themes yet. I’ll give them a try, though, and see what gives.

Since you've found the fix, I would suggest reaching out to the theme developers and letting them know.

Thanks for the suggestion; I’ll see what I can do once I’ve checked what goes on with some of these other themes.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 536.3 KiB (Peak: 537.14 KiB) ]