mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
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:
@@ -68,11 +68,14 @@ func (c *context) Present() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *context) Lock() {
|
||||
func (c *context) Lock() error {
|
||||
C.gio_lockContext(c.ctx)
|
||||
C.gio_makeCurrentContext(c.ctx)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *context) Unlock() {
|
||||
C.gio_clearCurrentContext()
|
||||
C.gio_unlockContext(c.ctx)
|
||||
}
|
||||
|
||||
@@ -83,17 +86,6 @@ func (c *context) Refresh() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *context) MakeCurrent() error {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
C.gio_makeCurrentContext(c.ctx)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *context) ReleaseCurrent() {
|
||||
C.gio_clearCurrentContext()
|
||||
}
|
||||
|
||||
func (w *window) NewContext() (Context, error) {
|
||||
return newContext(w)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user