changeset 862:e5d7e3f6826e

fix: do not try to change fullscreen if already in correct status
author sam <sam@basx.dev>
date Wed, 27 Dec 2023 16:14:36 +0700
parents 3ba17a9b0c01
children 64bf751ca680
files semicongine/engine.nim
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/engine.nim	Wed Dec 27 16:08:13 2023 +0700
+++ b/semicongine/engine.nim	Wed Dec 27 16:14:36 2023 +0700
@@ -210,5 +210,6 @@
 func hideSystemCursor*(engine: Engine) = engine.window.hideSystemCursor()
 func fullscreen*(engine: Engine): bool = engine.fullscreen
 proc `fullscreen=`*(engine: var Engine, enable: bool) =
-  engine.fullscreen = enable
-  engine.window.fullscreen(engine.fullscreen)
+  if enable != engine.fullscreen:
+    engine.fullscreen = enable
+    engine.window.fullscreen(engine.fullscreen)