From c6c9d266fad98310bb6f0118362d8dc7e60ecfae Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Tue, 9 Jul 2013 09:33:55 +0000 Subject: Make the bladesio1 driver work on OS X: Fix a bug where the wrong plug-in was being used in place of sio1, causing PCSXR to complain. Fix a bug where bladesio1's config window would cause PCSXR to crash. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85936 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- .../plugins/Bladesio1/macsrc/PluginConfigController.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'macosx/plugins/Bladesio1/macsrc/PluginConfigController.m') diff --git a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m index dbc85174..b1b4c08e 100755 --- a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m +++ b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m @@ -74,12 +74,19 @@ void AboutDlgProc() void ConfDlgProc() { - NSWindow *window; - - if (windowController == nil) { - windowController = [[PluginConfigController alloc] initWithWindowNibName:@"Bladesio1PluginConfig"]; + __block NSWindow *window; + __block PluginConfigController *tmpWindowController = nil; + + //We need this block due to the xib's use of auto layout + dispatch_sync(dispatch_get_main_queue(), ^{ + if (windowController == nil) { + tmpWindowController = [[PluginConfigController alloc] initWithWindowNibName:@"Bladesio1PluginConfig"]; + } + window = [(windowController ? windowController : tmpWindowController) window]; + }); + if (!windowController) { + windowController = tmpWindowController; } - window = [windowController window]; [windowController loadValues]; -- cgit v1.2.3