Title: [273993] trunk/Tools
Revision
273993
Author
[email protected]
Date
2021-03-05 12:00:10 -0800 (Fri, 05 Mar 2021)

Log Message

Don't open a new window in MiniBrowser if already opening a file from the command line
https://bugs.webkit.org/show_bug.cgi?id=222776

Patch by Cameron McCormack <[email protected]> on 2021-03-05
Reviewed by Dean Jackson.

* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate init]):
(-[BrowserAppDelegate applicationDidFinishLaunching:]):
(-[BrowserAppDelegate application:openFile:]):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (273992 => 273993)


--- trunk/Tools/ChangeLog	2021-03-05 19:54:19 UTC (rev 273992)
+++ trunk/Tools/ChangeLog	2021-03-05 20:00:10 UTC (rev 273993)
@@ -1,3 +1,16 @@
+2021-03-05  Cameron McCormack  <[email protected]>
+
+        Don't open a new window in MiniBrowser if already opening a file from the command line
+        https://bugs.webkit.org/show_bug.cgi?id=222776
+
+        Reviewed by Dean Jackson.
+
+        * MiniBrowser/mac/AppDelegate.h:
+        * MiniBrowser/mac/AppDelegate.m:
+        (-[BrowserAppDelegate init]):
+        (-[BrowserAppDelegate applicationDidFinishLaunching:]):
+        (-[BrowserAppDelegate application:openFile:]):
+
 2021-03-05  Aakash Jain  <[email protected]>
 
         [ews] Add python 3 support in send_email

Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.h (273992 => 273993)


--- trunk/Tools/MiniBrowser/mac/AppDelegate.h	2021-03-05 19:54:19 UTC (rev 273992)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.h	2021-03-05 20:00:10 UTC (rev 273993)
@@ -37,6 +37,8 @@
     IBOutlet NSMenuItem *_newWebKit2WindowItem;
     IBOutlet NSMenuItem *_newWebKit1EditorItem;
     IBOutlet NSMenuItem *_newWebKit2EditorItem;
+
+    bool _openNewWindowAtStartup;
 }
 
 - (void)browserWindowWillClose:(NSWindow *)window;

Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.m (273992 => 273993)


--- trunk/Tools/MiniBrowser/mac/AppDelegate.m	2021-03-05 19:54:19 UTC (rev 273992)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.m	2021-03-05 20:00:10 UTC (rev 273993)
@@ -72,6 +72,7 @@
     if (self) {
         _browserWindowControllers = [[NSMutableSet alloc] init];
         _extensionManagerWindowController = [[ExtensionManagerWindowController alloc] init];
+        _openNewWindowAtStartup = true;
     }
 
     return self;
@@ -234,6 +235,9 @@
 
     [self _updateNewWindowKeyEquivalents];
 
+    if (!_openNewWindowAtStartup)
+        return;
+
     if (_settingsController.createEditorByDefault)
         [self newEditorWindow:self];
     else
@@ -264,6 +268,7 @@
 
     [controller.window makeKeyAndOrderFront:self];
     [controller loadURLString:[NSURL fileURLWithPath:filename].absoluteString];
+    _openNewWindowAtStartup = false;
     return YES;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to