# SDL 2.0 API stabilization

**URL:** <https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378>\
**Category:** SDL Development\
**Created:** [February 18, 2013, 7:19am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378 "2013-02-18T07:19:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [February 18, 2013, 7:19am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/1 "2013-02-18T07:19:53Z")

</div>

We’re on the road to release for SDL 2.0.

To that end, most of the existing APIs are stable, and we’ll only change  
them if it’s critical.  
There are a few things which are still being considered, such as the iOS  
event handling, and touch/mouse event semantics, but by and large the API  
is set for release.

Please report bugs which are affecting you in the current snapshot:  
[http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)

If anyone wants to fix anything currently in bugzilla, they are more than  
welcome:  
[http://bugzilla.libsdl.org](http://bugzilla.libsdl.org)

Cheers!  
–Sam

---

<div class="post-metadata">

**Author:** ![Driedfruit](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/f14d63/32.png) [@Driedfruit](https://discourse.libsdl.org/u/Driedfruit)\
**Post date:** [February 20, 2013, 10:36pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/2 "2013-02-20T22:36:01Z")

</div>

> Please note, the  
> SDL\_DROPFILE and XDnD are not compatible.

I know this have been asked before, but just to make it clear… Wouldn’t  
it be possible to expose a subset of XDnD functionality as SDL\_DROPFILE?  
I.e. have SDL2 manage all the details (reject everything but files,  
accept files, issue SDL\_DROPFILE event) ?–  
driedfruit

---

<div class="post-metadata">

**Author:** ![Sagara\_Wijetunga](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Sagara\_Wijetunga](https://discourse.libsdl.org/u/Sagara_Wijetunga)\
**Post date:** [February 21, 2013, 6:21pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/3 "2013-02-21T18:21:02Z")

</div>

Drag and drop is not  
available at all for X11 users. The drag and drop is currently  
available in SDL 2.0 for Microsoft Windows users and Apple OSX users  
via SDL\_DROPFILE event. The SDL\_DROPFILE event does not trigger in  
X11 based systems such as Linux and BSDs.

I developed the drag  
and drop patch for SDL 2.0 to solve this issue for X11 users. My  
patch is based on the XDnD protocol. The XDnD is the de facto  
protocol for drag and drop for X11 based systems.

Drag and drop on  
Firefox, Opera, Gimp, Inkscape, Scribus, KDE, Gnome, etc. are  
implemented using XDnD protocol.  
([http://www.newplanetsoftware.com/xdnd/supporters.html](http://www.newplanetsoftware.com/xdnd/supporters.html))

Please note, the  
SDL\_DROPFILE and XDnD are not compatible. The SDL\_DROPFILE is a drop  
event information receiving mechanism, whereas, the XDnD is a  
conversation protocol to get the drag event information converted to  
an interested data format and retrieve the data of the drop either  
before the mouse button is released or after the mouse button is  
released at the choice of the application. The application may also  
choose to not to accept the drop!

Therefore, the  
SDL\_DROPFILE event cannot be meaningfully issued during an XDnD  
conversation.

For the benefit of X11  
users, what I see is support both SDL\_DROPFILE (for Windows and OSX  
users) and XDnD (for X11 users) in SDL. So that Windows, OSX and X11  
have a way to receive a drag and drop, rather than none at all for  
X11 users.

Since XDnD is a  
protocol, Windows and OSX may support it in their file managers etc.  
to have an uniform drag and drop handling. But what if they do not  
want to support?  
Sagara\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
From: Sam Lantinga   
To: A list for developers using the SDL library. (includes SDL-announce)   
Sent: Monday, February 18, 2013 7:19 AM  
Subject: [SDL] SDL 2.0 API stabilization

We’re on the road to release for SDL 2.0.

To that end, most of the existing APIs are stable, and we’ll only change them if it’s critical.  
There are a few things which are still being considered, such as the iOS event handling, and touch/mouse event semantics, but by and large the API is set for release.

Please report bugs which are affecting you in the current snapshot:  
[http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)

If anyone wants to fix anything currently in bugzilla, they are more than welcome:  
[http://bugzilla.libsdl.org](http://bugzilla.libsdl.org)

Cheers!  
–Sam

* * *

SDL mailing list  
SDL at [lists.libsdl.org](http://lists.libsdl.org)  
[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Sagara\_Wijetunga](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Sagara\_Wijetunga](https://discourse.libsdl.org/u/Sagara_Wijetunga)\
**Post date:** [February 22, 2013, 11:11am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/4 "2013-02-22T11:11:48Z")

</div>

Yes, this is technically feasible. Its really not a subset, SDL can then implement only one data type. Support “text/uri-list”. That is, you can only drag and drop one or more files or a URL, not other types. I see this as a more sensible compromise.

Sagara\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
From: Driedfruit   
To: sdl at [lists.libsdl.org](http://lists.libsdl.org)  
Cc: Sagara Wijetunga \<@Sagara\_Wijetunga\>  
Sent: Wednesday, February 20, 2013 10:36 PM  
Subject: Re: [SDL] SDL 2.0 API stabilization

> Please note, the  
> SDL\_DROPFILE and XDnD are not compatible.

I know this have been asked before, but just to make it clear… Wouldn’t  
it be possible to expose a subset of XDnD functionality as SDL\_DROPFILE?  
I.e. have SDL2 manage all the details (reject everything but files,  
accept files, issue SDL\_DROPFILE event) ?

–  
driedfruit

---

<div class="post-metadata">

**Author:** ![Rene\_Dudfield](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/rene_dudfield/32/3235_2.png) [@Rene\_Dudfield](https://discourse.libsdl.org/u/Rene_Dudfield)\
**Post date:** [February 22, 2013, 11:31am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/5 "2013-02-22T11:31:08Z")

</div>

This is great news!

_happy dance_On Mon, Feb 18, 2013 at 8:19 AM, Sam Lantinga wrote:

> We’re on the road to release for SDL 2.0.
> 
> To that end, most of the existing APIs are stable, and we’ll only change  
> them if it’s critical.  
> There are a few things which are still being considered, such as the iOS  
> event handling, and touch/mouse event semantics, but by and large the API  
> is set for release.
> 
> Please report bugs which are affecting you in the current snapshot:  
> [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)
> 
> If anyone wants to fix anything currently in bugzilla, they are more than  
> welcome:  
> [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org)
> 
> Cheers!  
> –Sam
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [February 23, 2013, 5:08am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/6 "2013-02-23T05:08:19Z")

</div>

Yep, let’s go with this option for now. If someone is interested enough in  
the expanded protocol to implement it for Mac OS X and Windows, then let’s  
look at that post 2.0.On Fri, Feb 22, 2013 at 3:11 AM, Sagara Wijetunga wrote:

> Yes, this is technically feasible. Its really not a subset, SDL can then  
> implement only one data type. Support “text/uri-list”. That is, you can  
> only drag and drop one or more files or a URL, not other types. I see this  
> as a more sensible compromise.
> 
> Sagara
> 
> * * *
> 
> _From:_ Driedfruit   
> _To:_ sdl at [lists.libsdl.org](http://lists.libsdl.org)  
> _Cc:_ Sagara Wijetunga   
> _Sent:_ Wednesday, February 20, 2013 10:36 PM  
> _Subject:_ Re: [SDL] SDL 2.0 API stabilization
> 
> > Please note, the  
> > SDL\_DROPFILE and XDnD are not compatible.
> 
> I know this have been asked before, but just to make it clear… Wouldn’t  
> it be possible to expose a subset of XDnD functionality as SDL\_DROPFILE?  
> I.e. have SDL2 manage all the details (reject everything but files,  
> accept files, issue SDL\_DROPFILE event) ?
> 
> –  
> driedfruit
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![wboe](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@wboe](https://discourse.libsdl.org/u/wboe)\
**Post date:** [February 24, 2013, 5:39pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/7 "2013-02-24T17:39:55Z")

</div>

Sam Lantinga wrote:

> We’re on the road to release for SDL 2.0.
> 
> To that end, most of the existing APIs are stable, and we’ll only change them if it’s critical.  
> There are a few things which are still being considered, such as the iOS event handling, and touch/mouse event semantics, but by and large the API is set for release.

Sam, I suppose you are aware that SDL2 for Android is far from perfect? Only some renderer techniques are actually working, and at that they only behave as expected on some phones and tablets. Still SDL2 in this respect seems to be the most advanced on the planet: I tried Allegro (claims to have solutions, but does not work at all) and SFML (only proof of concepts).  
I submitted 1 or 2 minor patches to bugzilla, and also sent a proposal regarding native sound to you which must be in the pipeline yet. Also there is a good solution to render TTF fonts using .ttf files that are already present in an Android phone or tablet.  
Part of the problems is that much depends on the low-level implementations by the OEM’s, which of course are secret. They will have to be reverse-engeneered. Personally I am in the phase: If my own application works on my own tablet then I am happy. However if I find any silver bullet, then bugzilla will be the first to know it!

---

<div class="post-metadata">

**Author:** ![Gabriel\_Jacobo](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/gabriel_jacobo/32/1968_2.png) [@Gabriel\_Jacobo](https://discourse.libsdl.org/u/Gabriel_Jacobo)\
**Post date:** [February 24, 2013, 7:15pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/8 "2013-02-24T19:15:54Z")

</div>

2013/2/24 wboe \<w.boeke at upcmail.nl\>

> \*\*  
> Sam Lantinga wrote:
> 
> Quote:
> 
> We’re on the road to release for SDL 2.0.
> 
> To that end, most of the existing APIs are stable, and we’ll only change  
> them if it’s critical.  
> There are a few things which are still being considered, such as the iOS  
> event handling, and touch/mouse event semantics, but by and large the API  
> is set for release.
> 
> Sam, I suppose you are aware that SDL2 for Android is far from perfect?  
> Only some renderer techniques are actually working, and at that they only  
> behave as expected on some phones and tablets. […]

Can you expand on this? As far as I know the Android backend is on equal  
footing with the other backends.  
If you refer to this issue you reported,  
[README.android: when to start drawing · Issue #752 · libsdl-org/SDL · GitHub](http://bugzilla.libsdl.org/show_bug.cgi?id=1710) as I said I’m not convinced  
the problem is with SDL, and if it were it can no be considered a release  
stopping bug, IMO. If there are other problems, let us know.

Gabriel.

---

<div class="post-metadata">

**Author:** ![wboe](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@wboe](https://discourse.libsdl.org/u/wboe)\
**Post date:** [February 25, 2013, 8:43am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/9 "2013-02-25T08:43:31Z")

</div>

gabomdq wrote:

> Can you expand on this? As far as I know the Android backend is on equal footing with the other backends.  
> If you refer to this issue you reported, [README.android: when to start drawing · Issue #752 · libsdl-org/SDL · GitHub](http://bugzilla.libsdl.org/show_bug.cgi?id=1710) as I said I’m not convinced the problem is with SDL, and if it were it can no be considered a release stopping bug, IMO. If there are other problems, let us know.

Hi Gabriel,

In the bug report that you refer to I proposed a solution for bad behaviour of SDL for Android. In brief: After initialization, the screen of an Android tablet is drawn correctly, but as soon you touch it, it turns to black. Only the widgets that are redrawn show up. Older tablets do not demonstrate this failure, but e.g. the screen of the Nexus 7 always seems to alternate between 2 different pixel buffers.

The solution that I described on bugzilla boiled down to give the SDL rendering thread more time to initialize. Later I found that this only worked on my own tablet. As I described in a former post to this forum I made a habit of going to a big store where you can play with gadgets unattendedly. There I installed from internet an app from my homepage, to investigate how it behaved on a specific tablet. I found different kinds of bizar behaviour. I had a discussion about this with o.a. Philipp Wiesemann, but no explanation or remedy.

If you want a demonstration yourself: please go to [http://members.chello.nl/w.boeke/and-sdl/index.html](http://members.chello.nl/w.boeke/and-sdl/index.html), then download and install the apk file at the bottom. Good luck!

Wouter

---

<div class="post-metadata">

**Author:** ![Sagara\_Wijetunga](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Sagara\_Wijetunga](https://discourse.libsdl.org/u/Sagara_Wijetunga)\
**Post date:** [February 28, 2013, 7:15pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/10 "2013-02-28T19:15:26Z")

</div>

After  
a second thought regarding the Drag-and-Drop support in SDL, I want  
to highlight that we should take a decision based on broader public  
good and should set a precedent.

The  
XDnD is a more evolved modern Drag and Drop protocol. Issues related  
obsolete Motif Drag and Drop, OffiX, Amulet, etc. are described here:  
[http://www.newplanetsoftware.com/xdnd/other\_protocols.html](http://www.newplanetsoftware.com/xdnd/other_protocols.html)

In  
the words of the XDnD: ?The basic requirements for such a protocol  
are that it provide visual feedback to the user during the drag and  
that it allow the target to choose whatever data format it prefers  
from among all the formats that the source can provide. In addition,  
it must be efficient so that the visual feedback does not lag behind  
the user’s actions, and it must be safe from deadlock, race  
conditions, and other hazards inherent in asynchronous systems.?

XDnD  
in nutshell is described here:

> **[X Window selection](https://en.wikipedia.org/wiki/X_Window_selection#XDND)**
>
> Selections, cut buffers, and drag-and-drop are the mechanisms used in the X Window System to allow a user to transfer data from one window to another. Selections and cut buffer are typically used when a user selects text or some other data in a window and pastes in another one. Drag-and-drop is used when a user selects something in a window, then clicks on the selection and drags it into another window.
> Since the two windows may be handled by two different applications, these mechanisms require ...

It  
is obvious, supporting XDnD facilitates incentives for innovative  
applications to emerge.

In  
my opinion, SDL should switch to XDnD as the preferred protocol for  
Drag-and-Drop for all operating system and keep the SDL\_DROPFILE as a  
fall back option for systems where XDnD is yet to support in source  
side.

Supporting  
XDnD in SDL for Unix systems, at first, it is possible applications  
with richer functionality to offer to Unix-based systems. This itself  
provide an incentive, though small, attract users of insecure  
operating systems to switch to Unix-based systems.

Note,  
XDnD is not a one sided implementation. That is, for two applications  
to communicate via XDnD, it requires to be implemented in both SDL  
and in the source application (eg. file browser, web browser, etc.).

XDnD  
is already fully supported (i.e. Implemented in both sides) in all  
Unix-based systems such as all Linux OSs, BSDs, etc. KDE, Gnome,  
Firefox, Opera, etc. support XDnD. More detailed list is here:  
[http://www.newplanetsoftware.com/xdnd/supporters.html](http://www.newplanetsoftware.com/xdnd/supporters.html)

Technologies  
may be useful to support XDnD for source side in both Microsoft  
Windows and Apple Mac OSX are highlighted here:  
[http://lists.lazarus.freepascal.org/pipermail/lazarus/2010-September/055428.html](http://lists.lazarus.freepascal.org/pipermail/lazarus/2010-September/055428.html)

So  
as a summary, XDnD in Unix is already covered, it must be not so  
difficult to support in both MS Windows and OSX. Switching to XDnD  
benefit all. My patch can be used as a base or guideline to support  
XDnD for both MS Windows and OSX in relevant places in SDL.  
Supporting XDnD and SDL\_DROPFILE in SDL is really the way forward.  
Supporting only SDL\_DROPFILE in SDL, nobody may bother to support  
real XDnD in SDL in future.

Sagara\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
From: Sam Lantinga   
To: Sagara Wijetunga \<@Sagara\_Wijetunga\>; SDL Development List   
Sent: Saturday, February 23, 2013 5:08 AM  
Subject: Re: [SDL] SDL 2.0 API stabilization

Yep, let’s go with this option for now. If someone is interested enough in the expanded protocol to implement it for Mac OS X and Windows, then let’s look at that post 2.0.

On Fri, Feb 22, 2013 at 3:11 AM, Sagara Wijetunga \<@Sagara\_Wijetunga\> wrote:

Yes, this is technically feasible. Its really not a subset, SDL can then implement only one data type. Support “text/uri-list”. That is, you can only drag and drop one or more files or a URL, not other types. I see this as a more sensible compromise.

> Sagara
> 
> * * *
> 
> From: Driedfruit   
> To: sdl at [lists.libsdl.org](http://lists.libsdl.org)  
> Cc: Sagara Wijetunga \<@Sagara\_Wijetunga\>  
> Sent: Wednesday, February 20, 2013 10:36 PM  
> Subject: Re: [SDL] SDL 2.0 API stabilization
> 
> > Please note, the  
> > SDL\_DROPFILE and XDnD are not compatible.
> 
> I know this have been asked before, but just to make it clear… Wouldn’t  
> it be possible to expose a subset of XDnD functionality as SDL\_DROPFILE?  
> I.e. have SDL2 manage all the details (reject everything but files,  
> accept files, issue SDL\_DROPFILE event) ?
> 
> –  
> driedfruit
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Edward\_Rudd](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/edward_rudd/32/180_2.png) [@Edward\_Rudd](https://discourse.libsdl.org/u/Edward_Rudd)\
**Post date:** [February 28, 2013, 8:19pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/11 "2013-02-28T20:19:49Z")

</div>

Sam,

I have a few local GameController API changes that do some subtle changes to the API naming, but mostly adjusting some structs to support future non-api breaking functionality I’m working on.

I’ll get those sorted out next week and up for review as I’d like to get those in NOW.On Feb 18, 2013, at 2:19 , Sam Lantinga wrote:

> We’re on the road to release for SDL 2.0.
> 
> To that end, most of the existing APIs are stable, and we’ll only change them if it’s critical.  
> There are a few things which are still being considered, such as the iOS event handling, and touch/mouse event semantics, but by and large the API is set for release.
> 
> Please report bugs which are affecting you in the current snapshot:  
> [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)
> 
> If anyone wants to fix anything currently in bugzilla, they are more than welcome:  
> [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org)
> 
> Cheers!  
> –Sam
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Edward Rudd  
OutOfOrder.cc  
Skype: outoforder\_cc  
317-674-3296

---

<div class="post-metadata">

**Author:** ![Sik\_the\_hedgehog](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/db5fbb/32.png) [@Sik\_the\_hedgehog](https://discourse.libsdl.org/u/Sik_the_hedgehog)\
**Post date:** [March 1, 2013, 1:20am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/12 "2013-03-01T01:20:45Z")

</div>

We really should stop thinking of this as XDnD and more of “advanced  
drag and drop”.

I’d propose to add events that match XDnD’s functionality like e.g.  
SDL\_DRAG for when the mouse is dragging something over the SDL window  
(probably with some flag to specify whether the drag is into the  
window or out from it). Dropping may be somewhat less trivial as we  
need to come up with a way to let the program choose between all the  
formats, but I’d assume it’d involve a SDL\_DROP event.

Also I’d propose adding a SDL\_DROPTEXT event similar to SDL\_DROPFILE  
but for plain text. Would be more of a convenience event than  
anything, since I can see that event being another potential common  
case for drag and drop. If you need more than what those two provide  
then you’d use the full SDL\_DROP event.

Should drag and drop enhancements be put in 2.0 or be left for 2.1?

2013/2/28, Sagara Wijetunga :\>

> After  
> a second thought regarding the Drag-and-Drop support in SDL, I want  
> to highlight that we should take a decision based on broader public  
> good and should set a precedent.
> 
> The  
> XDnD is a more evolved modern Drag and Drop protocol. Issues related  
> obsolete Motif Drag and Drop, OffiX, Amulet, etc. are described here:  
> [http://www.newplanetsoftware.com/xdnd/other\_protocols.html](http://www.newplanetsoftware.com/xdnd/other_protocols.html)
> 
> In  
> the words of the XDnD: ?The basic requirements for such a protocol  
> are that it provide visual feedback to the user during the drag and  
> that it allow the target to choose whatever data format it prefers  
> from among all the formats that the source can provide. In addition,  
> it must be efficient so that the visual feedback does not lag behind  
> the user’s actions, and it must be safe from deadlock, race  
> conditions, and other hazards inherent in asynchronous systems.?
> 
> XDnD  
> in nutshell is described here:  
> [X Window selection - Wikipedia](http://en.wikipedia.org/wiki/X_Window_selection#XDND)
> 
> It  
> is obvious, supporting XDnD facilitates incentives for innovative  
> applications to emerge.
> 
> In  
> my opinion, SDL should switch to XDnD as the preferred protocol for  
> Drag-and-Drop for all operating system and keep the SDL\_DROPFILE as a  
> fall back option for systems where XDnD is yet to support in source  
> side.
> 
> Supporting  
> XDnD in SDL for Unix systems, at first, it is possible applications  
> with richer functionality to offer to Unix-based systems. This itself  
> provide an incentive, though small, attract users of insecure  
> operating systems to switch to Unix-based systems.
> 
> Note,  
> XDnD is not a one sided implementation. That is, for two applications  
> to communicate via XDnD, it requires to be implemented in both SDL  
> and in the source application (eg. file browser, web browser, etc.).
> 
> XDnD  
> is already fully supported (i.e. Implemented in both sides) in all  
> Unix-based systems such as all Linux OSs, BSDs, etc. KDE, Gnome,  
> Firefox, Opera, etc. support XDnD. More detailed list is here:  
> [http://www.newplanetsoftware.com/xdnd/supporters.html](http://www.newplanetsoftware.com/xdnd/supporters.html)
> 
> Technologies  
> may be useful to support XDnD for source side in both Microsoft  
> Windows and Apple Mac OSX are highlighted here:  
> [[Lazarus] Drag-n-Drop usage?](http://lists.lazarus.freepascal.org/pipermail/lazarus/2010-September/055428.html)
> 
> So  
> as a summary, XDnD in Unix is already covered, it must be not so  
> difficult to support in both MS Windows and OSX. Switching to XDnD  
> benefit all. My patch can be used as a base or guideline to support  
> XDnD for both MS Windows and OSX in relevant places in SDL.  
> Supporting XDnD and SDL\_DROPFILE in SDL is really the way forward.  
> Supporting only SDL\_DROPFILE in SDL, nobody may bother to support  
> real XDnD in SDL in future.
> 
> Sagara
> 
> * * *
> 
> From: Sam Lantinga   
> To: Sagara Wijetunga ; SDL Development List  
>   
> Sent: Saturday, February 23, 2013 5:08 AM  
> Subject: Re: [SDL] SDL 2.0 API stabilization
> 
> Yep, let’s go with this option for now. If someone is interested enough in  
> the expanded protocol to implement it for Mac OS X and Windows, then let’s  
> look at that post 2.0.
> 
> On Fri, Feb 22, 2013 at 3:11 AM, Sagara Wijetunga wrote:
> 
> Yes, this is technically feasible. Its really not a subset, SDL can then  
> implement only one data type. Support “text/uri-list”. That is, you can only  
> drag and drop one or more files or a URL, not other types. I see this as a  
> more sensible compromise.
> 
> > Sagara
> > 
> > * * *
> > 
> > From: Driedfruit   
> > To: sdl at [lists.libsdl.org](http://lists.libsdl.org)  
> > Cc: Sagara Wijetunga   
> > Sent: Wednesday, February 20, 2013 10:36 PM  
> > Subject: Re: [SDL] SDL 2.0 API stabilization
> > 
> > > Please note, the  
> > > SDL\_DROPFILE and XDnD are not compatible.
> > 
> > I know this have been asked before, but just to make it clear… Wouldn’t  
> > it be possible to expose a subset of XDnD functionality as SDL\_DROPFILE?  
> > I.e. have SDL2 manage all the details (reject everything but files,  
> > accept files, issue SDL\_DROPFILE event) ?
> > 
> > –  
> > driedfruit
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![John6](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@John6](https://discourse.libsdl.org/u/John6)\
**Post date:** [March 2, 2013, 5:50pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/13 "2013-03-02T17:50:52Z")

</div>

The android duplicate event issue needs to be addressed before SDL2 is stable on  
Android. The patch is in the ticket:

> <https://github.com/libsdl-org/SDL/issues/755>
>
> \# This bug report was migrated from our old Bugzilla tracker.
> 
> These attachments… are available in the static archive:
> 
> \* \[patch to add the new hint support (SDL\_HINT\_SIMULATE\_INPUT\_EVENTS.patch, text/plain, 2013-02-16 10:40:38 +0000, 6662 bytes)\](https://bugzilla.libsdl.org/attachment.cgi?id=1044)
> 
> \*\*Reported in version:\*\* HG 2.0
> \*\*Reported for operating system, platform:\*\* Android (All), All
> 
> \# Comments on the original bug report:
> 
> On 2013-02-07 15:52:30 +0000, wrote:
> 
> \> On Android and UIKit, when SDL sees a touch/finger event, it also sends a mouse motion or mouse button event. When the user touches their device, the application will receive a touch event as well as a mouse down event. This breaks existing applications which handle both types of events. Applications cannot tell whether a mouse event was already handled as a touch event, is about to be handled as a touch event, or is a new event.
> \> 
> \> Instead of removing the duplicate events, this patch adds a new hint, SDL\_HINT\_SIMULATE\_INPUT\_EVENTS, leaving the above described behavior as the default, but permitting portable apps to disable duplicate events. The hint system seems the least intrusive approach, but is inefficient, so I added a flag in the SDL\_Mouse struct to mirror the hint.
> \> 
> \> Portable apps should either (1) not handle touch events at all, or (2) call SDL\_SetHint(SDL\_HINT\_SIMULATE\_INPUT\_EVENTS, "0") to disable duplicate events.
> 
> On 2013-02-16 02:01:10 +0000, Philipp Wiesemann wrote:
> 
> \> The patch was not attached to the bug.
> 
> On 2013-02-16 10:40:38 +0000, wrote:
> 
> \> Created attachment 1044
> \> patch to add the new hint support
> 
> On 2013-03-02 23:46:24 +0000, Sam Lantinga wrote:
> 
> \> You can now tell if a mouse event was simulated by touch input. The mouse event 'which' field will be set to the value SDL\_TOUCH\_MOUSEID.

The motivation is that developers cannot currently write a portable event loop  
in SDL2 if they want to support touch events.On 02/18/2013 02:19 AM, Sam Lantinga wrote:

> We’re on the road to release for SDL 2.0.
> 
> To that end, most of the existing APIs are stable, and we’ll only change them if  
> it’s critical.  
> There are a few things which are still being considered, such as the iOS event  
> handling, and touch/mouse event semantics, but by and large the API is set for  
> release.
> 
> Please report bugs which are affecting you in the current snapshot:  
> [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)
> 
> If anyone wants to fix anything currently in bugzilla, they are more than welcome:  
> [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> 
> Cheers!  
> –Sam
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [March 2, 2013, 6:10pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/14 "2013-03-02T18:10:31Z")

</div>

I agree, this needs to be addressed.

Another option is to default touch events off, and deliver mouse events if  
they are off, and touch events if they are enabled.On Sat, Mar 2, 2013 at 9:50 AM, John wrote:

> The android duplicate event issue needs to be addressed before SDL2 is  
> stable on Android. The patch is in the ticket:  
> [http://bugzilla.libsdl.org/\*\*show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/**show_bug.cgi?id=1713)[http://bugzilla.libsdl.org/show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/show_bug.cgi?id=1713)
> 
> The motivation is that developers cannot currently write a portable event  
> loop in SDL2 if they want to support touch events.
> 
> On 02/18/2013 02:19 AM, Sam Lantinga wrote:
> 
> > We’re on the road to release for SDL 2.0.
> > 
> > To that end, most of the existing APIs are stable, and we’ll only change  
> > them if  
> > it’s critical.  
> > There are a few things which are still being considered, such as the iOS  
> > event  
> > handling, and touch/mouse event semantics, but by and large the API is  
> > set for  
> > release.
> > 
> > Please report bugs which are affecting you in the current snapshot:  
> > [http://www.libsdl.org/tmp/SDL-\*\*2.0.zip](http://www.libsdl.org/tmp/SDL-**2.0.zip)[http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)
> > 
> > If anyone wants to fix anything currently in bugzilla, they are more than  
> > welcome:  
> > [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> > 
> > Cheers!  
> > –Sam
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Sik\_the\_hedgehog](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/db5fbb/32.png) [@Sik\_the\_hedgehog](https://discourse.libsdl.org/u/Sik_the_hedgehog)\
**Post date:** [March 2, 2013, 6:38pm UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/15 "2013-03-02T18:38:25Z")

</div>

So basically SDL\_INIT\_TOUCH? (if a program acknowledges it supports  
touch there isn’t any reason to emulate touch events)

2013/3/2, Sam Lantinga :\> I agree, this needs to be addressed.

> Another option is to default touch events off, and deliver mouse events if  
> they are off, and touch events if they are enabled.
> 
> On Sat, Mar 2, 2013 at 9:50 AM, John wrote:
> 
> > The android duplicate event issue needs to be addressed before SDL2 is  
> > stable on Android. The patch is in the ticket:  
> > [http://bugzilla.libsdl.org/\*\*show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/**show_bug.cgi?id=1713)[http://bugzilla.libsdl.org/show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/show_bug.cgi?id=1713)
> > 
> > The motivation is that developers cannot currently write a portable event  
> > loop in SDL2 if they want to support touch events.
> > 
> > On 02/18/2013 02:19 AM, Sam Lantinga wrote:
> > 
> > > We’re on the road to release for SDL 2.0.
> > > 
> > > To that end, most of the existing APIs are stable, and we’ll only change  
> > > them if  
> > > it’s critical.  
> > > There are a few things which are still being considered, such as the iOS  
> > > event  
> > > handling, and touch/mouse event semantics, but by and large the API is  
> > > set for  
> > > release.
> > > 
> > > Please report bugs which are affecting you in the current snapshot:  
> > > [http://www.libsdl.org/tmp/SDL-\*\*2.0.zip](http://www.libsdl.org/tmp/SDL-**2.0.zip)[http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)
> > > 
> > > If anyone wants to fix anything currently in bugzilla, they are more  
> > > than  
> > > welcome:  
> > > [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> > > 
> > > Cheers!  
> > > –Sam
> > > 
> > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > SDL mailing list  
> > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > > 
> > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > SDL mailing list  
> > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![PoV](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/pov/32/2344_2.png) [@PoV](https://discourse.libsdl.org/u/PoV)\
**Post date:** [March 3, 2013, 12:17am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/16 "2013-03-03T00:17:34Z")

</div>

urkle wrote:

> Sam,
> 
> I have a few local GameController API changes that do some subtle changes to the API naming, but mostly adjusting some structs to support future non-api breaking functionality I’m working on.
> 
> I’ll get those sorted out next week and up for review as I’d like to get those in NOW.

Whew! I’ve been avoiding the Joystick code for a few months now, since it hasn’t worked with MinGW. I’ve gone ahead and posted a bug report.------------------------  
| Mike Kasprzak | Sykhronics Entertainment ([http://www.sykhronics.com](http://www.sykhronics.com)) | Blog ([http://www.toonormal.com](http://www.toonormal.com)) | Twitter ([x.com](http://www.twitter.com/mikekasprzak)) | Ludum Dare ([http://ludumdare.com](http://ludumdare.com)) |

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [March 3, 2013, 4:47am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/17 "2013-03-03T04:47:44Z")

</div>

You can now tell if a mouse event was simulated by touch input. The mouse  
event has a new ‘which’ field and is set to the value SDL\_TOUCH\_MOUSEID.

I talked it over with Ryan and this was the best solution which didn’t  
involve unexpected behavior changes and still allowed smart applications to  
do the right thing.

Cheers!On Sat, Mar 2, 2013 at 10:38 AM, Sik the hedgehog \< sik.the.hedgehog at [gmail.com](http://gmail.com)\> wrote:

> So basically SDL\_INIT\_TOUCH? (if a program acknowledges it supports  
> touch there isn’t any reason to emulate touch events)
> 
> 2013/3/2, Sam Lantinga \<@slouken\>:
> 
> > I agree, this needs to be addressed.
> > 
> > Another option is to default touch events off, and deliver mouse events  
> > if  
> > they are off, and touch events if they are enabled.
> > 
> > On Sat, Mar 2, 2013 at 9:50 AM, John wrote:
> > 
> > > The android duplicate event issue needs to be addressed before SDL2 is  
> > > stable on Android. The patch is in the ticket:  
> > > [http://bugzilla.libsdl.org/\*\*show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/**show_bug.cgi?id=1713)\<  
> > > [simulated mouse events duplicate touch events · Issue #755 · libsdl-org/SDL · GitHub](http://bugzilla.libsdl.org/show_bug.cgi?id=1713)\>
> > > 
> > > The motivation is that developers cannot currently write a portable  
> > > event  
> > > loop in SDL2 if they want to support touch events.
> > > 
> > > On 02/18/2013 02:19 AM, Sam Lantinga wrote:
> > > 
> > > > We’re on the road to release for SDL 2.0.
> > > > 
> > > > To that end, most of the existing APIs are stable, and we’ll only  
> > > > change  
> > > > them if  
> > > > it’s critical.  
> > > > There are a few things which are still being considered, such as the  
> > > > iOS  
> > > > event  
> > > > handling, and touch/mouse event semantics, but by and large the API is  
> > > > set for  
> > > > release.
> > > > 
> > > > Please report bugs which are affecting you in the current snapshot:  
> > > > [http://www.libsdl.org/tmp/SDL-\*\*2.0.zip](http://www.libsdl.org/tmp/SDL-**2.0.zip)\<  
> > > > [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)\>
> > > > 
> > > > If anyone wants to fix anything currently in bugzilla, they are more  
> > > > than  
> > > > welcome:  
> > > > [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> > > > 
> > > > Cheers!  
> > > > –Sam
> > > > 
> > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > SDL mailing list  
> > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > > > 
> > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > SDL mailing list  
> > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Sik\_the\_hedgehog](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/db5fbb/32.png) [@Sik\_the\_hedgehog](https://discourse.libsdl.org/u/Sik_the_hedgehog)\
**Post date:** [March 3, 2013, 5:09am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/18 "2013-03-03T05:09:26Z")

</div>

Yeah, that seems better. I realized later that SDL\_INIT\_TOUCH would  
result in programs using SDL\_INIT\_EVERYTHING to not get emulated touch  
input, but I was away by then 😕 (honestly using SDL\_INIT\_EVERYTHING  
isn’t a good idea in the first place, but eh)

2013/3/3, Sam Lantinga :\> You can now tell if a mouse event was simulated by touch input. The mouse

> event has a new ‘which’ field and is set to the value SDL\_TOUCH\_MOUSEID.
> 
> I talked it over with Ryan and this was the best solution which didn’t  
> involve unexpected behavior changes and still allowed smart applications to  
> do the right thing.
> 
> Cheers!
> 
> On Sat, Mar 2, 2013 at 10:38 AM, Sik the hedgehog \< @Sik\_the\_hedgehog\> wrote:
> 
> > So basically SDL\_INIT\_TOUCH? (if a program acknowledges it supports  
> > touch there isn’t any reason to emulate touch events)
> > 
> > 2013/3/2, Sam Lantinga :
> > 
> > > I agree, this needs to be addressed.
> > > 
> > > Another option is to default touch events off, and deliver mouse events  
> > > if  
> > > they are off, and touch events if they are enabled.
> > > 
> > > On Sat, Mar 2, 2013 at 9:50 AM, John wrote:
> > > 
> > > > The android duplicate event issue needs to be addressed before SDL2 is  
> > > > stable on Android. The patch is in the ticket:  
> > > > [http://bugzilla.libsdl.org/\*\*show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/**show_bug.cgi?id=1713)\<  
> > > > [simulated mouse events duplicate touch events · Issue #755 · libsdl-org/SDL · GitHub](http://bugzilla.libsdl.org/show_bug.cgi?id=1713)\>
> > > > 
> > > > The motivation is that developers cannot currently write a portable  
> > > > event  
> > > > loop in SDL2 if they want to support touch events.
> > > > 
> > > > On 02/18/2013 02:19 AM, Sam Lantinga wrote:
> > > > 
> > > > > We’re on the road to release for SDL 2.0.
> > > > > 
> > > > > To that end, most of the existing APIs are stable, and we’ll only  
> > > > > change  
> > > > > them if  
> > > > > it’s critical.  
> > > > > There are a few things which are still being considered, such as the  
> > > > > iOS  
> > > > > event  
> > > > > handling, and touch/mouse event semantics, but by and large the API  
> > > > > is  
> > > > > set for  
> > > > > release.
> > > > > 
> > > > > Please report bugs which are affecting you in the current snapshot:  
> > > > > [http://www.libsdl.org/tmp/SDL-\*\*2.0.zip](http://www.libsdl.org/tmp/SDL-**2.0.zip)\<  
> > > > > [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)\>
> > > > > 
> > > > > If anyone wants to fix anything currently in bugzilla, they are more  
> > > > > than  
> > > > > welcome:  
> > > > > [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> > > > > 
> > > > > Cheers!  
> > > > > –Sam
> > > > > 
> > > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > > SDL mailing list  
> > > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > > > > 
> > > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > > SDL mailing list  
> > > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![John6](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@John6](https://discourse.libsdl.org/u/John6)\
**Post date:** [March 3, 2013, 5:19am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/19 "2013-03-03T05:19:13Z")

</div>

Does the mouse state become affected by delivery of the simulated events? i.e.,  
will touch events now alter the mouse state?On 03/03/2013 12:09 AM, Sik the hedgehog wrote:

> Yeah, that seems better. I realized later that SDL\_INIT\_TOUCH would  
> result in programs using SDL\_INIT\_EVERYTHING to not get emulated touch  
> input, but I was away by then 😕 (honestly using SDL\_INIT\_EVERYTHING  
> isn’t a good idea in the first place, but eh)
> 
> 2013/3/3, Sam Lantinga :
> 
> > You can now tell if a mouse event was simulated by touch input. The mouse  
> > event has a new ‘which’ field and is set to the value SDL\_TOUCH\_MOUSEID.
> > 
> > I talked it over with Ryan and this was the best solution which didn’t  
> > involve unexpected behavior changes and still allowed smart applications to  
> > do the right thing.
> > 
> > Cheers!
> > 
> > On Sat, Mar 2, 2013 at 10:38 AM, Sik the hedgehog \< sik.the.hedgehog at [gmail.com](http://gmail.com)\> wrote:
> > 
> > > So basically SDL\_INIT\_TOUCH? (if a program acknowledges it supports  
> > > touch there isn’t any reason to emulate touch events)
> > > 
> > > 2013/3/2, Sam Lantinga :
> > > 
> > > > I agree, this needs to be addressed.
> > > > 
> > > > Another option is to default touch events off, and deliver mouse events  
> > > > if  
> > > > they are off, and touch events if they are enabled.
> > > > 
> > > > On Sat, Mar 2, 2013 at 9:50 AM, John \<@John6\> wrote:
> > > > 
> > > > > The android duplicate event issue needs to be addressed before SDL2 is  
> > > > > stable on Android. The patch is in the ticket:  
> > > > > [http://bugzilla.libsdl.org/\*\*show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/**show_bug.cgi?id=1713)\<  
> > > > > [simulated mouse events duplicate touch events · Issue #755 · libsdl-org/SDL · GitHub](http://bugzilla.libsdl.org/show_bug.cgi?id=1713)\>
> > > > > 
> > > > > The motivation is that developers cannot currently write a portable  
> > > > > event  
> > > > > loop in SDL2 if they want to support touch events.
> > > > > 
> > > > > On 02/18/2013 02:19 AM, Sam Lantinga wrote:
> > > > > 
> > > > > > We’re on the road to release for SDL 2.0.
> > > > > > 
> > > > > > To that end, most of the existing APIs are stable, and we’ll only  
> > > > > > change  
> > > > > > them if  
> > > > > > it’s critical.  
> > > > > > There are a few things which are still being considered, such as the  
> > > > > > iOS  
> > > > > > event  
> > > > > > handling, and touch/mouse event semantics, but by and large the API  
> > > > > > is  
> > > > > > set for  
> > > > > > release.
> > > > > > 
> > > > > > Please report bugs which are affecting you in the current snapshot:  
> > > > > > [http://www.libsdl.org/tmp/SDL-\*\*2.0.zip](http://www.libsdl.org/tmp/SDL-**2.0.zip)\<  
> > > > > > [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)\>
> > > > > > 
> > > > > > If anyone wants to fix anything currently in bugzilla, they are more  
> > > > > > than  
> > > > > > welcome:  
> > > > > > [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> > > > > > 
> > > > > > Cheers!  
> > > > > > –Sam
> > > > > > 
> > > > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > > > SDL mailing list  
> > > > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > > > > > 
> > > > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > > > SDL mailing list  
> > > > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Sik\_the\_hedgehog](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/db5fbb/32.png) [@Sik\_the\_hedgehog](https://discourse.libsdl.org/u/Sik_the_hedgehog)\
**Post date:** [March 3, 2013, 5:21am UTC](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378/20 "2013-03-03T05:21:47Z")

</div>

What states could be affected? May want to narrow down the specific  
issues that could arise before trying to discuss what to do about it.

2013/3/3, John :\> Does the mouse state become affected by delivery of the simulated events?

> i.e.,  
> will touch events now alter the mouse state?
> 
> On 03/03/2013 12:09 AM, Sik the hedgehog wrote:
> 
> > Yeah, that seems better. I realized later that SDL\_INIT\_TOUCH would  
> > result in programs using SDL\_INIT\_EVERYTHING to not get emulated touch  
> > input, but I was away by then 😕 (honestly using SDL\_INIT\_EVERYTHING  
> > isn’t a good idea in the first place, but eh)
> > 
> > 2013/3/3, Sam Lantinga :
> > 
> > > You can now tell if a mouse event was simulated by touch input. The  
> > > mouse  
> > > event has a new ‘which’ field and is set to the value  
> > > SDL\_TOUCH\_MOUSEID.
> > > 
> > > I talked it over with Ryan and this was the best solution which didn’t  
> > > involve unexpected behavior changes and still allowed smart applications  
> > > to  
> > > do the right thing.
> > > 
> > > Cheers!
> > > 
> > > On Sat, Mar 2, 2013 at 10:38 AM, Sik the hedgehog \< @Sik\_the\_hedgehog\> wrote:
> > > 
> > > > So basically SDL\_INIT\_TOUCH? (if a program acknowledges it supports  
> > > > touch there isn’t any reason to emulate touch events)
> > > > 
> > > > 2013/3/2, Sam Lantinga :
> > > > 
> > > > > I agree, this needs to be addressed.
> > > > > 
> > > > > Another option is to default touch events off, and deliver mouse  
> > > > > events  
> > > > > if  
> > > > > they are off, and touch events if they are enabled.
> > > > > 
> > > > > On Sat, Mar 2, 2013 at 9:50 AM, John wrote:
> > > > > 
> > > > > > The android duplicate event issue needs to be addressed before SDL2  
> > > > > > is  
> > > > > > stable on Android. The patch is in the ticket:  
> > > > > > [http://bugzilla.libsdl.org/\*\*show\_bug.cgi?id=1713](http://bugzilla.libsdl.org/**show_bug.cgi?id=1713)\<  
> > > > > > [simulated mouse events duplicate touch events · Issue #755 · libsdl-org/SDL · GitHub](http://bugzilla.libsdl.org/show_bug.cgi?id=1713)\>
> > > > > > 
> > > > > > The motivation is that developers cannot currently write a portable  
> > > > > > event  
> > > > > > loop in SDL2 if they want to support touch events.
> > > > > > 
> > > > > > On 02/18/2013 02:19 AM, Sam Lantinga wrote:
> > > > > > 
> > > > > > > We’re on the road to release for SDL 2.0.
> > > > > > > 
> > > > > > > To that end, most of the existing APIs are stable, and we’ll only  
> > > > > > > change  
> > > > > > > them if  
> > > > > > > it’s critical.  
> > > > > > > There are a few things which are still being considered, such as the  
> > > > > > > iOS  
> > > > > > > event  
> > > > > > > handling, and touch/mouse event semantics, but by and large the API  
> > > > > > > is  
> > > > > > > set for  
> > > > > > > release.
> > > > > > > 
> > > > > > > Please report bugs which are affecting you in the current snapshot:  
> > > > > > > [http://www.libsdl.org/tmp/SDL-\*\*2.0.zip](http://www.libsdl.org/tmp/SDL-**2.0.zip)\<  
> > > > > > > [http://www.libsdl.org/tmp/SDL-2.0.zip](http://www.libsdl.org/tmp/SDL-2.0.zip)\>
> > > > > > > 
> > > > > > > If anyone wants to fix anything currently in bugzilla, they are more  
> > > > > > > than  
> > > > > > > welcome:  
> > > > > > > [http://bugzilla.libsdl.org](http://bugzilla.libsdl.org) [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> > > > > > > 
> > > > > > > Cheers!  
> > > > > > > –Sam
> > > > > > > 
> > > > > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > > > > SDL mailing list  
> > > > > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > > > > > > 
> > > > > > > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > > > > > > SDL mailing list  
> > > > > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > > > > [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)\<  
> > > > > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)\>
> > > > 
> > > > * * *
> > > > 
> > > > SDL mailing list  
> > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

[Next page](https://discourse.libsdl.org/t/sdl-2-0-api-stabilization/19378.md?page=2)
