qt-csd-demo icon indicating copy to clipboard operation
qt-csd-demo copied to clipboard

csd not working if window is nested compositor

Open damianatorrpm opened this issue 6 years ago • 1 comments

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 }
}

damianatorrpm avatar Jun 23 '19 18:06 damianatorrpm

This is when you try to move the window of the compositor? Is it still an issue for you?

johanhelsing avatar Apr 09 '20 17:04 johanhelsing