mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
internal/ui: bug fix: wrong monitor was detected on fullscreen
Updates #2225 Updates #2794
This commit is contained in:
parent
22118ba962
commit
8c7eb70635
@ -1484,7 +1484,13 @@ func (u *userInterfaceImpl) currentMonitor() *Monitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// As the fallback, detect the monitor from the window.
|
// As the fallback, detect the monitor from the window.
|
||||||
if m := theMonitors.monitorFromPosition(u.window.GetPos()); m != nil {
|
x, y := u.window.GetPos()
|
||||||
|
// On fullscreen, shift the position slightly. Otherwise, a wrong monitor could be detected, as the position is on the edge (#2794).
|
||||||
|
if u.isFullscreen() {
|
||||||
|
x++
|
||||||
|
y++
|
||||||
|
}
|
||||||
|
if m := theMonitors.monitorFromPosition(x, y); m != nil {
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user