1
0
Fork 0
forked from wry/wry

wayland: implement tablet-v2

This commit is contained in:
Julian Orth 2024-05-01 00:09:16 +02:00
parent 86e283d255
commit 7ed499eabd
62 changed files with 5174 additions and 318 deletions

View file

@ -4,7 +4,7 @@ use {
cursor::KnownCursor,
fixed::Fixed,
ifs::{
wl_seat::{NodeSeatState, SeatId, WlSeatGlobal},
wl_seat::{tablet::TabletTool, NodeSeatState, SeatId, WlSeatGlobal},
wl_surface::{x_surface::XSurface, WlSurface, WlSurfaceError},
},
rect::Rect,
@ -369,6 +369,16 @@ impl Node for Xwindow {
seat.pointer_cursor().set_known(KnownCursor::Default);
}
fn node_on_tablet_tool_enter(
self: Rc<Self>,
tool: &Rc<TabletTool>,
_time_usec: u64,
_x: Fixed,
_y: Fixed,
) {
tool.cursor().set_known(KnownCursor::Default)
}
fn node_into_toplevel(self: Rc<Self>) -> Option<Rc<dyn ToplevelNode>> {
Some(self)
}

View file

@ -4,7 +4,7 @@ use {
cursor::KnownCursor,
fixed::Fixed,
ifs::{
wl_seat::{NodeSeatState, WlSeatGlobal},
wl_seat::{tablet::TabletTool, NodeSeatState, WlSeatGlobal},
wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt},
xdg_positioner::{
XdgPositioned, XdgPositioner, CA_FLIP_X, CA_FLIP_Y, CA_RESIZE_X, CA_RESIZE_Y,
@ -346,6 +346,16 @@ impl Node for XdgPopup {
// log::info!("xdg-popup focus");
seat.pointer_cursor().set_known(KnownCursor::Default);
}
fn node_on_tablet_tool_enter(
self: Rc<Self>,
tool: &Rc<TabletTool>,
_time_usec: u64,
_x: Fixed,
_y: Fixed,
) {
tool.cursor().set_known(KnownCursor::Default)
}
}
impl StackedNode for XdgPopup {

View file

@ -9,7 +9,7 @@ use {
fixed::Fixed,
ifs::{
ext_foreign_toplevel_list_v1::ExtForeignToplevelListV1,
wl_seat::{NodeSeatState, SeatId, WlSeatGlobal},
wl_seat::{tablet::TabletTool, NodeSeatState, SeatId, WlSeatGlobal},
wl_surface::{
xdg_surface::{
xdg_toplevel::xdg_dialog_v1::XdgDialogV1, XdgSurface, XdgSurfaceError,
@ -529,6 +529,16 @@ impl Node for XdgToplevel {
seat.pointer_cursor().set_known(KnownCursor::Default);
}
fn node_on_tablet_tool_enter(
self: Rc<Self>,
tool: &Rc<TabletTool>,
_time_usec: u64,
_x: Fixed,
_y: Fixed,
) {
tool.cursor().set_known(KnownCursor::Default)
}
fn node_into_toplevel(self: Rc<Self>) -> Option<Rc<dyn ToplevelNode>> {
Some(self)
}