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 2920 - Extension of SDL_SetWindowHitTest
Summary: Extension of SDL_SetWindowHitTest
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.3
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-22 07:24 UTC by x414e54
Modified: 2016-10-07 23:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description x414e54 2015-03-22 07:24:55 UTC
Some Window Managers implement pop-ups via a hit-test based method.

The user clicks with a pointer and then the application should spawn the window which is controlled and hidden by the window manager.

There should be some method for the hit_test callback to notify SDL that it would like to create a window based of a hit test.

One way to implement this could be:
Add in the SDL_HITTEST_POPUP enum. The hit test result can then return a window pointer, another callback, window creation information or the callback could be set by a separate SDL_SetWindowPopupCallback function.


Also there is the possibility some window managers have their own context menus such as right clicking on the title bar as seen with GNOME Shell. If a client is implementing client side decorations they may still want the user to be able to access this context menu. 

An SDL_HITTEST_CONTEXT_MENU enum would need to be added which would then spawn a platform specific context menu if available.


There should be the option to set which mouse buttons will trigger the hit test. Currently it is just the Left mouse, but the application may want to hit test on other buttons also. 

For example extending SDL_SetWindowHitTest to also take a mouse button integer list and passing the mouse button id to the hit-test callback.


Finally some way for the application to know that something actually occurred after the hit_test callback returns to SDL. This is so it can choose what to do in the case of platform specific failure or success. 

An option for setting if SDL will eat the original event or not or send a SDL_WINDOWEVENT_HIT_TEST with fields for the SDL_HITTEST_ type and if it failed or succeeded.