Closed tkna91 closed 3 months ago
Is this a regression? Does this work fine on previous Sway versions?
@emersion I think it was the same before, but let's check with the official release version, shall I ?
This does not seem to occur in the official release version.
Version:
$ pacman -Q sway wlroots0.16
sway 1:1.8.1-5
wlroots0.16 0.16.2-2
$
Screencast:
https://github.com/swaywm/sway/assets/102382754/d6b6083d-a5c8-4334-833f-9d9f9b23a1c7
stacked in the wrong order
Stacking usually referrers to the order in which floating windows appear. It seems xwayland can maintain its own stacking order which can de sync from what the compositor thinks. There doesn't seem to be a problem with the stacking, but instead it looks like the reaper
application input events are not registering and somehow chromium got them so reaper
is unresponsive.
What happens if you switch to chromium, then back to your application? It it able to properly receive input events? What happens if you don't switch tabs but instead refocus on the workspace on your second monitor then back?
Can you provide the output of xwininfo -tree -root
when the windows are in this bad state?
@Nefsen402 @emersion It no longer occurs in the form it initially did. It may be because of the upgrade, but I don't know exactly. Sorry.
Screencast:
https://github.com/swaywm/sway/assets/102382754/9843fda6-45cd-4d06-a615-a3c470c33ca5
I found out how to reproduce the event in the current version.
Version:
Reproduction procedure:
This will still reproduce, but a quick operation of the following will reproduce it again.
Can you provide the output of xwininfo -tree -root when the windows are in this bad state?
[a@gb1 ~]$ xwininfo -tree -root
xwininfo: Window id: 0x413 (the root window) (has no name)
Root window id: 0x413 (the root window) (has no name)
Parent window id: 0x0 (none)
13 children:
0x400004 (has no name): () 1x1+0+0 +0+0
0x600008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0
1 child:
0x600009 (has no name): () 1x1+-1+-1 +-1+-1
0x600003 (has no name): () 1x1+-1+-1 +-1+-1
0x600001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10
0x400000 "Chromium clipboard": () 10x10+-100+-100 +-100+-100
0x1000009 (has no name): () 1x1+-1+-1 +-1+-1
0x1000001 "reaper": ("reaper" "") 10x10+10+10 +10+10
0x200004 "wlroots wm": () 10x10+0+0 +0+0
0x200003 (has no name): () 8192x8192+0+0 +0+0
0x200002 (has no name): () 10x10+0+0 +0+0
0x200001 (has no name): () 10x10+0+0 +0+0
0x400003 "新しいタブ - Chromium": ("chromium" "Chromium") 1916x1036+3842+42 +3842+42
0x10001b0 "REAPER v7.09 - EVALUATION LICENSE": ("REAPER" "REAPER") 1916x1036+3842+42 +3842+42
1 child:
0x10001b1 (has no name): () 1x1+-1+-1 +3841+41
[a@gb1 ~]$
Screenshot:
Screencast:
https://github.com/swaywm/sway/assets/102382754/7412337c-75e9-4bf3-999c-a535960844e6
sway-run-default_20240216-140729.log
It it able to properly receive input events? What happens if you don't switch tabs but instead refocus on the workspace on your second monitor then back?
Nothing changes. See between 16 and 24 seconds of the above screencast.
What happens if you switch to chromium, then back to your application?
The incorrect stacking condition will be resolved and normalized. See between 28 and 50 seconds of the above screencast.
I found an easier way to reproduce it.
Screencast:
https://github.com/swaywm/sway/assets/102382754/1c3f68a6-ef22-4710-bf6c-e07aea990bc7
$ paru -Q sway-git wlroots-git
sway-git 1.10.r7296.fc640d5-1
wlroots-git 0.18.0.r6930.2a897af7d-1
$
The GUI for REAPER was open source. It appears to use this.
It still occurs even now. Should I report this to the REAPER developer?
$ pacman -Q sway-git wlroots-git
sway-git 1.10.r7332.087226d-1
wlroots-git 0.18.0.r7002.b1b34cd66-1
$
Screencast:
https://github.com/swaywm/sway/assets/102382754/65a6da70-a385-4f1d-a993-8c3b697f0ad3
01:02:46.605 [ERROR] [wlr] [xwayland/xwm.c:1628] xcb error: op ConfigureWindow (no minor), code Window (no extension), sequence 10548, value 33560642
01:02:46.605 [ERROR] [wlr] [xwayland/xwm.c:1628] xcb error: op ChangeProperty (no minor), code Window (no extension), sequence 10553, value 33560642
01:02:46.605 [ERROR] [wlr] [xwayland/xwm.c:1628] xcb error: op ConfigureWindow (no minor), code Window (no extension), sequence 10555, value 33560642
01:02:46.605 [ERROR] [wlr] [xwayland/xwm.c:1628] xcb error: op ConfigureWindow (no minor), code Window (no extension), sequence 10561, value 33560642
01:02:46.606 [ERROR] [wlr] [xwayland/xwm.c:1628] xcb error: op ChangeProperty (no minor), code Window (no extension), sequence 10565, value 33560642
01:02:46.606 [ERROR] [wlr] [xwayland/xwm.c:1628] xcb error: op DeleteProperty (no minor), code Window (no extension), sequence 10566, value 33560642
I can reproduce this with just chromium and xeyes: open both and you can "click through" xeyes. Even weirder: if you open chromium, switch to another workspace and open xeyes there then clicking on xeyes still goes to chromium.
@baltitenger It certainly seems that way.
Screencast:
https://github.com/swaywm/sway/assets/102382754/fd074588-81d4-4bed-8b01-d39fbd73a5d9
$ pacman -Q sway-git wlroots-git mesa linux xorg-xeyes xorg-xwininfo
sway-git 1.10.r7314.dc9f217-1
wlroots-git 0.18.0.r6982.65bf7d167-1
mesa 1:24.1.0-1
linux 6.9.2.arch1-1
xorg-xeyes 1.3.0-1
xorg-xwininfo 1.1.6-1
$
$ sleep 10 ; xwininfo -tree -root
xwininfo: Window id: 0x3b5 (the root window) (has no name)
Root window id: 0x3b5 (the root window) (has no name)
Parent window id: 0x0 (none)
15 children:
0x600005 (has no name): () 1x1+0+0 +0+0
0x1200008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0
1 child:
0x1200009 (has no name): () 1x1+-1+-1 +-1+-1
0x1200003 (has no name): () 1x1+-1+-1 +-1+-1
0x1200001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10
0x600001 "Chromium clipboard": () 10x10+-100+-100 +-100+-100
0x4000003 "Fcitx5 Input Window": ("fcitx" "fcitx") 1x1+0+0 +0+0
0x4000001 (has no name): () 1x1+0+0 +0+0
0x4000000 (has no name): () 1x1+0+0 +0+0
0x400003 (has no name): () 3x3+0+0 +0+0
0x200004 "wlroots wm": () 10x10+0+0 +0+0
0x200003 (has no name): () 8192x8192+0+0 +0+0
0x200002 (has no name): () 10x10+0+0 +0+0
0x200001 (has no name): () 10x10+0+0 +0+0
0x80000b "xeyes": ("xeyes" "XEyes") 150x100+3179+1152 +3179+1152
1 child:
0x80000c (has no name): () 150x100+0+0 +3179+1152
0x600004 "Chrome のシークレット モードでブラウジングのプライバシーが保護される仕組み - Google Chrome ヘルプ - Chromium": ("chromium" "Chromium") 1920x1042+2160+779 +2160+779
$
I have found a workaround that can at least reduce mistakes. With the following settings, you can focus on the window where you made a wrong click.
focus_on_window_activation focus
Screencast:
https://github.com/user-attachments/assets/2ddd91b4-4c24-4d4d-b5e6-9433d93e63da
Unfortunately, however, it is not a fundamental solution. I am very sorry that this may be a very difficult task, but I would be glad if you would consider improving it.
Can you try https://github.com/swaywm/sway/pull/8268?
Can you try #8268?
@emersion @Nefsen402 Thanks. However, unfortunately it still does not seem to work.
$ pacman -Q sway-git wlroots-git linux mesa
sway-git 1.10.r7379.7e74a49-1
wlroots-git 0.19.0.r7134.42673a282-1
linux 6.10.1.arch1-1
mesa 1:24.1.4-2
$
https://github.com/user-attachments/assets/f4ae9f51-ad7e-4554-8b12-30afeee713c9
From IRC:
Nefsen402 | emersion: Wouldn't xwayland stacking still be subtly broken because it doesn't consider floating xwayland surfaces?
emersion | yeah
Nefsen402 | What a mess, yeah, I think I'll make a scene helper my next project
emersion | that's a great idea
To fix the stacking issue with floating windows, we need to add new features to scene. Since we are in a weird between time where we have a new wlroots release, but no sway release, sway is unlikely to have the fix for version 1.10.
I'll leave the issue open so we can triage the real fix.
This should be fully fixed with a combination of https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4756 and this sway patch:
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index e4d54ca6..ce2a4e23 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -289,9 +289,6 @@ static void set_activated(struct sway_view *view, bool activated) {
}
wlr_xwayland_surface_activate(surface, activated);
- if (activated) {
- wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE);
- }
}
static void set_tiled(struct sway_view *view, bool tiled) {
@Nefsen402 @vyivel Thanks, but unfortunately it still doesn't seem to work. Is there something I need to do?
$ pacman -Q sway-git wlroots-git linux mesa
sway-git 1.10.r7387.951a22c-1
wlroots-git 0.19.0.r7165.14446216f-1
linux 6.10.2.arch1-1
mesa 1:24.1.4-2
$
https://github.com/user-attachments/assets/74e5edce-2579-4a51-8786-770b4961c930
Yeah, I can reproduce this, and I think it's because wlr_xwayland_surface_restack itself is busted somehow
What's this business with "chromium" (multiple instances) and "chromium clipboard"
Hmm, xeyes and only xeyes lets me click through the middle of the eyes. I cannot reproduce a defect with any other xwayland client. Can you see if you have issues with other xwayland clients?
Hmm, I think xeyes has an odd input region. I cannot reproduce this with any other client but xeyes so closing again.
@Nefsen402 The REAPER procedure also seems to reproduce the problem.
https://github.com/user-attachments/assets/47dd8ec6-8aea-48a9-a08a-b2a3d9690c44
[a@gb1 ~]$ sleep 10 ; xwininfo -root -tree
\
xwininfo: Window id: 0x4f6 (the root window) (has no name)
Root window id: 0x4f6 (the root window) (has no name)
Parent window id: 0x0 (none)
13 children:
0xe00009 (has no name): () 1x1+-1+-1 +-1+-1
0xe00001 "reaper": ("reaper" "") 10x10+10+10 +10+10
0x400005 (has no name): () 1x1+0+0 +0+0
0x600008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0
1 child:
0x600009 (has no name): () 1x1+-1+-1 +-1+-1
0x600003 (has no name): () 1x1+-1+-1 +-1+-1
0x600001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10
0x400001 "Chromium clipboard": () 10x10+-100+-100 +-100+-100
0x200004 "wlroots wm": () 10x10+0+0 +0+0
0x200003 (has no name): () 8192x8192+0+0 +0+0
0x200002 (has no name): () 10x10+0+0 +0+0
0x200001 (has no name): () 10x10+0+0 +0+0
0x400004 "新しいシークレット タブ - Chromium": ("chromium" "Chromium") 1916x1028+3842+50 +3842+50
0xe00122 "REAPER v7.19 - EVALUATION LICENSE": ("REAPER" "REAPER") 1916x1028+3842+50 +3842+50
1 child:
0xe00123 (has no name): () 1x1+-1+-1 +3841+49
[a@gb1 ~]$
It certainly looks wrong to test with xeyes
.
The face part passes the click, but not the eyes, so I guess this is that kind of software.
I didn't notice. I'm sorry.
https://github.com/user-attachments/assets/a8a171e6-9dc5-4a3f-8d05-07f0eedbc7e4
But it is still a problem with REAPER. When using floating windows for various information screens, editing screens, instruments, etc., Chrome is often clicked on by mistake.
https://github.com/user-attachments/assets/96e6411c-79a3-40c0-8d4a-f624a827f792
it seems to me that there is a point to this "click-through on the face" feature of xeyes. This is because this click-through appears to be a click-through of the z-order itself.
https://github.com/user-attachments/assets/b279eca4-4d0a-4ebb-bd55-083e42326cc8
However, fixing it does not necessarily solve the REAPER problem. Sorry if they are separate causes.
Can you collect an xwininfo
and xprop -id <id>
for each REAPER window, when you are in this weird state where a REPEAR window is displayed on top but clicking it would focus Chrome?
Also I suppose wlroots!4772 might help?
@emersion
Can you collect an
xwininfo
andxprop -id <id>
for each REAPER window, when you are in this weird state where a REPEAR window is displayed on top but clicking it would focus Chrome?
This is just before I click through from REAPER to chromium.
https://github.com/user-attachments/assets/190a684f-db93-48e3-ae04-c82d825901dd
Also I suppose wlroots!4772 might help?
I tested the following version, is that correct?
$ pacman -Q sway-git wlroots-git linux mesa
sway-git 1.10.r7387.951a22c-1
wlroots-git 0.19.0.r7165.14446216f-1
linux 6.10.2.arch1-1
mesa 1:24.1.4-2
$
https://gitlab.freedesktop.org/wlroots/wlroots/-/commits/master/?ref_type=HEADS#:~:text=14446216
@emersion This is xwininfo -root -tree
just before you click through from REAPER to chromium.
https://github.com/user-attachments/assets/e72d6d68-d5e0-431c-9554-edeebdcdd204
Yeah… Not sure what's up here: the REAPER window is correctly restacked on top of the Chromium window...
focus_on_window_activation focus
and reloadurgent
xwininfo -root -tree
Would this be suspicious?
0x600142 (has no name): () 1x1+-1+-1 +976+2900
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x600142
https://github.com/user-attachments/assets/375381dc-f89f-41f5-828e-747c6fad733f
@emersion I installed labwc and tried to see what happens, but the problem does not seem to occur because once the REAPER child window is focused, the parent window is stacked next to it. Would this solution work for sway?
https://github.com/user-attachments/assets/f1addc9f-d3d6-4c2f-8cb4-dbf104513544
$ pacman -Q labwc-git wlroots
labwc-git 0.7.3.r67.g72df8fe7-1
wlroots 0.18.0-1
$
In this test procedure, the event is reproduced in sway v1.8.1
as well, so it does not seem to be a regression there at least.
$ pacman -Q sway wlroots linux mesa
sway 1:1.8.1-5
wlroots 0.16.2-2
linux 6.10.2.arch1-1
mesa 1:24.1.4-2
$
https://github.com/user-attachments/assets/915c58bf-aece-43f1-a811-e24febcea8b9
On labwc, I got xwininfo -root -tree
by clicking on Chromium and then on the REAPER child window.
Is the stacking method the opposite of sway?
https://github.com/user-attachments/assets/3805aaad-c597-4d6e-a8a5-1c1f1d1bb234
[a@gb1 ~]$ pacman -Q labwc wlroots0.17
labwc 0.7.4-1
wlroots0.17 0.17.4-3
[a@gb1 ~]$
[a@gb1 ~]$ sleep 5 ; xwininfo -root -tree
xwininfo: Window id: 0x4ef (the root window) (has no name)
Root window id: 0x4ef (the root window) (has no name)
Parent window id: 0x0 (none)
14 children:
0x400347 "About REAPER v7.19/linux-x86_64 rev 5f35fa (Jul 23 2024)": ("REAPER" "REAPER") 573x421+1240+370 +1240+370
1 child:
0x400348 (has no name): () 1x1+-1+-1 +1239+369
0x40031b "REAPER v7.19 - EVALUATION LICENSE": ("REAPER" "REAPER") 1024x768+568+180 +568+180
1 child:
0x40031c (has no name): () 1x1+-1+-1 +567+179
0x600004 "新しいシークレット タブ - Chromium": ("chromium" "Chromium") 1036x583+748+293 +748+293
0x600005 (has no name): () 1x1+0+0 +0+0
0xe00008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0
1 child:
0xe00009 (has no name): () 1x1+-1+-1 +-1+-1
0xe00003 (has no name): () 1x1+-1+-1 +-1+-1
0xe00001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10
0x600001 "Chromium clipboard": () 10x10+-100+-100 +-100+-100
0x400009 (has no name): () 1x1+-1+-1 +-1+-1
0x400001 "reaper": ("reaper" "") 10x10+10+10 +10+10
0x200004 "wlroots wm": () 10x10+0+0 +0+0
0x200003 (has no name): () 8192x8192+0+0 +0+0
0x200002 (has no name): () 10x10+0+0 +0+0
0x200001 (has no name): () 10x10+0+0 +0+0
[a@gb1 ~]$
The same form in the current sway would look like this.
https://github.com/user-attachments/assets/075ac4d1-5436-4d0c-ba41-c3ed035f0582
[a@gb1 ~]$ pacman -Q sway-git wlroots-git linux mesa
sway-git 1.10.r7390.b440155-1
wlroots-git 0.19.0.r7172.621414473-1
linux 6.10.2.arch1-1
mesa 1:24.1.4-2
[a@gb1 ~]$
[a@gb1 ~]$ sleep 5 ; xwininfo -root -tree
xwininfo: Window id: 0x512 (the root window) (has no name)
Root window id: 0x512 (the root window) (has no name)
Parent window id: 0x0 (none)
17 children:
0x800005 (has no name): () 1x1+0+0 +0+0
0xa00008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0
1 child:
0xa00009 (has no name): () 1x1+-1+-1 +-1+-1
0xa00003 (has no name): () 1x1+-1+-1 +-1+-1
0xa00001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10
0x800001 "Chromium clipboard": () 10x10+-100+-100 +-100+-100
0x400009 (has no name): () 1x1+-1+-1 +-1+-1
0x400001 "reaper": ("reaper" "") 10x10+10+10 +10+10
0x600003 "Fcitx5 Input Window": ("fcitx" "fcitx") 1x1+0+0 +0+0
0x600001 (has no name): () 1x1+0+0 +0+0
0x600000 (has no name): () 1x1+0+0 +0+0
0x200004 "wlroots wm": () 10x10+0+0 +0+0
0x200003 (has no name): () 8192x8192+0+0 +0+0
0x200002 (has no name): () 10x10+0+0 +0+0
0x200001 (has no name): () 10x10+0+0 +0+0
0x401452 "About REAPER v7.19/linux-x86_64 rev 5f35fa (Jul 23 2024)": ("REAPER" "REAPER") 573x421+1085+3133 +1085+3133
1 child:
0x401453 (has no name): () 1x1+-1+-1 +1084+3132
0x800004 "新しいシークレット タブ - Chromium": ("chromium" "Chromium") 958x1041+961+2901 +961+2901
0x400119 "REAPER v7.19 - EVALUATION LICENSE": ("REAPER" "REAPER") 958x1041+961+2901 +961+2901
1 child:
0x40011a (has no name): () 1x1+-1+-1 +960+2900
[a@gb1 ~]$
@emersion @Nefsen402
Also I suppose wlroots!4772 might help?
I think I have probably patched it successfully, but it still doesn't seem to work. Am I doing something wrong?
https://github.com/user-attachments/assets/24a59ba6-8f93-42c0-be03-ad396c1e9106
I don't understand, the video clip just shared shows that stacking is kept correct? It might be worth running watch -n 1 xwininfo -root -tree
which will continuously update the console with xwayland stacking information while the reproduction happens. That would reduce the confusion.
@Nefsen402 I tried. Did I do it well?
https://github.com/user-attachments/assets/f69127ff-8717-44e4-a0e9-2271f4b1daa3
@Nefsen402 @emersion Understood. If the title bar turns red, there is no problem as long as there is no click-through from REAPER to chromium, etc. After a quick check, that glitch does not appear to be there. Maybe I was just using the wrong method of checking and in reality this has been resolved. You can have it closed. I will report back if I notice anything else. Thanks for your help. I know it was a lot of work. Thanks so much for working on this.
09:31:36 <Nefsen402> We'll close the issue after the wlroots MR is merged. 09:31:55 <Nefsen402> Although now I'm wondering if it worked fine before the patch and it was just part of the misunderstanding.
I tried the same thing before applying the patch and it may work fine. At least a quick check showed no click-through from REAPER to chromium.
https://github.com/user-attachments/assets/6535693e-a83b-4bc9-9305-b7afee9ed9df
Thank you for all your patience and quickness to respond! Thank you for making open source better.
Sway Version:
1.10-dev-88b2abf5 (Feb 11 2024, branch 'master')
0.18.0-dev
Arch Linux x86_64
6.7.4-arch1-1
Screencast, Debug Log:
https://github.com/swaywm/sway/assets/102382754/6aed8b7a-2c98-4b6a-99f8-6d352a942392
Configuration File:
/etc/sway/config
Description: Reproduction procedure
sudo pacman -S chromium reaper
to Install Chromium and REAPERsway -c /etc/sway/config -d 2> sway-run-default_
date +%Y%m%d-%H%M%S.log
to start Swaymeta+enter
to start footchromium<enter>
to start Chromiummeta+w
to make tab layoutmeta+enter
to start footreaper<enter>
to start REAPERescape
to close the floating window-> I can't click on the REAPER window, the Chromium tab turns red. Layers are in the wrong order.
Comment
I have heard that REAPER uses some sort of proprietary GUI library for games, so this may be related to that.The same problem occurs with Renoise, which is also an application for music and uses its own GUI library often used for games.Related Links
7608