Drag and drop a toplevel window using Quickshell makes Hyprland crash #13324
|
systeminfo.txt Quickshell scriptsWorkspaceOverviewWidget.qmlpragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Hyprland
import QtQuick
import QtQuick.Layouts
Scope {
id: root
property HyprlandMonitor focusedMonitor: Hyprland.focusedMonitor
property real spacing: 8
property real columns: 5
property real rows: 2
property real contentWidth: (focusedMonitor?.width / focusedMonitor?.scale) / 1.5
property real tileWidth: (contentWidth - spacing * (columns + 1)) / columns
property real tileHeight: tileWidth * 9 / 16
PanelWindow {
id: overviewWindow
color: "transparent"
implicitWidth: root.contentWidth
implicitHeight: root.tileHeight * root.rows + root.spacing * (root.rows + 1)
// mask: Region { item: Rectangle {anchors.fill: parent} }
Rectangle {
id: overviewWindowRect
color: "grey"
anchors.fill: parent
radius: 20
GridLayout {
id: overviewLayout
anchors.fill: parent
anchors.margins: root.spacing
columns: root.columns
rows: root.rows
rowSpacing: 8
columnSpacing: 8
Repeater {
model: root.rows * root.columns
WorkspaceView {
parentWindow: overviewWindowRect
implicitWidth: root.tileWidth
implicitHeight: root.tileHeight
DropArea {
anchors.fill: parent
onDropped: function(drag) {
var address = drag.source.address
Hyprland.dispatch(
"movetoworkspacesilent " +
(index + 1) +
", address:" +
address
)
Hyprland.refreshWorkspaces()
Hyprland.refreshMonitors()
Hyprland.refreshToplevels()
}
}
}
}
}
}
}
}WorkspaceView.qmlpragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Hyprland
import QtQuick
import Quickshell.Wayland
import Quickshell.Widgets
ClippingRectangle {
visible: true
id: root
required property int index
required property Item parentWindow
property HyprlandWorkspace wsp: Hyprland.workspaces.values.find(s => s.id == (index + 1)) || null
property real scaleFactor: (wsp?.monitor) ? ((wsp.monitor.width / wsp.monitor.scale) / implicitWidth) : -1
color: "transparent"
border {
width: 2
color: "black"
}
radius: 20
Connections {
target: (root.wsp) ? root.wsp?.toplevels : null
function onObjectInsertedPost() { Hyprland.refreshToplevels() }
function onObjectRemovedPre() { Hyprland.refreshToplevels() }
function onObjectRemovedPost() { Hyprland.refreshToplevels() }
function onObjectInsertedPre() {Hyprland.refreshToplevels() }
}
Text {
color: "pink"
text: root.index + 1
anchors.centerIn: parent
}
Repeater {
model: (root.wsp) ? root.wsp.toplevels : []
ScreencopyView {
id: scView
required property HyprlandToplevel modelData
property string address: modelData.lastIpcObject.address ? modelData.lastIpcObject.address : null
captureSource: modelData.wayland
live: true
x: (modelData.lastIpcObject.at && root.wsp?.monitor) ? ((modelData.lastIpcObject.at[0] - root.wsp.monitor.x) / root.scaleFactor) : 0
y: (modelData.lastIpcObject.at && root.wsp?.monitor) ? ((modelData.lastIpcObject.at[1] - root.wsp.monitor.y) / root.scaleFactor) : 0
width: (modelData.lastIpcObject.size && root.wsp) ? ((modelData.lastIpcObject.size[0]) / root.scaleFactor) : 0
height: (modelData.lastIpcObject.size && root.wsp) ? ((modelData.lastIpcObject.size[1]) / root.scaleFactor) : 0
Component.onCompleted: Hyprland.refreshToplevels()
DragHandler {
id: dragHandler
target: scView
onActiveChanged: {
if (!active) {
target.Drag.drop()
}
}
}
Drag.active: dragHandler.active
Drag.source: scView
Drag.supportedActions: Qt.MoveAction
Drag.hotSpot.x: width / 2
Drag.hotSpot.y: height / 2
states: [
State {
when: dragHandler.active
ParentChange {
target: scView
parent: root.parentWindow
}
}
]
}
}
}Reproduce
I haven't bisected yet, but my suspicion is the new Layout commit. I don't think this is Quickshell's fault — I don't have any problems with 5b6c42ca70c3fbc0986760c2d0be8ab7c8b833b9 |
Answered by
Dregu
Feb 22, 2026
Replies: 1 comment 1 reply
|
I believe this boils down to moving a window from a scrolling workspace that's invisible, qs indeed has nothing to do with it. Can repro with |
1 reply
Answer selected by
myamusashi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe this boils down to moving a window from a scrolling workspace that's invisible, qs indeed has nothing to do with it. Can repro with
hyprctl dispatch movetoworkspacesilent 1,address:0xbeefcake"when 0xbeefcake is on a scrolling inactive workspace.