mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 10:44:46 +00:00
use EventGenerator in order to not eat half events
This commit is contained in:
parent
5a9aa3c440
commit
565dbc963c
1 changed files with 8 additions and 0 deletions
|
|
@ -39,6 +39,10 @@ MouseEventListener {
|
||||||
property int oldMouseX
|
property int oldMouseX
|
||||||
property int oldMouseY
|
property int oldMouseY
|
||||||
|
|
||||||
|
EventGenerator {
|
||||||
|
id: eventGenerator
|
||||||
|
}
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
id: removeAnim
|
id: removeAnim
|
||||||
property Item target
|
property Item target
|
||||||
|
|
@ -68,6 +72,10 @@ MouseEventListener {
|
||||||
var pos = mapToItem(appletsLayout, mouse.x, mouse.y);
|
var pos = mapToItem(appletsLayout, mouse.x, mouse.y);
|
||||||
draggingApplet = appletsSpace.layout.childAt(pos.x, pos.y);
|
draggingApplet = appletsSpace.layout.childAt(pos.x, pos.y);
|
||||||
|
|
||||||
|
eventGenerator.sendGrabEvent(draggingApplet, EventGenerator.UngrabMouse);
|
||||||
|
eventGenerator.sendGrabEvent(headerItem, EventGenerator.GrabMouse);
|
||||||
|
eventGenerator.sendMouseEvent(headerItem, EventGenerator.MouseButtonPress, mouse.x, mouse.y, Qt.LeftButton, Qt.LeftButton, 0)
|
||||||
|
|
||||||
if (draggingApplet) {
|
if (draggingApplet) {
|
||||||
draggingApplet.animationsEnabled = false;
|
draggingApplet.animationsEnabled = false;
|
||||||
dndSpacer.height = draggingApplet.height;
|
dndSpacer.height = draggingApplet.height;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue