mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +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);
|
||||
}
|
||||
if (reallyMoved) {
|
||||
_mouseActive = true;
|
||||
lastGlobalPosition = e->globalPos();
|
||||
if (!buttonsPressed || (_scrollDateLink && ClickHandler::getPressed() == _scrollDateLink)) {
|
||||
keepScrollDateForNow();
|
||||
|
@ -1623,6 +1624,7 @@ void HistoryInner::mousePressEvent(QMouseEvent *e) {
|
|||
e->accept();
|
||||
return; // ignore mouse press, that was hiding context menu
|
||||
}
|
||||
_mouseActive = true;
|
||||
mouseActionStart(e->globalPos(), e->button());
|
||||
}
|
||||
|
||||
|
@ -3526,6 +3528,7 @@ void HistoryInner::setShownPinned(HistoryItem *item) {
|
|||
}
|
||||
|
||||
void HistoryInner::enterEventHook(QEnterEvent *e) {
|
||||
_mouseActive = true;
|
||||
mouseActionUpdate(QCursor::pos());
|
||||
return TWidget::enterEventHook(e);
|
||||
}
|
||||
|
@ -3542,6 +3545,7 @@ void HistoryInner::leaveEventHook(QEvent *e) {
|
|||
_cursor = style::cur_default;
|
||||
setCursor(_cursor);
|
||||
}
|
||||
_mouseActive = false;
|
||||
return TWidget::leaveEventHook(e);
|
||||
}
|
||||
|
||||
|
@ -3892,7 +3896,7 @@ auto HistoryInner::reactionButtonParameters(
|
|||
}
|
||||
|
||||
void HistoryInner::mouseActionUpdate() {
|
||||
if (hasPendingResizedItems()) {
|
||||
if (hasPendingResizedItems() || !_mouseActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -499,6 +499,7 @@ private:
|
|||
HistoryItem *_dragStateItem = nullptr;
|
||||
CursorState _mouseCursorState = CursorState();
|
||||
uint16 _mouseTextSymbol = 0;
|
||||
bool _mouseActive = false;
|
||||
bool _dragStateUserpic = false;
|
||||
bool _pressWasInactive = false;
|
||||
bool _recountedAfterPendingResizedItems = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue