swaywm / sway

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

Rapid flashing between destroyed surface and current surface when in fullscreen mode #5224

Open varagnac opened 4 years ago

varagnac commented 4 years ago

sway -v gives version 1.4 Programs affected include: qutebrowser, luakit. I don't use gui programs with right-click menu a lot so I'm not sure. Calibre is not affected. I've encountered the same phenomenom in Firefox once. It should be easy to reproduce. Open qutebrowser, switch from tiling to fullscreen mode, right click so the menu shows up, move the cursor. The screen flashes rapidly between previous drawn screen when tiling and the current screen. Or switch from other workspace to fullscreened qutebrowser and repeat the above procedure. The screen flashes rapidly between previous drawn screen when focusing on previously focused workspace and the current screen. Or right click to open the menu, and discard it, then scroll down some lines, and then right click and open the menu again, move the cursor, screen flashes between what is drawn pre-scroll and post-scroll. Intel GPU ( don't think it is related)

I thought this was a qutebrowser bug at first but the behavior, especially when switching between different workspaces, doesn't seem to indicate that it is the case. Everything is ok when tiling.

I have in my profile

export QT_QPA_PLATFORM=wayland-egl
export MOZ_ENABLE_WAYLAND=1
export ECORE_EVAS_ENGINE=wayland_egl
export ELM_ENGINE=wayland_egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1

as for the log, the following messages are shown tenths of times, in about 2 seconds.

2020-04-16 17:00:58 - [sway/ipc-server.c:334] Sending window::title event
2020-04-16 17:00:58 - [sway/ipc-server.c:937] Added IPC reply of type 0x80000003 to client 60 queue: { "change": "title", "container": { "id": 10, "name": "[80%] DuckDuckGo — Privacy, simplified. - qutebrowser", "rect": { "x": 962, "y": 4, "width": 954, "height": 1052 }, "focused": true, "focus": [ ], "border": "pixel", "current_border_width": 3, "layout": "none", "orientation": "none", "percent": 0.4989539748953975, "window_rect": { "x": 3, "y": 3, "width": 948, "height": 1046 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 800, "height": 600 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "con", "fullscreen_mode": 0, "pid": 152230, "app_id": "org.qutebrowser.qutebrowser", "visible": true, "marks": [ ], "max_render_time": 0, "nodes": [ ] } }
2020-04-16 17:00:58 - [sway/ipc-server.c:937] Added IPC reply of type 0x80000003 to client 68 queue: { "change": "title", "container": { "id": 10, "name": "[80%] DuckDuckGo — Privacy, simplified. - qutebrowser", "rect": { "x": 962, "y": 4, "width": 954, "height": 1052 }, "focused": true, "focus": [ ], "border": "pixel", "current_border_width": 3, "layout": "none", "orientation": "none", "percent": 0.4989539748953975, "window_rect": { "x": 3, "y": 3, "width": 948, "height": 1046 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 800, "height": 600 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "con", "fullscreen_mode": 0, "pid": 152230, "app_id": "org.qutebrowser.qutebrowser", "visible": true, "marks": [ ], "max_render_time": 0, "nodes": [ ] } }
2020-04-16 17:00:58 - [sway/tree/view.c:432] Checking criteria [app_id="org.qutebrowser.qutebrowser"]
2020-04-16 17:00:58 - [sway/tree/view.c:434] Criteria already executed
2020-04-16 17:00:58 - [sway/ipc-server.c:524] Client 60 writable
2020-04-16 17:00:58 - [sway/ipc-server.c:524] Client 68 writable
2020-04-16 17:00:58 - [sway/ipc-server.c:220] Client 66 readable
2020-04-16 17:00:58 - [sway/ipc-server.c:937] Added IPC reply of type 0x4 to client 66 queue: { "id": 1, "name": "root", "rect": { "x": 0, "y": 0, "width": 1920, "height": 1080 }, "focused": false, "focus": [ 3 ], "border": "none", "current_border_width": 0, "layout": "splith", "orientation": "horizontal", "percent": null, "window_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 0, "height": 0 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "root", "nodes": [ { "id": 2147483647, "name": "__i3", "rect": { "x": 0, "y": 0, "width": 1920, "height": 1080 }, "focused": false, "focus": [ 2147483646 ], "border": "none", "current_border_width": 0, "layout": "output", "orientation": "horizontal", "percent": null, "window_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 0, "height": 0 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "output", "nodes": [ { "id": 2147483646, "name": "__i3_scratch", "rect": { "x": 0, "y": 0, "width": 1920, "height": 1080 }, "focused": false, "focus": [ ], "border": "none", "current_border_width": 0, "layout": "splith", "orientation": "horizontal", "percent": null, "window_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 0, "height": 0 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "workspace" } ] }, { "id": 3, "name": "eDP-1", "rect": { "x": 0, "y": 0, "width": 1920, "height": 1080 }, "focused": false, "focus": [ 4, 6 ], "border": "none", "current_border_width": 0, "layout": "output", "orientation": "none", "percent": 1.0, "window_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 0, "height": 0 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "output", "active": true, "dpms": true, "primary": false, "make": "Sharp Corporation", "model": "0x14B9", "serial": "0x00000000", "scale": 2.0, "scale_filter": "nearest", "transform": "normal", "current_workspace": "1:Main", "modes": [ { "width": 3840, "height": 2160, "refresh": 59997 } ], "current_mode": { "width": 3840, "height": 2160, "refresh": 59997 }, "max_render_time": 0, "nodes": [ { "id": 4, "name": "1:Main", "rect": { "x": 4, "y": 4, "width": 1912, "height": 1052 }, "focused": false, "focus": [ 10, 8 ], "border": "none", "current_border_width": 0, "layout": "splith", "orientation": "horizontal", "percent": null, "window_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 0, "height": 0 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "num": 1, "output": "eDP-1", "type": "workspace", "representation": "H[org.qutebrowser.qutebrowser org.qutebrowser.qutebrowser]", "nodes": [ { "id": 8, "name": "Whoops!", "rect": { "x": 4, "y": 4, "width": 955, "height": 1052 }, "focused": false, "focus": [ ], "border": "pixel", "current_border_width": 3, "layout": "none", "orientation": "none", "percent": 0.49947698744769875, "window_rect": { "x": 3, "y": 3, "width": 949, "height": 1046 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 640, "height": 600 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "con", "fullscreen_mode": 0, "pid": 152230, "app_id": "org.qutebrowser.qutebrowser", "visible": true, "marks": [ ], "max_render_time": 0, "nodes": [ ] }, { "id": 10, "name": "[80%] DuckDuckGo — Privacy, simplified. - qutebrowser", "rect": { "x": 962, "y": 4, "width": 954, "height": 1052 }, "focused": true, "focus": [ ], "border": "pixel", "current_border_width": 3, "layout": "none", "orientation": "none", "percent": 0.4989539748953975, "window_rect": { "x": 3, "y": 3, "width": 948, "height": 1046 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 800, "height": 600 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "con", "fullscreen_mode": 0, "pid": 152230, "app_id": "org.qutebrowser.qutebrowser", "visible": true, "marks": [ ], "max_render_time": 0, "nodes": [ ] } ] }, { "id": 6, "name": "10", "rect": { "x": 4, "y": 4, "width": 1912, "height": 1052 }, "focused": false, "focus": [ 5 ], "border": "none", "current_border_width": 0, "layout": "splith", "orientation": "horizontal", "percent": null, "window_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 0, "height": 0 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "num": 10, "output": "eDP-1", "type": "workspace", "representation": "H[kitty]", "nodes": [ { "id": 5, "name": "~", "rect": { "x": 4, "y": 4, "width": 1912, "height": 1052 }, "focused": false, "focus": [ ], "border": "pixel", "current_border_width": 3, "layout": "none", "orientation": "none", "percent": 1.0, "window_rect": { "x": 3, "y": 3, "width": 1906, "height": 1046 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 1906, "height": 1014 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "con", "fullscreen_mode": 0, "pid": 152132, "app_id": "kitty", "visible": false, "marks": [ ], "max_render_time": 0, "nodes": [ ] } ] } ] } ] }
2020-04-16 17:00:58 - [sway/ipc-server.c:524] Client 66 writable
Linden6 commented 4 years ago

I have only been using Sway for two days, but am noticing the same behaviour. Although I have experienced it in videos in Firefox, it is most apparent to me when using Nomacs image viewer - an image can be panned around within a window tile quite smoothly, but when opened in fullscreen mode panning produces bands of multicoloured artefacts. (These disappear when the image comes to rest.)

yokelpole commented 4 years ago

I'm seeing this as well after updating to Ubuntu 20.04. I'm primarily seeing it in Firefox with videos and when scrolling while the app is fullscreen.

Using a Dell XPS 13 w/ Intel integrated graphics.

$ lspci | grep Intel
00:00.0 Host bridge: Intel Corporation Device 9b51
00:02.0 VGA compatible controller: Intel Corporation Device 9bca (rev 04)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
yokelpole commented 4 years ago

I did a bit more digging and I think that this may be related to xwayland as it goes away when I run Firefox in wayland mode. I turned on sway's logging info and it seems like these errors were happening when the corruption was visible:

2020-04-29 20:26:27 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194307)
2020-04-29 20:26:27 - [xwayland/xwm.c:722] unhandled X11 property 326 (_NET_WM_USER_TIME) for window 4194307
2020-04-29 20:26:27 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194307)
2020-04-29 20:26:27 - [xwayland/xwm.c:722] unhandled X11 property 326 (_NET_WM_USER_TIME) for window 4194307

I'm not certain this output would be related, but it's the only output that seemed out of the ordinary.

I also tried to replicate on a machine that has Nvidia graphics and the corruption was not present there, so I'm thinking that this is probably specific for Intel integrated graphics.

I also tested nomacs to see if I could see what Linden6 was seeing, and there was plenty of corruption. Here are the sway logs for that program when this was happening:

2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:722] unhandled X11 property 335 (_NET_WM_ICON_NAME) for window 4194310
[120 21:01:37.420347] No render frame received in 0.250000 seconds, re-requesting at: 8.312701
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:441] XCB_ATOM_WM_NAME: IMG_0615.jpg  - 1600 x 1200
[120 21:01:37.423418] No render frame received in 0.250000 seconds, re-requesting at: 8.315767
2020-04-29 21:01:37 - [sway/tree/view.c:432] Checking criteria [class=".*"]
2020-04-29 21:01:37 - [sway/tree/view.c:434] Criteria already executed
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:441] XCB_ATOM_WM_NAME: IMG_0615.jpg  - 1600 x 1200
2020-04-29 21:01:37 - [sway/tree/view.c:432] Checking criteria [class=".*"]
2020-04-29 21:01:37 - [sway/tree/view.c:434] Criteria already executed
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:722] unhandled X11 property 335 (_NET_WM_ICON_NAME) for window 4194310
varagnac commented 4 years ago

I did a bit more digging and I think that this may be related to xwayland as it goes away when I run Firefox in wayland mode. I turned on sway's logging info and it seems like these errors were happening when the corruption was visible:

2020-04-29 20:26:27 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194307)
2020-04-29 20:26:27 - [xwayland/xwm.c:722] unhandled X11 property 326 (_NET_WM_USER_TIME) for window 4194307
2020-04-29 20:26:27 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194307)
2020-04-29 20:26:27 - [xwayland/xwm.c:722] unhandled X11 property 326 (_NET_WM_USER_TIME) for window 4194307

I'm not certain this output would be related, but it's the only output that seemed out of the ordinary.

I also tried to replicate on a machine that has Nvidia graphics and the corruption was not present there, so I'm thinking that this is probably specific for Intel integrated graphics.

I also tested nomacs to see if I could see what Linden6 was seeing, and there was plenty of corruption. Here are the sway logs for that program when this was happening:

2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:722] unhandled X11 property 335 (_NET_WM_ICON_NAME) for window 4194310
[120 21:01:37.420347] No render frame received in 0.250000 seconds, re-requesting at: 8.312701
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:441] XCB_ATOM_WM_NAME: IMG_0615.jpg  - 1600 x 1200
[120 21:01:37.423418] No render frame received in 0.250000 seconds, re-requesting at: 8.315767
2020-04-29 21:01:37 - [sway/tree/view.c:432] Checking criteria [class=".*"]
2020-04-29 21:01:37 - [sway/tree/view.c:434] Criteria already executed
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:441] XCB_ATOM_WM_NAME: IMG_0615.jpg  - 1600 x 1200
2020-04-29 21:01:37 - [sway/tree/view.c:432] Checking criteria [class=".*"]
2020-04-29 21:01:37 - [sway/tree/view.c:434] Criteria already executed
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:968] XCB_PROPERTY_NOTIFY (4194310)
2020-04-29 21:01:37 - [xwayland/xwm.c:722] unhandled X11 property 335 (_NET_WM_ICON_NAME) for window 4194310

Nope, as in my case qutebrowser runs natively in wayland without any intervention of xwayland. The error messages you recieved are very common when in xwayland (which I avoid since it cannot handle any 4k display), and 'render frame received in 0.250000 seconds' also shows up also when I turn on the debug mode of another wayland native software kitty.

yokelpole commented 4 years ago

Nope, as in my case qutebrowser runs natively in wayland without any intervention of xwayland.

Whoops, my mistake. I think the corruption that I am seeing might be a different problem then - I just tried qutebrowser and am not seeing any of the corruption that you're mentioning but I'm still seeing a fair amount of corruption whenever I scroll in xwayland firefox or move around in nomacs.

Sorry for adding noise to your issue. :smile:

pavlus commented 4 years ago

I see two different problems in discussion here:

  1. Flashing of other window/destroyed window? when in fullscreen (usually occurs in apps when some dynamic animated windows appear, like on-hover menus)
  2. image corruption (like scrolling some webpages, like github, noise trails in video)

Image corruption appears only when using Sway-native fullscreen mode ($mod+F by default), and I managed to fix it in FF for myself by randomly changing some wayland-related flags in FF, but most likely was fixed by enabling VSync.

Flashing is flaky, but still appears often in fullscreen mode.

treeshateorcs commented 3 years ago

this is still an issue in 1.5.1, and it also happens in falkon (a qt5-webengine based browser as well)

3nt3 commented 4 months ago

this is honestly so annoying – no idea where it comes from