labwc/include
John Lindgren 4fa51b950c common: render text buffers with opaque background
After a roundabout discussion[1] with wlroots devs, it's become apparent
that subpixel text rendering (a.k.a. "ClearType") does not work properly
when rendering over a transparent background, as labwc currently does.

Basically it comes down to the fact that the color of semi-transparent
pixels (which is adjusted redder or bluer to compensate for RGB subpixel
alignment) depends somewhat on background color. When rendering over
transparency, the text engine doesn't know the intended background color
and can't adjust the pixel colors correctly.

With Pango/Cairo, the end result can range from grayscale rendering (no
subpixel rendering at all) to wrong/oversaturated colors (for example,
bright pink pixels when rendering white text on blue background).

This change solves the issue by first filling the text buffer with an
opaque background color before rendering the text over it. Currently,
this is easy since the background is always a solid color. It may be a
little more complex (but doable) if we implement gradients in future.

Note that GTK 4 (and to some degree, recent versions of Microsoft
Windows) avoid this issue by disabling subpixel rendering altogether. I
would much prefer that labwc NOT do this -- it results in noticeably
blurrier text on non-retina LCD screens, which are still common.

[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3822
2024-03-17 19:09:53 +00:00
..
button Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
common common: render text buffers with opaque background 2024-03-17 19:09:53 +00:00
config osd: add window-switcher field content types (#1623) 2024-03-16 15:28:37 +00:00
input IME: support IME popup 2024-03-14 20:11:03 +00:00
menu menu: use wl_list instead of array 2023-10-10 06:17:37 +01:00
action.h action: add If and ForEach actions 2023-10-01 14:17:29 +01:00
buffer.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
debug.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
decorations.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
dnd.h chase (dnd): refactor to use wlroot's scene_drag_icon 2023-12-03 18:24:26 +00:00
edges.h edges: do not apply resistance to invisible edges 2024-02-14 21:20:45 +00:00
idle.h Add support for ext_idle_notify_v1.. 2023-07-09 08:26:33 +01:00
labwc.h Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
layers.h src/layers.c: delay popup unconstrain until after first commit 2024-02-25 11:49:03 +00:00
meson.build Make xwayland support optional 2020-12-30 10:29:21 +00:00
node.h IME: support IME popup 2024-03-14 20:11:03 +00:00
output-virtual.h Add optional headless fallback output 2024-03-08 13:54:13 +01:00
placement.h view: honor automatic placement when adjusting floating geometry 2023-12-30 16:50:09 +00:00
regions.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
resistance.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
resize_indicator.h Add window resize indicator 2023-08-19 18:37:16 +02:00
session-lock.h session-lock: reconfigure for output layout changes 2023-10-05 20:10:37 +01:00
snap.h edges, resistance, snap: unified resistance and snapping engine 2024-01-30 15:02:17 -05:00
ssd-internal.h src/ssd: refactor button hover and maximize toggle 2023-12-08 20:55:50 +00:00
ssd.h feat: add Shade/Unshade/ToggleShade actions 2024-01-15 21:37:36 +00:00
theme.h theme: use non-hover button variants as fallback 2023-12-21 02:42:23 +01:00
view-impl-common.h view: commonize sub-view logic in view_move_to_front/back() 2023-10-21 15:40:56 +01:00
view.h Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
window-rules.h window-rules: add fixedPosition property 2023-11-10 21:46:15 +01:00
workspaces.h desktop: switch workspaces and optionally raise in desktop_focus_view() 2023-09-28 03:38:51 +02:00
xwayland.h xwayland: support querying window types 2024-01-25 21:14:30 +00:00