swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.68k stars 1.11k forks source link

Multiple Xwayland windows are stacked in the wrong order #7974

Closed tkna91 closed 3 months ago

tkna91 commented 9 months ago

Sway Version:

Screencast, Debug Log:

https://github.com/swaywm/sway/assets/102382754/6aed8b7a-2c98-4b6a-99f8-6d352a942392

Configuration File:

Description: Reproduction procedure

  1. sudo pacman -S chromium reaper to Install Chromium and REAPER
  2. sway -c /etc/sway/config -d 2> sway-run-default_date +%Y%m%d-%H%M%S.log to start Sway
  3. meta+enter to start foot
  4. chromium<enter> to start Chromium
  5. meta+w to make tab layout
  6. meta+enter to start foot
  7. reaper<enter> to start REAPER
  8. escape to close the floating window
  9. click anywhere in the REAPER window

-> I can't click on the REAPER window, the Chromium tab turns red. Layers are in the wrong order.

Comment

Related Links

emersion commented 9 months ago

Is this a regression? Does this work fine on previous Sway versions?

tkna91 commented 9 months ago

@emersion I think it was the same before, but let's check with the official release version, shall I ?

tkna91 commented 9 months ago

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

Nefsen402 commented 9 months ago

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?

emersion commented 9 months ago

Can you provide the output of xwininfo -tree -root when the windows are in this bad state?

tkna91 commented 9 months ago

@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

tkna91 commented 9 months ago

I found out how to reproduce the event in the current version.

Version:

Reproduction procedure:

  1. sudo pacman -S chromium reaper to Install Chromium and REAPER
  2. sway -c /etc/sway/config -d 2> sway-run-default_date +%Y%m%d-%H%M%S.log to start Sway
  3. meta+enter to start foot
  4. chromium to start Chromium
  5. meta+w to make tab layout
  6. meta+enter to start foot
  7. reaper to start REAPER
  8. escape to close the floating window

This will still reproduce, but a quick operation of the following will reproduce it again.

  1. meta+shift+j to move the chromium window down
  2. meta+shift+k to move the chromium window back
  3. Focus on the reaper window
  4. ctrl+f1 to bring up a floating window
  5. escape to close the floating window
  6. Click anywhere in the reaper window

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: 20240216-143732_screenshot

Screencast:

https://github.com/swaywm/sway/assets/102382754/7412337c-75e9-4bf3-999c-a535960844e6

20240216-141721-chromium.log

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.

tkna91 commented 8 months ago

I found an easier way to reproduce it.

  1. Focus on the reaper window
  2. ctrl+f1 to bring up a floating window
  3. Focus on the the chromium window
  4. close the floating window

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
$
tkna91 commented 7 months ago

The GUI for REAPER was open source. It appears to use this.

tkna91 commented 7 months ago

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
baltitenger commented 6 months ago

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.

tkna91 commented 5 months ago

@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
$ 
tkna91 commented 3 months ago

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.

emersion commented 3 months ago

Can you try https://github.com/swaywm/sway/pull/8268?

tkna91 commented 3 months ago

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

Nefsen402 commented 3 months ago

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.

Nefsen402 commented 3 months ago

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) {
tkna91 commented 3 months ago

@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

Nefsen402 commented 3 months ago

Yeah, I can reproduce this, and I think it's because wlr_xwayland_surface_restack itself is busted somehow

Nefsen402 commented 3 months ago

image What's this business with "chromium" (multiple instances) and "chromium clipboard"

Nefsen402 commented 3 months ago

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?

Nefsen402 commented 3 months ago

Hmm, I think xeyes has an odd input region. I cannot reproduce this with any other client but xeyes so closing again.

tkna91 commented 3 months ago

@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 ~]$ 

sway-run-default_20240808-142348.log

tkna91 commented 3 months ago

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

tkna91 commented 3 months ago

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.

emersion commented 3 months ago

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?

emersion commented 3 months ago

Also I suppose wlroots!4772 might help?

tkna91 commented 3 months ago

@emersion

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?

This is just before I click through from REAPER to chromium.

https://github.com/user-attachments/assets/190a684f-db93-48e3-ae04-c82d825901dd

Click to expand ``` [a@gb1 ~]$ cowsay $(date "+%Y-%m-%d %H:%M:%S %Z") ; for i in 0x143cf2a 0x140026d 0x600004 ; do cowsay "*ID: $i *" ; xprop -id $i ; done _________________________ < 2024-08-10 20:50:32 JST > ------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || __________________ < *ID: 0x143cf2a * > ------------------ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 21 (X_ListProperties) Resource id in failed request: 0x143cf2a Serial number of failed request: 12 Current serial number in output stream: 12 __________________ < *ID: 0x140026d * > ------------------ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || GDK_SELECTION(UTF8_STRING) = "cowsay $(date \"+%Y-%m-%d %H:%M:%S %Z\") ; for i in 0x14298ae 0x14002d 0x600004 ; do cowsay \"*ID: $i *\" ; xprop -id $i ; done\n" _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ WM_STATE(WM_STATE): window state: Normal icon window: 0x0 WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. bitmap id # to use for icon: 0x1400271 bitmap id # of mask for icon: 0x1400277 window id # of group leader: 0x1400001 XdndAware(ATOM) = BITMAP _NET_WM_ICON(CARDINAL) = _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x11, 0x0, 0x0 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 20972143, 20972144 _NET_WM_USER_TIME(CARDINAL) = 335998210 _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x140026e WM_CLIENT_LEADER(WINDOW): window id # 0x1400001 _NET_WM_PID(CARDINAL) = 3100967 WM_LOCALE_NAME(STRING) = "C" WM_CLIENT_MACHINE(STRING) = "gb1" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified location: 0, 0 program specified minimum size: 300 by 300 program specified maximum size: 16384 by 16384 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_CLASS(STRING) = "REAPER", "REAPER" WM_ICON_NAME(STRING) = "REAPER v7.19 - EVALUATION LICENSE" _NET_WM_ICON_NAME(UTF8_STRING) = "REAPER v7.19 - EVALUATION LICENSE" WM_NAME(STRING) = "REAPER v7.19 - EVALUATION LICENSE" _NET_WM_NAME(UTF8_STRING) = "REAPER v7.19 - EVALUATION LICENSE" _________________ < *ID: 0x600004 * > ----------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || WM_STATE(WM_STATE): window state: Normal icon window: 0x0 _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ _NET_WM_USER_TIME(CARDINAL) = 335924654 WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified location: 0, 2901 program specified minimum size: 500 by 88 window gravity: Static _NET_WM_OPAQUE_REGION(CARDINAL) = 0, 0, 958, 1041 _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0 XdndAware(ATOM) = BITMAP _NET_WM_ICON(CARDINAL) = Icon (128 x 128): (not shown) _NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2 WM_NAME(UTF8_STRING) = "新しいシークレット タブ - Chromium" _NET_WM_NAME(UTF8_STRING) = "新しいシークレット タブ - Chromium" WM_WINDOW_ROLE(STRING) = "browser" WM_CLASS(STRING) = "chromium", "Chromium" _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL _NET_WM_PID(CARDINAL) = 3061242 WM_CLIENT_MACHINE(STRING) = "gb1" WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, _NET_WM_PING, _NET_WM_SYNC_REQUEST [a@gb1 ~]$ ```

xwininfo-20240810-204950.log

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

tkna91 commented 3 months ago

@emersion This is xwininfo -root -tree just before you click through from REAPER to chromium.

Click to expand ``` 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) 16 children: 0x1400005 (has no name): () 1x1+0+0 +0+0 0x1600008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0 1 child: 0x1600009 (has no name): () 1x1+-1+-1 +-1+-1 0x1600003 (has no name): () 1x1+-1+-1 +-1+-1 0x1600001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10 0x1400001 "Chromium clipboard": () 10x10+-100+-100 +-100+-100 0x600009 (has no name): () 1x1+-1+-1 +-1+-1 0x600001 "reaper": ("reaper" "") 10x10+10+10 +10+10 0x1c00003 "Fcitx5 Input Window": ("fcitx" "fcitx") 1x1+0+0 +0+0 0x1c00001 (has no name): () 1x1+0+0 +0+0 0x1c00000 (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 0x1400004 "新しいシークレット タブ - Chromium": ("chromium" "Chromium") 942x1041+977+2901 +977+2901 0x600141 "REAPER v7.19 - EVALUATION LICENSE": ("REAPER" "REAPER") 942x1041+977+2901 +977+2901 1 child: 0x600142 (has no name): () 1x1+-1+-1 +976+2900 ```

https://github.com/user-attachments/assets/e72d6d68-d5e0-431c-9554-edeebdcdd204

xwininfo-20240810-223945.log

emersion commented 3 months ago

Yeah… Not sure what's up here: the REAPER window is correctly restacked on top of the Chromium window...

tkna91 commented 3 months ago
Click to expand ``` 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) 16 children: 0x400003 "Fcitx5 Input Window": ("fcitx" "fcitx") 1x1+0+0 +0+0 0x400001 (has no name): () 1x1+0+0 +0+0 0x400000 (has no name): () 1x1+0+0 +0+0 0x1400005 (has no name): () 1x1+0+0 +0+0 0x1600008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0 1 child: 0x1600009 (has no name): () 1x1+-1+-1 +-1+-1 0x1600003 (has no name): () 1x1+-1+-1 +-1+-1 0x1600001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10 0x1400001 "Chromium clipboard": () 10x10+-100+-100 +-100+-100 0x600009 (has no name): () 1x1+-1+-1 +-1+-1 0x600001 "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 0x1400004 "新しいシークレット タブ - Chromium": ("chromium" "Chromium") 942x1041+977+2901 +977+2901 0x600141 "REAPER v7.19 - EVALUATION LICENSE": ("REAPER" "REAPER") 942x1041+977+2901 +977+2901 1 child: 0x600142 (has no name): () 1x1+-1+-1 +976+2900 [a@gb1 ~]$ ```

Would this be suspicious?

https://github.com/user-attachments/assets/375381dc-f89f-41f5-828e-747c6fad733f

xwininfo-20240810-231312.log

tkna91 commented 3 months ago

@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
$
tkna91 commented 3 months ago

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
$ 
  1. Focus on the reaper window
  2. ctrl+f1 to bring up a floating window
  3. Focus on the the chromium window
  4. close the floating window

https://github.com/user-attachments/assets/915c58bf-aece-43f1-a811-e24febcea8b9

tkna91 commented 3 months ago

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 ~]$ 
tkna91 commented 3 months ago

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 ~]$ 
tkna91 commented 3 months ago

@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

Click to expand ```bash [a@gb1 ~]$ cd ~/.cache/paru/clone/wlroots-git [a@gb1 wlroots-git]$ git diff HEAD~ diff --git a/PKGBUILD b/PKGBUILD index b63435d..a703a23 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ # Maintainer: GreyXor # Maintainer: Antonin Décimo pkgname=wlroots-git -pkgver=0.19.0.r7126.e17916d4 +pkgver=0.19.0.r7176.e6dbe458 pkgrel=1 pkgdesc='Modular Wayland compositor library (git development version)' arch=(x86_64) @@ -41,8 +41,10 @@ optdepends=( 'xorg-xwayland: enable X11 support' ) provides=("lib${pkgname%-git}-${pkgver%.*.*.*}.so") -source=("${pkgname}::git+${url}.git") -b2sums=('SKIP') +source=("${pkgname}::git+${url}.git" + "https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4772.patch") +b2sums=('SKIP' +'SKIP') _builddir="build" _builddir_pkgver="build-pkgver" @@ -56,6 +58,8 @@ _meson_setup() { prepare() { _meson_setup "${_builddir_pkgver}" + cd "${pkgname}" + patch -p1 -i ../4772.patch } pkgver() { [a@gb1 wlroots-git]$ [a@gb1 wlroots-git]$ pacman -Q sway-git wlroots-git linux mesa sway-git 1.10.r7390.b440155-1 wlroots-git 0.19.0.r7176.e6dbe458-1 linux 6.10.2.arch1-1 mesa 1:24.1.4-2 [a@gb1 wlroots-git]$ [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: 0x800003 "Fcitx5 Input Window": ("fcitx" "fcitx") 1x1+0+0 +0+0 0x800001 (has no name): () 1x1+0+0 +0+0 0x800000 (has no name): () 1x1+0+0 +0+0 0xa00005 (has no name): () 1x1+0+0 +0+0 0xc00008 "chromium": ("chromium" "Chromium") 200x200+0+0 +0+0 1 child: 0xc00009 (has no name): () 1x1+-1+-1 +-1+-1 0xc00003 (has no name): () 1x1+-1+-1 +-1+-1 0xc00001 "chromium": ("chromium" "Chromium") 10x10+10+10 +10+10 0xa00001 "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 0x4099b2 "About REAPER v7.19/linux-x86_64 rev 5f35fa (Jul 23 2024)": ("REAPER" "REAPER") 573x421+1099+3221 +1099+3221 1 child: 0x4099b3 (has no name): () 1x1+-1+-1 +1098+3220 0xa00004 "新しいシークレット タブ - Chromium": ("chromium" "Chromium") 958x1041+961+2901 +961+2901 0x40030f "REAPER v7.19 - EVALUATION LICENSE": ("REAPER" "REAPER") 958x1041+961+2901 +961+2901 1 child: 0x400310 (has no name): () 1x1+-1+-1 +960+2900 [a@gb1 ~]$
Nefsen402 commented 3 months ago

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.

tkna91 commented 3 months ago

@Nefsen402 I tried. Did I do it well?

https://github.com/user-attachments/assets/f69127ff-8717-44e4-a0e9-2271f4b1daa3

tkna91 commented 3 months ago

@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.

tkna91 commented 3 months ago

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

Nefsen402 commented 3 months ago

Thank you for all your patience and quickness to respond! Thank you for making open source better.