[gedit/wip/3.14-osx: 4/9] Prevent Cocoa command line argument parsing for files
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/3.14-osx: 4/9] Prevent Cocoa command line argument parsing for files
- Date: Thu, 21 Aug 2014 18:43:12 +0000 (UTC)
commit e1f2c8dce51aaa059f321bed8956180a55b39dc8
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sun Mar 23 13:27:01 2014 +0100
Prevent Cocoa command line argument parsing for files
gedit/gedit-app-osx.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-app-osx.c b/gedit/gedit-app-osx.c
index 5076b72..b00fd5b 100644
--- a/gedit/gedit-app-osx.c
+++ b/gedit/gedit-app-osx.c
@@ -418,6 +418,13 @@ gedit_app_osx_init (GeditAppOSX *app)
{
GtkOSXApplication *osxapp;
+ /* This is required so that Cocoa is not going to parse the
+ command line arguments by itself and generate OpenFile events.
+ We already parse the command line ourselves, so this is needed
+ to prevent opening files twice, etc. */
+ [[NSUserDefaults standardUserDefaults] setObject:@"NO"
+ forKey:@"NSTreatUnknownArgumentsAsOpen"];
+
/* This is a singleton */
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]