]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
iPad: Ensure we set sourceRect for all cases where we use sourceView
authorRoopesh Chander <roop@roopc.net>
Wed, 7 Nov 2018 14:13:36 +0000 (19:43 +0530)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 7 Nov 2018 16:43:30 +0000 (17:43 +0100)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift

index 5374b40200d6074b5f92ff25620bf2d4e1ce348e..fac200556daadd2de9871bb74aa718e5819adf83 100644 (file)
@@ -99,8 +99,8 @@ class SettingsTableViewController: UITableViewController {
             let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil)
             // popoverPresentationController shall be non-nil on the iPad
             activityVC.popoverPresentationController?.sourceView = sourceView
+            activityVC.popoverPresentationController?.sourceRect = sourceView.bounds
             present(activityVC, animated: true)
-
         } catch (let error) {
             showErrorAlert(title: "Unable to export", message: "There was an error exporting the tunnel configuration archive: \(String(describing: error))")
         }
index 9bd9f5abc72f9868e58ef837ba0937dd6c9d971c..3e30662e19d53788b37755bbd46ff38bed48d8c2 100644 (file)
@@ -72,6 +72,7 @@ class TunnelDetailTableViewController: UITableViewController {
 
         // popoverPresentationController will be nil on iPhone and non-nil on iPad
         alert.popoverPresentationController?.sourceView = sourceView
+        alert.popoverPresentationController?.sourceRect = sourceView.bounds
 
         self.present(alert, animated: true, completion: nil)
     }
index 40d86e9b1e4105d97c5ae3e4966ea039d0579238..3af97dac917fef29f29e2fa0aa8a7e77e2b148e4 100644 (file)
@@ -400,6 +400,7 @@ extension TunnelEditTableViewController {
 
         // popoverPresentationController will be nil on iPhone and non-nil on iPad
         alert.popoverPresentationController?.sourceView = sourceView
+        alert.popoverPresentationController?.sourceRect = sourceView.bounds
 
         self.present(alert, animated: true, completion: nil)
     }