Commit 2d674d8b authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎮 Committed by Aleix Pol Gonzalez
Browse files

pointerlockerqt: fix Lock button not reappearing after unlocking the pointer

parent d41558d5
Pipeline #73406 passed with stage
in 4 minutes and 7 seconds
......@@ -33,9 +33,10 @@ PointerLockerQt::~PointerLockerQt() = default;
void PointerLockerQt::setLocked(bool lock)
{
if (isLocked() == lock) {
if (m_isLocked == lock) {
return;
}
m_isLocked = lock;
if (lock) {
/* Cursor needs to be hidden such that Xwayland emulates warps. */
......@@ -54,7 +55,7 @@ void PointerLockerQt::setLocked(bool lock)
bool PointerLockerQt::isLocked() const
{
return !m_originalPosition.isNull();
return m_isLocked;
}
bool PointerLockerQt::eventFilter(QObject *watched, QEvent *event)
......
......@@ -57,7 +57,7 @@ private:
bool eventFilter(QObject *watched, QEvent *event) override;
QPoint m_originalPosition;
bool m_moving = false;
bool m_isLocked = false;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment