fix mouse chasing in 2x2 & floating layouts

QTimer was getting new connections added w/o removing existing ones; fix the same in FreezePointer
zero check is seemingly not needed now; zeros spam was caused by this QTimer misuse
This commit is contained in:
Garux
2024-01-09 04:12:08 +06:00
parent 2d11fdee43
commit 27dff0c888
2 changed files with 6 additions and 6 deletions

View File

@@ -159,6 +159,7 @@ protected:
// handle runaways with released buttons; FIXME: need more elegant way to persistently grab in this case
if( !m_widget->rect().contains( mouseEvent->pos() ) ){ // bomb cursor via timer to get it back to the widget
if( !m_rescueTimer.isActive() ){
m_rescueTimer.disconnect(); // disconnect everything
m_rescueTimer.callOnTimeout( [center = center](){ QCursor::setPos( center ); } );
m_rescueTimer.start( 33 );
}