baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.79k stars 414 forks source link

Float windows sometimes falling behind Tiled #651

Open jupart opened 7 years ago

jupart commented 7 years ago

Sometimes, float windows fall behind tiled windows and are very hard to find/get a hold of. As of now, I haven't been able to tell the cause or steps to reproduce, but will update if I do. I know of another user on IRC that said he had experienced as well.

jupart commented 7 years ago

Here's my config:

#! /bin/sh

xrandr --output DP-2 --auto --primary
xrandr --output HDMI-0 --auto --right-of DP-2

killall sxhkd
sxhkd &

bspc monitor DP-2 -d web chat elec IV
bspc monitor HDMI-0 -d term elec2 music VIII

bspc config border_width         2
bspc config window_gap           4

bspc config split_ratio          0.50
bspc config borderless_monocle   false
bspc config gapless_monocle      true

bspc rule -a Firefox desktop=^1
bspc rule -r Firefox split_ratio=0.6
bspc rule -a Audacious desktop=^8
bspc rule -a GerbView state=floating
bspc rule -a Gedit state=floating
bspc rule -a Eog state=floating
bspc rule -a Nautilus state=floating
bspc rule -a File-roller state=floating
bspc rule -a Gnome-system-monitor state=floating
bspc rule -a Screenkey manage=off
bspc rule -a Empathy state=floating
bspc rule -a ccstudio desktop=^9
bspc rule -a Gpick state=floating
bspc rule -a Pidgin state=floating
bspc rule -a "Kicad_py_tool.py" state=floating
bspc rule -a Evince state=floating
bspc rule -a OpenSCAD state=floating
bspc rule -a Window state=floating
bspc rule -a qutebrowser state=floating
bspc rule -a Polybar state=floating
bspc rule -a Conky state=tiled split_ratio=0.81
bspc rule -a VirtualBox state=floating
bspc rule -a python3.5 state=floating

bspc config pointer_action1 move
bspc config pointer_action2 none
bspc config pointer_action3 resize_corner
bspc config click_to_focus true
bspc config focus_follows_pointer true

bspc config active_border_color "#555753"
bspc config focused_border_color "#d79921"
bspc config normal_border_color "#282828"

xsetroot -cursor_name left_ptr

feh --bg-scale "/usr/share/xfce4/backdrops/xubuntu-development.png" --bg-scale "/usr/share/xfce4/backdrops/xubuntu-development.png"

setxkbmap -option 'caps:ctrl_modifier'
xcape -e 'Caps_Lock=Escape'
setxkbmap -option 'caps:ctrl_modifier'~
setxkbmap -option 'caps:ctrl_modifier'
xcape -e 'Caps_Lock=Escape;Control_L=Escape;Control_R=Escape'

xset r rate 250 33

killall unclutter
killall empathy
killall compton

unclutter &
empathy &
compton -b
compton -c --config ~/.config/compton.conf -b
jupart commented 7 years ago

This is definitely triggered by opening Virtualbox, even in a float window.

15bitgames commented 7 years ago

I've also come into this issue when using the pass password manager and the window asking for the gpg password comes up behind all my other tiled windows. This has only happened recently with one of the latest commits.

ghost commented 7 years ago

I have the exact same issue described by @z1lt0id. Specifically, gpg dialog goes below any other window instead of on top and becomes unselectable. I just run git bisect and I found that commit b181b5c7756b2726304f8ea852cbb637394672c0 is where this issue sits. Hope it helps.

baskerville commented 7 years ago

@oceans112 What's the output of xprop for the GPG dialog?

ghost commented 7 years ago

xprop doesn't show any output. I've to say that that gpg dialog is actually dmenu. Reverting that commit solves this issue, but i can't understand how rules can affect this.

Thank you for your time, btw

baskerville commented 7 years ago

Could you provide some steps to reproduce the issue?

ghost commented 7 years ago

I was wrong, it's the pinentry dialog that goes below other windows, not dmenu. The easiest way that i could find to reproduce this issue is launch pinentry-gtk-2 and give the command getpin in a not empty desktop.

ghost commented 7 years ago

I just noticed that the keyboard focus is correct, if i type i actually write in the pinentry dialog, but still it's below other windows (i noticed that using a non-opaque console as other window).

jupart commented 7 years ago

The issue I'm facing happens whenever I open a Virtualbox guest. This affects all float windows across all workspaces after that until I restart my machine, causing all float windows to fall behind tiled windows (not just windows associated with Virtualbox).

0x647262 commented 7 years ago

@jupart cc3d306 fix this issue for you?

jupart commented 7 years ago

Indeed it does. Thanks for bringing it up.

baskerville commented 7 years ago

I don't think so: the regression was introduced 21 days ago and the issue was created 28 days ago.

jupart commented 7 years ago

@baskerville You're right, it does fix popups like "Open file", etc. though, so it's a step in the right direction. The issue where opening a Virtualbox guest "relayers" all floating windows behind tiled still exists though.

jupart commented 7 years ago

I recently noticed if I remove bspc rule -a VirtualBox state=floating from my bspwmrc, this problem no longer happens.

msteen commented 7 years ago

I also ran into problems with certain popups, such as the GPG password popup, floating behind tiled windows, but this rule fixed that for me:

bspc rule -a \* node=.floating layer=above
baskerville commented 7 years ago

I'm afraid node=.floating isn't valid: the descriptor can only be omitted with query -{M,D,N} ... and node=NODE_SEL is a consequence (it sets the insertion point of the upcoming window) not a filter.

So the aforementioned rule just sends everything to the above layer.

msteen commented 7 years ago

Aha, I did not know that. Well then, in that case, all I can say is that sending everything to the above layer made everything work the way I expect (floating windows always on top of tiled), but I understand that it is not a correct solution. Thanks for clearing that up!

Edit: After updating to the latest git version, sending all the windows to the above layer no longer works, but then again, it is also no longer necessary. I think I was just using the version which still had the bug where sending something to the above layer sent it to the below layer. And since dialogs and such are send to the above layer, they were actually sent to the below layer, causing them to be shown behind the tiled windows that were in the normal layer. So by sending all my windows to the above layer, I was actually sending them all to the below layer, causing the dialogs and windows to be on the same level.

skjnldsv commented 5 years ago

I recently updated and it started doing that for me as well! :confused: bspwmrc: https://gist.github.com/skjnldsv/927b0d757d0e6ac90a9f1058ee0122d9 sxhkdrc: https://gist.github.com/skjnldsv/f2f41433e271549789e598becbdc35e2

icf20 commented 5 years ago

@skjnldsv i got this also today

@baskerville here image

one terminal open 2 pcmanfm-qt in one of them i select rclick -> make new folder in the lower corner pcmanfm window (music) in the image you can see the dialog box to set the name of the folder and does open behind the bigger pcmanfm

this used to happen all the tiem few versions ago when using tellico and editing a book ( not longer happens today)

it can be something related to qt?

skjnldsv commented 5 years ago

No idea, but it is still happening! It's happening for all qt apps indeed! @baskerville any idea here?

dhsdshdhk commented 5 years ago

This is happening to me as well. Floating videos opening behind my thunar is annoying.

baskerville commented 5 years ago

xtruss might be helpful here.

skjnldsv commented 5 years ago

@baskerville what can we do to help? :) I also encountered non qt apps behaving the same! I thought we had narrowed it a bit, but apparently not!

baskerville commented 5 years ago

You could record the events with xtruss.

skjnldsv commented 5 years ago

Here are the logs @baskerville The nextcloud app is behind all windows

# Opening nextcloud app
03200000: --- XKEYBOARD:UnknownEvent0
03200000: --- PropertyNotify(window=w#00000167, atom=a"_NET_ACTIVE_WINDOW", state=NewValue, time=0x4CAC094F)
03200000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAC094F)
03200000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAC0953)
03200000: --- PropertyNotify(window=w#00000167, atom=a#328, state=NewValue, time=0x4CAC0954)
03200000: --- PropertyNotify(window=w#00000167, atom=a"_NET_ACTIVE_WINDOW", state=NewValue, time=0x4CAC0955)
03200000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAC0955)
05800000: --- SendEvent-generated ClientMessage(window=w#0060001A, type=a"_NET_ACTIVE_WINDOW", format=32, data=00000001:4CAC0954:00000000:00000000:00000000)
03200000: --- SendEvent-generated ClientMessage(window=w#0060001A, type=a"_NET_ACTIVE_WINDOW", format=32, data=00000001:4CAC0954:00000000:00000000:00000000)
# Closing nextcloud app with ESC
03200000: --- XKEYBOARD:UnknownEvent0
03200000: --- PropertyNotify(window=w#00000167, atom=a#328, state=NewValue, time=0x4CAC13A2)
03200000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAC13A3)
03200000: --- PropertyNotify(window=w#00000167, atom=a"_NET_ACTIVE_WINDOW", state=NewValue, time=0x4CAC13A3)
03200000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAC13A4)

# Opening nextcloud app
05c00000: --- XKEYBOARD:UnknownEvent0
05c00000: --- PropertyNotify(window=w#00000167, atom=a"_NET_ACTIVE_WINDOW", state=NewValue, time=0x4CAD49B5)
05c00000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAD49B5)
05c00000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAD49B5)
05c00000: --- PropertyNotify(window=w#00000167, atom=a#328, state=NewValue, time=0x4CAD49B6)
05c00000: --- PropertyNotify(window=w#00000167, atom=a"_NET_ACTIVE_WINDOW", state=NewValue, time=0x4CAD49B6)
05c00000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAD49B6)
05c00000: --- SendEvent-generated ClientMessage(window=w#0060001A, type=a"_NET_ACTIVE_WINDOW", format=32, data=00000001:4CAD49B6:00000000:00000000:00000000)
05e00000: --- SendEvent-generated ClientMessage(window=w#0060001A, type=a"_NET_ACTIVE_WINDOW", format=32, data=00000001:4CAD49B6:00000000:00000000:00000000)
# Setting nextcloud app as tiled
05c00000: --- XKEYBOARD:UnknownEvent0
05c00000: --- XKEYBOARD:UnknownEvent0
05c00000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAD4F28)
# Closing nextcloud app with ESC
05c00000: --- XKEYBOARD:UnknownEvent0
05c00000: --- PropertyNotify(window=w#00000167, atom=a#328, state=NewValue, time=0x4CAD53BE)
05c00000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAD53BE)
05c00000: --- PropertyNotify(window=w#00000167, atom=a"_NET_ACTIVE_WINDOW", state=NewValue, time=0x4CAD53BE)
05c00000: --- PropertyNotify(window=w#00000167, atom=a#330, state=NewValue, time=0x4CAD53BE)
TheZoq2 commented 5 years ago

I also have this issue. It doesn't happen every time, It works fine for a while, then something triggers it, and then all floating windows end up behind tiling windows if they are focused (with focus_follows_pointer, they are above the tiled windows until I move the mouse).

Do you want x events of it being moved behind other windows, or of when the issue starts occuring?

Edit: Looks like I found the offending program in my case. If sc-controller is running and is in floating mode, all floating windows, including sc-controller itself have the issue. If I make it tiled, the issue goes away

Edit 2: When this happens, another issue happens as well. Switching between recent windows in monocle-mode doesn't work. The focus changes, but the same window is always on top. This does not seem to be fixed by making sc-controller tiled.

Also, I think I've had sc-controller running in floating mode before without issues. I.e. something else is triggering this bug

Edit 3: Here is an xtruss log of me toggling between windows in a monocle layout. https://gist.github.com/TheZoq2/517eeb31ccd4d562b0b1da2230acab7f.

skjnldsv commented 4 years ago

@baskerville this is still happening after a few years :( This is really frustrating and I don't know how can I fix it.

What could I provide so it helps you debug further? For example I want to have a floating music player on all desktop, it will end up behind all tiled windows, making it quite unusable :(

kranzo commented 3 years ago

Same for me in 2021, any update/workaround?

kranzo commented 3 years ago

I encountered the problem again and had some timer to tinker around:

i can now reproduce some similar behavior

switching a window layer to below/above (tiled or floating doesnt matter) pulls it to the top and keeps every other window below.

the only way to revover normal behavior

  1. set layer back to normal
  2. set state to floating
  3. pull an other floating window to the top (clicking it)
  4. focus the window in the background (keep it below)
  5. switch it to tiling

now it behaves well again with the floating layer (monocle still broken) if i can do any testing i'm happy about ideas.

ryanw commented 1 year ago

This is still an issue, but it's pretty rare. I encounter it less than once a month. Only way I've found to fix it is to kill and restart bspwm.

elee1766 commented 1 year ago

for me it is certain tiled windows that end up appearing in front of all floating windows, which i fix by putting the offending tiling windows back into floating, marking normal, then back into tiled.

TheArcaneBrony commented 1 year ago

This happens multiple times per day here, it's annoying having to relog as seemingly not even restarting bspwm fixes it.