Surface position in global compositor space is not required to be
rounded to logical integers. The compositor is free to put surfaces
wherever. So, do not require an integer-logical position.
Not to be confused with:
* A subsurface can only be at an integer-logical offset from its parent
surface (for now, at least). However, this is unrelated to the
subsurface position in the global compositor space.
* A surface buffer is (generally expected to be) at an integer
*physical* pixel position. However, this is unrelated, and frequently
isn't, an integer *logical* pixel position.
This fixes an issue I noticed where cancelled drag-and-drop in clients
like Firefox and Nautilus caused a window to ignore pointer events until
losing and regaining focus. It seems calling the `.ungrab` method at the
end of `with_grab` means calling it after pointer focus is restored, and
clients seem not to handle the `wl_pointer.enter` before the drag is
actually over.
Deferring the focus restoration as well is slightly complicated to
implement, and seems problematic when it involves a serial. Maybe there
shouldn't be any input events after the `*set_grab` call but before
returning, but this seems cleaner.
Taking a reference to the handler in `*InterHandle.*set_grab` is a bit
annoying, but easy enough to deal with, and allows this to work more
cleanly. This seems reasonable as long as we don't have a better
solution to the whole `GrabStatus::Borrowed` thing.
`unset` is called when a grab is removed with `unset_grab` or replaced
with `set_grab`.
This fixes https://github.com/pop-os/cosmic-comp/issues/403. There are a
couple other grabs in Smithay and cosmic-comp that they run before
unsetting the grab, that may cause issues if the grab is removed without
running it. So this seems useful in general.
The usual value for one wheel tick is 15, not 3. This can be verified
with Firefox by scrolling on a TTY backend vs. on the winit backend
(since this particular fallback is used on the winit backend).
This adds support for `wl_pointer` version 8, calling
`wl_pointer::axis_value120` with the v120 values from libinput. For
clients not binding version 8, values are accumulated to multiples of
120 to send the old `axis_discrete` event.
This helps even for clients using `wl_pointer::axis` with old versions
of `wl_pointer`, since the old libinput event only was emitted where
there was a whole discrete scroll step.
Raises libinput requirement to 1.19, which should be widely available
now. Removes handling of versions before that.
It should be possible to support high res scrolling in the X11 and Winit
backends, where the platform supports it, but for now this just converts
the low-res value to v120.
Make better winit integration by providing a calloop's WaylandSource
for it. The winit backend now doesn't use vsync and utilizes frame
callbacks, when the user cooperates and asks for `redraw_requested`.
Fixes#146.
Used in `ClickGrab` to prevent `motion` events from occurring with every
`button` event. Otherwise, behavior should be unchanged. This matches
the argument taken by `KeyboardInnerHandle::unset_grab`.
This seems like the simplest solution. It would also be possible to add
a method to the `PointerGrab` trait indicating if focus should be
restored, but that's complicated since `unset_grab` can't access the
grab when it's `Borrowed`, so it would have to add a bool to
`GrabStatus::Borrowed`, etc.
This still doesn't send a `frame`, but since this takes a serial and a
time, it probably will be sent along with other pointer events, and
hopefully part of a `frame`. The Wayland spec isn't all that specific
about when things can/should be part of a `frame`...
Calling `motion` is also incorrect with pointer constraints, but grabs
other than `ClickGrab` generally shouldn't exist while a constraint is
active. It would be good to enforce that some way.
Fixes https://github.com/Smithay/smithay/issues/1148.
wlr_data_control is a protocol used to implement clipboard managers or
access clipboard without creating a window. The implementation of it
ties to regular selections, thus the selection handling was unified
to reduce the maintainance burden.
The present selection modules, like `walyand/primary_selection` and
`wayland/data_device` moved into the new `wayland/selection` module.
Keeping their original implementation, where it was possible.
The new selection module uses the common structure of `seat_data`,
`device`, `source`, and `mod.rs` used in the said above modules, however
it uses the hand-rolled dynamic dispatch with the `selection_dispatch!`
macro. The offers and selection replies are all handled together,
so the code is unique in the most cases.
As a side effect of the selection update and merging the handling of
the primary and clipboard selection into the single `SelectionHandler`
trait (users could still just use one of them, it's not a must to have
both), the xwayland was changed to use some types from the
`wayland/selection` module.
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.
Meant to address https://github.com/Smithay/smithay/issues/1126.
It's only supposed to be sent when there actually is a zero in the
event, not when the value is missing.
This notably fixes non-diagonal scrolling in winit and alacritty.
* smallvil: Store DisplayHandle in State
Will be useful for the data device focus.
* smallvil: Set data device focus
Makes clipboard work across clients.
* smallvil: Add basic PopupManager implementation
Doesn't handle popup grabs but gets smallvil far enough.
On Winit the code seems fine as is, however when using smallvil as a
base for a libinput compositor, these unwraps crash on scrolls. Use
default values like in Anvil to make it work with no surprises.
this changes send_configure for ToplevelSurface,
PopupSurface and LayerSurface to always generate
a configure event. The old behavior can be found
in send_pending_configure. This is needed as
set_fullscreen and set_maximized always expect
a configure event regardless if the request was
fulfilled or not.
Add helper for the relative pointer protocol, and a way to send relative
pointer events to clients. This also exposes unaccelerated vectors and
microsecond timestamps in pointer events from the libinput backend.
Enables `wlcs` relative pointer test, though what `wlcs` currently
handles seems to be limited at this point.
Adds relative pointer support for Anvil, exposing the global only on the
`udev` backend so clients won't use the protocol but get no events.
this extends the result of the dtr with a report
that holds the render states of the provided elements.
The state can be used to query states like skipped after
the rendering took place. This enables use-cases
where the actual state is needed like frame
callback throttling and wp_presentation.