Skip to content

Commit

Permalink
Switch to windowed mode when changing wallpaper
Browse files Browse the repository at this point in the history
This fixes a bug on macOS where fullscreen applications are treated like separate desktops.  Also makes the wallpaper easier to see.
  • Loading branch information
queengooborg committed May 4, 2018
1 parent 0e3abe0 commit 8a873cd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/Game_Oneshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ def self.get_user_name

module Wallpaper
def self.set_persistent(name, color)
if Graphics.fullscreen
Graphics.fullscreen = false
$console = false
if Oneshot::OS == "macos"
sleep 0.65
else
sleep 0.2
end
Graphics.update
end

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

def self.reset_persistent
if Graphics.fullscreen
Graphics.fullscreen = false
$console = false
if Oneshot::OS == "macos"
sleep 0.65
else
sleep 0.2
end
Graphics.update
end

$game_oneshot.wallpaper = nil
$game_oneshot.wallpaper_color = nil
Wallpaper.reset
Expand Down

0 comments on commit 8a873cd

Please sign in to comment.