mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app: ensure SetDriver is called before sending events
This used to not matter, but a follow-up change will require a valid driver to process events. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -243,11 +243,11 @@ func newWLWindow(callbacks *callbacks, options []Option) error {
|
|||||||
go func() {
|
go func() {
|
||||||
defer d.destroy()
|
defer d.destroy()
|
||||||
defer w.destroy()
|
defer w.destroy()
|
||||||
|
|
||||||
|
w.w.SetDriver(w)
|
||||||
// Finish and commit setup from createNativeWindow.
|
// Finish and commit setup from createNativeWindow.
|
||||||
w.Configure(options)
|
w.Configure(options)
|
||||||
C.wl_surface_commit(w.surf)
|
C.wl_surface_commit(w.surf)
|
||||||
|
|
||||||
w.w.SetDriver(w)
|
|
||||||
if err := w.loop(); err != nil {
|
if err := w.loop(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -777,12 +777,11 @@ func newX11Window(gioWin *callbacks, options []Option) error {
|
|||||||
C.XSetWMProtocols(dpy, win, &w.atoms.evDelWindow, 1)
|
C.XSetWMProtocols(dpy, win, &w.atoms.evDelWindow, 1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
w.w.SetDriver(w)
|
||||||
w.Configure(options)
|
w.Configure(options)
|
||||||
|
|
||||||
// make the window visible on the screen
|
// make the window visible on the screen
|
||||||
C.XMapWindow(dpy, win)
|
C.XMapWindow(dpy, win)
|
||||||
|
|
||||||
w.w.SetDriver(w)
|
|
||||||
w.w.Event(ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)})
|
w.w.Event(ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)})
|
||||||
w.setStage(system.StageRunning)
|
w.setStage(system.StageRunning)
|
||||||
w.loop()
|
w.loop()
|
||||||
|
|||||||
Reference in New Issue
Block a user