- timefmt.hhmm12 + render_digital(hour12=); compositor panel shows '7:51 PM' (wasm clock component keeps 24h by default) - wp_cursor_shape_v1: server lets clients pick their cursor; nested window forwards the shape to the host. Launcher button/entries show a hand, the search field a text cursor, client windows what the client asked for. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a63f65806d
commit
59ea224d38
8 files changed
+146
-3
No files matched your search
@@ -38,6 +38,8 @@ enum ObjKind {
|
||||
ObjSubsurface
|
||||
ObjDataManager
|
||||
ObjDataObj
|
||||
ObjCursorShapeMgr
|
||||
ObjCursorShapeDev
|
||||
}
|
||||
|
||||
///|
|
||||
@@ -99,6 +101,8 @@ struct ClientConn {
|
||||
pointer_ids : Array[UInt]
|
||||
keyboard_ids : Array[UInt]
|
||||
mut seat_ver : UInt
|
||||
/// wp_cursor_shape_v1 shape the client last asked for (0 = never set).
|
||||
mut cursor_shape : UInt
|
||||
mut alive : Bool
|
||||
}
|
||||
|
||||
@@ -120,6 +124,7 @@ fn ClientConn::new(client_id : UInt, fd : Int) -> ClientConn {
|
||||
pointer_ids: [],
|
||||
keyboard_ids: [],
|
||||
seat_ver: 1U,
|
||||
cursor_shape: 0U,
|
||||
alive: true,
|
||||
}
|
||||
}
|
||||
@@ -219,6 +224,7 @@ fn emit_registry_globals(c : ClientConn, reg_id : UInt) -> Unit {
|
||||
(6U, "wl_output", 4U),
|
||||
(7U, "wl_subcompositor", 1U),
|
||||
(8U, "wl_data_device_manager", 3U),
|
||||
(9U, "wp_cursor_shape_manager_v1", 1U),
|
||||
]
|
||||
for g in globals {
|
||||
let w = WireWriter::new()
|
||||
@@ -385,6 +391,8 @@ fn WaylandServer::dispatch_msg(
|
||||
c.objects.set(new_id, ObjSeat)
|
||||
c.seat_ver = ver
|
||||
emit_seat_info(c, new_id)
|
||||
} else if iface == "wp_cursor_shape_manager_v1" {
|
||||
c.objects.set(new_id, ObjCursorShapeMgr)
|
||||
} else if iface == "wl_data_device_manager" {
|
||||
c.objects.set(new_id, ObjDataManager)
|
||||
} else if iface == "wl_subcompositor" {
|
||||
@@ -497,6 +505,22 @@ fn WaylandServer::dispatch_msg(
|
||||
c.objects.set(id, ObjDataObj)
|
||||
}
|
||||
ObjDataObj => ()
|
||||
ObjCursorShapeMgr =>
|
||||
if opcode == 1U {
|
||||
// get_pointer(cursor_shape_device: new_id, pointer)
|
||||
let id = reader.u32()
|
||||
c.objects.set(id, ObjCursorShapeDev)
|
||||
} else if opcode == 2U {
|
||||
// get_tablet_tool_v2: accepted, unused
|
||||
let id = reader.u32()
|
||||
c.objects.set(id, ObjCursorShapeDev)
|
||||
}
|
||||
ObjCursorShapeDev =>
|
||||
if opcode == 1U {
|
||||
// set_shape(serial, shape)
|
||||
let _serial = reader.u32()
|
||||
c.cursor_shape = reader.u32()
|
||||
}
|
||||
ObjSubsurface =>
|
||||
if opcode == 0U {
|
||||
c.objects.remove(obj_id)
|
||||
@@ -1059,3 +1083,12 @@ pub fn WaylandServer::keyboard_modifiers(self : WaylandServer, win_id : UInt64,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///| Cursor shape (wp_cursor_shape_v1 enum value) the client owning `win_id` last
|
||||
/// requested; 1 (default) if it never asked for one.
|
||||
pub fn WaylandServer::client_cursor_shape(self : WaylandServer, win_id : UInt64) -> UInt {
|
||||
match self.win_client(win_id) {
|
||||
Some((c, _)) => if c.cursor_shape == 0U { 1U } else { c.cursor_shape }
|
||||
None => 1U
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user