Skip to content

Feature(wayland): Add a property that allow mouse to pass through window#1437

Open
LemonKronos wants to merge 4 commits into
elkowar:masterfrom
LemonKronos:add-wayland-passthrough
Open

Feature(wayland): Add a property that allow mouse to pass through window#1437
LemonKronos wants to merge 4 commits into
elkowar:masterfrom
LemonKronos:add-wayland-passthrough

Conversation

@LemonKronos

@LemonKronos LemonKronos commented May 14, 2026

Copy link
Copy Markdown

Description

This PR introduces a :passthrough property for Wayland windows, allowing pointer events (like mouse clicks) to pass through the regions of an Eww widget to the applications underneath.

Why? This let me set up Eww window as notify, remider, etc to "flash" my screen, but still let me click pass them, maintain my work flow. Idk!

Implementation details:

  • Added the passthrough boolean to the WlBackendWindowOptions and the Yuck parser.
  • Modified crates/eww/src/display_backend.rs for the platform_wayland module.
  • Hooked into the GTK connect_map signal (to ensure GTK has finished its internal geometry calculations) to fetch the underlying gdk::Window.
  • Applied an empty gtk::cairo::Region using input_shape_combine_region to tell the Wayland compositor the window has no clickable pixels.

Usage

Set :passthrough true in your window definition.
Note: For the property to work, you must also set :focusable "none".

(defwindow click_through_box
  :monitor 0
  :geometry (geometry :width "400px" :height "400px" :anchor "center")
  :stacking "fg"
  :focusable "none" 
  :passthrough true
  (box :style "background-color: rgba(255, 0, 0, 0.5);" 
    (label :text "You can click straight through this window!")))

Showcase

I can still click the files below this Text widget
Screenshot_14-May_15-52-52_6388

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant