Skip to content

No window on Weston/FreeBSD #109

Closed

Description

@johalun

Hi

I've been working on getting Wayland stuff ported to FreeBSD and would love to be able to run glutin there as well.

I'm getting no events with winit/glutin on Weston.
Simple C Wayland clients work fine. wayland-client rust crate examples work fine.

Logging shows that it stops at the second dispatch call on
https://github.com/tomaka/winit/blob/master/src/api/wayland/window.rs#L166

For winit example, no error is reported, no window is displayed. The process is just halted on select() syscall.

For glutin example, pixel format and OpenGL version is printed but nothing more, no window.

Is there any similar known problems on Linux?

Activity

  1. added
    DS - wayland
    B - bug
    on Jan 14, 2017
  2. johalun commented on Jan 20, 2017

    @johalun
    Author

    Wayland debug output comparison, working wayland-window crate's simple_window vs winit crate's window. Weston with X11 backend.

    winit: window

    johannes@JVM:~/dev/winit % cargo run --example window
        Finished debug [unoptimized + debuginfo] target(s) in 0.1 secs
         Running `target/debug/examples/window`
    [606092.331]  -> wl_display@1.get_registry(new id wl_registry@2)
    [606092.709]  -> wl_display@1.sync(new id wl_callback@3)
    [606093.021] wl_display@1.delete_id(3)
    [606093.048] wl_registry@2.global(1, "wl_compositor", 4)
    [606093.072] wl_registry@2.global(2, "wl_subcompositor", 1)
    [606093.080] wl_registry@2.global(3, "wp_viewporter", 1)
    [606093.087] wl_registry@2.global(4, "wp_presentation", 1)
    [606093.104] wl_registry@2.global(5, "zwp_relative_pointer_manager_v1", 1)
    [606093.115] wl_registry@2.global(6, "zwp_pointer_constraints_v1", 1)
    [606093.128] wl_registry@2.global(7, "wl_data_device_manager", 3)
    [606093.139] wl_registry@2.global(8, "wl_shm", 1)
    [606093.150] wl_registry@2.global(9, "wl_seat", 5)
    [606093.160]  -> wl_registry@2.bind(9, "wl_seat", 5, new id [unknown]@4)
    [606093.183] wl_registry@2.global(10, "wl_output", 3)
    [606093.194]  -> wl_registry@2.bind(10, "wl_output", 1, new id [unknown]@5)
    [606093.210] wl_registry@2.global(11, "zwp_input_panel_v1", 1)
    [606093.225] wl_registry@2.global(12, "zwp_input_method_v1", 1)
    [606093.237] wl_registry@2.global(13, "zwp_text_input_manager_v1", 1)
    [606093.249] wl_registry@2.global(14, "zxdg_shell_v6", 1)
    [606093.263] wl_registry@2.global(15, "xdg_shell", 1)
    [606093.279] wl_registry@2.global(16, "wl_shell", 1)
    [606093.294]  -> wl_registry@2.bind(1, "wl_compositor", 4, new id [unknown]@6)
    [606093.304]  -> wl_registry@2.bind(16, "wl_shell", 1, new id [unknown]@7)
    [606093.315]  -> wl_registry@2.bind(8, "wl_shm", 1, new id [unknown]@8)
    [606093.324]  -> wl_registry@2.bind(2, "wl_subcompositor", 1, new id [unknown]@9)
    [606093.334] wl_registry@2.global(17, "weston_desktop_shell", 1)
    [606093.342] wl_registry@2.global(18, "weston_screenshooter", 1)
    [606093.349] wl_callback@3.done(1568)
    [606093.356]  -> wl_display@1.sync(new id wl_callback@3)
    [606093.884] wl_display@1.delete_id(3)
    [606093.910] wl_seat@4.capabilities(3)
    [606093.919]  -> wl_seat@4.get_pointer(new id wl_pointer@10)
    [606093.927]  -> wl_seat@4.get_keyboard(new id wl_keyboard@11)
    [606093.935] wl_seat@4.name("default")
    [606093.941] wl_output@5.geometry(0, 0, 269, 158, 0, "weston-X11", "none", 0)
    [606093.960] wl_output@5.mode(3, 1024, 600, 60000)
    [606093.969] wl_callback@3.done(1568)
    [606093.988]  -> wl_compositor@6.create_surface(new id wl_surface@3)
    [606094.001]  -> wl_registry@2.bind(9, "wl_seat", 5, new id [unknown]@12)
    [606095.070]  -> wl_shm@8.create_pool(new id wl_shm_pool@13, fd 5, 76800)
    [606095.109]  -> wl_compositor@6.create_surface(new id wl_surface@14)
    [606095.117]  -> wl_compositor@6.create_surface(new id wl_surface@15)
    [606095.124]  -> wl_compositor@6.create_surface(new id wl_surface@16)
    [606095.130]  -> wl_compositor@6.create_surface(new id wl_surface@17)
    [606095.137]  -> wl_subcompositor@9.get_subsurface(new id wl_subsurface@18, wl_surface@14, wl_surface@3)
    [606095.147]  -> wl_subcompositor@9.get_subsurface(new id wl_subsurface@19, wl_surface@15, wl_surface@3)
    [606095.155]  -> wl_subcompositor@9.get_subsurface(new id wl_subsurface@20, wl_surface@16, wl_surface@3)
    [606095.164]  -> wl_subcompositor@9.get_subsurface(new id wl_subsurface@21, wl_surface@17, wl_surface@3)
    [606095.173]  -> wl_subsurface@18.set_desync()
    [606095.177]  -> wl_subsurface@19.set_desync()
    [606095.181]  -> wl_subsurface@20.set_desync()
    [606095.185]  -> wl_subsurface@21.set_desync()
    [606095.189]  -> wl_shell@7.get_shell_surface(new id wl_shell_surface@22, wl_surface@3)
    [606095.196]  -> wl_shell_surface@22.set_toplevel()
    [606095.201]  -> wl_seat@12.get_pointer(new id wl_pointer@23)
    [606096.219]  -> wl_shm@8.create_pool(new id wl_shm_pool@24, fd 7, 1024)
    [606097.104]  -> wl_shm_pool@24.resize(3072)
    [606097.749]  -> wl_shm_pool@24.resize(7168)
    [606098.357]  -> wl_shm_pool@24.resize(15360)
    [606098.381]  -> wl_compositor@6.create_surface(new id wl_surface@25)
    [606098.394]  -> wl_surface@14.attach(nil, 0, 0)
    [606098.401]  -> wl_surface@14.commit()
    [606098.405]  -> wl_surface@15.attach(nil, 0, 0)
    [606098.412]  -> wl_surface@15.commit()
    [606098.416]  -> wl_surface@16.attach(nil, 0, 0)
    [606098.422]  -> wl_surface@16.commit()
    [606098.426]  -> wl_surface@17.attach(nil, 0, 0)
    [606098.432]  -> wl_surface@17.commit()
    [606098.441]  -> wl_shell_surface@22.set_toplevel()
    [606099.123]  -> wl_shm_pool@13.resize(78336)
    [606189.176]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@26, 0, 816, 24, 3264, 0)
    [606189.240]  -> wl_surface@14.attach(wl_buffer@26, 0, 0)
    [606189.253]  -> wl_subsurface@18.set_position(-8, -24)
    [606189.264]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@27, 0, 8, 600, 32, 0)
    [606189.279]  -> wl_surface@15.attach(wl_buffer@27, 0, 0)
    [606189.288]  -> wl_subsurface@19.set_position(800, 0)
    [606189.295]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@28, 0, 816, 8, 3264, 0)
    [606189.311]  -> wl_surface@16.attach(wl_buffer@28, 0, 0)
    [606189.319]  -> wl_subsurface@20.set_position(-8, 600)
    [606189.326]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@29, 0, 8, 600, 32, 0)
    [606189.338]  -> wl_surface@17.attach(wl_buffer@29, 0, 0)
    [606189.346]  -> wl_subsurface@21.set_position(-8, 0)
    [606189.354]  -> wl_surface@14.commit()
    [606189.359]  -> wl_surface@15.commit()
    [606189.363]  -> wl_surface@16.commit()
    [606189.367]  -> wl_surface@17.commit()
    [606189.375]  -> wl_buffer@26.destroy()
    [606189.383]  -> wl_buffer@27.destroy()
    [606189.388]  -> wl_buffer@28.destroy()
    [606189.393]  -> wl_buffer@29.destroy()
    [606194.403]  -> wl_shm_pool@13.resize(99840)
    [606313.206]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@30, 0, 1040, 24, 4160, 0)
    [606313.256]  -> wl_surface@14.attach(wl_buffer@30, 0, 0)
    [606313.295]  -> wl_subsurface@18.set_position(-8, -24)
    [606313.304]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@31, 0, 8, 768, 32, 0)
    [606313.317]  -> wl_surface@15.attach(wl_buffer@31, 0, 0)
    [606313.325]  -> wl_subsurface@19.set_position(1024, 0)
    [606313.334]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@32, 0, 1040, 8, 4160, 0)
    [606313.346]  -> wl_surface@16.attach(wl_buffer@32, 0, 0)
    [606313.356]  -> wl_subsurface@20.set_position(-8, 768)
    [606313.363]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@33, 0, 8, 768, 32, 0)
    [606313.374]  -> wl_surface@17.attach(wl_buffer@33, 0, 0)
    [606313.382]  -> wl_subsurface@21.set_position(-8, 0)
    [606313.389]  -> wl_surface@14.commit()
    [606313.393]  -> wl_surface@15.commit()
    [606313.398]  -> wl_surface@16.commit()
    [606313.402]  -> wl_surface@17.commit()
    [606314.109] wl_display@1.delete_id(26)
    [606314.140] wl_display@1.delete_id(27)
    [606314.145] wl_display@1.delete_id(28)
    [606314.150] wl_display@1.delete_id(29)
    [606314.155] wl_keyboard@11.repeat_info(40, 400)
    [606314.166] wl_keyboard@11.keymap(1, fd 5, 44985)
    

    Log stops here. No window presented.

    wayland-window: simple_window

    johannes@JVM:~/dev/wayland-window % cargo run --example simple_window
        Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
         Running `target/debug/examples/simple_window`
    [559046.373]  -> wl_display@1.get_registry(new id wl_registry@2)
    [559046.414]  -> wl_display@1.sync(new id wl_callback@3)
    [559046.659] wl_display@1.delete_id(3)
    [559046.687] wl_registry@2.global(1, "wl_compositor", 4)
    [559046.707] wl_registry@2.global(2, "wl_subcompositor", 1)
    [559046.714] wl_registry@2.global(3, "wp_viewporter", 1)
    [559046.721] wl_registry@2.global(4, "wp_presentation", 1)
    [559046.739] wl_registry@2.global(5, "zwp_relative_pointer_manager_v1", 1)
    [559046.752] wl_registry@2.global(6, "zwp_pointer_constraints_v1", 1)
    [559046.765] wl_registry@2.global(7, "wl_data_device_manager", 3)
    [559046.777] wl_registry@2.global(8, "wl_shm", 1)
    [559046.788] wl_registry@2.global(9, "wl_seat", 5)
    [559046.802] wl_registry@2.global(10, "wl_output", 3)
    [559046.815] wl_registry@2.global(11, "zwp_input_panel_v1", 1)
    [559046.830] wl_registry@2.global(12, "zwp_input_method_v1", 1)
    [559046.844] wl_registry@2.global(13, "zwp_text_input_manager_v1", 1)
    [559046.857] wl_registry@2.global(14, "zxdg_shell_v6", 1)
    [559046.871] wl_registry@2.global(15, "xdg_shell", 1)
    [559046.887] wl_registry@2.global(16, "wl_shell", 1)
    [559046.903]  -> wl_registry@2.bind(1, "wl_compositor", 4, new id [unknown]@4)
    [559046.914]  -> wl_registry@2.bind(2, "wl_subcompositor", 1, new id [unknown]@5)
    [559046.925]  -> wl_registry@2.bind(8, "wl_shm", 1, new id [unknown]@6)
    [559046.935]  -> wl_registry@2.bind(16, "wl_shell", 1, new id [unknown]@7)
    [559046.946] wl_registry@2.global(17, "weston_desktop_shell", 1)
    [559046.953] wl_registry@2.global(18, "weston_screenshooter", 1)
    [559046.960] wl_callback@3.done(1489)
    [559047.256]  -> wl_compositor@4.create_surface(new id wl_surface@3)
    [559047.285]  -> wl_shm@6.create_pool(new id wl_shm_pool@8, fd 5, 64)
    [559047.298]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@9, 0, 4, 4, 16, 0)
    [559047.312]  -> wl_registry@2.bind(9, "wl_seat", 1, new id [unknown]@10)
    [559047.322]  -> wl_surface@3.attach(wl_buffer@9, 0, 0)
    [559047.330]  -> wl_surface@3.commit()
    [559048.129]  -> wl_shm@6.create_pool(new id wl_shm_pool@11, fd 7, 1536)
    [559048.160]  -> wl_compositor@4.create_surface(new id wl_surface@12)
    [559048.169]  -> wl_compositor@4.create_surface(new id wl_surface@13)
    [559048.175]  -> wl_compositor@4.create_surface(new id wl_surface@14)
    [559048.180]  -> wl_compositor@4.create_surface(new id wl_surface@15)
    [559048.188]  -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@16, wl_surface@12, wl_surface@3)
    [559048.199]  -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@17, wl_surface@13, wl_surface@3)
    [559048.207]  -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@18, wl_surface@14, wl_surface@3)
    [559048.216]  -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@19, wl_surface@15, wl_surface@3)
    [559048.224]  -> wl_subsurface@16.set_desync()
    [559048.229]  -> wl_subsurface@17.set_desync()
    [559048.233]  -> wl_subsurface@18.set_desync()
    [559048.237]  -> wl_subsurface@19.set_desync()
    [559048.242]  -> wl_shell@7.get_shell_surface(new id wl_shell_surface@20, wl_surface@3)
    [559048.250]  -> wl_shell_surface@20.set_toplevel()
    [559048.255]  -> wl_seat@10.get_pointer(new id wl_pointer@21)
    [559049.463]  -> wl_shm@6.create_pool(new id wl_shm_pool@22, fd 9, 1024)
    [559050.295]  -> wl_shm_pool@22.resize(3072)
    [559050.979]  -> wl_shm_pool@22.resize(7168)
    [559051.732]  -> wl_shm_pool@22.resize(15360)
    [559051.776]  -> wl_compositor@4.create_surface(new id wl_surface@23)
    [559052.486]  -> wl_shm_pool@11.resize(3072)
    [559055.414]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@24, 0, 32, 24, 128, 0)
    [559055.454]  -> wl_surface@12.attach(wl_buffer@24, 0, 0)
    [559055.462]  -> wl_subsurface@16.set_position(-8, -24)
    [559055.470]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@25, 0, 8, 16, 32, 0)
    [559055.481]  -> wl_surface@13.attach(wl_buffer@25, 0, 0)
    [559055.489]  -> wl_subsurface@17.set_position(16, 0)
    [559055.495]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@26, 0, 32, 8, 128, 0)
    [559055.507]  -> wl_surface@14.attach(wl_buffer@26, 0, 0)
    [559055.514]  -> wl_subsurface@18.set_position(-8, 16)
    [559055.520]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@27, 0, 8, 16, 32, 0)
    [559055.531]  -> wl_surface@15.attach(wl_buffer@27, 0, 0)
    [559055.537]  -> wl_subsurface@19.set_position(-8, 0)
    [559055.544]  -> wl_surface@12.commit()
    [559055.548]  -> wl_surface@13.commit()
    [559055.552]  -> wl_surface@14.commit()
    [559055.556]  -> wl_surface@15.commit()
    [559056.201]  -> wl_buffer@24.destroy()
    [559056.227]  -> wl_buffer@25.destroy()
    [559056.232]  -> wl_buffer@26.destroy()
    [559056.236]  -> wl_buffer@27.destroy()
    [559056.963]  -> wl_shm_pool@11.resize(26112)
    [559085.085]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@28, 0, 272, 24, 1088, 0)
    [559085.134]  -> wl_surface@12.attach(wl_buffer@28, 0, 0)
    [559085.143]  -> wl_subsurface@16.set_position(-8, -24)
    [559085.150]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@29, 0, 8, 128, 32, 0)
    [559085.162]  -> wl_surface@13.attach(wl_buffer@29, 0, 0)
    [559085.169]  -> wl_subsurface@17.set_position(256, 0)
    [559085.175]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@30, 0, 272, 8, 1088, 0)
    [559085.186]  -> wl_surface@14.attach(wl_buffer@30, 0, 0)
    [559085.193]  -> wl_subsurface@18.set_position(-8, 128)
    [559085.199]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@31, 0, 8, 128, 32, 0)
    [559085.210]  -> wl_surface@15.attach(wl_buffer@31, 0, 0)
    [559085.217]  -> wl_subsurface@19.set_position(-8, 0)
    [559085.224]  -> wl_surface@12.commit()
    [559085.227]  -> wl_surface@13.commit()
    [559085.231]  -> wl_surface@14.commit()
    [559085.235]  -> wl_surface@15.commit()
    [559125.234]  -> wl_shm_pool@8.resize(131072)
    [559125.283]  -> wl_buffer@9.destroy()
    [559125.303]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@32, 0, 256, 128, 1024, 0)
    [559125.353]  -> wl_surface@3.attach(wl_buffer@32, 0, 0)
    [559125.369]  -> wl_surface@3.commit()
    

    Window is presented.

  3. changed the title [-]No events on Weston/FreeBSD[/-] [+]No window on Weston/FreeBSD[/+] on Jan 20, 2017
  4. tomaka commented on Jan 20, 2017

    @tomaka
    Contributor
  5. elinorbgr commented on Jan 20, 2017

    @elinorbgr
    Contributor

    This is a known issue, and relates to some characteristics of wayland (aka: this is expected behavior).

    A wayland window is not shown at all before anything is drawn on it. And a window don't generates event as long as it is not displayed.

    Winit does not display anything, so the event loop deadlocks.

    You can try a glutin example, they should work.

  6. johalun commented on Jan 20, 2017

    @johalun
    Author

    Sorry but that's not it. I first tried glutin but no examples work (same behavior), I narrowed it down to wayland-window vs winit.

  7. elinorbgr commented on Jan 20, 2017

    @elinorbgr
    Contributor

    Oh, yeah, I forgot about that. Glutin examples are actually broken regarding wayland...

    The only example that I know to work is the window one, but it requires patching first: you to do the draw_frame and swap_buffers once before the event loop starts, overwose it deadlocks waiting for events coming from a window that is not yet visible.

  8. johalun commented on Jan 20, 2017

    @johalun
    Author

    That did it. Thanks! At least it is working now with this temporary workaround.

  9. added a commit that references this issue on Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDS - wayland

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions