mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
app/internal/window: remove context-menu (right-click) for wasm
The context-menu seems useless. The only action available, on the context-menu is to "Save image": which gives a black image. I think it's better to remove it. The right-click still work and still provide `pointer.Event`. Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
@@ -120,6 +120,10 @@ func (w *window) addEventListeners() {
|
|||||||
w.draw(true)
|
w.draw(true)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
w.addEventListener(w.window, "contextmenu", func(this js.Value, args []js.Value) interface{} {
|
||||||
|
args[0].Call("preventDefault")
|
||||||
|
return nil
|
||||||
|
})
|
||||||
w.addEventListener(w.cnv, "mousemove", func(this js.Value, args []js.Value) interface{} {
|
w.addEventListener(w.cnv, "mousemove", func(this js.Value, args []js.Value) interface{} {
|
||||||
w.pointerEvent(pointer.Move, 0, 0, args[0])
|
w.pointerEvent(pointer.Move, 0, 0, args[0])
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user