mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
macOS APIs are really really bonkers
This commit is contained in:
@@ -1669,14 +1669,10 @@ send_data_available_event_on_next_event_loop_tick(GLFWid wid, const char *mime)
|
|||||||
static void
|
static void
|
||||||
create_uri_list(_GLFWDropData *d, NSArray *urls) {
|
create_uri_list(_GLFWDropData *d, NSArray *urls) {
|
||||||
NSMutableArray<NSString *> *items = [NSMutableArray array];
|
NSMutableArray<NSString *> *items = [NSMutableArray array];
|
||||||
NSCharacterSet *c1 = [NSCharacterSet URLQueryAllowedCharacterSet];
|
NSCharacterSet *allowedChars = [NSCharacterSet URLQueryAllowedCharacterSet];
|
||||||
NSCharacterSet *c2 = [NSCharacterSet URLPathAllowedCharacterSet];
|
|
||||||
for (NSURL *url in urls) {
|
for (NSURL *url in urls) {
|
||||||
NSCharacterSet *allowedChars = c1;
|
NSCharacterSet *allowedChars = c1;
|
||||||
if ([url isFileURL]) {
|
if ([url isFileURL]) url = [url filePathURL];
|
||||||
url = [url filePathURL];
|
|
||||||
allowedChars = c2;
|
|
||||||
}
|
|
||||||
NSString *absoluteString = url.absoluteString;
|
NSString *absoluteString = url.absoluteString;
|
||||||
NSString *q = [absoluteString stringByAddingPercentEncodingWithAllowedCharacters:allowedChars];
|
NSString *q = [absoluteString stringByAddingPercentEncodingWithAllowedCharacters:allowedChars];
|
||||||
[items addObject:q];
|
[items addObject:q];
|
||||||
|
|||||||
Reference in New Issue
Block a user