canonical / mir

The Mir compositor
GNU General Public License v2.0
620 stars 99 forks source link

`wbg` constantly resizing after switching to 2.17.0 #3450

Closed OPNA2608 closed 2 weeks ago

OPNA2608 commented 2 months ago

I'm using wbg as my wallpaper app. On Mir 2.15.0, this worked fine in Miriway:

shell-component=wbg /path/to/wallpaper.png

After switching to 2.17.0, the wallpaper is now constantly flickering between two sizes, and wbg logs:

machine # [   16.456052] xsession[1033]: info: main.c:119: render: 640x480 (scaled from 1920x1080)
machine # [   16.504047] xsession[1033]: info: main.c:119: render: 1280x800 (scaled from 1920x1080)
machine # [   16.521671] xsession[1033]: info: main.c:119: render: 640x480 (scaled from 1920x1080)
machine # [   16.570346] xsession[1033]: info: main.c:119: render: 1280x800 (scaled from 1920x1080)
Bisect log ``` git bisect start # Status: warte auf guten und schlechten Commit # good: [65a0f9c1a86130a000d0845de86bb65e61f6ed10] Merge pull request #3009 from MirServer/fix-alpine-edge git bisect good 65a0f9c1a86130a000d0845de86bb65e61f6ed10 # Status: warte auf schlechten Commit, 1 guter Commit bekannt # bad: [a3c667ae3339967febda1a5c97659c313c7639de] ci: devel != noble any more git bisect bad a3c667ae3339967febda1a5c97659c313c7639de # bad: [0704026bd06372ea8286a46d8c939286dd8a8c68] Merge pull request #3138 from MirServer/fix-miral-ExternalClient-tests git bisect bad 0704026bd06372ea8286a46d8c939286dd8a8c68 # skip: [525bf195cb6f82e52eb38ac601de967b04d7d0de] Apply refactorings that happened on target branch git bisect skip 525bf195cb6f82e52eb38ac601de967b04d7d0de # skip: [a1de2788676959699d1ed962ead7c6b40a76ddae] Revert "tests: add eglinfo dependency" git bisect skip a1de2788676959699d1ed962ead7c6b40a76ddae # skip: [399f38c8ff52fa2120a99134814dc14bb928b8ed] Fix nitpicking git bisect skip 399f38c8ff52fa2120a99134814dc14bb928b8ed # good: [af63ec11aaca3c05ba93f10e28378051b6fb2746] WIP but at least we're not crashing git bisect good af63ec11aaca3c05ba93f10e28378051b6fb2746 # skip: [3ef63bb4ebfa1ccce03484aa48a0a6b75df40b53] Catching VT-switch errors git bisect skip 3ef63bb4ebfa1ccce03484aa48a0a6b75df40b53 # bad: [389033c113877fa0c8cca61161193ff40d9fa23f] Merge pull request #3104 from MirServer/fix-scaled-outputs git bisect bad 389033c113877fa0c8cca61161193ff40d9fa23f # skip: [b3e4da9a10513452c85dea6033d84fe6861e60bd] Resetting an accidentally changed file git bisect skip b3e4da9a10513452c85dea6033d84fe6861e60bd # skip: [26873dcc0a83b6f29aa75bd946d77f66a74f63c9] Changing the platform name to virtual instead of virt git bisect skip 26873dcc0a83b6f29aa75bd946d77f66a74f63c9 # good: [06f516cb6b8ef268b228a8a8ddf6be6925afa31f] Building implementation of the CRTC-only smooth boot support git bisect good 06f516cb6b8ef268b228a8a8ddf6be6925afa31f # skip: [3d073f6419c5c94822ca7f3b5d15f82f2bda655b] Merge remote-tracking branch 'origin/main' into platform-API-merge git bisect skip 3d073f6419c5c94822ca7f3b5d15f82f2bda655b # good: [989ad916c4f8448935bed16a8c5695063789251e] sanitizers: use modern CMake commands git bisect good 989ad916c4f8448935bed16a8c5695063789251e # skip: [12ea68ab6a2a2636b412f0ebec0dcc20f279fbfe] linux_dmabuf: use eglDestroyImageKHR extension (#3069) git bisect skip 12ea68ab6a2a2636b412f0ebec0dcc20f279fbfe # skip: [b09b8cadc34e9d413298d125789a0a40bcd4b7c0] Proper const styles for virtual display.cpp git bisect skip b09b8cadc34e9d413298d125789a0a40bcd4b7c0 # bad: [cc2b82d4df57e29d05f4ba70fdc46c3e6edb7c46] Initial draft of the architecture diagram git bisect bad cc2b82d4df57e29d05f4ba70fdc46c3e6edb7c46 # bad: [a1f85c3f5689d21693f95193ea21b7b95dc6b5b5] Update obsolete instructions git bisect bad a1f85c3f5689d21693f95193ea21b7b95dc6b5b5 # good: [7d67a3378cd22f5d8cf2b3442f9d64999d231bfe] Merge pull request #3030 from MirServer/fix-2011 git bisect good 7d67a3378cd22f5d8cf2b3442f9d64999d231bfe # good: [d0407f7c0ada76e1c03929799dde53977fa562a1] Fix scaling of wayland platform pointer git bisect good d0407f7c0ada76e1c03929799dde53977fa562a1 # good: [156cc32e95dcbd2a598685e5797da875df449075] Merge pull request #3039 from MirServer/build-snap-release git bisect good 156cc32e95dcbd2a598685e5797da875df449075 # bad: [6b2aa7846fa4569873c6413585604dba16ad12cd] Fix resize handling git bisect bad 6b2aa7846fa4569873c6413585604dba16ad12cd # first bad commit: [6b2aa7846fa4569873c6413585604dba16ad12cd] Fix resize handling ```

Behaving like this since 6b2aa7846fa4569873c6413585604dba16ad12cd, behaviour is the same on current main (0980da33355a85e45ace121e21bce9ccbad8a64a).

Here's a log of env WAYLAND_DEBUG=1 wbg /path/to/wallpaper, in case the extra insight helps: wbg.log

Saviq commented 2 months ago

Thanks @OPNA2608 for all the detail, that will make it much easier to track down.

AlanGriffiths commented 2 months ago

This the the corresponding PR : https://github.com/canonical/mir/pull/3042 (which links to the issue it intended to solve)

AlanGriffiths commented 1 month ago

I've now seen a different "constantly resizing" when dragging edges to resize chromium-browser windows. Probably the same underlying cause. (A ping-pong of compositor requested sizes and buffers of a different size being submitted.)

AlanGriffiths commented 1 month ago

Here's an extract from WAYLAND_DEBUGing

[2195719.972]  -> wl_output@7.mode(3, 1268, 994, 60000)
[2195720.061]  -> zwlr_layer_surface_v1@11.configure(1, 640, 480)
[2195720.188]  -> zwlr_layer_surface_v1@11.configure(2, 1268, 994)
[2195747.549] zwlr_layer_surface_v1@11.ack_configure(1)
[2195747.660] wl_shm_pool@10.create_buffer(new id wl_buffer@9, 0, 640, 480, 2560, 1)
[2195747.731] wl_surface@8.damage_buffer(0, 0, 640, 480)
[2195747.824]  -> zwlr_layer_surface_v1@11.configure(3, 640, 480)
[2195747.873]  -> zwlr_layer_surface_v1@11.configure(4, 1268, 994)
[2195747.887] zwlr_layer_surface_v1@11.ack_configure(2)
[2195747.912] wl_shm_pool@12.create_buffer(new id wl_buffer@13, 0, 1268, 994, 5072, 1)
[2195747.949] wl_surface@8.damage_buffer(0, 0, 1268, 994)

What is obvious from this is that wbg is responding to stale configure events (that it could drop), and that Mir is interpreting the corresponding buffer size as a resize request (which generates further configure events).

Mir's logic is clearly wrong here. Essentially, it is remembering the most recent configure event but not ignoring buffer sizes received before the ack.