Blurry titlebar font when window is not maximized

Bug #1780468 reported by Stephen Karanja
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
metacity (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

What happens
------------
I've configured Compiz window manager to use gtk-window-decorator so that it may apply my Metacity theme for the titlebars. With this decorator, I've noticed that Compiz renders slightly blurry titlebar fonts when a window is not maximized. Once the window is maximized, sharp fonts are rendered.

When a window is not maximized, the font seems to lack sub-pixel hinting or anti-aliasing, hence the slightly blurry appearance. I zoomed in on the font when the window was maximized and observed bluish lines around the characters. When a window was not maximized, the zoomed-in characters didn't have the bluish lines.

I've tested and seen that the Marco window manager and the Emerald decorator (used with Compiz) both render sharp titlebar fonts regardless of whether a window is maximized or not.

The image in the below link shows the slight difference in font rendering when Compiz is used with gtk-window-decorator. Firefox's window was maximized, with sharp text, while VLC's window was not maximized, with slightly blurry text.

https://i.stack.imgur.com/5BalZ.png

Upon switching to Marco window manager, both texts are sharp.

https://i.stack.imgur.com/9Gzli.png

When the "Compiz with gtk-window-decorator" setup is zoomed-in, blue lines around the maximized Firefox window titlebar text are visible (it looks like sub-pixel rendering to me). The blue lines are completely lacking in the un-maximized VLC window titlebar text.

https://i.stack.imgur.com/XDSAU.png

What I expect to happen
-----------------------
The titlebar font rendering should be sharp for both maximized and un-maximized windows.

The cause (clip_to_rounded_corners)
-----------------------------------
Upon investigating, I've discovered that Compiz's gtk-window-decorator uses the libmetacity library. The clip_to_rounded_corners() function in "meta-theme-metacity.c" is called to draw rounded corners for the un-maximized windows in my theme. It seems the call to draw rounded corners by cairo_arc() in that function somehow affects the font rendering. When windows are maximized, the drawing of rounded corners is not performed, hence the sharp font rendering.

I rebuilt the libmetacity library with the clip_to_rounded_corners() call commented out and achieved sharp fonts for un-maximized windows.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: metacity 1:3.28.0-1
ProcVersionSignature: Ubuntu 4.15.0-24.26-generic 4.15.18
Uname: Linux 4.15.0-24-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CurrentDesktop: MATE
Date: Fri Jul 6 19:52:03 2018
InstallationDate: Installed on 2018-05-06 (61 days ago)
InstallationMedia: Ubuntu-MATE 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: metacity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Stephen Karanja (caw) wrote :
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Do you have same problem with metacity? Sounds like you tested only gtk-window-decorator and marco...

Can you test also with metacity-theme-viewer?

Does it happen also with other themes?

Revision history for this message
Stephen Karanja (caw) wrote :

To answer your questions:

I've just tested with Metacity window manager and the blurry font rendering occurs, just like with gtk-window-decorator. The issue is not present in Marco window manager because it doesn't include the clip_to_rounded_corners() function.

The issue occurs similarly for several MATE themes that I have tested with e.g. TraditionalOK, TraditionalGreen, Ambiant-MATE, BlueMenta etc.

metacity-theme-viewer draws a different titlebar than what is specified in the Metacity themes. It doesn't display the titlebar as a themed window would. See the attached images in which the VLC window has a blue titlebar as specified in the TraditionalOK theme while metacity-theme-viewer renders a different titlebar.

Revision history for this message
Stephen Karanja (caw) wrote :
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

In metacity-theme-viewer you should change GTK+ to Metacity...

Please open upstream issue:
https://gitlab.gnome.org/GNOME/metacity/issues

Revision history for this message
Stephen Karanja (caw) wrote :

Thanks for the heads up about metacity-theme-viewer!

I've opened an upstream issue: https://gitlab.gnome.org/GNOME/metacity/issues/2

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Is problem visible also in metacity-theme-viewer? If so then please use max scale and attach to upstream bug screenshot that looks good and other that shows problem.

Revision history for this message
Stephen Karanja (caw) wrote :

It's not visible in metacity-theme-viewer. What is visible here is the first character rendered differently in the maximized state.

See the attached images.

Revision history for this message
Stephen Karanja (caw) wrote :
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Can you attach your theme?

Revision history for this message
Stephen Karanja (caw) wrote :

Here you go.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Is this still problem in 20.04 or newer Ubuntu versions?

Changed in metacity (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for metacity (Ubuntu) because there has been no activity for 60 days.]

Changed in metacity (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.