Cleamnup code for #2020 and use internal pointer for current tracking window

This commit is contained in:
2023-12-16 12:39:10 +01:00
parent 141bec0259
commit c0ef2a1f58
3 changed files with 15 additions and 29 deletions
+4 -2
View File
@@ -40,6 +40,7 @@ extern X11::Atom xAtomWmName;
extern Dictionary<StringAnsi, X11::KeyCode> KeyNameMap;
extern Array<KeyboardKeys> KeyCodeMap;
extern X11::Cursor Cursors[(int32)CursorType::MAX];
extern Window* MouseTrackingWindow;
static constexpr uint32 MouseDoubleClickTime = 500;
static constexpr uint32 MaxDoubleClickDistanceSquared = 10;
@@ -822,12 +823,13 @@ void LinuxWindow::SetTitle(const StringView& title)
void LinuxWindow::StartTrackingMouse(bool useMouseScreenOffset)
{
LinuxPlatform::StartTrackingMouse(this);
MouseTrackingWindow = this;
}
void LinuxWindow::EndTrackingMouse()
{
LinuxPlatform::EndTrackingMouse(this);
if (MouseTrackingWindow == this)
MouseTrackingWindow = nullptr;
}
void LinuxWindow::SetCursor(CursorType type)