Disable initial mouse capture on XWayland
This commit is contained in:
parent
dd2df6cbcf
commit
7283bb046b
1 changed files with 13 additions and 2 deletions
|
|
@ -1140,11 +1140,22 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER
|
// HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER
|
||||||
// event where it seems to work consistently on GNOME.
|
// event where it seems to work consistently on GNOME. This doesn't work for
|
||||||
|
// XWayland though.
|
||||||
if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0) {
|
if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0) {
|
||||||
m_InputHandler->setCaptureActive(true);
|
// We know we aren't running on native Wayland now, but
|
||||||
|
// we still may be running on XWayland.
|
||||||
|
if (!WMUtils::isRunningWayland()) {
|
||||||
|
// Neither Wayland or XWayland: capture now
|
||||||
|
m_InputHandler->setCaptureActive(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// XWayland: mouse capture doesn't work reliably, so let the user
|
||||||
|
// engage the mouse capture via clicking or using the hotkey.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// Native Wayland: Capture on SDL_WINDOWEVENT_ENTER
|
||||||
needsFirstEnterCapture = true;
|
needsFirstEnterCapture = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue