Skip to content

Commit

Permalink
disabling Zenity in full-screen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mki1967 committed Feb 3, 2021
1 parent ee6f514 commit 5cd0266
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions key-callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
// "github.com/mki1967/go-mki3d/glmki3d"
)

var oldIsZenity bool

func (g *Mki3dGame) KeyCallback(w *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey) {
if action == glfw.Release {
if action == glfw.Release {
Expand Down Expand Up @@ -128,12 +130,15 @@ func (g *Mki3dGame) KeyCallback(w *glfw.Window, key glfw.Key, scancode int, acti
mode := monitor.GetVideoMode()
w.SetMonitor(monitor, 0, 0, mode.Width, mode.Height, mode.RefreshRate)
g.FullScreen = true
oldIsZenity = IsZenity
IsZenity = false
} else {
// unset full-screen
monitor := glfw.GetPrimaryMonitor()
mode := monitor.GetVideoMode()
w.SetMonitor(nil, g.PosX, g.PosY, g.SizeWidth, g.SizeHeight, mode.RefreshRate)
g.FullScreen = false
IsZenity = oldIsZenity
}

}
Expand Down

0 comments on commit 5cd0266

Please sign in to comment.