Merge commit 'a11a61e48c716669aa128bae6fd8b2c67d53cc22' into rootless

This commit is contained in:
Jesús A. Álvarez 2020-01-15 19:40:07 +01:00
commit 49bf3fcfa2

View File

@ -55,6 +55,7 @@ void disable_SDL2_macosx_menu_bar_keyboard_shortcuts() {
} }
} }
#ifdef VIDEO_ROOTLESS
void make_window_transparent(SDL_Window * window) void make_window_transparent(SDL_Window * window)
{ {
if (!window) { if (!window) {
@ -73,6 +74,7 @@ void make_window_transparent(SDL_Window * window)
CGColorRef clearColor = [NSColor clearColor].CGColor; CGColorRef clearColor = [NSColor clearColor].CGColor;
NSWindow *cocoaWindow = wmInfo.info.cocoa.window; NSWindow *cocoaWindow = wmInfo.info.cocoa.window;
NSView *sdlView = cocoaWindow.contentView; NSView *sdlView = cocoaWindow.contentView;
sdlView.wantsLayer = YES;
sdlView.layer.backgroundColor = [NSColor clearColor].CGColor; sdlView.layer.backgroundColor = [NSColor clearColor].CGColor;
if (SDL_GetWindowData(window, "observing") == NULL) { if (SDL_GetWindowData(window, "observing") == NULL) {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
@ -127,6 +129,7 @@ void update_window_mask_rects(SDL_Window * window, int h, const std::vector<SDL_
maskLayer.affineTransform = CGAffineTransformScale(CGAffineTransformMakeTranslation(0, h), 1.0, -1.0); maskLayer.affineTransform = CGAffineTransformScale(CGAffineTransformMakeTranslation(0, h), 1.0, -1.0);
CGPathRelease(path); CGPathRelease(path);
} }
#endif
bool is_fullscreen_osx(SDL_Window * window) bool is_fullscreen_osx(SDL_Window * window)
{ {