green-green-avk / AnotherTerm

Local PTY, USB and Bluetooth serial ports, SSH and Telnet terminal client for Android. Xwayland support (in dev only).
https://green-green-avk.github.io/AnotherTerm-docs/
Other
190 stars 20 forks source link

Wayland support: missing XDG-WM-Base protocol #41

Closed green-green-avk closed 1 year ago

green-green-avk commented 1 year ago

Where

https://github.com/green-green-avk/AnotherTerm/tree/Wayland

https://green-green-avk.github.io/AnotherTerm-docs/graphical-sessions.html#main_content

What

And we are not alone: https://github.com/termux/termux-x11/issues/40

Resolution

I prefer to implement proper support for xdg_shell here. Dwarrowdelf. Digging...

green-green-avk commented 1 year ago

wl_shell was just changed to xdg_wm_base and nothing more: there are still a single surface for the composed output and one more for the mouse cursor... Some more testing...

green-green-avk commented 1 year ago

Hmm...

Flickering after screen rotation...

Xwayland looks broken. It tries to use an old buffer after a screen size change:

[ 103004.732]  -> wl_shm@4.create_pool(new id wl_shm_pool@23, fd 10, 9054720)
[ 103004.787]  -> wl_shm_pool@23.create_buffer(new id wl_buffer@21, 0, 1080, 2096, 4320, 1)
[ 103004.809]  -> wl_shm_pool@23.destroy()
[ 105296.196] wl_output@5.geometry(0, 0, 143, 64, 1, "Lindon inc.", "Palantir v1", 0)
[ 105296.591] wl_output@5.mode(3, 2181, 995, 60000)
[ 105296.701] wl_output@5.done()
[ 106975.484]  -> wl_shm@4.create_pool(new id wl_shm_pool@20, fd 10, 8680380)
[ 106975.553]  -> wl_shm_pool@20.create_buffer(new id wl_buffer@22, 0, 2181, 995, 8724, 1)
[ 106975.570]  -> wl_shm_pool@20.destroy()
[ 107738.231] wl_display@1.delete_id(20)
[ 107738.417] wl_pointer@17.frame()
[ 107738.548] wl_callback@20.done(106)
[ 107746.446]  -> wl_surface@10.attach(wl_buffer@22, 0, 0)
[ 107746.652]  -> wl_surface@10.damage_buffer(0, 0, 2175, 994)
[ 107746.759]  -> wl_surface@10.frame(new id wl_callback@20)
[ 107746.860]  -> wl_surface@10.commit()
[ 107748.698] wl_pointer@17.motion(579133439, 1871.86718750, 92.89453125)
[ 107748.907] wl_pointer@17.frame()
[ 107752.163] wl_buffer@21.release()
[ 107761.402] wl_pointer@17.motion(579133456, 1896.17578125, 81.51171875)
[ 107763.173] wl_pointer@17.frame()
[ 107776.670] wl_pointer@17.motion(579133472, 1925.40234375, 66.12890625)
[ 107777.237] wl_pointer@17.frame()
[ 107795.278] wl_pointer@17.motion(579133489, 1955.70703125, 52.90234375)
[ 107795.427] wl_pointer@17.frame()
[ 107810.895] wl_pointer@17.motion(579133506, 1982.62890625, 42.75000000)
[ 107811.062] wl_pointer@17.frame()
[ 107813.325] wl_display@1.delete_id(20)
[ 107813.407] wl_callback@20.done(107)
[ 107816.666]  -> wl_surface@10.attach(wl_buffer@21, 0, 0)
[ 107816.792]  -> wl_surface@10.damage_buffer(0, 0, 2175, 994)
[ 107816.835]  -> wl_surface@10.frame(new id wl_callback@20)
[ 107816.864]  -> wl_surface@10.commit()
[ 107824.405] wl_buffer@22.release()
[ 107825.966] wl_pointer@17.motion(579133522, 2010.16796875, 34.90234375)
[ 107828.897] wl_pointer@17.frame()
[ 107844.842] wl_pointer@17.motion(579133539, 2033.85546875, 27.05859375)
[ 107845.467] wl_pointer@17.frame()
[ 107859.590] wl_pointer@17.motion(579133556, 2053.85546875, 20.13671875)
[ 107859.962] wl_pointer@17.frame()
[ 107878.827] wl_pointer@17.motion(579133572, 2071.85546875, 13.36718750)
[ 107879.071] wl_pointer@17.frame()
[ 107887.907] wl_callback@20.done(108)
[ 107894.053]  -> wl_surface@10.attach(wl_buffer@22, 0, 0)
[ 107894.137]  -> wl_surface@10.damage_buffer(0, 0, 2175, 994)
[ 107894.173]  -> wl_surface@10.frame(new id wl_callback@19)
[ 107894.204]  -> wl_surface@10.commit()
[ 107894.838] wl_display@1.delete_id(20)
[ 107894.922] wl_pointer@17.motion(579133589, 2087.23828125, 6.75390625)
[ 107894.944] wl_pointer@17.frame()
[ 107902.884] wl_buffer@21.release()
[ 107917.503] wl_pointer@17.motion(579133606, 2099.39062500, -1.39453125)
[ 107917.574] wl_pointer@17.frame()
[ 107967.034] wl_callback@19.done(109)
[ 107970.540]  -> wl_surface@10.attach(wl_buffer@21, 0, 0)
[ 107970.660]  -> wl_surface@10.damage_buffer(0, 0, 2175, 994)
[ 107970.700]  -> wl_surface@10.frame(new id wl_callback@20)
[ 107970.722]  -> wl_surface@10.commit()
[ 107971.024] wl_display@1.delete_id(19)
[ 107974.618] wl_buffer@22.release()
[ 108023.124] wl_callback@20.done(110)
[ 108023.304] wl_display@1.delete_id(20)

Continuing...

green-green-avk commented 1 year ago

What ever...

Fixed: https://github.com/green-green-avk/AnotherTerm/commit/48aa3d5ef0e62b30593022bbca19feab6c25ea6f.

Xwayland bugs is a separate task to deal with.

green-green-avk commented 1 year ago

Xwayland: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1560