Filter the events received by windows (only allow those matching a specific window or those needed for the IM to work) NOLINTNEXTLINE(readability-non-const-parameter)
| 97 | // Filter the events received by windows (only allow those matching a specific window or those needed for the IM to work) |
| 98 | // NOLINTNEXTLINE(readability-non-const-parameter) |
| 99 | Bool checkEvent(::Display*, XEvent* event, XPointer userData) |
| 100 | { |
| 101 | if (event->xany.window == reinterpret_cast<::Window>(userData) || event->type == GenericEvent) |
| 102 | { |
| 103 | // The event matches the current window so pick it up |
| 104 | return true; |
| 105 | } |
| 106 | if (event->type == ClientMessage) |
| 107 | { |
| 108 | // The input method sometimes sends ClientMessage with a different window ID. |
| 109 | // Our event loop has to process them for the IM to work. |
| 110 | // We assume ClientMessage events not having WM_PROTOCOLS message type are such events. |
| 111 | // ClientMessage events having WM_PROTOCOLS message type should be handled by their own window, |
| 112 | // so we ignore them here. They will eventually be picked up with the first condition. |
| 113 | static const Atom wmProtocols = sf::priv::getAtom("WM_PROTOCOLS"); |
| 114 | return event->xclient.message_type != wmProtocols; |
| 115 | } |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | // Find the name of the current executable |
| 120 | std::filesystem::path findExecutableName() |