Merge branch 'Plasma/5.10'

remotes/origin/mart/foreign
Martin Flöser 9 years ago
commit 8e2805ce9d
  1. 50
      autotests/integration/quick_tiling_test.cpp
  2. 4
      geometry.cpp
  3. 3
      plugins/kdecorations/aurorae/src/aurorae.cpp
  4. 2
      plugins/kdecorations/aurorae/src/qml/Decoration.qml
  5. 9
      plugins/platforms/x11/standalone/x11_platform.cpp

@ -117,20 +117,21 @@ void QuickTilingTest::testQuickTiling_data()
QTest::addColumn<AbstractClient::QuickTileMode>("mode");
QTest::addColumn<QRect>("expectedGeometry");
QTest::addColumn<QRect>("secondScreen");
QTest::addColumn<AbstractClient::QuickTileMode>("expectedModeAfterToggle");
#define FLAG(name) AbstractClient::QuickTileMode(AbstractClient::QuickTile##name)
QTest::newRow("left") << FLAG(Left) << QRect(0, 0, 640, 1024) << QRect(1280, 0, 640, 1024);
QTest::newRow("top") << FLAG(Top) << QRect(0, 0, 1280, 512) << QRect(1280, 0, 1280, 512);
QTest::newRow("right") << FLAG(Right) << QRect(640, 0, 640, 1024) << QRect(1920, 0, 640, 1024);
QTest::newRow("bottom") << FLAG(Bottom) << QRect(0, 512, 1280, 512) << QRect(1280, 512, 1280, 512);
QTest::newRow("left") << FLAG(Left) << QRect(0, 0, 640, 1024) << QRect(1280, 0, 640, 1024) << FLAG(Right);
QTest::newRow("top") << FLAG(Top) << QRect(0, 0, 1280, 512) << QRect(1280, 0, 1280, 512) << FLAG(Top);
QTest::newRow("right") << FLAG(Right) << QRect(640, 0, 640, 1024) << QRect(1920, 0, 640, 1024) << AbstractClient::QuickTileMode();
QTest::newRow("bottom") << FLAG(Bottom) << QRect(0, 512, 1280, 512) << QRect(1280, 512, 1280, 512) << FLAG(Bottom);
QTest::newRow("top left") << (FLAG(Left) | FLAG(Top)) << QRect(0, 0, 640, 512) << QRect(1280, 0, 640, 512);
QTest::newRow("top right") << (FLAG(Right) | FLAG(Top)) << QRect(640, 0, 640, 512) << QRect(1920, 0, 640, 512);
QTest::newRow("bottom left") << (FLAG(Left) | FLAG(Bottom)) << QRect(0, 512, 640, 512) << QRect(1280, 512, 640, 512);
QTest::newRow("bottom right") << (FLAG(Right) | FLAG(Bottom)) << QRect(640, 512, 640, 512) << QRect(1920, 512, 640, 512);
QTest::newRow("top left") << (FLAG(Left) | FLAG(Top)) << QRect(0, 0, 640, 512) << QRect(1280, 0, 640, 512) << (FLAG(Right) | FLAG(Top));
QTest::newRow("top right") << (FLAG(Right) | FLAG(Top)) << QRect(640, 0, 640, 512) << QRect(1920, 0, 640, 512) << AbstractClient::QuickTileMode();
QTest::newRow("bottom left") << (FLAG(Left) | FLAG(Bottom)) << QRect(0, 512, 640, 512) << QRect(1280, 512, 640, 512) << (FLAG(Right) | FLAG(Bottom));
QTest::newRow("bottom right") << (FLAG(Right) | FLAG(Bottom)) << QRect(640, 512, 640, 512) << QRect(1920, 512, 640, 512) << AbstractClient::QuickTileMode();
QTest::newRow("maximize") << FLAG(Maximize) << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024);
QTest::newRow("maximize") << FLAG(Maximize) << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024) << AbstractClient::QuickTileMode();
#undef FLAG
}
@ -188,6 +189,10 @@ void QuickTilingTest::testQuickTiling()
// quick tile should not be changed
QCOMPARE(c->quickTileMode(), mode);
QTEST(c->geometry(), "secondScreen");
// now try to toggle again
c->setQuickTileMode(mode, true);
QTEST(c->quickTileMode(), "expectedModeAfterToggle");
}
void QuickTilingTest::testQuickMaximizing_data()
@ -426,20 +431,22 @@ void QuickTilingTest::testX11QuickTiling_data()
{
QTest::addColumn<AbstractClient::QuickTileMode>("mode");
QTest::addColumn<QRect>("expectedGeometry");
QTest::addColumn<int>("screen");
QTest::addColumn<AbstractClient::QuickTileMode>("modeAfterToggle");
#define FLAG(name) AbstractClient::QuickTileMode(AbstractClient::QuickTile##name)
QTest::newRow("left") << FLAG(Left) << QRect(0, 0, 640, 1024);
QTest::newRow("top") << FLAG(Top) << QRect(0, 0, 1280, 512);
QTest::newRow("right") << FLAG(Right) << QRect(640, 0, 640, 1024);
QTest::newRow("bottom") << FLAG(Bottom) << QRect(0, 512, 1280, 512);
QTest::newRow("left") << FLAG(Left) << QRect(0, 0, 640, 1024) << 0 << AbstractClient::QuickTileMode();
QTest::newRow("top") << FLAG(Top) << QRect(0, 0, 1280, 512) << 1 << FLAG(Top);
QTest::newRow("right") << FLAG(Right) << QRect(640, 0, 640, 1024) << 1 << FLAG(Left);
QTest::newRow("bottom") << FLAG(Bottom) << QRect(0, 512, 1280, 512) << 1 << FLAG(Bottom);
QTest::newRow("top left") << (FLAG(Left) | FLAG(Top)) << QRect(0, 0, 640, 512);
QTest::newRow("top right") << (FLAG(Right) | FLAG(Top)) << QRect(640, 0, 640, 512);
QTest::newRow("bottom left") << (FLAG(Left) | FLAG(Bottom)) << QRect(0, 512, 640, 512);
QTest::newRow("bottom right") << (FLAG(Right) | FLAG(Bottom)) << QRect(640, 512, 640, 512);
QTest::newRow("top left") << (FLAG(Left) | FLAG(Top)) << QRect(0, 0, 640, 512) << 0 << AbstractClient::QuickTileMode();
QTest::newRow("top right") << (FLAG(Right) | FLAG(Top)) << QRect(640, 0, 640, 512) << 1 << (FLAG(Left) | FLAG(Top));
QTest::newRow("bottom left") << (FLAG(Left) | FLAG(Bottom)) << QRect(0, 512, 640, 512) << 0 << AbstractClient::QuickTileMode();
QTest::newRow("bottom right") << (FLAG(Right) | FLAG(Bottom)) << QRect(640, 512, 640, 512) << 1 << (FLAG(Left) | FLAG(Bottom));
QTest::newRow("maximize") << FLAG(Maximize) << QRect(0, 0, 1280, 1024);
QTest::newRow("maximize") << FLAG(Maximize) << QRect(0, 0, 1280, 1024) << 0 << AbstractClient::QuickTileMode();
#undef FLAG
}
@ -483,6 +490,13 @@ void QuickTilingTest::testX11QuickTiling()
QEXPECT_FAIL("maximize", "For maximize we get two changed signals", Continue);
QCOMPARE(quickTileChangedSpy.count(), 1);
// quick tile to same edge again should also act like send to screen
QCOMPARE(client->screen(), 0);
client->setQuickTileMode(mode, true);
QTEST(client->screen(), "screen");
QTEST(client->quickTileMode(), "modeAfterToggle");
QCOMPARE(client->geometryRestore(), origGeo);
// and destroy the window again
xcb_unmap_window(c.data(), w);
xcb_destroy_window(c.data(), w);

@ -3407,7 +3407,9 @@ void AbstractClient::setQuickTileMode(QuickTileMode mode, bool keyboard)
whichScreen = screens[nextScreen].center();
// Swap sides
mode = ~mode & QuickTileHorizontal;
if (mode & QuickTileHorizontal) {
mode = (~mode & QuickTileHorizontal) | (mode & QuickTileVertical);
}
}
setElectricBorderMode(mode); // used by ::electricBorderMaximizeGeometry(.)
} else if (quickTileMode() == QuickTileNone) {

@ -339,6 +339,7 @@ void Decoration::init()
m_renderControl = new QQuickRenderControl(this);
m_view = new QQuickWindow(m_renderControl);
m_view->setColor(Qt::transparent);
m_view->setFlags(Qt::FramelessWindowHint);
// delay rendering a little bit for better performance
m_updateTimer.reset(new QTimer);
@ -404,6 +405,7 @@ void Decoration::init()
connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, updateExtendedBorders);
}
connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection);
connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateBorders);
updateBorders();
if (!m_view.isNull()) {
auto resizeWindow = [this] {
@ -417,6 +419,7 @@ void Decoration::init()
connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow);
resizeWindow();
} else {
// create a dummy shadow for the configuration interface

@ -32,5 +32,5 @@ Item {
}
property bool alpha: true
width: decoration.client.width + decoration.borderLeft + decoration.borderRight + (decoration.client.maximized ? 0 : (padding.left + padding.right))
height: decoration.client.height + decoration.borderTop + decoration.borderBottom + (decoration.client.maximized ? 0 : (padding.top + padding.bottom))
height: (decoration.client.shaded ? 0 : decoration.client.height) + decoration.borderTop + (decoration.client.shaded ? 0 : decoration.borderBottom) + (decoration.client.maximized ? 0 : (padding.top + padding.bottom))
}

@ -63,7 +63,14 @@ X11StandalonePlatform::X11StandalonePlatform(QObject *parent)
#endif
}
X11StandalonePlatform::~X11StandalonePlatform() = default;
X11StandalonePlatform::~X11StandalonePlatform()
{
if (m_openGLFreezeProtectionThread) {
m_openGLFreezeProtectionThread->quit();
m_openGLFreezeProtectionThread->wait();
delete m_openGLFreezeProtectionThread;
}
}
void X11StandalonePlatform::init()
{

Loading…
Cancel
Save