fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.34k stars 100 forks source link

Compton not working with i3wm. #579

Closed haydenhv closed 4 years ago

haydenhv commented 4 years ago

Compton & vimb do not work with the '"0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'",' opacity rule.

Steps to reproduce

Edit the compton config to contain: "0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'", "90:class_g ?= 'Vimb'",

Expected behaviour

When tabbed in i3, the top vimb windows will have 90% opacity whereas all others will have 0% opacity.

Actual behaviour

All vimb windows will have 90% opacity.

fanglingsu commented 4 years ago

@haydenhv I don't have i3 nor compton. But I assume that vimb or gtk doe not set the _NET_WM_STATE_HIDDEN.

haydenhv commented 4 years ago

Makes sense... It'd be nice to see that as a feature though.

fanglingsu commented 4 years ago

@haydenhv If I read https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html right the _NET_WM_STATE_HIDDEN should be set by the window manager and is never set by the application. Maybe this i3 issue helps i3/i3/issues/1648.

haydenhv commented 4 years ago

So, I've read through both of those links, you are correct on the _NET_WM_STATE_HIDDEN being set by the window manager. The i3 issue's latest activity is in 2016, so I assumed they've implemented it, I'm just confused as to why vimb specifically is acting up. Here's some background info, if you're interested.

Compton.conf:

shadow=true shadow-radius=25 shadow-offset-x=-25 shadow-offset-y=-25

shadow-red=0.054901960784313725 shadow-green=0.06666666666666667 shadow-blue=0.10196078431372549

shadow-exclude = [ "class_g ?= 'dmenu'", ];

opacity-rule = [ "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", #This is what should hide the windows in tabbed mode, as it works with urxvt. "90:class_g ?= 'urxvt'", "90:class_g ?= 'i3bar'", "90:class_g ?= 'Vimb'", ];

fade-exclude = [ "!_I3_FLOATING_WINDOW@:c", ];

inactive-dim=0.2

xprop for vimb: xprop -name vimb _NET_STARTUP_ID(UTF8_STRING) = "i3/vimb/866-21-portButterscotch_TIME81742595" WM_CLASS(STRING) = "vimb", "Vimb" WM_COMMAND(STRING) = { "vimb" } WM_CLIENT_LEADER(WINDOW): window id # 0x800001 _NET_WM_PID(CARDINAL) = 5539 WM_LOCALE_NAME(STRING) = "en_US.UTF-8" WM_CLIENT_MACHINE(STRING) = "portButterscotch" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified size: 10 by 10 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING WM_ICON_NAME(STRING) = "vimb" _NET_WM_ICON_NAME(UTF8_STRING) = "vimb" WM_NAME(STRING) = "vimb" _NET_WM_NAME(UTF8_STRING) = "vimb"

xprop for urxvt (just as an example: not hidden): xprop -id 0x100052c _NET_WM_DESKTOP(CARDINAL) = 1 _NET_WM_STATE(ATOM) = WM_STATE(WM_STATE): window state: Normal icon window: 0x0 _NET_STARTUP_ID(UTF8_STRING) = "i3/urxvtc/866-9-portButterscotch_TIME84944428" _NET_WM_PID(CARDINAL) = 1271 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, _NET_WM_PING WM_LOCALE_NAME(STRING) = "en_US.UTF-8" WM_CLASS(STRING) = "urxvt", "URxvt" WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. window id # of group leader: 0x100052c WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified minimum size: 57 by 65 program specified resize increment: 7 by 15 program specified base size: 50 by 50 window gravity: NorthWest WM_CLIENT_MACHINE(STRING) = "portButterscotch" WM_COMMAND(STRING) = { "urxvt", "-cd", "/home/hayden" } _NET_WM_ICON_NAME(UTF8_STRING) = "urxvt" WM_ICON_NAME(STRING) = "urxvt" _NET_WM_NAME(UTF8_STRING) = "urxvt" WM_NAME(STRING) = "urxvt"

xprop for urxvt, but now hidden: xprop -id 0x100052c _NET_WM_DESKTOP(CARDINAL) = 1 _NET_WM_STATE(ATOM) = _NET_WM_STATE_HIDDEN WM_STATE(WM_STATE): window state: Normal icon window: 0x0 _NET_STARTUP_ID(UTF8_STRING) = "i3/urxvtc/866-9-portButterscotch_TIME84944428" _NET_WM_PID(CARDINAL) = 1271 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, _NET_WM_PING WM_LOCALE_NAME(STRING) = "en_US.UTF-8" WM_CLASS(STRING) = "urxvt", "URxvt" WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. window id # of group leader: 0x100052c WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified minimum size: 57 by 65 program specified resize increment: 7 by 15 program specified base size: 50 by 50 window gravity: NorthWest WM_CLIENT_MACHINE(STRING) = "portButterscotch" WM_COMMAND(STRING) = { "urxvt", "-cd", "/home/hayden" } _NET_WM_ICON_NAME(UTF8_STRING) = "urxvt" WM_ICON_NAME(STRING) = "urxvt" _NET_WM_NAME(UTF8_STRING) = "urxvt" WM_NAME(STRING) = "urxvt"

MKV video demonstrating the issue here: http://0x0.st/z6x-.mkv

Hope all of this could do something, I'm still wondering why mpv, urxvt and stuff work, but not vimb.

fanglingsu commented 4 years ago

@haydenhv I don't see which ATOM make the difference. But might be you should use the forts part of the CLASS for vimb too "90:class_g ?= 'vimb'", instead of "90:class_g ?= 'Vimb'",. Or you could try to run vimb with vimb --no-maximize and see if influences the behaviour. Does hiding with other gtk applications?

haydenhv commented 4 years ago

Luckily the --no-maximize option seems to have worked. I can however definately say that vimb not being capitalized in compton was not the issue, as the "90:class_g ?= 'Vimb'", refers to making it transparent, not hiding unfocused windows. Thanks for your help.

fanglingsu commented 4 years ago

@haydenhv Nice to hear that it works for you now.