Drop duplicate clientMaximizedStateChanged signal

This commit is contained in:
Vlad Zahorodnii 2023-02-18 13:16:42 +02:00
parent 7f4071c7d4
commit 88c974835c
9 changed files with 14 additions and 26 deletions

View file

@ -114,7 +114,7 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows()
QVERIFY(window->readyForPainting());
// simulate click on maximize button
QSignalSpy maximizedStateChangedSpy(window, static_cast<void (Window::*)(KWin::Window *, MaximizeMode)>(&Window::clientMaximizedStateChanged));
QSignalSpy maximizedStateChangedSpy(window, &Window::clientMaximizedStateChanged);
quint32 timestamp = 1;
Test::pointerMotion(window->frameGeometry().topLeft() + scenePoint.toPoint(), timestamp++);
Test::pointerButtonPressed(BTN_LEFT, timestamp++);

View file

@ -128,7 +128,7 @@ void MaximizeAnimationTest::testMaximizeRestore()
// Maximize the window.
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QSignalSpy maximizeChangedSpy(window, qOverload<Window *, bool, bool>(&Window::clientMaximizedStateChanged));
QSignalSpy maximizeChangedSpy(window, &Window::clientMaximizedStateChanged);
workspace()->slotWindowMaximize();
QVERIFY(surfaceConfigureRequestedSpy.wait());

View file

@ -240,8 +240,7 @@ void QuickTilingTest::testQuickMaximizing()
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QSignalSpy maximizeChangedSpy1(window, qOverload<Window *, MaximizeMode>(&Window::clientMaximizedStateChanged));
QSignalSpy maximizeChangedSpy2(window, qOverload<Window *, bool, bool>(&Window::clientMaximizedStateChanged));
QSignalSpy maximizeChangedSpy(window, &Window::clientMaximizedStateChanged);
window->setQuickTileMode(QuickTileFlag::Maximize, true);
QCOMPARE(quickTileChangedSpy.count(), 1);
@ -267,13 +266,9 @@ void QuickTilingTest::testQuickMaximizing()
QCOMPARE(window->geometryRestore(), QRect(0, 0, 100, 50));
// window is now set to maximised
QCOMPARE(maximizeChangedSpy1.count(), 1);
QCOMPARE(maximizeChangedSpy1.first().first().value<KWin::Window *>(), window);
QCOMPARE(maximizeChangedSpy1.first().last().value<KWin::MaximizeMode>(), MaximizeFull);
QCOMPARE(maximizeChangedSpy2.count(), 1);
QCOMPARE(maximizeChangedSpy2.first().first().value<KWin::Window *>(), window);
QCOMPARE(maximizeChangedSpy2.first().at(1).toBool(), true);
QCOMPARE(maximizeChangedSpy2.first().at(2).toBool(), true);
QCOMPARE(maximizeChangedSpy.count(), 1);
QCOMPARE(maximizeChangedSpy.first().first().value<KWin::Window *>(), window);
QCOMPARE(maximizeChangedSpy.first().last().value<KWin::MaximizeMode>(), MaximizeFull);
QCOMPARE(window->maximizeMode(), MaximizeFull);
// go back to quick tile none
@ -297,13 +292,9 @@ void QuickTilingTest::testQuickMaximizing()
QCOMPARE(frameGeometryChangedSpy.count(), 2);
QCOMPARE(window->frameGeometry(), QRect(0, 0, 100, 50));
QCOMPARE(window->geometryRestore(), QRect(0, 0, 100, 50));
QCOMPARE(maximizeChangedSpy1.count(), 2);
QCOMPARE(maximizeChangedSpy1.last().first().value<KWin::Window *>(), window);
QCOMPARE(maximizeChangedSpy1.last().last().value<KWin::MaximizeMode>(), MaximizeRestore);
QCOMPARE(maximizeChangedSpy2.count(), 2);
QCOMPARE(maximizeChangedSpy2.last().first().value<KWin::Window *>(), window);
QCOMPARE(maximizeChangedSpy2.last().at(1).toBool(), false);
QCOMPARE(maximizeChangedSpy2.last().at(2).toBool(), false);
QCOMPARE(maximizeChangedSpy.count(), 2);
QCOMPARE(maximizeChangedSpy.last().first().value<KWin::Window *>(), window);
QCOMPARE(maximizeChangedSpy.last().last().value<KWin::MaximizeMode>(), MaximizeRestore);
}
void QuickTilingTest::testQuickTilingKeyboardMove_data()

View file

@ -290,7 +290,7 @@ void EffectsHandlerImpl::unloadAllEffects()
void EffectsHandlerImpl::setupWindowConnections(Window *window)
{
connect(window, &Window::windowClosed, this, &EffectsHandlerImpl::slotWindowClosed);
connect(window, static_cast<void (Window::*)(KWin::Window *, MaximizeMode)>(&Window::clientMaximizedStateChanged),
connect(window, &Window::clientMaximizedStateChanged,
this, &EffectsHandlerImpl::slotClientMaximized);
connect(window, static_cast<void (Window::*)(KWin::Window *, MaximizeMode)>(&Window::clientMaximizedStateAboutToChange),
this, [this](KWin::Window *window, MaximizeMode m) {

View file

@ -39,7 +39,7 @@ void PlacementTracker::add(Window *window)
return;
}
connect(window, &Window::frameGeometryChanged, this, &PlacementTracker::saveGeometry);
connect(window, qOverload<Window *, MaximizeMode>(&Window::clientMaximizedStateChanged), this, &PlacementTracker::saveMaximize);
connect(window, &Window::clientMaximizedStateChanged, this, &PlacementTracker::saveMaximize);
connect(window, &Window::quickTileModeChanged, this, &PlacementTracker::saveQuickTile);
connect(window, &Window::fullScreenChanged, this, &PlacementTracker::saveFullscreen);
connect(window, &Window::clientFinishUserMovedResized, this, &PlacementTracker::saveInteractionCounter);
@ -52,7 +52,7 @@ void PlacementTracker::remove(Window *window)
{
if (m_savedWindows.contains(window)) {
disconnect(window, &Window::frameGeometryChanged, this, &PlacementTracker::saveGeometry);
disconnect(window, qOverload<Window *, MaximizeMode>(&Window::clientMaximizedStateChanged), this, &PlacementTracker::saveMaximize);
disconnect(window, &Window::clientMaximizedStateChanged, this, &PlacementTracker::saveMaximize);
disconnect(window, &Window::quickTileModeChanged, this, &PlacementTracker::saveQuickTile);
disconnect(window, &Window::fullScreenChanged, this, &PlacementTracker::saveFullscreen);
disconnect(window, &Window::clientFinishUserMovedResized, this, &PlacementTracker::saveInteractionCounter);

View file

@ -99,7 +99,7 @@ Window::Window()
connect(this, &Window::clientFinishUserMovedResized, this, [this]() {
m_keyboardGeometryRestore = QRectF();
});
connect(this, qOverload<Window *, bool, bool>(&Window::clientMaximizedStateChanged), this, [this]() {
connect(this, &Window::clientMaximizedStateChanged, this, [this]() {
m_keyboardGeometryRestore = QRectF();
});
connect(this, &Window::fullScreenChanged, this, [this]() {
@ -2223,7 +2223,7 @@ void Window::setupWindowManagementInterface()
connect(this, &Window::minimizedChanged, w, [w, this] {
w->setMinimized(isMinimized());
});
connect(this, static_cast<void (Window::*)(Window *, MaximizeMode)>(&Window::clientMaximizedStateChanged), w, [w](KWin::Window *c, MaximizeMode mode) {
connect(this, &Window::clientMaximizedStateChanged, w, [w](KWin::Window *c, MaximizeMode mode) {
w->setMaximized(mode == KWin::MaximizeFull);
});
connect(this, &Window::demandsAttentionChanged, w, [w, this] {

View file

@ -1522,7 +1522,6 @@ Q_SIGNALS:
void captionChanged();
void clientMaximizedStateAboutToChange(KWin::Window *, MaximizeMode);
void clientMaximizedStateChanged(KWin::Window *, MaximizeMode);
void clientMaximizedStateChanged(KWin::Window *c, bool h, bool v);
void transientChanged();
void modalChanged();
void quickTileModeChanged();

View file

@ -4538,7 +4538,6 @@ void X11Window::maximize(MaximizeMode mode)
if (max_mode != old_mode) {
Q_EMIT clientMaximizedStateChanged(this, max_mode);
Q_EMIT clientMaximizedStateChanged(this, max_mode & MaximizeHorizontal, max_mode & MaximizeVertical);
}
}

View file

@ -1425,7 +1425,6 @@ void XdgToplevelWindow::updateMaximizeMode(MaximizeMode maximizeMode)
m_maximizeMode = maximizeMode;
updateWindowRules(Rules::MaximizeVert | Rules::MaximizeHoriz);
Q_EMIT clientMaximizedStateChanged(this, maximizeMode);
Q_EMIT clientMaximizedStateChanged(this, maximizeMode & MaximizeHorizontal, maximizeMode & MaximizeVertical);
}
void XdgToplevelWindow::updateFullScreenMode(bool set)