app,app/internal/wm: fold context MakeCurrent/ReleaseCurrent into Lock/Unlock

While here, make context Refresh useful and remove the redundant
MakeCurrent from the window loop.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-04 12:03:04 +02:00
parent 4dd6a50670
commit 0bdc2e0432
11 changed files with 83 additions and 132 deletions
+7 -6
View File
@@ -33,10 +33,6 @@ func (c *x11Context) Release() {
}
func (c *x11Context) Refresh() error {
return nil
}
func (c *x11Context) MakeCurrent() error {
c.Context.ReleaseSurface()
win, width, height := c.win.window()
eglSurf := egl.NativeWindowType(uintptr(win))
@@ -47,9 +43,14 @@ func (c *x11Context) MakeCurrent() error {
return err
}
c.Context.EnableVSync(true)
c.Context.ReleaseCurrent()
return nil
}
func (c *x11Context) Lock() {}
func (c *x11Context) Lock() error {
return c.Context.MakeCurrent()
}
func (c *x11Context) Unlock() {}
func (c *x11Context) Unlock() {
c.Context.ReleaseCurrent()
}