kc3-lang/SDL/src/video/windows/SDL_windowswindow.c

Branch :


Log

Author Commit Date CI Message
d44f3922 2014-07-07 10:33:32 Fixed bug 2629 - Mac: crash when calling SDL_DestroyWindow with an active OpenGL context Alex Szpakowski Since this commit https://hg.libsdl.org/SDL/rev/59b543340d63 , calling SDL_DestroyWindow will crash the program if the window has an active OpenGL context. This is because the Cocoa_DestroyWindow code sets the window's driverdata to NULL and then calls [context setWindow:NULL], which tries to access the window's driverdata, resulting in a null pointer dereference. I have attached a patch which fixes the issue by moving the line which sets the driverdata to NULL to after the lines which call functions that use the driverdata pointer.
b29740b8 2014-06-25 17:06:12 Merged Ryan's SDL-gui-backend branch. Adds three APIs, and implements them on X11, Cocoa, and Windows: - SDL_CaptureMouse() - SDL_GetGlobalMouseState() - SDL_SetWindowHitTest()
67e55655 2014-06-23 10:09:15 Fixed grab interaction with Windows Classic theme Testing: * For each theme in Windows 7, Windows 7 Basic, and Windows 7 Classic: - Ran testsprite2 - Pressed Ctrl-G to grab the mouse - Alt-tabbed away, verified mouse is no longer grabbed - Alt-tabbed back, verified that mouse was grabbed - Alt-tabbed away - Clicked in the window, verified mouse was grabbed - Alt-tabbed away - Grabbed the title bar and dragged the window around successfully, verified that mouse was grabbed when move modal loop completed - Alt-tabbed away - Clicked the minimize button on the title bar, the window was successfully minimized - Clicked on the icon in the task bar, the window was restored and the mouse grabbed again - Alt-tabbed away - Clicked the close button on the title bar, the window was successfully closed
b7b6d8ab 2014-06-22 02:30:36 Fixed crash initializing OpenGL ES renderer if OpenGL renderer fails
707fd9f0 2014-06-04 10:56:30 Fixed bug where changing the window border would change the window size on Windows.
89ad7934 2014-05-29 13:39:02 First shot (not even compiled) at Windows hit-testing support.
9bc47465 2014-05-18 21:11:30 Changed C++ style comments.
3dcb451f 2014-04-09 21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
2a6213ad 2014-02-24 22:49:30 Make sure we don't clip the cursor while clicking on the window title bar
b80f4f9e 2014-02-22 17:39:35 Don't fail initialization if the helper window class already exists.
a396841f 2014-02-10 10:02:18 Fixed bug where a window created fullscreen and hidden would get activated and "shown" but never actually be visible. This is the case with the Steam In-Home Streaming client.
58edac3e 2014-02-02 00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
d76c2cc1 2014-01-30 12:30:40 Add a new hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that allows SDL_CreateWindowFrom() to set the pixel format of another SDL_Window (and also will set the SDL_WINDOW_OPENGL flag on the window created with SDL_CreateWindowFrom()). The reasoning behind this change is that source2 in -tools mode has a single OpenGL context that is used with multiple different windows. Some of those windows are created outside the engine (i.e. with Qt) and therefore we need to use SDL_CreateWindowFrom() to get an SDL_Window for those. The requirement for sharing an OpenGL context across multiple different windows is that each window has the same pixel format. To facilitate this, I now set SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT for the main window before calling SDL_CreateWindowFrom(). When I do this, SDL_CreateWindowFrom() will: 1. Set the pixel format of the returned window to the same pixel format as this SDL_Window passed in with the hint 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for OpenGL rendering. I only currently implemented this for Win32/WGL so implementing it for other platforms (i.e. X11) remains a TODO. CR: SamL Some pseudocode that shows how this is used in Source2: HWND hExternalHwnd; // HWND that was established outside of SDL // Create main window (happens inside platwindow.cpp) SDL_Window *mainWindow = SDL_CreateWindow( , SDL_WINDOW_OPENGL .. ); // Create GL context, happens inside rendersystemgl SDL_GLContext onlyContext = SDL_GL_CreateContext( mainWindow ); // Now I need to create another window from hEternalHwnd for my swap chain that will have the same pixel format as mainWindow, so set the hint SDL_SetHint( SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT, CFmtStr( %p, mainWindow) ); // Create the secondary window. This returned window will have SDL_WINDOW_OPENGL set and share a pixel format with mainWindow from the hint SDL_Window *secondaryWindow = SDL_CreateWindowFrom( hExternalHwnd ); // To render to the main window: SDL_GL_MakeCurrent( mainWindow, onlyContext ); // Do some rendering to main window // To render to the secondary window: SDL_GLMakeCurrent( secondaryWindow, onlyContext ); // Do some rendering to secondary window
2521e497 2013-12-23 17:55:06 Setting the mouse in relative mode implies grabbing the mouse. This fixes getting mouse button events in raw input relative mode on X11.
f848adff 2013-11-29 10:06:08 Improve Android pause/resume behavior.
2bb344d6 2013-11-27 10:29:27 Don't crash when no WM is present. CR: Sam Lantinga.
7e1289af 2013-11-24 23:56:17 Make internal SDL sources include SDL_internal.h instead of SDL_config.h The new header will include SDL_config.h, but allows for other global stuff.
61959aa6 2013-11-22 13:24:53 OpenGL ES support for Windows
e19f15dd 2013-11-10 14:10:00 Fixed bug 2067 - Window size limit calculation issue when exiting fullscreen on Windows Also fixed minimize and maximize state detection for Windows.
976c8769 2013-11-08 14:05:23 Fixed bug 2172 - Window loses maximized state when activated I still haven't figured out why my application is being minimized when I try to raise, it but my previous workaround is causing issues. For now the correct way to raise and/or restore the window is as follows: if ( !(SDL_GetWindowFlags( window ) & SDL_WINDOW_MINIMIZED) ) { SDL_RaiseWindow( window ); } if ( SDL_GetWindowFlags( window ) & SDL_WINDOW_MINIMIZED ) { SDL_RestoreWindow( window ); } I will investigate the window state change rules more fully in the future. CR: Alfred Reynolds
12ca3ce3 2013-10-17 23:02:29 Fixed building using MinGW Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
4b603abf 2013-10-14 08:56:55 For some reason, trying to raise the window programmatically while it's alt-tabbed away will minimize it. Added a workaround for this.
8fbd7dc7 2013-10-03 00:54:58 Fixed bug 2130 - Two members of Windows WindowData not initialized norfanin SetupWindowData in SDL_windowswindow.c doesn't initialize two members of SDL_WindowData with NULL. This is an issue because other parts of the SDL code seem to make the assumption that this is the case. WIN_DestroyWindowFramebuffer for example uses data->mdc and data->hbm if they're not NULL.
9f390e79 2013-09-28 14:06:59 Moved SDL_Direct3D9GetAdapterIndex() to SDL_windowsvideo.c since it doesn't belong in the window code.
b6be1435 2013-09-28 14:06:20 Moved D3D_LoadDLL and SDL_Direct3D9GetAdapterIndex to SDL_windowswindow.c at Jorgen's insistence. That file is wrapped in a more appropriate define check so it will work if somebody builds a binary without D3D support. Added a reference to SDL_Direct3D9GetAdapterIndex to SDL_test_common.c so SDL will fail to compile if the new symbol isn't included properly. CR: Jorgen
f79fc33a 2013-08-29 08:29:21 Christoph Mallon: Remove pointless if (x) before SDL_free(x)
552b04c5 2013-08-20 20:34:40 More non C89 compliant comments
dad42067 2013-08-12 11:13:50 Fixes #2022, do not resume on Android when surfaceChanged If the app is in landscape mode and the user presses the power button, a pause is followed immediately by a surfaceChanged event because the lock screen is shown in portrait mode. This triggers a "false" resume. So, we just pause and resume following the onWindowFocusChanged events. Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before blocking the event pump.
1ad936eb 2013-08-11 19:56:43 Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() Rainer Deyke I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.