Window is resizable by default (lol)
This commit is contained in:
parent
95b1d033a9
commit
02de78c997
28
x/window.go
28
x/window.go
@ -99,6 +99,8 @@ func (this *Backend) newWindow (
|
|||||||
link := &windowLink { window: window }
|
link := &windowLink { window: window }
|
||||||
window.hierarchy = this.system.NewHierarchy(link)
|
window.hierarchy = this.system.NewHierarchy(link)
|
||||||
window.leader = window
|
window.leader = window
|
||||||
|
window.resizeX = true
|
||||||
|
window.resizeY = true
|
||||||
|
|
||||||
window.xWindow, err = xwindow.Generate(this.x)
|
window.xWindow, err = xwindow.Generate(this.x)
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
@ -424,14 +426,30 @@ func (this *window) doMinimumSize () {
|
|||||||
|
|
||||||
if size.X < 8 { size.X = 8 }
|
if size.X < 8 { size.X = 8 }
|
||||||
if size.Y < 8 { size.Y = 8 }
|
if size.Y < 8 { size.Y = 8 }
|
||||||
icccm.WmNormalHintsSet (
|
|
||||||
this.backend.x,
|
hints := icccm.NormalHints {
|
||||||
this.xWindow.Id,
|
|
||||||
&icccm.NormalHints {
|
|
||||||
Flags: icccm.SizeHintPMinSize,
|
Flags: icccm.SizeHintPMinSize,
|
||||||
MinWidth: uint(size.X),
|
MinWidth: uint(size.X),
|
||||||
MinHeight: uint(size.Y),
|
MinHeight: uint(size.Y),
|
||||||
})
|
// now you can tell your friends that the max size of a Tomo
|
||||||
|
// window under X when one of the dimensions is constrained is
|
||||||
|
// 99999999999
|
||||||
|
MaxWidth: uint(99999999999),
|
||||||
|
MaxHeight: uint(99999999999),
|
||||||
|
}
|
||||||
|
if !this.resizeX {
|
||||||
|
hints.Flags |= icccm.SizeHintPMaxSize
|
||||||
|
hints.MaxWidth = uint(size.X)
|
||||||
|
}
|
||||||
|
if !this.resizeY {
|
||||||
|
hints.Flags |= icccm.SizeHintPMaxSize
|
||||||
|
hints.MaxHeight = uint(size.Y)
|
||||||
|
}
|
||||||
|
|
||||||
|
icccm.WmNormalHintsSet (
|
||||||
|
this.backend.x,
|
||||||
|
this.xWindow.Id,
|
||||||
|
&hints)
|
||||||
newWidth := this.metrics.bounds.Dx()
|
newWidth := this.metrics.bounds.Dx()
|
||||||
newHeight := this.metrics.bounds.Dy()
|
newHeight := this.metrics.bounds.Dy()
|
||||||
if newWidth < size.X { newWidth = size.X }
|
if newWidth < size.X { newWidth = size.X }
|
||||||
|
Loading…
Reference in New Issue
Block a user