Skip to content

Commit 8a873cd

Browse files
committed
Switch to windowed mode when changing wallpaper
This fixes a bug on macOS where fullscreen applications are treated like separate desktops. Also makes the wallpaper easier to see.
1 parent 0e3abe0 commit 8a873cd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/Game_Oneshot.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ def self.get_user_name
3232

3333
module Wallpaper
3434
def self.set_persistent(name, color)
35+
if Graphics.fullscreen
36+
Graphics.fullscreen = false
37+
$console = false
38+
if Oneshot::OS == "macos"
39+
sleep 0.65
40+
else
41+
sleep 0.2
42+
end
43+
Graphics.update
44+
end
3545

3646
if (name == 'save_w32')
3747
case $persistent.langcode
@@ -55,6 +65,17 @@ def self.set_persistent(name, color)
5565
end
5666

5767
def self.reset_persistent
68+
if Graphics.fullscreen
69+
Graphics.fullscreen = false
70+
$console = false
71+
if Oneshot::OS == "macos"
72+
sleep 0.65
73+
else
74+
sleep 0.2
75+
end
76+
Graphics.update
77+
end
78+
5879
$game_oneshot.wallpaper = nil
5980
$game_oneshot.wallpaper_color = nil
6081
Wallpaper.reset

0 commit comments

Comments
 (0)