We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2757 - [Patch] Mac: add support for dragging files directly onto SDL windows
Summary: [Patch] Mac: add support for dragging files directly onto SDL windows
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Mac OS X (All)
: P2 enhancement
Assignee: Jørgen Tjernø
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-19 18:58 UTC by Alex Szpakowski
Modified: 2014-11-24 19:48 UTC (History)
1 user (show)

See Also:


Attachments
Patch to allow users to drop files onto SDL windows in OS X (2.63 KB, patch)
2014-10-19 18:58 UTC, Alex Szpakowski
Details | Diff
Updated patch to allow users to drop files onto SDL windows in OS X (3.57 KB, patch)
2014-10-20 05:38 UTC, Alex Szpakowski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Szpakowski 2014-10-19 18:58:34 UTC
Created attachment 1907 [details]
Patch to allow users to drop files onto SDL windows in OS X

SDL's Cocoa code currently triggers SDL_DROPFILE events when the user drops a file onto the application's icon, but another idiomatic way for OS X users to drag-and-drop files is to put the file directly inside the window's frame.

I have attached a patch which adds that functionality to SDL's Cocoa video backend.
Comment 1 Alex Szpakowski 2014-10-20 05:38:24 UTC
Created attachment 1909 [details]
Updated patch to allow users to drop files onto SDL windows in OS X

The previous patch didn't handle OS X alias files. I've attached a new updated patch which does.
Comment 2 Jørgen Tjernø 2014-11-24 19:42:18 UTC
    if (isAlias != nil && [isAlias boolValue]) {    

Just using [isAlias boolValue] is cleaner -- calling any method on nil returns nil, which is a false value.

Other than that, it LGTM. I can merge and make that change.
Comment 3 Jørgen Tjernø 2014-11-24 19:48:01 UTC
Fixed in https://hg.libsdl.org/SDL/rev/2cc90bb31777