kwin/src/layershellv1integration.h
Vlad Zahorodnii a489bfa12c wayland: Fix windows shrinking when output layout changes
When the output layout changes, the Workspace is going to update the
struts and then go through every window and see whether it should be
moved or resized.

On the other hand, the layer shell windows react to output changes on
a timer. Furthermore, it's not synchronized with the workspace rearranging
the managed windows. It means that when Workspace::desktopResized() runs,
the panel struts can be slightly outdated, i.e.

- An output layout change occurs
- Workspace::desktopResized() is called but the struts can be wrong
- some time later, LayerShellV1Integration::rearrange is called, it
  fixes layer shell window geometries and struts
- after the layer shell integration has finished rearranging the
  layer shell windows, it calls Workspace::desktopResized(), but the
  damage had already been caused

With the proposed change, the Workspace and the LayerShellV1Integration
will rearrange the windows in sync.

CCBUG: 482361
2024-03-07 13:41:01 +02:00

30 lines
620 B
C++

/*
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "waylandshellintegration.h"
namespace KWin
{
class LayerSurfaceV1Interface;
class LayerShellV1Integration : public WaylandShellIntegration
{
Q_OBJECT
public:
explicit LayerShellV1Integration(QObject *parent = nullptr);
void rearrange();
void createWindow(LayerSurfaceV1Interface *shellSurface);
void recreateWindow(LayerSurfaceV1Interface *shellSurface);
void destroyWindow(LayerSurfaceV1Interface *shellSurface);
};
} // namespace KWin