Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
//! Touch handling.
|
|
|
|
|
|
|
|
|
|
use sctk::reexports::client::protocol::wl_seat::WlSeat;
|
|
|
|
|
use sctk::reexports::client::protocol::wl_surface::WlSurface;
|
|
|
|
|
use sctk::reexports::client::protocol::wl_touch::WlTouch;
|
2023-04-19 00:56:29 +03:00
|
|
|
use sctk::reexports::client::{Connection, Proxy, QueueHandle};
|
|
|
|
|
use sctk::seat::touch::{TouchData, TouchHandler};
|
2024-07-05 13:09:23 +03:00
|
|
|
use tracing::warn;
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
|
|
|
|
use crate::dpi::LogicalPosition;
|
2023-04-19 00:56:29 +03:00
|
|
|
use crate::event::{Touch, TouchPhase, WindowEvent};
|
|
|
|
|
use crate::platform_impl::wayland::state::WinitState;
|
2024-09-29 15:49:45 +02:00
|
|
|
use crate::platform_impl::wayland::{self, FingerId};
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
impl TouchHandler for WinitState {
|
|
|
|
|
fn down(
|
|
|
|
|
&mut self,
|
|
|
|
|
_: &Connection,
|
|
|
|
|
_: &QueueHandle<Self>,
|
|
|
|
|
touch: &WlTouch,
|
|
|
|
|
_: u32,
|
|
|
|
|
_: u32,
|
|
|
|
|
surface: WlSurface,
|
|
|
|
|
id: i32,
|
|
|
|
|
position: (f64, f64),
|
|
|
|
|
) {
|
|
|
|
|
let window_id = wayland::make_wid(&surface);
|
|
|
|
|
let scale_factor = match self.windows.get_mut().get(&window_id) {
|
|
|
|
|
Some(window) => window.lock().unwrap().scale_factor(),
|
|
|
|
|
None => return,
|
|
|
|
|
};
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2024-07-05 13:09:23 +03:00
|
|
|
let seat_state = match self.seats.get_mut(&touch.seat().id()) {
|
|
|
|
|
Some(seat_state) => seat_state,
|
|
|
|
|
None => {
|
|
|
|
|
warn!("Received wl_touch::down without seat");
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
};
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
// Update the state of the point.
|
2024-07-05 13:09:23 +03:00
|
|
|
let location = LogicalPosition::<f64>::from(position);
|
2023-04-19 00:56:29 +03:00
|
|
|
seat_state.touch_map.insert(id, TouchPoint { surface, location });
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
self.events_sink.push_window_event(
|
|
|
|
|
WindowEvent::Touch(Touch {
|
2024-09-29 15:49:45 +02:00
|
|
|
device_id: None,
|
2023-04-19 00:56:29 +03:00
|
|
|
phase: TouchPhase::Started,
|
|
|
|
|
location: location.to_physical(scale_factor),
|
|
|
|
|
force: None,
|
2024-08-08 00:36:36 +02:00
|
|
|
finger_id: crate::event::FingerId(crate::platform_impl::FingerId::Wayland(
|
|
|
|
|
FingerId(id),
|
|
|
|
|
)),
|
2023-04-19 00:56:29 +03:00
|
|
|
}),
|
|
|
|
|
window_id,
|
|
|
|
|
);
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
}
|
|
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
fn up(
|
|
|
|
|
&mut self,
|
|
|
|
|
_: &Connection,
|
|
|
|
|
_: &QueueHandle<Self>,
|
|
|
|
|
touch: &WlTouch,
|
|
|
|
|
_: u32,
|
|
|
|
|
_: u32,
|
|
|
|
|
id: i32,
|
|
|
|
|
) {
|
2024-07-05 13:09:23 +03:00
|
|
|
let seat_state = match self.seats.get_mut(&touch.seat().id()) {
|
|
|
|
|
Some(seat_state) => seat_state,
|
|
|
|
|
None => {
|
|
|
|
|
warn!("Received wl_touch::up without seat");
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
};
|
2023-04-19 00:56:29 +03:00
|
|
|
|
|
|
|
|
// Remove the touch point.
|
|
|
|
|
let touch_point = match seat_state.touch_map.remove(&id) {
|
|
|
|
|
Some(touch_point) => touch_point,
|
|
|
|
|
None => return,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let window_id = wayland::make_wid(&touch_point.surface);
|
|
|
|
|
let scale_factor = match self.windows.get_mut().get(&window_id) {
|
|
|
|
|
Some(window) => window.lock().unwrap().scale_factor(),
|
|
|
|
|
None => return,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
self.events_sink.push_window_event(
|
|
|
|
|
WindowEvent::Touch(Touch {
|
2024-09-29 15:49:45 +02:00
|
|
|
device_id: None,
|
2023-04-19 00:56:29 +03:00
|
|
|
phase: TouchPhase::Ended,
|
|
|
|
|
location: touch_point.location.to_physical(scale_factor),
|
|
|
|
|
force: None,
|
2024-08-08 00:36:36 +02:00
|
|
|
finger_id: crate::event::FingerId(crate::platform_impl::FingerId::Wayland(
|
|
|
|
|
FingerId(id),
|
|
|
|
|
)),
|
2023-04-19 00:56:29 +03:00
|
|
|
}),
|
|
|
|
|
window_id,
|
|
|
|
|
);
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
}
|
|
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
fn motion(
|
|
|
|
|
&mut self,
|
|
|
|
|
_: &Connection,
|
|
|
|
|
_: &QueueHandle<Self>,
|
|
|
|
|
touch: &WlTouch,
|
|
|
|
|
_: u32,
|
|
|
|
|
id: i32,
|
|
|
|
|
position: (f64, f64),
|
|
|
|
|
) {
|
2024-07-05 13:09:23 +03:00
|
|
|
let seat_state = match self.seats.get_mut(&touch.seat().id()) {
|
|
|
|
|
Some(seat_state) => seat_state,
|
|
|
|
|
None => {
|
|
|
|
|
warn!("Received wl_touch::motion without seat");
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
};
|
2023-04-19 00:56:29 +03:00
|
|
|
|
|
|
|
|
// Remove the touch point.
|
2023-05-03 22:20:55 +03:00
|
|
|
let touch_point = match seat_state.touch_map.get_mut(&id) {
|
2023-04-19 00:56:29 +03:00
|
|
|
Some(touch_point) => touch_point,
|
|
|
|
|
None => return,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let window_id = wayland::make_wid(&touch_point.surface);
|
|
|
|
|
let scale_factor = match self.windows.get_mut().get(&window_id) {
|
|
|
|
|
Some(window) => window.lock().unwrap().scale_factor(),
|
|
|
|
|
None => return,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
touch_point.location = LogicalPosition::<f64>::from(position);
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
self.events_sink.push_window_event(
|
|
|
|
|
WindowEvent::Touch(Touch {
|
2024-09-29 15:49:45 +02:00
|
|
|
device_id: None,
|
2023-09-01 02:14:34 +04:00
|
|
|
phase: TouchPhase::Moved,
|
2023-04-19 00:56:29 +03:00
|
|
|
location: touch_point.location.to_physical(scale_factor),
|
|
|
|
|
force: None,
|
2024-08-08 00:36:36 +02:00
|
|
|
finger_id: crate::event::FingerId(crate::platform_impl::FingerId::Wayland(
|
|
|
|
|
FingerId(id),
|
|
|
|
|
)),
|
2023-04-19 00:56:29 +03:00
|
|
|
}),
|
|
|
|
|
window_id,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn cancel(&mut self, _: &Connection, _: &QueueHandle<Self>, touch: &WlTouch) {
|
2024-07-05 13:09:23 +03:00
|
|
|
let seat_state = match self.seats.get_mut(&touch.seat().id()) {
|
|
|
|
|
Some(seat_state) => seat_state,
|
|
|
|
|
None => {
|
|
|
|
|
warn!("Received wl_touch::cancel without seat");
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
};
|
2023-04-19 00:56:29 +03:00
|
|
|
|
|
|
|
|
for (id, touch_point) in seat_state.touch_map.drain() {
|
|
|
|
|
let window_id = wayland::make_wid(&touch_point.surface);
|
|
|
|
|
let scale_factor = match self.windows.get_mut().get(&window_id) {
|
|
|
|
|
Some(window) => window.lock().unwrap().scale_factor(),
|
|
|
|
|
None => return,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let location = touch_point.location.to_physical(scale_factor);
|
|
|
|
|
|
|
|
|
|
self.events_sink.push_window_event(
|
|
|
|
|
WindowEvent::Touch(Touch {
|
2024-09-29 15:49:45 +02:00
|
|
|
device_id: None,
|
2023-04-19 00:56:29 +03:00
|
|
|
phase: TouchPhase::Cancelled,
|
|
|
|
|
location,
|
|
|
|
|
force: None,
|
2024-08-08 00:36:36 +02:00
|
|
|
finger_id: crate::event::FingerId(crate::platform_impl::FingerId::Wayland(
|
|
|
|
|
FingerId(id),
|
|
|
|
|
)),
|
2023-04-19 00:56:29 +03:00
|
|
|
}),
|
|
|
|
|
window_id,
|
|
|
|
|
);
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
}
|
|
|
|
|
}
|
2023-04-19 00:56:29 +03:00
|
|
|
|
|
|
|
|
fn shape(
|
|
|
|
|
&mut self,
|
|
|
|
|
_: &Connection,
|
|
|
|
|
_: &QueueHandle<Self>,
|
|
|
|
|
_: &WlTouch,
|
|
|
|
|
_: i32,
|
|
|
|
|
_: f64,
|
|
|
|
|
_: f64,
|
|
|
|
|
) {
|
|
|
|
|
// Blank.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn orientation(&mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlTouch, _: i32, _: f64) {
|
|
|
|
|
// Blank.
|
|
|
|
|
}
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
}
|
|
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
/// The state of the touch point.
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub struct TouchPoint {
|
|
|
|
|
/// The surface on which the point is present.
|
|
|
|
|
pub surface: WlSurface,
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
/// The location of the point on the surface.
|
|
|
|
|
pub location: LogicalPosition<f64>,
|
|
|
|
|
}
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
pub trait TouchDataExt {
|
|
|
|
|
fn seat(&self) -> &WlSeat;
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
}
|
|
|
|
|
|
2023-04-19 00:56:29 +03:00
|
|
|
impl TouchDataExt for WlTouch {
|
|
|
|
|
fn seat(&self) -> &WlSeat {
|
|
|
|
|
self.data::<TouchData>().expect("failed to get touch data.").seat()
|
Update SCTK to 0.11.0
* Update SCTK to 0.11.0
Updates smithay-client-toolkit to 0.11.0. The major highlight
of that updated, is update of wayland-rs to 0.27.0. Switching
to wayland-cursor, instead of using libwayland-cursor. It
also fixes the following bugs:
- Disabled repeat rate not being handled.
- Decoration buttons not working after tty switch.
- Scaling not being applied on output reenable.
- Crash when `XCURSOR_SIZE` is `0`.
- Pointer getting created in some cases without pointer capability.
- On kwin, fix space between window and decorations on startup.
- Incorrect size event when entering fullscreen when using
client side decorations.
- Client side decorations not being hided properly in fullscreen.
- Size tracking between fullscreen/tiled state changes.
- Repeat rate triggering multiple times from slow callback handler.
- Resizable attribute not being applied properly on startup.
- Not working IME
Besides those fixes it also adds a bunch of missing virtual key codes,
implements proper cursor grabbing, adds right click on decorations
to open application menu, disabled maximize button for non-resizeable
window, and fall back for cursor icon to similar ones, if the requested
is missing.
It also adds new methods to a `Theme` trait, such as:
- `title_font(&self) -> Option<(String, f32)>` - The font for a title.
- `title_color(&self, window_active: bool) -> [u8; 4]` - The color of
the text in the title.
Fixes #1680.
Fixes #1678.
Fixes #1676.
Fixes #1646.
Fixes #1614.
Fixes #1601.
Fixes #1533.
Fixes #1509.
Fixes #952.
Fixes #947.
2020-09-29 00:11:43 +03:00
|
|
|
}
|
|
|
|
|
}
|
2023-04-19 00:56:29 +03:00
|
|
|
|
|
|
|
|
sctk::delegate_touch!(WinitState);
|