diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-12-31 01:04:35 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2022-01-01 12:19:30 +0100 |
commit | b351cbe4902269590ef5a51cc93c56b52541ba52 (patch) | |
tree | dbdcd424ab68364ca4ca02bbb8e1b96403e023f4 /src/video/cocoa/cocoa_v.mm | |
parent | f40e82a19d9f902979377d913507990d9bcf5621 (diff) | |
download | openttd-b351cbe4902269590ef5a51cc93c56b52541ba52.tar.xz |
Fix #9743: [OSX] Only (re-)create touchbar sprites when requested by the main loop.
Diffstat (limited to 'src/video/cocoa/cocoa_v.mm')
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 2f0f2a746..0636f2cc0 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -99,6 +99,8 @@ VideoDriver_Cocoa::VideoDriver_Cocoa() this->setup = false; this->buffer_locked = false; + this->refresh_sys_sprites = true; + this->window = nil; this->cocoaview = nil; this->delegate = nil; @@ -221,6 +223,19 @@ bool VideoDriver_Cocoa::ToggleFullscreen(bool full_screen) return false; } +void VideoDriver_Cocoa::ClearSystemSprites() +{ + this->refresh_sys_sprites = true; +} + +void VideoDriver_Cocoa::PopulateSystemSprites() +{ + if (this->refresh_sys_sprites && this->window != nil) { + [ this->window refreshSystemSprites ]; + this->refresh_sys_sprites = false; + } +} + /** * Callback invoked after the blitter was changed. * @return True if no error. |