From c0f3ec88e9787722ef2d74c760a1c38a70cf165c Mon Sep 17 00:00:00 2001 From: Pierre Curto Date: Tue, 18 Jan 2022 17:34:49 +0100 Subject: [PATCH] io/pointer: add new pointers Add resize pointer cursor names for resize operations in preparation for the window decorations patch. Signed-off-by: Pierre Curto --- app/os_wayland.go | 16 ++++++++++++++++ io/pointer/pointer.go | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/app/os_wayland.go b/app/os_wayland.go index ce181bcb..a8a95872 100644 --- a/app/os_wayland.go +++ b/app/os_wayland.go @@ -1018,6 +1018,22 @@ func (w *window) SetCursor(name pointer.CursorName) { name = "left_side" case pointer.CursorGrab: name = "hand1" + case pointer.CursorTopLeftResize: + name = "top_left_corner" + case pointer.CursorTopRightResize: + name = "bottom_left_corner" + case pointer.CursorBottomLeftResize: + name = "top_right_corner" + case pointer.CursorBottomRightResize: + name = "bottom_right_corner" + case pointer.CursorLeftResize: + name = "right_side" + case pointer.CursorRightResize: + name = "left_side" + case pointer.CursorTopResize: + name = "top_side" + case pointer.CursorBottomResize: + name = "bottom_side" } cname := C.CString(string(name)) defer C.free(unsafe.Pointer(cname)) diff --git a/io/pointer/pointer.go b/io/pointer/pointer.go index 97987f7c..adefea4b 100644 --- a/io/pointer/pointer.go +++ b/io/pointer/pointer.go @@ -110,6 +110,22 @@ const ( CursorGrab CursorName = "grab" // CursorNone hides the cursor. To show it again, use any other cursor. CursorNone CursorName = "none" + // CursorTopLeftResize is the cursor for top-left corner resizing. + CursorTopLeftResize = "top-left-resize" + // CursorTopRightResize is the cursor for top-right corner resizing. + CursorTopRightResize = "top-right-resize" + // CursorBottomLeftResize is the cursor for bottom-left corner resizing. + CursorBottomLeftResize = "bottom-left-resize" + // CursorBottomRightResize is the cursor for bottom-right corner resizing. + CursorBottomRightResize = "bottom-right-resize" + // CursorLeftResize is the cursor for left resizing. + CursorLeftResize = "left-resize" + // CursorRightResize is the cursor for right resizing. + CursorRightResize = "right-resize" + // CursorTopResize is the cursor for top resizing. + CursorTopResize = "top-resize" + // CursorBottomResize is the cursor for bottom resizing. + CursorBottomResize = "bottom-resize" ) const (