Wlroots: RetroArch (Wayland context) failed to launch in rootston

Created on 21 Nov 2018  Â·  8Comments  Â·  Source: swaywm/wlroots

Hello. I'm working on replace wl_shell with xdg_shell in RetroArch. With my patch, it run's fine on GNOME, but fail to launch on Rootston:

2018-11-21 21:37:17 - [types/wlr_surface.c:596] New wlr_surface 0x55f9d90f7ac0 (res 0x55f9d90f79a0)
2018-11-21 21:37:17 - [types/xdg_shell/wlr_xdg_surface.c:445] new xdg_surface 0x55f9d90f7ef0 (res 0x55f9d90aa2e0)
2018-11-21 21:37:17 - [rootston/xdg_shell.c:412] new xdg toplevel: title=RetroArch  , app_id=RetroArch
error in client communication (pid 13786)

Most helpful comment

As @emersion said you need to wait for the first configure before starting to draw. So at a guess from glancing at the code you need to not do this until both you and the server agree on the size of the window.

All 8 comments

Can you upload a WAYLAND_DEBUG=1 log of your app?

[2739323.918] [email protected]_surface(new id wl_surface@15)
2018-11-21 22:08:31 - [types/wlr_surface.c:596] New wlr_surface 0x55564e59fde0 (res 0x55564e59fcc0)
[2739324.055] [email protected]_buffer_scale(1)
[2739324.080] [email protected]_xdg_surface(new id xdg_surface@16, wl_surface@15)
2018-11-21 22:08:31 - [types/xdg_shell/wlr_xdg_surface.c:445] new xdg_surface 0x55564e5a0210 (res 0x55564e614870)
[2739324.135] [email protected]_toplevel(new id xdg_toplevel@17)
[2739324.161] [email protected]_app_id("RetroArch")
[2739324.179] [email protected]_title("RetroArch")
[2739327.813]  -> [email protected]_title("RetroArch  ")
[2739327.859]  -> [email protected](new id wl_callback@18)
[2739327.870]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@19)
[2739327.896]  -> [email protected](fd 15, 0, 0, 4096, 16777216, 1)
[2739327.932]  -> [email protected]_immed(new id wl_buffer@20, 960, 720, 875713112, 0)
[2739327.968]  -> [email protected]()
[2739327.982]  -> [email protected](wl_buffer@20, 0, 0)
[2739328.004]  -> [email protected](0, 0, 2147483647, 2147483647)
[2739330.888]  -> [email protected]()
[2739330.944] [email protected]_title("RetroArch  ")
[2739330.968] [email protected](new id wl_callback@18)
[2739330.987] [email protected]_params(new id zwp_linux_buffer_params_v1@19)
[2739331.010] [email protected](fd 19, 0, 0, 4096, 16777216, 1)
[2739331.066] [email protected]_immed(new id wl_buffer@20, 960, 720, 875713112, 0)
[2739331.253] [email protected]()
[2739331.268]  -> [email protected]_id(19)
[2739331.281] [email protected](wl_buffer@20, 0, 0)
[2739331.307] [email protected](0, 0, 2147483647, 2147483647)
[2739331.339] [email protected]()
2018-11-21 22:08:31 - [rootston/xdg_shell.c:412] new xdg toplevel: title=RetroArch  , app_id=RetroArch
[2739331.443]  -> [email protected](2)
[2739331.463]  -> [email protected](xdg_surface@16, 3, "xdg_surface has never been configured")
error in client communication (pid 17007)
[2739456.324]  -> [email protected]()
[2739457.886]  -> [email protected]()
[2739458.157]  -> [email protected]()
[2739458.451]  -> [email protected]()
[2739458.473]  -> [email protected]()
[2739458.483]  -> [email protected]()
[2739458.492]  -> [email protected]()
[3026691.744] [email protected](11904, wl_surface@10, 1160.148438, 718.765625)
[3026691.866]  -> [email protected]_cursor(11904, wl_surface@19, 4, 4)
[3026691.919] [email protected]()
[3026691.938] [email protected](88142603, 1160.148438, 718.765625)
[3026692.019] [email protected]()
[3026710.022] [email protected](88142619, 1190.148438, 652.765625)
[3026710.135] [email protected]()
[3026726.444] [email protected](88142635, 1210.148438, 582.765625)
[3026726.567] [email protected]()
[3026743.329] [email protected](88142651, 1230.148438, 520.765625)
[3026743.447] [email protected]()
[3026759.428] [email protected](88142667, 1248.148438, 470.765625)
[3026759.543] [email protected]()
[3026775.977] [email protected](88142683, 1264.148438, 426.765625)
[3026776.100] [email protected]()
[3026793.208] [email protected](88142707, 1273.589844, 380.738281)
[3026793.323] [email protected]()
[3026809.416] [email protected](88142723, 1272.128906, 368.406250)
[3026809.480] [email protected]()
[3026826.129] [email protected](88142739, 1272.128906, 361.226562)
[3026826.248] [email protected]()
[3026841.901] [email protected](88142755, 1275.214844, 341.453125)
[3026841.944] [email protected]()
[3026859.129] [email protected](11905, wl_surface@10)
[3026859.192] [email protected]()
[3026892.145] [email protected](11908, wl_surface@10, 1275.261719, 238.277344)
[3026892.231]  -> [email protected]_cursor(11908, wl_surface@19, 4, 4)
[3026892.277] [email protected]()
[3026892.287] [email protected](88142803, 1275.261719, 238.277344)
[3026892.337] [email protected]()
[3026926.220] [email protected](88142835, 1274.253906, 232.257812)
[3026926.325] [email protected]()
[3026941.981] [email protected](88142851, 1274.253906, 227.257812)
[3026942.087] [email protected]()
[3026959.191] [email protected](88142867, 1274.253906, 218.632812)
[3026959.305] [email protected]()
[3026976.935] [email protected](88142883, 1274.253906, 209.753906)
[3026977.122] [email protected]()
[3026992.187] [email protected](88142907, 1273.066406, 193.187500)
[3026992.332] [email protected]()
[3027009.614] [email protected](88142923, 1276.128906, 170.308594)
[3027009.708] [email protected]()
[3027025.455] [email protected](11909, wl_surface@10)
[3027025.529] [email protected]()
[3028885.722] [email protected](1280, 720, array)
[3028885.784] [email protected](11911)
[3028885.800]  -> [email protected]_configure(11911)
[3028885.814] [email protected](11913, wl_surface@10)
[2739331.463]  -> [email protected](xdg_surface@16, 3, "xdg_surface has never been configured")

Your app is violating the Wayland protocol. You need to wait for the first xdg_surface.configure event before starting to draw. Per the spec:

Creating an xdg_surface from a wl_surface which has a buffer attached or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first xdg_surface.configure call must also be treated as errors.

Can you please help me find error in my patch?

As @emersion said you need to wait for the first configure before starting to draw. So at a guess from glancing at the code you need to not do this until both you and the server agree on the size of the window.

@Timidger should I remove this from gfx_ctx_wl_set_video_mode?

You should read the protocol as this will answer most of your questions better than I can.

Thanks for hint's, fixed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RPigott picture RPigott  Â·  4Comments

ddevault picture ddevault  Â·  5Comments

J0nnyMak0 picture J0nnyMak0  Â·  5Comments

emersion picture emersion  Â·  6Comments

emersion picture emersion  Â·  5Comments