mirror of https://github.com/odrling/Aegisub
osx: Move the detached video dialog to the normal window level when it goes fullscreen as it's hilariously broken otherwise
Originally committed to SVN as r6890.
This commit is contained in:
parent
f0f7ad2858
commit
8c17d45e8c
|
@ -20,6 +20,7 @@ LDFLAGS += $(LDFLAGS_CCMALLOC)
|
|||
|
||||
ifeq (yes, $(BUILD_DARWIN))
|
||||
SRC += osx_utils.mm
|
||||
osx_utils.o: OBJCXXFLAGS += -fobjc-arc
|
||||
endif
|
||||
|
||||
###############
|
||||
|
|
|
@ -23,6 +23,14 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
// This bit of awfulness is to disable some ARC-incompatible stuff in window.h
|
||||
// that we don't need
|
||||
#include <wx/brush.h>
|
||||
#undef wxOSX_USE_COCOA_OR_IPHONE
|
||||
#define wxOSX_USE_COCOA_OR_IPHONE 0
|
||||
class WXDLLIMPEXP_FWD_CORE wxWidgetImpl;
|
||||
typedef wxWidgetImpl wxOSXWidgetImpl;
|
||||
|
||||
#include <wx/window.h>
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
@ -38,5 +46,19 @@ void AddFullScreenButton(wxWindow *window) {
|
|||
}
|
||||
|
||||
void SetFloatOnParent(wxWindow *window) {
|
||||
[[window->GetHandle() window] setLevel:NSFloatingWindowLevel];
|
||||
__unsafe_unretained NSWindow *nsWindow = [window->GetHandle() window];
|
||||
[nsWindow setLevel:NSFloatingWindowLevel];
|
||||
|
||||
if (!([nsWindow collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary))
|
||||
return;
|
||||
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserverForName:@"NSWindowWillEnterFullScreenNotification"
|
||||
object:nsWindow
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification *) { [nsWindow setLevel:NSNormalWindowLevel]; }];
|
||||
[nc addObserverForName:@"NSWindowWillExitFullScreenNotification"
|
||||
object:nsWindow
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification *) { [nsWindow setLevel:NSFloatingWindowLevel]; }];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue