mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/ui: bug fix: do not set the minimum window width for macOS
Shrinking a window size by a cursor sometimes makes a smaller window than 126px. To avoid such flaky behavior, do not set the limitation of the minimum window width. On Linux/UNIX, there should not be reasons to limit the window width. Updates #165
This commit is contained in:
parent
ad675640b1
commit
edca32e520
@ -1252,16 +1252,22 @@ func (u *UserInterface) setWindowSizeInDIP(width, height int, fullscreen bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *UserInterface) minimumWindowWidth() int {
|
func (u *UserInterface) minimumWindowWidth() int {
|
||||||
// On Windows, giving a too small width doesn't call a callback (#165).
|
|
||||||
// To prevent hanging up, return asap if the width is too small.
|
|
||||||
if u.window.GetAttrib(glfw.Decorated) == glfw.False {
|
if u.window.GetAttrib(glfw.Decorated) == glfw.False {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On Windows, giving a too small width doesn't call a callback (#165).
|
||||||
|
// To prevent hanging up, return asap if the width is too small.
|
||||||
// 126 is an arbitrary number and I guess this is small enough .
|
// 126 is an arbitrary number and I guess this is small enough .
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
return 126
|
return 126
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On macOS, resizing the window by cursor sometimes ignores the minimum size.
|
||||||
|
// To avoid the flaky behavior, do not add a limitation.
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
func (u *UserInterface) setWindowSizeInDIPImpl(width, height int, fullscreen bool) {
|
func (u *UserInterface) setWindowSizeInDIPImpl(width, height int, fullscreen bool) {
|
||||||
if fullscreen {
|
if fullscreen {
|
||||||
if x, y := u.origPos(); x == invalidPos || y == invalidPos {
|
if x, y := u.origPos(); x == invalidPos || y == invalidPos {
|
||||||
|
Loading…
Reference in New Issue
Block a user