mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app: [API] remove StageEvent and Stage
StageEvent served only redundant purposes: - To detect whether the window has focus. That is covered by key.FocusEvent. - To detect whether the window is currently visible. That is covered by the absence or presence of FrameEvents. - To detect when the window native handle is valid. That is covered by ViewEvent. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -115,7 +115,6 @@ func newWindow(win *callbacks, options []Option) {
|
||||
w.Configure(options)
|
||||
w.blur()
|
||||
w.processEvent(JSViewEvent{Element: cont})
|
||||
w.processEvent(StageEvent{Stage: StageRunning})
|
||||
w.resize()
|
||||
w.draw(true)
|
||||
}
|
||||
@@ -195,17 +194,6 @@ func (w *window) addEventListeners() {
|
||||
}
|
||||
return w.browserHistory.Call("back")
|
||||
})
|
||||
w.addEventListener(w.document, "visibilitychange", func(this js.Value, args []js.Value) interface{} {
|
||||
ev := StageEvent{}
|
||||
switch w.document.Get("visibilityState").String() {
|
||||
case "hidden", "prerender", "unloaded":
|
||||
ev.Stage = StagePaused
|
||||
default:
|
||||
ev.Stage = StageRunning
|
||||
}
|
||||
w.processEvent(ev)
|
||||
return nil
|
||||
})
|
||||
w.addEventListener(w.cnv, "mousemove", func(this js.Value, args []js.Value) interface{} {
|
||||
w.pointerEvent(pointer.Move, 0, 0, args[0])
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user