From 1416ff0994c685f967fceff8dca90f71c3286b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 25 Sep 2014 12:49:18 +0200 Subject: [PATCH] Fix VirtualDesktopGrid::size for one desktop The default was set that the grid size for one desktop is (1, 2) which doesn't make any sense at all - it should be (1, 1). This most likely only affects the unit test as in production the default layout is taken fron NETRootInfo. --- autotests/test_virtual_desktops.cpp | 2 +- virtualdesktops.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autotests/test_virtual_desktops.cpp b/autotests/test_virtual_desktops.cpp index ad70d4e759..277a0c853f 100644 --- a/autotests/test_virtual_desktops.cpp +++ b/autotests/test_virtual_desktops.cpp @@ -496,7 +496,7 @@ void TestVirtualDesktops::updateLayout_data() QTest::addColumn("desktop"); QTest::addColumn("result"); - QTest::newRow("01") << (uint)1 << QSize(1, 2); + QTest::newRow("01") << (uint)1 << QSize(1, 1); QTest::newRow("02") << (uint)2 << QSize(1, 2); QTest::newRow("03") << (uint)3 << QSize(2, 2); QTest::newRow("04") << (uint)4 << QSize(2, 2); diff --git a/virtualdesktops.cpp b/virtualdesktops.cpp index 7055c0fb4e..36ae63a6b6 100644 --- a/virtualdesktops.cpp +++ b/virtualdesktops.cpp @@ -305,7 +305,7 @@ void VirtualDesktopManager::updateLayout() } if (width == 0 && height == 0) { // Not given, set default layout - height = 2; + height = count() == 1u ? 1 : 2; } setNETDesktopLayout(orientation, width, height, 0 //rootInfo->desktopLayoutCorner() // Not really worth implementing right now.