Skip to content

Support _NET_WM_WINDOW_OPACITY with alpha-modifier #131

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bbb651
Copy link
Contributor

@bbb651 bbb651 commented Mar 24, 2025

Ok this is admittedly very useless, especially as niri doesn't support it yet, although it's used by wine and supported by KDE. Not sure if it should be merged.

I mostly wanted to experiment with implementing a clientside only protocol, this is almost identical to xdg-decoration just a bit simpler because it doesn't have events it needs to handle.

Couple of things I noticed while implementing this:

  • The first time set_win_opacity is called, win.surface_key is None so it doesn't actually set anything and it doesn't print anything, I'm pretty sure this applies to everything in handle_window_attributes. I removed it from the test for that reason
  • PropertyCookieWrapper should be fallible, does Connection::wait_for_reply actually have any guarantee about the length of the reply (when r#type != ATOM_NONE)? Things like this can easily fail
  • Having client codeside leak into the ServerState::set_* methods doesn't feel great and forces more and more things into SurfaceData

Also it should be double-buffered and tested as such in testwl, this is also currently missing for min_size and max_size

Edit: I think this also needs to be added to the supported atom i3/i3#2840 (comment):

Thanks Tony. This makes me realize something: the JDK has a method isWindowTranslucencySupported which returns false for TRANSLUCENT if _NET_WM_WINDOW_OPACITY is not in _NET_SUPPORTED. This might be correct since there does not seem to be any other way to know if it is supported. However when the method setOpacity is called, it will fail with an exception in that case, making it impossible to set the opacity. Theoretically this could be changed to always set the _NET_WM_WINDOW_OPACITY property, not knowing if it will have an actual effect or not, which I suppose is what other X clients do.

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

Successfully merging this pull request may close these issues.

1 participant