WayfireWM / WayfireWM/wf-shell

`wf-locker`: invalid GTK CSS color `#0000` causes background configuration to be ignored

Open
#554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
179
Forks
55
Avg merge
16d 1h
Merged PRs (30d)
3

Description

Description

wf-locker in wf-shell 0.11 appears to generate invalid GTK CSS for its fade-in animation:

@keyframes slowfade {
    from { opacity: 0; background: #0000; }
    to   { opacity: 1; }
}

GTK rejects #0000 with:

Gtk-WARNING **: Theme parser error: <data>:1:30-31: Expected a valid color.

As a result, the locker background configured with background_color does not appear to be applied. The lock screen remains transparent/whitish regardless of the configured value.

Reproduction

With wf-locker running in debug mode:

WF_LOCKER_DEBUG=1 wf-locker --now

Configure:

[locker]
background_image = false
background_color = #ff0000

The result is still a white/whitish or transparent background rather than red.

The locker emits:

Gtk-WARNING **: Theme parser error: <data>:1:30-31: Expected a valid color.

and the generated CSS contains:

.fade-in {animation-name: slowfade;animation-duration: 3.000000s; animation-timing-function: linear; animation-iteration-count: 1; animation-fill-mode: forwards;}
@keyframes slowfade {
    from {opacity:0; background: #0000;}
    to {opacity:1;}
}
Additional observation

The configuration option in the implementation/metadata is named:

locker/background_color

and the source uses:

new CssFromConfigString(
    "locker/background_color",
    ".wf-locker {background-color:",
    ";}"
);

However, the shipped wf-shell.ini.example documents the option as:

background-color = #0000

rather than:

background_color = ...

So there also appears to be a typo in the example configuration.

Expected behavior

A valid background_color should be applied to the locker, e.g.:

background_color = #ff0000

should produce an opaque red background.

The fade-in animation should also use a GTK-compatible representation of transparent black, such as:

background: rgba(0, 0, 0, 0);

or another color syntax accepted by GTK CSS.

Environment
  • Fedora 44
  • Wayfire 0.11
  • wf-shell 0.11
  • GTK4
  • Reproduced with WF_LOCKER_DEBUG=1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the warning with WF_LOCKER_DEBUG=1 wf-locker --now, then locate wf-locker’s CSS generation around CssFromConfigString and the slowfade animation. Check wf-shell.ini.example alongside the locker/background_color configuration metadata. Done means GTK accepts the generated transparent color, the configured color appears, and the example uses the actual option name.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.