Update window.go

This commit is contained in:
Sasha Koshka 2024-05-26 15:20:25 -04:00
parent 0f9c27c19a
commit 9dc929f545

View File

@ -267,10 +267,10 @@ func (window *window) Paste (callback func (data.Data, error), accept ...data.Mi
} }
func (window *window) SetVisible (visible bool) { func (window *window) SetVisible (visible bool) {
if this.visible == visible { return } if window.visible == visible { return }
window.visible = visible window.visible = visible
if this.visible { if window.visible {
window.xWindow.Map() window.xWindow.Map()
if window.shy { window.grabInput() } if window.shy { window.grabInput() }
} else { } else {
@ -280,7 +280,7 @@ func (window *window) SetVisible (visible bool) {
} }
func (window *window) Visible () bool { func (window *window) Visible () bool {
return this.visible return window.visible
} }
func (window *window) Close () { func (window *window) Close () {
@ -293,7 +293,7 @@ func (window *window) Close () {
// we are a modal dialog, so unlock the parent // we are a modal dialog, so unlock the parent
window.modalParent.hasModal = false window.modalParent.hasModal = false
} }
window.Hide() window.SetVisible(false)
window.SetRoot(nil) window.SetRoot(nil)
delete(window.backend.windows, window.xWindow.Id) delete(window.backend.windows, window.xWindow.Id)
window.xWindow.Destroy() window.xWindow.Destroy()
@ -377,7 +377,7 @@ func (window *window) pushRegion (region image.Rectangle) {
return return
} }
subCanvas := window.xCanvas.Clip(region) subCanvas := window.xCanvas.SubCanvas(region)
if subCanvas == nil { if subCanvas == nil {
return return
} }