Added a window flash operation to be explicit about window flash behavior

This commit is contained in:
Sam Lantinga
2021-07-24 13:41:55 -07:00
parent b2c8d3e9e4
commit f1633127d1
16 changed files with 79 additions and 32 deletions

View File

@@ -1440,15 +1440,6 @@ extern "C" {
*/
#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION"
/**
* \brief Controls the number of times a window flashes with SDL_FlashWindow()
*
* On Windows, if this variable is set, the SDL_FlashWindow() call will flash
* the specified number of times. Otherwise the window will flash until it
* becomes the foreground window.
*/
#define SDL_HINT_WINDOW_FLASH_COUNT "SDL_WINDOW_FLASH_COUNT"
/**
* \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
* The 0x406D1388 Exception is a trick used to inform Visual Studio of a

View File

@@ -64,6 +64,7 @@ typedef struct
const char *window_title;
const char *window_icon;
Uint32 window_flags;
SDL_bool flash_on_focus_loss;
int window_x;
int window_y;
int window_w;

View File

@@ -188,6 +188,9 @@ typedef enum
SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */
} SDL_DisplayEventID;
/**
* \brief Display orientation
*/
typedef enum
{
SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */
@@ -197,6 +200,16 @@ typedef enum
SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */
} SDL_DisplayOrientation;
/**
* \brief Window flash operation
*/
typedef enum
{
SDL_FLASH_CANCEL, /**< Cancel any window flash state */
SDL_FLASH_BRIEFLY, /**< Flash the window briefly to get attention */
SDL_FLASH_UNTIL_FOCUSED, /**< Flash the window until it gets focus */
} SDL_FlashOperation;
/**
* \brief An opaque handle to an OpenGL context.
*/
@@ -1511,10 +1524,11 @@ extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window,
* Request a window to demand attention from the user.
*
* \param window the window to be flashed
* \param the flash operation
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*/
extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window * window);
extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation);
/**
* Destroy a window.