Skip to content
Merged
8 changes: 8 additions & 0 deletions source/MRViewer/MRMacOSOpenDocumentsHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// accumulates file names until called with null, then handles the list
extern "C" void handle_load_message(const char* filePath);

// based on
// https://github.com/glfw/glfw/issues/1024#issuecomment-522667555
@implementation GLFWCustomDelegate

+ (void)load{
Expand All @@ -14,6 +16,12 @@ + (void)load{

[GLFWCustomDelegate swizzle:class_ src:@selector(application:openFile:) tgt:@selector(swz_application:openFile:)];
[GLFWCustomDelegate swizzle:class_ src:@selector(application:openFiles:) tgt:@selector(swz_application:openFiles:)];
// This call makes it so that application:openFile: doesn't get bogus calls
// from Cocoa doing its own parsing of the argument string. And yes, we need
// to use a string with a boolean value in it. That's just how it works.
[[NSUserDefaults standardUserDefaults]
setObject:@"NO"
forKey:@"NSTreatUnknownArgumentsAsOpen"];
});
}

Expand Down
2 changes: 1 addition & 1 deletion source/MRViewer/MRRibbonMenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum class RibbonItemType

// class to hold menu items
// some information stored in json (icons path, tab name, subtab name)
class RibbonMenuItem : virtual public ISceneStateCheck
class MRVIEWER_CLASS RibbonMenuItem : virtual public ISceneStateCheck
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it related?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related, but it produces some low level warnings on mac

{
public:
MR_DELETE_MOVE( RibbonMenuItem );
Expand Down
Loading