Plasmashell notifications accept focus unless no_focus directive is used
Per discussion here, I'm creating a separate issue. There is an alternative way to reproduce it by using picom/compton with transparency, and switching to another workspace (which makes notification to get focus).
A workaround for the problem described is to add in config this line:
no_focus [window_type="notification"]
I'm submitting a…
[x] Bug [ ] Feature Request [ ] Documentation Request [ ] Other (Please describe in detail)
Current Behavior
A notification popup makes keyboard layout get changed again
Expected Behavior
Keyboard layout stays the same
Reproduction Instructions
- Start KDE Plasma
- Open
systemsettings5 → Input Devices → Keyboard → Layouts- Make sure you have more than one language layout
- Set "Switching policy" checkbox to "Window"
- Click
Apply
- Create a
/usr/share/xsessions/plasma-i3.desktopfile with the following:[Desktop Entry] Type=XSession Exec=env KDEWM=/usr/bin/i3 /usr/bin/startplasma-x11 DesktopNames=KDE Name=Plasma with i3 Comment=Plasma with i3 - Relogin into session named "Plasma with i3" and wait for it to finish loading (a plasma panel should appear at the bottom)
- Write in terminal
notify-send 'Hello world' - Switch keyboard layout to non-default one
- Press enter
Environment
Output of i3 --moreversion 2>&-:
Binary i3 version: 4.18.1 (2020-04-22) © 2009 Michael Stapelberg and contributors (Getting version from running i3, press ctrl-c to abort…)
Config file
https://pastebin.com/raw/kfhcrzua
- Linux Distribution & Version: Archlinux - Are you using a compositor: picom, but it is reproducible with and without it.
I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)
Oh, I forgot to say: I tested and it is reproducible with latest git as well (commit d7d4f0a)
Can you also upload the logs please?
Can you also upload the logs please?
Sure. There nothing appears when notification is created. Here are the logs I'm currently getting with this config and no_focus commented out:
$ killall i3 && sleep 1 && i3 --shmlog-size=26214400
05.05.2020 15:48:28 - ERROR: PCRE regular expression compilation failed at 4: nothing to repeat
05.05.2020 15:48:28 - ERROR: Match is empty, ignoring this for_window statement
[ 05.05.2020 15:48:28.608 register_cm FATAL ERROR ] Another composite manager is already running
15:48:29 INFO: Opening in existing instance
Closing SHM log "/i3-log-163859"
Please follow https://i3wm.org/docs/debugging.html to get the full output of the logs
Please follow https://i3wm.org/docs/debugging.html to get the full output of the logs
Oh, so there is more to it. I read it but didn't see the paragraph "obtaining logs", so I thought that the output that i3 prints here is all I can get. Sorry, okay, here's the full log https://logs.i3wm.org/logs/5652195542302720.bz2
Okay, so, I have redone the logs with, like, minimal possible configuration of i3
https://logs.i3wm.org/logs/5762164153384960.bz2
The configuration was just that:
$ grep -vE "#|^$" ~/.config/i3/config
set $mod Mod4
floating_modifier $mod
bindsym $mod+Return exec konsole
bindsym $mod+Shift+c kill
So, looking at the logs I see the following:
Window gets managed:
05.05.2020 16:08:46 - manage.c:manage_window:111 - window 0x0440002b
05.05.2020 16:08:46 - WM_CLASS changed to plasmashell (instance), plasmashell (class)
nc->window->doesnt_accept_focus is set to true:
05.05.2020 16:08:46 - WM_HINTS.input changed to "0"
Focus is set:
05.05.2020 16:08:47 - manage.c:manage_window:662 - Now setting focus.
It can inferred from
https://github.com/i3/i3/blob/d7d4f0a95b4bebb180071cb51534b2e8c093821b/src/manage.c#L648-L655
that nc->window->needs_take_focus is true, meaning that the WM_TAKE_FOCUS is set.
Reference: https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
@Airblader you are the one that commited this change. When you have the time to read this, do you believe that i3 behaves correctly here according to the standard?
Maybe related: https://github.com/i3/i3/issues/2409
I don't have a lot of time at the moment and am not fully into the whole focus topic anymore. What I do know is that i3 does not implement some of the focus scenarios correctly and changing that isn't all that easy. I'm pretty sure we also still have some issue(s?) about that.
I edit-linked one.
Ok, when you have time, see if you can elaborate on how i3 should handle this case. Not urgent since we already have a workaround.
for_window [class="plasmashell" window_type="notification"] floating enable, no_focus, border none, move position 70 ppt 81 ppt