Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland: Opacity, shadows and corner radius with scenefx #4524

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jwijenbergh
Copy link
Contributor

@jwijenbergh jwijenbergh commented Oct 15, 2023

Draft. Depends on https://github.com/jwijenbergh/pywlroots/tree/scenefx (make sure to fetch submodules!) and https://github.com/wlrfx/scenefx

TODO:

  • [ ]: Only unset shadow when needed for efficiency
  • [ ]: Create a better Qtile API than setting window properties (maybe global config settings like bordercolor with wl_ prefixes?)
  • [ ]: Make scenefx optional (detect that it is installed somehow), NO-OP opacity, shadows, corner radius if not
  • [ ]: Align borders with corner radius
  • [ ]: Is the xwayland implementation correct?

Opacity is now in wlroots too so in the future we wont need scenefx for this

Usage is setting the relevant properties, E.g. I just used this for testing:

# add to keys
Key([mod, "control"], "x", lazy.function(set_eye_candy))

def set_eye_candy(qtile):
    curr = qtile.current_window
    if curr.opacity < 1:
        curr.opacity = 1
        curr.shadow = None
        curr.shadowblur = 20
        curr.corner_radius = 0
    else:
        curr.opacity = 0.7
        curr.shadow = "#ff0000"
        curr.shadowblur = 500
        curr.corner_radius = 10

To set the setting globally right now you can e.g. use a hook:

@hook.subscribe.client_new
def new_win(win):
    win.opacity = 0.9
    win.shadow = "#000000aa"
    win.shadowblur = 40
    win.corner_radius = 10

Much love to the Scenefx team!

Using this branch in nix: https://gist.github.com/jwijenbergh/9d5de199f5ff8cda9b5439308032251b

scenefx bug or qtile bug? With scenefx this otherwise gives a segfault
Opacity is now in Wlroots as well so we do not need scenefx for that
in the future. Scenefx pywlroots branch is here https://github.com/jwijenbergh/pywlroots/tree/scenefx
@WillPower3309
Copy link

I'll work on the border impl on scenefx :)

@jwijenbergh
Copy link
Contributor Author

I'll work on the border impl on scenefx :)

Thanks for your hard work!

@QBobWatson
Copy link
Contributor

Thank you for this!

I just started a discussion that might be relevant: #4553 .

Copy link

This PR is stale because it has been open 90 days with no activity. Remove the status: stale label or comment, or this will be closed in 30 days.

@WillPower3309
Copy link

We're hoping to get a stable release of scenefx out within the next week or two, we'll have SwayFX switch to the scenefx renderer in that time so will have feature parity soon

@WillPower3309
Copy link

SceneFX 0.1 released. We have a few tasks left before a 1.0 release: https://github.com/wlrfx/scenefx/milestone/2

@WillPower3309
Copy link

The border TODO will be helped by wlrfx/scenefx#46

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

Successfully merging this pull request may close these issues.

None yet

5 participants