xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 2 00:51:26 UTC 2021


 hw/xquartz/X11Application.m |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 520e7a1310ddc25b30bcaa0ea3eeaa6c4d137c8c
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Jan 27 15:03:46 2021 -0800

    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 at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 10afdf91a..a009d6415 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -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];


More information about the xorg-commit mailing list