Float as a KWin-managed window instead of a layer surface
The grab bar didn't move the window by mouse, and the corner grip never resized it (the bar's handler took over its drag). The bar and grip now start the window manager's move/resize, and Super+LMB/RMB work too. A KWin rule in kwinrulesrc keeps the window above and unfocused, off the taskbar, pager and switcher, and remembers its position. KWin now places the window and keeps it on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-10
@@ -1,11 +1,11 @@
|
||||
import QtQuick
|
||||
|
||||
// The grab bar under the floating keyboard. Emits how far it was dragged;
|
||||
// moving the window is up to the owner.
|
||||
// The grab bar under the floating keyboard. Moving the window is up to the
|
||||
// owner (the window manager's move, so it works for mouse and touch alike).
|
||||
Item {
|
||||
id: handle
|
||||
|
||||
signal moved(real dx, real dy)
|
||||
signal dragStarted()
|
||||
|
||||
implicitHeight: 22
|
||||
|
||||
@@ -19,12 +19,6 @@ Item {
|
||||
|
||||
DragHandler {
|
||||
target: null
|
||||
// The window follows the pointer, so the pointer stays near its press
|
||||
// position in window coordinates: measure each step from there.
|
||||
onCentroidChanged: {
|
||||
if (active)
|
||||
handle.moved(centroid.scenePosition.x - centroid.scenePressPosition.x,
|
||||
centroid.scenePosition.y - centroid.scenePressPosition.y)
|
||||
}
|
||||
onActiveChanged: if (active) handle.dragStarted()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user