Skip to content

Commit 782b241

Browse files
authored
Add show and hide events to the spec (#4)
* Add show and hide events to the spec * update date
1 parent 72a0087 commit 782b241

1 file changed

Lines changed: 31 additions & 9 deletions

File tree

src/spec.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
A protocol for interactive rendering surfaces.
55

6-
*Last update: 09-05-2025*
6+
*Last update: 18-03-2026*
77

88
*This spec was previously known as the jupyter_rfb event spec, but was rolled into a separate project.*
99

@@ -31,7 +31,7 @@ This spec if used by:
3131

3232
## Controlling the view
3333

34-
The way that the view (a.k.a. canvas, surface) can be controlled is left up to
34+
The way that the view (a.k.a. canvas, surface, widget) can be controlled is left up to
3535
the implementation. This spec does not say much about it, except for the
3636
following suggestions for settable things:
3737

@@ -60,7 +60,7 @@ are well-defined, they can always be serialized to json, and send to other progr
6060

6161
### resize
6262

63-
This event is emitted when the widget changes size.
63+
This event is emitted when the canvas changes size.
6464

6565

6666
Fields:
@@ -76,14 +76,36 @@ Fields:
7676

7777
### close
7878

79-
This event is emitted when the widget is closed (i.e. destroyed).
79+
This event is emitted when the canvas is closed (i.e. destroyed).
8080

8181
Fields:
8282

8383
* `event_type`: 'close'
8484
* `time_stamp`: A timestamp in seconds.
8585

8686

87+
### show
88+
89+
This event is emitted when the canvas is shown. The implementation may
90+
optionally emit an initial 'show' event; the canvas is initially assumed to be
91+
shown. If this is not the case, the implementation should emit a 'hide' event.
92+
93+
Fields:
94+
95+
* `event_type`: 'show'
96+
* `time_stamp`: A timestamp in seconds.
97+
98+
99+
### hide
100+
101+
This event is emitted when the canvas is hidden. It can e.g. be minimized or scrolled out of view.
102+
103+
Fields:
104+
105+
* `event_type`: 'hide'
106+
* `time_stamp`: A timestamp in seconds.
107+
108+
87109
### pointer_down
88110

89111
This event is emitted when the user interacts with mouse, touch or other pointer devices, by pressing it down.
@@ -135,7 +157,7 @@ Fields:
135157

136158
### pointer_enter
137159

138-
This event is emitted when the user moves a pointer into the boundary of the widget.
160+
This event is emitted when the user moves a pointer into the boundary of the canvas.
139161

140162
Fields:
141163

@@ -145,7 +167,7 @@ Fields:
145167

146168
### pointer_leave
147169

148-
This event is emitted when the user moves a pointer out of the boundary of the widget.
170+
This event is emitted when the user moves a pointer out of the boundary of the canvas.
149171

150172
Fields:
151173

@@ -259,11 +281,11 @@ Positive `x` moves to the right, positive `y` moves down.
259281

260282
### Event capturing
261283

262-
The `pointer_move` event only occurs when the pointer is over the widget,
284+
The `pointer_move` event only occurs when the pointer is over the canvas,
263285
unless a button is down (i.e. dragging). The `pointer_down` event can only
264-
occur inside the widget, the `pointer_up` can occur outside of the widget.
286+
occur inside the canvas, the `pointer_up` can occur outside of the canvas.
265287

266-
Some events only work when the widget has focus within the application
288+
Some events only work when the canvas has focus within the application
267289
(i.e. having received a pointer down).
268290
This applies to the `key_down`, `key_up`, and `wheel` events.
269291

0 commit comments

Comments
 (0)