Commit Graph

45 Commits

Author SHA1 Message Date
Sam Lantinga
d5ddb3cb91 Fixed bug 3453 - First mouse button input after a drag and drop event is ignored
Olav Sorensen

After a drag and drop event, any following mouse button input (down/up) doesn't generate an event. Clicking any mouse button a *second* time generates an event like it should.

Further investigation shows that the new SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH logic also causes this issue in other cases, like the first time you open the program and click the mouse.
2016-10-14 08:40:21 -07:00
Sam Lantinga
27d4f09929 Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
Sam Lantinga
dac3892816 Fixed bug 2832 - Inverted arrow-key navigation in MessageBox
Jan Hellwig

On Windows, you are able to navigate between the buttons on a MessageBox that was created using SDL_ShowMessageBox using the arrow keys. However, if you press the left arrow key, the selection jumps to the button on the right of the currently selected one (and vice versa).

This can be fixed by reversing the order in which the buttons are added to the dialog.

The attached patch files fixes this problem. However the first press of an arrow key leads to the selection of the leftmost or rightmost button on the MessageBox, not to the selection of the button left/right of the one that is selected by default.
2016-10-07 16:19:50 -07:00
Alex Szpakowski
8500de8fa5 Fix tabs -> spaces 2016-10-01 19:16:46 -03:00
Alex Szpakowski
f0539aa25e Fix bug 3436 - SDL_RaiseWindow not working on windows 2016-10-01 19:12:58 -03:00
Sam Lantinga
f4b26cd8e0 Removed carriage returns from previous patch 2016-10-01 13:16:31 -07:00
Sam Lantinga
7b0ccd32e5 Fixed bug 3405 - Wrong default icon size on windows systems
Evgeny Vrublevsky

Original code in the video/windows/SDL_windowsevents.c registers obsolete WNDCLASS (not WNDCLASSEX). As the result only one icon size is used as the small and normal icons. Also original code doesn't specify required size of an icon. As the result when 256x256 icon is available, the program uses it as a default icon, and it looks ugly.

We have to use WNDCLASSEX and load icons with proper sizes which we can get using GetSystemMetrics.

Better idea. We could use the first icon from resources, like the Explorer does. Patch is included. It also correctly loads large and small icons, so it will look nice everywhere.
2016-10-01 13:14:51 -07:00
Ethan Lee
c3e48e71b4 Force WM_PAINT events on window resize 2016-04-12 10:45:56 -04:00
Sam Lantinga
0b576962ca Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications. 2016-10-01 12:17:42 -07:00
Sam Lantinga
1e6e595484 Fixed bug 3332 - Win32: reset deadkeys in StartTextInput/StopTextInput
Eric Wasylishen

The bug here is that a dead keys pressed before calling SDL_StartTextInput() carries over into future text input, so the next key pressed will have the deadkey applied to it.

This in undesirable, imho, and doesn't occur on OS X (haven't check Linux or elsewhere). It's causing a problem for Quakespasm on German keyboard layouts, where we use the ^ deadkey to toggle the console (which enables/disables text input), and ^ characters are showing up in the TEXTINPUT events.
2016-10-01 11:54:02 -07:00
Ryan C. Gordon
e64c5186e2 windows: Removed hardcoded "1" for mouse clickthrough hint. 2016-09-29 23:42:18 -04:00
Ryan C. Gordon
f2fcd324c5 windows: fix borderless windows at desktop resolution (thanks, Evgeny!).
Fixes Bugzilla #3404.
2016-09-29 23:12:58 -04:00
Ryan C. Gordon
4f4c4b629f Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
Sam Lantinga
d285af2a96 Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH 2016-09-29 14:48:33 -07:00
Sam Lantinga
8ddb4328b5 When clicking on a window to give it focus, don't pass the mouse click to the application. 2016-09-29 03:59:04 -07:00
Alex Szpakowski
ea2f5e5930 Windows: Fix other window positions/sizes being changed when exiting exclusive fullscreen (bug #3315, thanks Simon Hug!) 2016-05-23 15:29:25 -03:00
Philipp Wiesemann
d4140ca473 Windows: Fixed missing error message if SDL_GetDisplayDPI() failed. 2016-05-20 22:15:58 +02:00
Sam Lantinga
a29a925d7e Pick up new display mode information after a mode change (Windows only right now). 2016-03-11 08:33:47 -08:00
Ryan C. Gordon
eeb899999f Patched to compile. 2016-01-05 05:22:35 -05:00
Ryan C. Gordon
aa4952fdef Added SDL_WINDOWEVENT_HIT_TEST.
This lets windows know when they are dropping a mouse event because their
hit test reported something other than SDL_HITTEST_NORMAL. It lets them know
exactly where in the event queue this happened.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2015-04-21 10:10:59 -04:00
Ryan C. Gordon
3bdaf4c611 Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity().
This is currently implemented for X11, Cocoa, Windows, and DirectFB.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2016-01-05 02:46:10 -05:00
Ryan C. Gordon
8e855f2fbc Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops.
This allows an app to know when a set of drops are coming in a grouping of
some sort (for example, a user selected multiple files and dropped them all
on the window with a single drag), and when that set is complete.

This also adds a window ID to the drop events, so the app can determine to
which window a given drop was delivered. For application-level drops (for
example, you launched an app by dropping a file on its icon), the window ID
will be zero.
2016-01-05 01:42:00 -05:00
Ryan C. Gordon
c3114975db Added SDL_GetDisplayUsableBounds(). 2016-01-04 23:52:40 -05:00
Sam Lantinga
42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
David Ludwig
854cf7ac40 Fixed Bug 3215 - Win32: 'fullscreen' app doesn't always extend to top of screen 2015-12-30 12:44:13 -05:00
Ryan C. Gordon
fd6b435c6a Windows: resync num/caps lock when window is gaining focus. 2015-12-28 13:08:19 -05:00
Ryan C. Gordon
257b7af247 Sync up the caps/numlock state properly without sending key events.
Partially fixes Bugzilla #2736 and #3125.
2015-12-28 13:07:44 -05:00
Ryan C. Gordon
2befe01d39 Removed a tabstop. 2015-12-27 18:56:46 -05:00
Ryan C. Gordon
6a2e8a7a90 Win: make sure SDL keyboard state reflects system capslock state at startup. 2015-12-27 18:48:14 -05:00
Alex Szpakowski
4026980917 Cleaned up some code formatting. 2015-12-18 00:49:27 -04:00
Philipp Wiesemann
57f2f3baf3 Windows: Added missing NULL check after SDL_stack_alloc().
SDL_stack_alloc() might wrap SDL_malloc() which can return NULL.
2015-12-06 17:51:11 +01:00
Sam Lantinga
2b0140a91f Add a new SDL_KEYMAPCHANGED SDL event to abstract notification of keyboard layout or input language changes. 2015-10-27 11:17:32 -07:00
Sam Lantinga
5b1741132f Converted tabs to spaces for SDL style 2015-10-06 21:40:50 -07:00
Sam Lantinga
9bd640e1a0 Fixed sending a size event while setting up a window (fix for DOTA 2 on Source 2) 2015-10-06 21:16:21 -07:00
Sam Lantinga
7bc72eaf84 Fixed forcing the window size when creating a non-resizable window on Windows. 2015-10-01 11:21:06 -07:00
Sam Lantinga
08ce12c4e3 Fixed divide by zero if the application has run out of GDI handles and is trying to show an error dialog 2015-09-14 11:15:25 -07:00
andrewb
a702c338f0 Add SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to SDL so that Reborn can keep running through Alt+F4. 2015-08-03 11:37:03 -07:00
Sam Lantinga
e93f90ae90 Trivial integer truncation warning fixes. 2015-07-30 10:01:04 -07:00
Alfred Reynolds
5aaf81c84e Fix up monitor enumeration for Windows 8.1 case. 2015-07-29 17:19:13 -07:00
Alfred Reynolds
61c7415071 Add SDL_GetDisplayDPI routine and implement for Windows. 2015-07-29 17:18:56 -07:00
Ryan C. Gordon
e346f14277 SDL_WarpMouseGlobal() should return non-void.
There are platforms it isn't implemented on (and currently can't be
implemented on!), and there's currently no way for an app to know this.

This shouldn't break ABI on apps that moved to a revision between 2.0.3 and
2.0.4.
2015-07-17 21:03:58 -04:00
Sam Lantinga
3a08b46336 Fixed bug 2834 - Patch to support dead keys on Windows
Elise Maurer

When inputting text, dead-keys are currently not handled correctly on Windows with the latest SDL2 tip as well as the 2.0.3 release.

Using a French AZERTY keyboard, when I type the `^` key followed by `e` key to compose the `` character, I erroneously get two SDL_TEXTINPUT events, one with the `^` character and one with the `e` character.

I've looked at the history for SDL_windowsevents.c and there's been some back-and-forth with several methods for handling text input:

  * r8142 removed any handling of WM_CHAR because keyboard input was being handled through WM_KEYDOWN along with ToUnicode since r7645.

  * But using ToUnicode actually breaks dead-keys (googling for "ToUnicode dead keys" reports many horror stories of people trying to work around that and failing).

  * It seems like r7645 introduced a double-fix: it fixed WM_CHAR to properly handle Unicode, and also (unnecessarily?) added text input handling to WM_KEYDOWN. Later, r8142 removed the WM_CHAR stuff instead of the WM_KEYDOWN stuff.

The attached patch restores handling of text input through WM_CHAR and removes it from WM_KEYDOWN. I've tested it with French, English and Russian layouts and it seems to do its job. Obviously, with such matters, it's still a risky change.
2015-06-25 11:49:48 -07:00
Alfred Reynolds
e4e4e1b82a SDL
- do the scancode to keyboard code lookup for the grave key, so that we can show users the correct keyface for the key, rather than forcing it to "`".  Note that if a game is using SDLK_* for its KB mapping then after this change on some keyboards the top left key will no longer be mapped correctly with the old data.

CR: SamL
2015-06-24 10:56:37 -07:00
Philipp Wiesemann
8cea1b986e Windows: Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 19:37:37 +02:00
Philipp Wiesemann
0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00