Skip to content

fix mouse interactions being limited to LMB - #33

Merged
VimYoung merged 3 commits into
VimYoung:mainfrom
dotsem:fix/mouse-interactions-being-limited-to-LMB
Jun 8, 2026
Merged

VimYoung merged 3 commits into
VimYoung:mainfrom
dotsem:fix/mouse-interactions-being-limited-to-LMB

Conversation

@dotsem

@dotsem dotsem commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Adds support between hardware key codes & the slint key enum.
Via this way we can use all 5 (6 if we include other) mouse buttons that can be used in Slint.

I've added 6 buttons to test the interactinos & renamed cursor_test to mouse_interactions to more accuratly reflect the usage.

Fixes #32

2026-06-07.01-01-15.mp4

@VimYoung

VimYoung commented Jun 7, 2026 •

Copy link
Copy Markdown
Owner

Hey @dotsem , thanks for the PR. Unfortunately, I have done some project restructuring to place traits implementations of widgets in separate module with the long term goal to clutter down wayland_adapter.rs (It is becoming ridiculously long). I request you to kindly resolve the merge conflicts.

@dotsem
dotsem force-pushed the fix/mouse-interactions-being-limited-to-LMB branch from 949c261 to de60efc Compare June 7, 2026 20:03
@dotsem

dotsem commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@VimYoung Just tried rebasing to main, but it seems like there is an issue trying to compile the framework:

Error log
error[E0432]: unresolved import `crate::wayland_adapter::SpellXDGPopup`
 --> spell-framework/src/wayland_adapter/widget_impls/popup_impl.rs:3:5
  |
3 | use crate::wayland_adapter::SpellXDGPopup;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SpellXDGPopup` in `wayland_adapter`

warning: unused imports: `Anchor`, `CompositorState`, `KeyboardInteractivity`, `LayerShell`, `Layer`, `globals::registry_queue_init`, and `slot::SlotPool`
  --> spell-framework/src/wayland_adapter/widget_impls/popup_impl.rs:5:37
   |
 5 |     compositor::{CompositorHandler, CompositorState},
   |                                     ^^^^^^^^^^^^^^^
...
 9 |         globals::registry_queue_init,
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
22 |             Anchor, KeyboardInteractivity, Layer, LayerShell, LayerShellHandler,...
   |             ^^^^^^  ^^^^^^^^^^^^^^^^^^^^^  ^^^^^  ^^^^^^^^^^
...
27 |     shm::{Shm, ShmHandler, slot::SlotPool},
   |                            ^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

error[E0425]: cannot find function, tuple struct or tuple variant `FrameCallbackData` in this scope
   --> spell-framework/src/wayland_adapter/widget_impls/popup_impl.rs:462:24
    |
462 |             .frame(qh, FrameCallbackData(self.layer.wl_surface().clone()));
    |                        ^^^^^^^^^^^^^^^^^ not found in this scope

@VimYoung

VimYoung commented Jun 8, 2026

Copy link
Copy Markdown
Owner

That was caused by temporary broken change due to addition of XDG popup, I have moved the changes to a separate branch so that main build remains stable but seems like some changes have percolated here. I have fixed it though, you will get warnings but the code should compile without errors now.

@dotsem
dotsem force-pushed the fix/mouse-interactions-being-limited-to-LMB branch from de60efc to 51240cb Compare June 8, 2026 12:08
@dotsem

dotsem commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

The code compiles again. I also renamed the long "smithay_to_slint_mouse_button_mapping.rs" name to a shorter one and renamed mouse button to pointer button to reflect waylands naming conventions.

@VimYoung
VimYoung merged commit 25396a1 into VimYoung:main Jun 8, 2026
@VimYoung

VimYoung commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR !! I have merged it.

@dotsem
dotsem deleted the fix/mouse-interactions-being-limited-to-LMB branch November 17, 2026 21:13
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.

only recieving left pointer event

2 participants