Commit graph

13 commits

Author SHA1 Message Date
John Lindgren
c9b576982d include: add missing header dependencies
Ensure that headers compile correctly regardless of include order.
2025-07-29 21:51:56 +01:00
John Lindgren
3ca7adace0 common/graphic-helpers: add a few cairo pattern helpers 2025-06-18 15:48:24 -04:00
John Lindgren
c4bae87c04 common/graphic-helpers: adopt lookup_named_color from xpm parser 2025-06-18 15:48:24 -04:00
tokyo4j
ffd400503e Replace multi_rect with lab_scene_rect
lab_scene_rect accepts the arbitrary number of borders and a background
color.
2025-06-10 06:03:03 +09:00
tokyo4j
c48324975d buffer: always set buffer->{cairo,surface} for simplification 2024-11-28 18:56:03 +09:00
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
Consolatis
27de4e6398 theme: create hover button fallbacks
...by copying the non-hover variant and adding a transparent overlay.

Co-authored-by: @johanmalm
2023-12-21 02:42:23 +01:00
Johan Malm
b200dd2e7b osd: use theme->osd_border_width for focused item 2023-06-29 19:14:08 +01:00
Tomi Ollila
7ad5200f2e includes: identifier consistency in include guards
Made all header files to have LABWC_ prefix in include guard identifers.

Converted from __LABWC_ in 35 include/ files.
Converted from __LAB_ in 5 include/ files.
Added LABWC prefix to 3 include/ files.
Added include guards to 3 include/ files.

The double underscores were removed since according to C standard
those "are always reserved for any use".
2023-05-13 22:29:21 +01:00
Consolatis
51727cf8f7 SnapToRegion: Add implementation 2023-01-10 23:29:10 +01:00
Consolatis
89ad0b808f s/wl_list_insert(list.prev...)/wl_list_append(list...)/ 2022-10-05 19:50:36 +01:00
Consolatis
fb36463c34 common/graphic-helpers: Add cairo helpers 2022-08-20 22:16:52 +01:00
Consolatis
8c8583ef94 common/graphic-helpers: Add multi_rect 2022-08-20 22:16:52 +01:00