picom icon indicating copy to clipboard operation
picom copied to clipboard

Switching Qtile groups with the mouse doesn't activate the focus opacity

Open angrybacon opened this issue 7 months ago • 6 comments

Preamble: I have a bare Qtile and Picom installation ie. no desktop environment. Apologies in advance if this is a Qtile issue more than a Picom one. I've decided to post here because the issue is visual: changing Qtile groups does update the focused window (I can type in the window for the current group), but the visuals are not updated to match which window is currently focused.

Switching to my Qtile groups with the associated keybindings works fine ie. the new group shows up, the opacity for the now current window is set to the expected amount. However, when I switch groups using the mouse ie. clicking on the Qtile widget.GroupBox widget then the opacity remains as if it were unfocused.

$ yay -Qs picom
local/picom-git 2530_11.513.g7094d7a9_2024.07.31-1
    X compositor (fork of compton) (git-version)
local/picom-git-debug 2530_11.513.g7094d7a9_2024.07.31-1
    Detached debugging symbols for picom-git

$ yay -Qs qtile
local/qtile 0.31.0-1
    A full-featured, pure-Python tiling window manager
local/qtile-extras 0.31.0-1
    Unofficial mods for qtile. Tagged release to match stable qtile releases.
  • Picom configuration: https://github.com/angrybacon/dot/blob/master/config/picom.org
  • Qtile configuration: https://github.com/angrybacon/dot/blob/master/config/qtile.org

For context and to make the screenshots at the end of this issue easier to understand:

  • I've lowered the default unfocused opacity to 5% in order to make the difference more visible
  • I have 10 Qtile groups shown at the top left, blue means current, white means at least 1 window is opened in the group, grey means empty

👌 Initial setup

  • Current group: 1
  • Left is Zen, right is Emacs
  • Focused window is Zen
Image

👌 Moving the mouse on top of Emacs

  • Current group: 1
  • Left is Zen, right is Emacs
  • Focused window is Emacs
Image

👌 Moving to group 2 with the keyboard ie. Alt+2

  • Current group: 2
  • Only one window opened: Kitty
  • Focused window is Kitty
Image

❌ Moving back to group 1 using the mouse ie. click on the first circle top left

  • Current group: 1
  • Left is Zen, right is Emacs
  • None of Zen nor Emacs appear to be focused
  • If I start typing, Emacs receives the character inputs
  • Moving the mouse towards Emacs doesn't update its opacity, but moving it to Zen, then back to Emacs will update the opacity levels accordingly
Image

❌ Moving to group 3 using the mouse, then creating a new Kitty window

  • Current group: 3
  • Only one window opened: Kitty
  • The newly created Kitty window appears unfocused, but I can type in it
Image

angrybacon avatar Apr 05 '25 18:04 angrybacon

In case this is relevant, here is my .xprofile

[ -f "$HOME/.fehbg" ] && ~/.fehbg &
picom --daemon

angrybacon avatar Apr 05 '25 18:04 angrybacon

This is most likely an issue with Qtile not setting the focus hint properly. Please see if _NET_ACTIVE_WINDOW is set on multiple or the wrong windows. No idea how it works, but watching this snippet from the picom-trans script should do:

watch -n 4 xprop -root -notype -f _NET_ACTIVE_WINDOW 32x '$0' _NET_ACTIVE_WINDOW

If the focus stays on the old window, you might want to report that to upstream or patch it in. If it's set on multiple, that's not necessarily a bug, but both clients using a different interpretation of what focused means

CyberKite avatar Apr 23 '25 12:04 CyberKite

Thanks for the suggestion. I get the appropriate output ie. whatever "focus" means, your watcher gives me whatever window can be typed in. My issue is that this can-be-typed-in window doesn't have the appropriate opacity decoration

angrybacon avatar Apr 26 '25 13:04 angrybacon

By focus I meant the active window, sorry. Could you share your Picom configuration file? It couldn't find one ending in .conf in the repo. On a potentially related note, you are using the old method for specifying rules, which is probably deprecated, but I am by no means a developer so idk.

CyberKite avatar Apr 26 '25 15:04 CyberKite

Could you share your Picom configuration file? It couldn't find one ending in .conf in the repo.

The .org file transpiles to .conf on save. All the code blocks in the document are what's running on my machine essentially

Good call on the syntax, I read that the old would not be deprecated and didn't bother finding the new equivalent but it probably won't hurt

angrybacon avatar Apr 26 '25 16:04 angrybacon

FWIW I only reproduce the issue with picom-git

$ yay -Qs picom
local/picom 12.5-3
    Lightweight compositor for X11

works fine

angrybacon avatar Jun 03 '25 00:06 angrybacon