[webkit-gtk] Opening default context menu on mouse release
tanty at igalia.com
Tue May 16 23:23:08 PDT 2017
On Sun, 2017-05-14 at 12:35 +0200, Peter Hofmann wrote:
> Hi all,
> we're trying to implement mouse gestures in a simple webkit2gtk
> browser. To make things a little easier, here's a minimal example:
> To invoke a gesture, press the right mouse button and drag the pointer
> left, right, up or down. The browser will then navigate backward,
> forward, reload the page or open a new tab.
> The current implementation makes the context menu inaccessible. Problem
> is, the context menu always opens on mouse *down* events. At that point
> in time, we don't know yet if the user is going to perform a gesture.
> So, my question is, is there a way to open webkit's default context menu
> on mouse *release* events?
Maybe I'm stating something too obvious that you have already checked
but, since I didn't see any mention to this in your code, I will point
GTK+ has gestures support:
Here some examples:
I'm no expert on that but, as stated at:
I would assume that if you would set GDK_TOUCHPAD_GESTURE_MASK on
the GdkWindows of your widgets, you will have direct control for the
gestures and the context window would only be triggered by a press and
hold gesture (?)
As said, I'm no expert so maybe this is not so straight forward and/or
needs some modifications on WebKitGtk+ in order to work.
More information about the webkit-gtk