mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +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:
@@ -95,7 +95,6 @@ type x11Window struct {
|
||||
// _NET_WM_STATE_MAXIMIZED_VERT
|
||||
wmStateMaximizedVert C.Atom
|
||||
}
|
||||
stage Stage
|
||||
metric unit.Metric
|
||||
notify struct {
|
||||
read, write int
|
||||
@@ -437,14 +436,6 @@ func (w *x11Window) window() (C.Window, int, int) {
|
||||
return w.xw, w.config.Size.X, w.config.Size.Y
|
||||
}
|
||||
|
||||
func (w *x11Window) setStage(s Stage) {
|
||||
if s == w.stage {
|
||||
return
|
||||
}
|
||||
w.stage = s
|
||||
w.ProcessEvent(StageEvent{Stage: s})
|
||||
}
|
||||
|
||||
func (w *x11Window) dispatch() {
|
||||
if w.x == nil {
|
||||
// Only Invalidate can wake us up.
|
||||
@@ -879,7 +870,6 @@ func newX11Window(gioWin *callbacks, options []Option) error {
|
||||
C.XMapWindow(dpy, win)
|
||||
w.Configure(options)
|
||||
w.ProcessEvent(X11ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)})
|
||||
w.setStage(StageRunning)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user