Skip to content

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

Description

@birdie-github

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions