Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions autotests/integration/offscreenquickview_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,9 @@ void OffscreenQuickViewTest::testOpacity()
view.setOpacity(opacity);
QCOMPARE(view.opacity(), opacity);
QCOMPARE(item->opacity(), opacity);
// The fork's Plasma/6.8 fix propagates the opacity to the QWindow as well,
// while master's fix (upstream ff26dc46b3) deliberately leaves the platform
// window untouched because QWindow::setOpacity() noops here. Pin whichever
// behavior this build implements, so both branches stay covered.
if (view.window()->opacity() == opacity) {
QCOMPARE(view.window()->opacity(), opacity);
} else {
QCOMPARE(view.window()->opacity(), 1.0);
}
// The opacity is the item's, as in upstream's own fix (ff26dc46b3). The view's QWindow is
// left untouched: it has no platform window, so a value set there is stored and never used.
QCOMPARE(view.window()->opacity(), 1.0);
QVERIFY(view.isVisible());
QVERIFY(item->isVisible());
}
Expand All @@ -174,6 +168,9 @@ void OffscreenQuickViewTest::testResynchronizeOpacity()
QVERIFY(item);
view.setOpacity(0.5);
view.window()->setOpacity(0.25);
// A value written to the QWindow does not become the view's opacity.
QCOMPARE(view.opacity(), 0.5);
QCOMPARE(item->opacity(), 0.5);
view.setOpacity(0.25);
QCOMPARE(item->opacity(), 0.25);
QCOMPARE(view.opacity(), 0.25);
Expand Down
41 changes: 27 additions & 14 deletions autotests/integration/tiles_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,29 @@
*/
#include "kwin_wayland_test.h"

#include "atoms.h"
#include "core/output.h"
#include "pointer_input.h"
#include "rules.h"
#include "tiles/tilemanager.h"
#include "tiles/transientplacementwriter.h"
#include "tiles/transienttilecontroller.h"
#include "utils/gravity.h"
#include "wayland_server.h"
#include "window.h"
#include "workspace.h"
#include "xdgshellwindow.h"

#if KWIN_BUILD_X11
// The fork's includes, in blocks of their own between upstream's: a line of ours inside one
// of upstream's blocks is a merge conflict with every edit beside it.
#include "atoms.h"
#include "rules.h"
#include "tiles/transientplacementwriter.h"
#include "tiles/transienttilecontroller.h"
#include "utils/gravity.h"
#include "xdgshellwindow.h"
#if KWIN_BUILD_X11 // the fork's X11 rows
#include "utils/xcbutils.h"
#include "x11window.h"
#include <KDecoration3/DecoratedWindow>
#include <KDecoration3/Decoration>
#include <netwm.h>
#include <xcb/xcb_icccm.h>
#endif

#include <KConfigGroup>
#include <KDecoration3/DecoratedWindow>
#include <KDecoration3/Decoration>
#include <KSharedConfig>
#include <QAbstractItemModelTester>
#include <QChildEvent>
#include <QPointer>

Expand All @@ -42,6 +39,14 @@
#include <type_traits>
#include <utility>

#if KWIN_BUILD_X11
#include "x11window.h"
#include <netwm.h>
#include <xcb/xcb_icccm.h>
#endif

#include <QAbstractItemModelTester>

Q_DECLARE_METATYPE(KWin::QuickTileMode)
Q_DECLARE_METATYPE(KWin::MaximizeMode)

Expand Down Expand Up @@ -182,6 +187,7 @@ private Q_SLOTS:
void transientPublicMutations_data();
void transientPublicMutations();
void transientRefusesDirectManagement();
void rootTileIsNotTransient();
void compatibilityAssignmentRefusal_data();
void compatibilityAssignmentRefusal();
void compatibilityAssignmentAcrossDesktops_data();
Expand Down Expand Up @@ -270,7 +276,6 @@ void TilesTest::init()
m_output = workspace()->activeOutput();
m_tileManager = workspace()->tileManager(m_output);
m_rootTile = workspace()->rootTile(m_output);
QVERIFY(!m_rootTile->isTransient());
QAbstractItemModelTester(m_tileManager->model(), QAbstractItemModelTester::FailureReportingMode::QtTest);

VirtualDesktopManager::self()->setCount(3);
Expand Down Expand Up @@ -437,6 +442,14 @@ void TilesTest::transientRefusesDirectManagement()
QVERIFY(silent);
}

void TilesTest::rootTileIsNotTransient()
{
// The fixture every row starts from: init() leaves an ordinary root tile. A test of its
// own, so that upstream's init() stays as upstream has it.
QVERIFY(m_rootTile);
QVERIFY(!m_rootTile->isTransient());
}

void TilesTest::compatibilityAssignmentRefusal_data()
{
QTest::addColumn<bool>("propertyWrite");
Expand Down
5 changes: 2 additions & 3 deletions src/effect/offscreenquickview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,12 @@ Rect OffscreenQuickView::geometry() const

void OffscreenQuickView::setOpacity(qreal opacity)
{
d->m_view->setOpacity(opacity);
d->m_item->setOpacity(d->m_view->opacity());
d->m_item->setOpacity(opacity);
}

qreal OffscreenQuickView::opacity() const
{
return d->m_view->opacity();
return d->m_item->opacity();
}

bool OffscreenQuickView::hasAlphaChannel() const
Expand Down
14 changes: 11 additions & 3 deletions src/tiles/tilemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,24 @@

class QTimer;

// The transient tiling's types, declared in a namespace block of the fork's own: a line of
// ours among upstream's declarations below is a merge conflict with every edit beside it.
namespace KWin
{

class LogicalOutput;
class Tile;
class TileModel;
class TransientTile;
class TransientTileController;
class Workspace;

}

namespace KWin
{

class LogicalOutput;
class Tile;
class TileModel;

/**
* Custom tiling zones management per output.
*/
Expand Down