diff --git a/libs/wxutil/FreezePointer.cpp b/libs/wxutil/FreezePointer.cpp index f16ac98b04..b4273865ed 100644 --- a/libs/wxutil/FreezePointer.cpp +++ b/libs/wxutil/FreezePointer.cpp @@ -28,7 +28,7 @@ void FreezePointer::startCapture(wxWindow* window, if (_hidePointer) { - topLevel->SetCursor(wxCursor(wxCURSOR_BLANK)); + window->SetCursor(wxCursor(wxCURSOR_BLANK)); } // We capture the mouse on the toplevel app, coordinates @@ -92,7 +92,7 @@ void FreezePointer::endCapture() if (_hidePointer) { - topLevel->SetCursor(wxCursor(wxCURSOR_DEFAULT)); + window->SetCursor(wxCursor(wxCURSOR_DEFAULT)); } if (topLevel->HasCapture()) diff --git a/radiant/RadiantApp.cpp b/radiant/RadiantApp.cpp index a26c7aca19..4b63d43181 100644 --- a/radiant/RadiantApp.cpp +++ b/radiant/RadiantApp.cpp @@ -89,7 +89,15 @@ class RadiantApp::ArtProvider final: public wxArtProvider }; RadiantApp::RadiantApp() -{} +{ +#if defined(__linux__) + // The native Wayland backend for GTK does not implement the mouse pointer + // warping functions used in the FreezePointer class. Forcing the backend + // to X11 will let us run using XWayland which does provide emulation of + // this functionality. + setenv("GDK_BACKEND", "x11", 0); +#endif +} RadiantApp::~RadiantApp() {} diff --git a/radiant/xyview/OrthoView.cpp b/radiant/xyview/OrthoView.cpp index b261bfda4d..ab53f4b76e 100644 --- a/radiant/xyview/OrthoView.cpp +++ b/radiant/xyview/OrthoView.cpp @@ -423,6 +423,9 @@ bool OrthoView::checkChaseMouse(unsigned int state) void OrthoView::setCursorType(CursorType type) { + if (_freezePointer.isCapturing(_wxGLWidget)) + return; + switch (type) { case CursorType::Pointer: