diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index bd1fb2c8..e01d4920 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -486,18 +486,19 @@ void WindowImplX11::setKeyRepeatEnabled(bool enabled) //////////////////////////////////////////////////////////// void WindowImplX11::requestFocus() { - // Check if window is viewable (not on other desktop, minimized, ...) - XWindowAttributes attributes; - if (XGetWindowAttributes(m_display, m_window, &attributes) == 0) - return; // error getting attribute - - // Not viewable: Can't set focus - if (attributes.map_state != IsViewable) - return; - - // Bring window to the front and give it input focus - XRaiseWindow(m_display, m_window); - XSetInputFocus(m_display, m_window, RevertToPointerRoot, CurrentTime); + // Ensure WM hints exist + XWMHints* hints = XGetWMHints(m_display, m_window); + if (hints == NULL) + { + hints = XAllocWMHints(); + } + else + { + // Add Urgency Hint flag (visual notification) + hints->flags |= XUrgencyHint; + XSetWMHints(m_display, m_window, hints); + XFree(hints); + } }