gtk4: event handling
Current git master has no public API to get context for events (mouse click at some cell) and has no context menu handling at all. The gtk3 APIs exposes GdkEvent
; that still exists for gtk4, but I want to avoid exposing it, and I'd also like to take the opportunity of gtk4 to improve the event handling.
I see a couple possibilities:
-
We could make the event signals carry the (row, column) info, and replace the
vte_terminal_*_check_event()
with an API that takes those coordinates. -
Or have the event signals carry a
VteEventContext
struct that encapsulates the coordinates, and that has API to perform the checks (hyperlink, regex, ...). -
Or just keep exposing the API taking the raw
GdkEvent
s.
I'm leaning towards the 2nd option.
As for the context menu handling, I also see several possibilities:
-
Do nothing. Let the vte users handle listening to raw events / gestures, get context for them, pop up menu, etc, all by themselves.
-
Have a GMenuModel set as context menu, and a 'setup-menu' signal that's emitted when there's a context menu to pop up, that can configure (enable, set state, etc) the actions. This is similar to what libhandy's HdyTabView does.
-
Have the context menu handler return a GMenuModel directly.
I don't like possibility 1; 2 and 3 only differ in how the final menu model is configured.