Revert "app: optimize window context locking"

This reverts commit 3e601e73c4 because it
results in a blank window on Android.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Fixes: https://todo.sr.ht/~eliasnaur/gio/671
This commit is contained in:
Elias Naur
2025-10-17 14:47:19 +02:00
parent 3f4f8ba7c1
commit be8d9df848
+9 -5
View File
@@ -142,11 +142,8 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
if w.gpu == nil && !w.nocontext {
var err error
if w.ctx == nil {
if w.ctx, err = w.driver.NewContext(); err != nil {
return err
}
if err = w.ctx.Lock(); err != nil {
w.destroyGPU()
w.ctx, err = w.driver.NewContext()
if err != nil {
return err
}
sync = true
@@ -166,6 +163,12 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
return err
}
}
if w.ctx != nil {
if err := w.ctx.Lock(); err != nil {
w.destroyGPU()
return err
}
}
if w.gpu == nil && !w.nocontext {
gpu, err := gpu.New(w.ctx.API())
if err != nil {
@@ -197,6 +200,7 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
var err error
if w.gpu != nil {
err = w.ctx.Present()
w.ctx.Unlock()
}
return err
}