mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
app: [Wayland] don't change cursor when there is no pointer
Fixes: https://todo.sr.ht/~eliasnaur/gio/333 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+6
-2
@@ -937,8 +937,12 @@ func (w *window) Configure(options []Option) {
|
|||||||
func (w *window) Raise() {}
|
func (w *window) Raise() {}
|
||||||
|
|
||||||
func (w *window) SetCursor(name pointer.CursorName) {
|
func (w *window) SetCursor(name pointer.CursorName) {
|
||||||
|
ptr := w.disp.seat.pointer
|
||||||
|
if ptr == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if name == pointer.CursorNone {
|
if name == pointer.CursorNone {
|
||||||
C.wl_pointer_set_cursor(w.disp.seat.pointer, w.serial, nil, 0, 0)
|
C.wl_pointer_set_cursor(ptr, w.serial, nil, 0, 0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch name {
|
switch name {
|
||||||
@@ -966,7 +970,7 @@ func (w *window) SetCursor(name pointer.CursorName) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
w.cursor.cursor = c
|
w.cursor.cursor = c
|
||||||
w.setCursor(w.disp.seat.pointer, w.serial)
|
w.setCursor(ptr, w.serial)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *window) setCursor(pointer *C.struct_wl_pointer, serial C.uint32_t) {
|
func (w *window) setCursor(pointer *C.struct_wl_pointer, serial C.uint32_t) {
|
||||||
|
|||||||
Reference in New Issue
Block a user