qt-csd-demo
qt-csd-demo copied to clipboard
csd not working if window is nested compositor
So I experimented a bit further and tried to make the minimal-qml example use this kind of CSD. If the window is part of a WaylandCompositor window.startSystemResize(e) never has any effect. Should it?
import QtQuick 2.12
import QtQuick.Window 2.12
import QtWayland.Compositor 1.13
WaylandCompositor {
// The output defines the screen.
WaylandOutput {
sizeFollowsWindow: true
window: Window {
id: window
width: 1024
height: 768
visible: true
Repeater {
model: shellSurfaces
// ShellSurfaceItem handles displaying a shell surface.
// It has implementations for things like interactive
// resize/move, and forwarding of mouse and keyboard
// events to the client process.
ShellSurfaceItem {
autoCreatePopupItems: true
shellSurface: modelData
onSurfaceDestroyed: shellSurfaces.remove(index)
}
}
flags: Qt.FramelessWindowHint
Rectangle
{
id:rect
z: 2000000000
anchors.fill: parent
color: "transparent"
border.color: "black"
border.width: window.visibility === Window.Windowed ? 10 : 0
visible: true
DragHandler
{
id: resizeHandler
grabPermissions: TapHandler.TakeOverForbidden
target: null
onActiveChanged:
{
if (active)
{
const p = resizeHandler.centroid.position;
let e = 0;
if (p.x / window.width < 0.10) { e |= Qt.LeftEdge}
if (p.x / window.width > 0.90) { e |= Qt.RightEdge}
if (p.y / window.width < 0.10) { e |= Qt.TopEdge}
if (p.y / window.width > 0.90) { e |= Qt.BottomEdge}
console.log("RESIZING", e);
window.startSystemResize(e);
}
}
}
}
}
}
// Extensions are additions to the core Wayland
// protocol. We choose to support three different
// shells (window management protocols). When the
// client creates a new shell surface (i.e. a window)
// we append it to our list of shellSurfaces.
WlShell {
onWlShellSurfaceCreated:
shellSurfaces.append({shellSurface: shellSurface});
}
XdgShellV6 {
onToplevelCreated:
shellSurfaces.append({shellSurface: xdgSurface});
}
XdgShell {
onToplevelCreated:
shellSurfaces.append({shellSurface: xdgSurface});
}
ListModel { id: shellSurfaces }
}
This is when you try to move the window of the compositor? Is it still an issue for you?