Skip to content

Add on_hover_change; keep overlay drags in screen travel when the window moves - #11

Merged
kitlangton merged 1 commit into
devfrom
hex-motion
Oct 23, 2026
Merged

kitlangton merged 1 commit into
devfrom
hex-motion

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What it does

  • El::on_hover_change(|s, inside, tx| ..) fires on entering and leaving an element's rect, children included. It is not a primary target, so child buttons keep their presses and hover. A held press stays inside until release.
  • An overlay that moves its own window during a drag (place, set_placement, set_align) now keeps Drag::dx/dy as pointer travel, so a dragged capsule follows the pointer instead of feeding back.

How it works

  • The runtime tracks the on_hover_change elements under the pointer (hover_within) and queues HoverChange actions on pointer move, leave and release.
  • Overlay::place_window compares the window's outer position before and after placing and calls Runtime::window_moved(dx, dy), which shifts the pointer and the press origin.

Risk

Low. Both are opt-in except for the drag fix, which only applies to overlays that move during a drag.

Proof

Two new runtime tests (hover across a child and through a held press; drag travel across window_moved). rune + rune-kit: 354 passed.

@kitlangton
kitlangton merged commit 2748c62 into dev Oct 23, 2026
@kitlangton
kitlangton deleted the hex-motion branch October 30, 2026 13:16
adeerkhan added a commit to adeerkhan/rune that referenced this pull request Nov 12, 2026
The completion thread polls the device in a loop, and `SurfaceRenderer` had no
`Drop`, so its fields dropped in declaration order: the wgpu `Device` first,
then the sender that ends the thread's wait. The thread was therefore still
polling a device that was being torn down, and the poll reached driver state
that had already gone.

It shows up as a SIGSEGV in the Vulkan driver at process exit:

  anomalyco#2  <ash::device::Device>::get_semaphore_counter_value ()
  anomalyco#3  <wgpu_hal::vulkan::Fence>::get_latest ()
  anomalyco#6  <wgpu_core::device::resource::Device>::maintain ()
  anomalyco#10 <wgpu::api::device::Device>::poll ()
  anomalyco#11 <rune::native_surface::pipeline::SurfaceRenderer>::with_pipeline ({closure#1})

The thread is now joined in `Drop`, before the device is dropped.
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