diff --git a/Cocoa/CheatSearch.xib b/Cocoa/CheatSearch.xib
index 640cdca92..c23d00067 100644
--- a/Cocoa/CheatSearch.xib
+++ b/Cocoa/CheatSearch.xib
@@ -20,7 +20,7 @@
-
+
diff --git a/Cocoa/Document.xib b/Cocoa/Document.xib
index d7fb2e215..a5e55ae48 100644
--- a/Cocoa/Document.xib
+++ b/Cocoa/Document.xib
@@ -86,7 +86,7 @@
-
+
@@ -318,9 +318,12 @@
+
+
+
-
+
@@ -400,10 +403,13 @@
+
+
+
-
+
@@ -667,9 +673,12 @@
+
+
+
-
+
@@ -717,9 +726,12 @@
+
+
+
-
+
@@ -798,7 +810,7 @@
-
+
@@ -955,6 +967,9 @@
+
+
+
diff --git a/Cocoa/GBCheatSearchController.m b/Cocoa/GBCheatSearchController.m
index 41b96add3..2d3729bdb 100644
--- a/Cocoa/GBCheatSearchController.m
+++ b/Cocoa/GBCheatSearchController.m
@@ -1,6 +1,7 @@
#import "GBCheatSearchController.h"
#import "GBWarningPopover.h"
#import "GBCheatWindowController.h"
+#import "GBPanel.h"
@interface GBCheatSearchController()
@property IBOutlet NSPopUpButton *dataTypeButton;
@@ -16,6 +17,7 @@ @implementation GBCheatSearchController
__weak Document *_document;
size_t _resultCount;
GB_cheat_search_result_t *_results;
+ GBPanel *_window;
}
+ (instancetype)controllerWithDocument:(Document *)document
@@ -26,6 +28,7 @@ + (instancetype)controllerWithDocument:(Document *)document
[[NSBundle mainBundle] loadNibNamed:@"CheatSearch" owner:ret topLevelObjects:&objects];
ret->_resultsLabel.stringValue = @"";
ret->_resultsLabel.cell.backgroundStyle = NSBackgroundStyleRaised;
+ ret->_window.ownerWindow = document.mainWindow;
return ret;
}
diff --git a/Cocoa/GBPanel.h b/Cocoa/GBPanel.h
new file mode 100644
index 000000000..162ed69a8
--- /dev/null
+++ b/Cocoa/GBPanel.h
@@ -0,0 +1,5 @@
+#import
+
+@interface GBPanel : NSPanel
+@property (weak) IBOutlet NSWindow *ownerWindow;
+@end
diff --git a/Cocoa/GBPanel.m b/Cocoa/GBPanel.m
new file mode 100644
index 000000000..e21346875
--- /dev/null
+++ b/Cocoa/GBPanel.m
@@ -0,0 +1,9 @@
+#import "GBPanel.h"
+
+@implementation GBPanel
+- (void)becomeKeyWindow
+{
+ [_ownerWindow makeMainWindow];
+ [super becomeKeyWindow];
+}
+@end