fix: expose EGL_WL_bind_wayland_display for Qt Wayland clients#248
fix: expose EGL_WL_bind_wayland_display for Qt Wayland clients#248paperbenni merged 2 commits intomainfrom
Conversation
Qt applications and browsers require the `EGL_WL_bind_wayland_display` extension to properly initialize hardware acceleration natively on Wayland. This explicitly calls `bind_wl_display()` on the `GlesRenderer` (using the `ImportEgl` trait) in both the DRM and Winit backends, making this extension available to Wayland clients. Co-authored-by: paperbenni <15818888+paperbenni@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures the EGL_WL_bind_wayland_display extension is actually bound for Wayland clients by invoking bind_wl_display on the renderer in both the DRM and winit Wayland runtimes, with warnings logged on failure. Sequence diagram for DRM runtime initialization with EGL_WL_bind_wayland_displaysequenceDiagram
participant DrmRuntime as DrmRuntime_run
participant State as WaylandState
participant Renderer as GlesRenderer
participant WlDisplay as WaylandDisplay
DrmRuntime->>State: init_dmabuf_global(dmabuf_formats, egl_display)
Note over State: dmabuf global initialized
DrmRuntime->>State: with_renderer(callback)
activate State
State->>Renderer: provide_mut_renderer_to_callback
activate Renderer
State->>Renderer: bind_wl_display(display_handle)
Renderer-->>State: Result<(), Error>
deactivate Renderer
alt bind_wl_display fails
State->>State: log::warn("failed to bind egl to wayland display")
else bind_wl_display succeeds
Note over State,WlDisplay: EGL_WL_bind_wayland_display extension bound
end
deactivate State
DrmRuntime->>State: init_screencopy_manager()
Note over State: screencopy manager ready
Sequence diagram for winit runtime initialization with EGL_WL_bind_wayland_displaysequenceDiagram
participant WinitRuntime as WinitRuntime_run
participant State as WaylandState
participant Backend as WinitBackend
participant Renderer as GlesRenderer
participant WlDisplay as WaylandDisplay
WinitRuntime->>State: init_dmabuf_global(dmabuf_formats, egl_display)
Note over State: dmabuf global initialized
WinitRuntime->>Backend: renderer()
Backend-->>WinitRuntime: &mut Renderer
WinitRuntime->>Renderer: bind_wl_display(state.display_handle)
Renderer-->>WinitRuntime: Result<(), Error>
alt bind_wl_display fails
WinitRuntime->>WinitRuntime: log::warn("failed to bind egl to wayland display")
else bind_wl_display succeeds
Note over Renderer,WlDisplay: EGL_WL_bind_wayland_display extension bound
end
WinitRuntime->>State: init_screencopy_manager()
Note over State: screencopy manager ready
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe DRM and Winit runtime backends now import Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
bind_wl_displaycalls in bothdrm.rsandwinit.rsare nearly identical; consider extracting this into a shared helper on the state/backend (e.g.state.bind_egl_to_display()) so the behavior and logging stay consistent and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `bind_wl_display` calls in both `drm.rs` and `winit.rs` are nearly identical; consider extracting this into a shared helper on the state/backend (e.g. `state.bind_egl_to_display()`) so the behavior and logging stay consistent and easier to maintain.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@jules Overall Comments
|
I have extracted the |
Qt applications and browsers require the `EGL_WL_bind_wayland_display` extension to properly initialize hardware acceleration natively on Wayland. This explicitly calls `bind_wl_display()` on the `GlesRenderer` (using the `ImportEgl` trait) in both the DRM and Winit backends, making this extension available to Wayland clients. Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: paperbenni <15818888+paperbenni@users.noreply.github.com>
Exposes the
EGL_WL_bind_wayland_displayWayland extension to clients by explicitly callingbind_wl_display(&display_handle)on theGlesRendererthrough thesmithay::backend::renderer::ImportEgltrait. This fixes rendering issues andqt.waylandcompositor.hardwareintegrationcrashes with Qt5/Qt6 applications (like Telegram).PR created automatically by Jules for task 4200173433058344887 started by @paperbenni
Summary by Sourcery
Bind the EGL renderer to the Wayland display in both DRM and winit runtimes to expose the EGL_WL_bind_wayland_display extension to clients.
New Features:
Bug Fixes:
Summary by CodeRabbit