Commit 520e7a13 authored by Jeremy Huddleston Sequoia's avatar Jeremy Huddleston Sequoia
Browse files

xquartz: Ensure that NSRunAlertPanel() is run on the main thread

Fixes: https://github.com/XQuartz/XQuartz/issues/30

Signed-off-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
parent 7d0bb7ed
Pipeline #264762 passed with stages
in 5 minutes and 6 seconds
......@@ -1082,12 +1082,15 @@ X11ApplicationCanEnterRandR(void)
if (!XQuartzIsRootless)
QuartzShowFullscreen(FALSE);
switch (NSRunAlertPanel(title, @"%@",
NSLocalizedString(@"Allow",
@""),
NSLocalizedString(@"Cancel",
@""),
NSLocalizedString(@"Always Allow", @""), msg)) {
NSInteger __block alert_result;
dispatch_sync(dispatch_get_main_queue(), ^{
alert_result = NSRunAlertPanel(title, @"%@",
NSLocalizedString(@"Allow", @""),
NSLocalizedString(@"Cancel", @""),
NSLocalizedString(@"Always Allow", @""), msg);
});
switch (alert_result) {
case NSAlertOtherReturn:
[X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES];
[X11App prefs_synchronize];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment