detached c2603da

feat(ports): add data drag and drop messages

commit
c2603da68e005266c0838fcbfdd3f8cbf87fedcf
author
brice · · 2026-10-17 14:10 UTC
parent
458251f
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +67 -0
A internal/ports/dnd.go +67 -0
@@ -0,0 +1,67 @@
1+package ports
2+
3+import "time"
4+
5+// Data drag and drop (wl_data_device.start_drag). Wayland validates the
6+// client's request and tells core; core owns the pointer during the drag:
7+// it hit-tests, routes the drag to the surface under the pointer, drops on
8+// the release and cancels on Escape. Wayland speaks the protocol to the
9+// source and the targets. The icon is a client surface core draws over
10+// everything at the cursor.
11+
12+// DataDragStarted carries wayland → core a client drag answering the
13+// client's current press. Icon is the drag icon's ID (0: none); core
14+// answers with DataDragCancel when it refuses the drag.
15+type DataDragStarted struct {
16+ Icon WindowID
17+}
18+
19+func (DataDragStarted) clientEvent() {}
20+
21+// DataDragIcon carries wayland → core the drag icon's geometry after a
22+// commit: its top left corner relative to the cursor hotspot, and its
23+// size, in logical pixels. W or H 0 hides it.
24+type DataDragIcon struct {
25+ ID WindowID
26+ X, Y, W, H int
27+}
28+
29+func (DataDragIcon) clientEvent() {}
30+
31+// DataDragEnded carries wayland → core the end of a drag core did not
32+// end itself: the source died or the drag was cancelled.
33+type DataDragEnded struct{}
34+
35+func (DataDragEnded) clientEvent() {}
36+
37+// DataDragFocus carries core → wayland the surface under the pointer
38+// during a drag (0: none), at surface-local X, Y: the old target gets
39+// leave, the new one enter with an offer.
40+type DataDragFocus struct {
41+ ID WindowID
42+ X, Y float64
43+ Time time.Duration
44+}
45+
46+func (DataDragFocus) clientCommand() {}
47+
48+// DataDragMotion carries core → wayland the pointer over the drag target,
49+// in its surface coordinates.
50+type DataDragMotion struct {
51+ ID WindowID
52+ X, Y float64
53+ Time time.Duration
54+}
55+
56+func (DataDragMotion) clientCommand() {}
57+
58+// DataDragDrop carries core → wayland the release of the drag button: the
59+// target gets drop when it accepted the offer, else the drag is cancelled.
60+type DataDragDrop struct{}
61+
62+func (DataDragDrop) clientCommand() {}
63+
64+// DataDragCancel carries core → wayland a cancelled or refused drag.
65+type DataDragCancel struct{}
66+
67+func (DataDragCancel) clientCommand() {}
@@ -0,0 +1,67 @@
1+package ports
2+
3+import "time"
4+
5+// Data drag and drop (wl_data_device.start_drag). Wayland validates the
6+// client's request and tells core; core owns the pointer during the drag:
7+// it hit-tests, routes the drag to the surface under the pointer, drops on
8+// the release and cancels on Escape. Wayland speaks the protocol to the
9+// source and the targets. The icon is a client surface core draws over
10+// everything at the cursor.
11+
12+// DataDragStarted carries wayland → core a client drag answering the
13+// client's current press. Icon is the drag icon's ID (0: none); core
14+// answers with DataDragCancel when it refuses the drag.
15+type DataDragStarted struct {
16+ Icon WindowID
17+}
18+
19+func (DataDragStarted) clientEvent() {}
20+
21+// DataDragIcon carries wayland → core the drag icon's geometry after a
22+// commit: its top left corner relative to the cursor hotspot, and its
23+// size, in logical pixels. W or H 0 hides it.
24+type DataDragIcon struct {
25+ ID WindowID
26+ X, Y, W, H int
27+}
28+
29+func (DataDragIcon) clientEvent() {}
30+
31+// DataDragEnded carries wayland → core the end of a drag core did not
32+// end itself: the source died or the drag was cancelled.
33+type DataDragEnded struct{}
34+
35+func (DataDragEnded) clientEvent() {}
36+
37+// DataDragFocus carries core → wayland the surface under the pointer
38+// during a drag (0: none), at surface-local X, Y: the old target gets
39+// leave, the new one enter with an offer.
40+type DataDragFocus struct {
41+ ID WindowID
42+ X, Y float64
43+ Time time.Duration
44+}
45+
46+func (DataDragFocus) clientCommand() {}
47+
48+// DataDragMotion carries core → wayland the pointer over the drag target,
49+// in its surface coordinates.
50+type DataDragMotion struct {
51+ ID WindowID
52+ X, Y float64
53+ Time time.Duration
54+}
55+
56+func (DataDragMotion) clientCommand() {}
57+
58+// DataDragDrop carries core → wayland the release of the drag button: the
59+// target gets drop when it accepted the offer, else the drag is cancelled.
60+type DataDragDrop struct{}
61+
62+func (DataDragDrop) clientCommand() {}
63+
64+// DataDragCancel carries core → wayland a cancelled or refused drag.
65+type DataDragCancel struct{}
66+
67+func (DataDragCancel) clientCommand() {}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close