mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't update mouse in non-active window.
This commit is contained in:
parent
4cab699b04
commit
7ac849ab12
2 changed files with 6 additions and 1 deletions
|
@ -1577,6 +1577,7 @@ void HistoryInner::mouseMoveEvent(QMouseEvent *e) {
|
||||||
mouseReleaseEvent(e);
|
mouseReleaseEvent(e);
|
||||||
}
|
}
|
||||||
if (reallyMoved) {
|
if (reallyMoved) {
|
||||||
|
_mouseActive = true;
|
||||||
lastGlobalPosition = e->globalPos();
|
lastGlobalPosition = e->globalPos();
|
||||||
if (!buttonsPressed || (_scrollDateLink && ClickHandler::getPressed() == _scrollDateLink)) {
|
if (!buttonsPressed || (_scrollDateLink && ClickHandler::getPressed() == _scrollDateLink)) {
|
||||||
keepScrollDateForNow();
|
keepScrollDateForNow();
|
||||||
|
@ -1623,6 +1624,7 @@ void HistoryInner::mousePressEvent(QMouseEvent *e) {
|
||||||
e->accept();
|
e->accept();
|
||||||
return; // ignore mouse press, that was hiding context menu
|
return; // ignore mouse press, that was hiding context menu
|
||||||
}
|
}
|
||||||
|
_mouseActive = true;
|
||||||
mouseActionStart(e->globalPos(), e->button());
|
mouseActionStart(e->globalPos(), e->button());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3526,6 +3528,7 @@ void HistoryInner::setShownPinned(HistoryItem *item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInner::enterEventHook(QEnterEvent *e) {
|
void HistoryInner::enterEventHook(QEnterEvent *e) {
|
||||||
|
_mouseActive = true;
|
||||||
mouseActionUpdate(QCursor::pos());
|
mouseActionUpdate(QCursor::pos());
|
||||||
return TWidget::enterEventHook(e);
|
return TWidget::enterEventHook(e);
|
||||||
}
|
}
|
||||||
|
@ -3542,6 +3545,7 @@ void HistoryInner::leaveEventHook(QEvent *e) {
|
||||||
_cursor = style::cur_default;
|
_cursor = style::cur_default;
|
||||||
setCursor(_cursor);
|
setCursor(_cursor);
|
||||||
}
|
}
|
||||||
|
_mouseActive = false;
|
||||||
return TWidget::leaveEventHook(e);
|
return TWidget::leaveEventHook(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3892,7 +3896,7 @@ auto HistoryInner::reactionButtonParameters(
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInner::mouseActionUpdate() {
|
void HistoryInner::mouseActionUpdate() {
|
||||||
if (hasPendingResizedItems()) {
|
if (hasPendingResizedItems() || !_mouseActive) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -499,6 +499,7 @@ private:
|
||||||
HistoryItem *_dragStateItem = nullptr;
|
HistoryItem *_dragStateItem = nullptr;
|
||||||
CursorState _mouseCursorState = CursorState();
|
CursorState _mouseCursorState = CursorState();
|
||||||
uint16 _mouseTextSymbol = 0;
|
uint16 _mouseTextSymbol = 0;
|
||||||
|
bool _mouseActive = false;
|
||||||
bool _dragStateUserpic = false;
|
bool _dragStateUserpic = false;
|
||||||
bool _pressWasInactive = false;
|
bool _pressWasInactive = false;
|
||||||
bool _recountedAfterPendingResizedItems = false;
|
bool _recountedAfterPendingResizedItems = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue