Skip to content

Commit 31f5673

Browse files
committed
fix: use Qt::UniqueConnection to avoid duplicate signal connections
Prevent slotWorkAreaResized from being called multiple times when resizeByCurrentScreen is invoked repeatedly. Log: 使用UniqueConnection避免重复信号连接 Influence: 防止slotWorkAreaResized被多次调用
1 parent 3051c63 commit 31f5673

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3519,7 +3519,7 @@ void QuakeWindow::resizeByCurrentScreen(bool force)
35193519
setFixedWidth(windowWidth);
35203520
setMinimumHeight(60);
35213521
setMaximumHeight(cursorScreen->geometry().height() * 2 / 3);
3522-
connect(cursorScreen, &QScreen::availableGeometryChanged, this, &QuakeWindow::slotWorkAreaResized);
3522+
connect(cursorScreen, &QScreen::availableGeometryChanged, this, &QuakeWindow::slotWorkAreaResized, Qt::UniqueConnection);
35233523
}
35243524
}
35253525

0 commit comments

Comments
 (0)