mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
Make NotifyWindow work with SDL2
This commit is contained in:
parent
38cfe32385
commit
6efd028393
|
@ -705,45 +705,41 @@ void CGraphicsBackend_SDL_OpenGL::SetWindowGrab(bool Grab)
|
||||||
|
|
||||||
void CGraphicsBackend_SDL_OpenGL::NotifyWindow()
|
void CGraphicsBackend_SDL_OpenGL::NotifyWindow()
|
||||||
{
|
{
|
||||||
//// get window handle
|
// get window handle
|
||||||
//SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
//SDL_VERSION(&info.version);
|
SDL_VERSION(&info.version);
|
||||||
//if(!SDL_GetWMInfo(&info))
|
if(!SDL_GetWindowWMInfo(m_pWindow, &info))
|
||||||
//{
|
{
|
||||||
// dbg_msg("gfx", "unable to obtain window handle");
|
dbg_msg("gfx", "unable to obtain window handle");
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//#if defined(CONF_FAMILY_WINDOWS)
|
#if defined(CONF_FAMILY_WINDOWS)
|
||||||
// FLASHWINFO desc;
|
FLASHWINFO desc;
|
||||||
// desc.cbSize = sizeof(desc);
|
desc.cbSize = sizeof(desc);
|
||||||
// desc.hwnd = info.window;
|
desc.hwnd = info.window;
|
||||||
// desc.dwFlags = FLASHW_TRAY;
|
desc.dwFlags = FLASHW_TRAY;
|
||||||
// desc.uCount = 3; // flash 3 times
|
desc.uCount = 3; // flash 3 times
|
||||||
// desc.dwTimeout = 0;
|
desc.dwTimeout = 0;
|
||||||
|
|
||||||
// FlashWindowEx(&desc);
|
FlashWindowEx(&desc);
|
||||||
//#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOSX)
|
#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOSX)
|
||||||
// Display *dpy = info.info.x11.display;
|
Display *dpy = info.info.x11.display;
|
||||||
// Window win;
|
Window win = info.info.x11.window;
|
||||||
// if(m_pScreenSurface->flags & SDL_FULLSCREEN)
|
|
||||||
// win = info.info.x11.fswindow;
|
|
||||||
// else
|
|
||||||
// win = info.info.x11.wmwindow;
|
|
||||||
|
|
||||||
// // Old hints
|
// Old hints
|
||||||
// XWMHints *wmhints;
|
XWMHints *wmhints;
|
||||||
// wmhints = XAllocWMHints();
|
wmhints = XAllocWMHints();
|
||||||
// wmhints->flags = XUrgencyHint;
|
wmhints->flags = XUrgencyHint;
|
||||||
// XSetWMHints(dpy, win, wmhints);
|
XSetWMHints(dpy, win, wmhints);
|
||||||
// XFree(wmhints);
|
XFree(wmhints);
|
||||||
|
|
||||||
// // More modern way of notifying
|
// More modern way of notifying
|
||||||
// static Atom demandsAttention = XInternAtom(dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", true);
|
static Atom demandsAttention = XInternAtom(dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", true);
|
||||||
// static Atom wmState = XInternAtom(dpy, "_NET_WM_STATE", true);
|
static Atom wmState = XInternAtom(dpy, "_NET_WM_STATE", true);
|
||||||
// XChangeProperty(dpy, win, wmState, XA_ATOM, 32, PropModeReplace,
|
XChangeProperty(dpy, win, wmState, XA_ATOM, 32, PropModeReplace,
|
||||||
// (unsigned char *) &demandsAttention, 1);
|
(unsigned char *) &demandsAttention, 1);
|
||||||
//#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue