mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 02:38:11 +02:00
xquartz: Ensure that NSRunAlertPanel() is run on the main thread
Fixes: https://github.com/XQuartz/XQuartz/issues/30
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 520e7a1310)
This commit is contained in:
parent
a5c301c2a4
commit
60ab67b6ad
1 changed files with 9 additions and 6 deletions
|
|
@ -1063,12 +1063,15 @@ X11ApplicationCanEnterRandR(void)
|
||||||
if (!XQuartzIsRootless)
|
if (!XQuartzIsRootless)
|
||||||
QuartzShowFullscreen(FALSE);
|
QuartzShowFullscreen(FALSE);
|
||||||
|
|
||||||
switch (NSRunAlertPanel(title, @"%@",
|
NSInteger __block alert_result;
|
||||||
NSLocalizedString(@"Allow",
|
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||||
@""),
|
alert_result = NSRunAlertPanel(title, @"%@",
|
||||||
NSLocalizedString(@"Cancel",
|
NSLocalizedString(@"Allow", @""),
|
||||||
@""),
|
NSLocalizedString(@"Cancel", @""),
|
||||||
NSLocalizedString(@"Always Allow", @""), msg)) {
|
NSLocalizedString(@"Always Allow", @""), msg);
|
||||||
|
});
|
||||||
|
|
||||||
|
switch (alert_result) {
|
||||||
case NSAlertOtherReturn:
|
case NSAlertOtherReturn:
|
||||||
[X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES];
|
[X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES];
|
||||||
[X11App prefs_synchronize];
|
[X11App prefs_synchronize];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue