on xenial help sign in
don't show the menu popup at all when dragging window
e3f079bLukáš Tinkl
qml/ApplicationMenus/MenuBar.qml+24−5
@@ -28,6 +28,7 @@ Item {
28 property alias unityMenuModel: rowRepeater.model
28 property alias unityMenuModel: rowRepeater.model
29 property bool enableKeyFilter: false
29 property bool enableKeyFilter: false
30 property real overflowWidth: width
30 property real overflowWidth: width
31+ property bool windowMoving: false
31
32
32 // read from outside
33 // read from outside
33 readonly property bool valid: rowRepeater.count > 0
34 readonly property bool valid: rowRepeater.count > 0
@@ -44,6 +45,12 @@ Item {
44 d.dismissAll();
45 d.dismissAll();
45 }
46 }
46
47
48+ onWindowMovingChanged: {
49+ if (windowMoving) {
50+ dismiss();
51+ }
52+ }
53+
47 GlobalShortcut {
54 GlobalShortcut {
48 shortcut: Qt.Key_Alt|Qt.AltModifier
55 shortcut: Qt.Key_Alt|Qt.AltModifier
49 active: enableKeyFilter
56 active: enableKeyFilter
@@ -217,9 +224,23 @@ Item {
217 } // Row
224 } // Row
218
225
219 MouseArea {
226 MouseArea {
227+ id: mouseArea
220 anchors.fill: row
228 anchors.fill: row
221 hoverEnabled: d.currentItem
229 hoverEnabled: d.currentItem
222
230
231+ Timer {
232+ id: delayedPopupTimer
233+ interval: 100
234+ onTriggered: {
235+ if (root.windowMoving) return;
236+ var prevItem = d.currentItem;
237+ mouseArea.updateCurrentItemFromPosition(Qt.point(mouseArea.mouseX, mouseArea.mouseY));
238+ if (prevItem && d.currentItem == prevItem) {
239+ prevItem.hide();
240+ }
241+ }
242+ }
243+
223 onEntered: {
244 onEntered: {
224 if (d.currentItem) {
245 if (d.currentItem) {
225 updateCurrentItemFromPosition(Qt.point(mouseX, mouseY))
246 updateCurrentItemFromPosition(Qt.point(mouseX, mouseY))
@@ -229,13 +250,11 @@ Item {
229 if (d.currentItem) {
250 if (d.currentItem) {
230 updateCurrentItemFromPosition(Qt.point(mouse.x, mouse.y))
251 updateCurrentItemFromPosition(Qt.point(mouse.x, mouse.y))
231 }
252 }
232− mouse.accepted = false;
233 }
253 }
254+
234 onPressed: {
255 onPressed: {
235− var prevItem = d.currentItem;
256+ if (containsPress && !root.windowMoving) {
236− updateCurrentItemFromPosition(Qt.point(mouse.x, mouse.y))
257+ delayedPopupTimer.start();
237− if (prevItem && d.currentItem == prevItem) {
238− prevItem.hide();
239 }
258 }
240 mouse.accepted = false;
259 mouse.accepted = false;
241 }
260 }
qml/Stage/DecoratedWindow.qml+1−1
@@ -204,6 +204,7 @@ FocusScope {
204 height: units.gu(3)
204 height: units.gu(3)
205
205
206 title: applicationWindow.title
206 title: applicationWindow.title
207+ windowMoving: moveHandler.moving
207
208
208 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
209 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
209 Behavior on opacity { UbuntuNumberAnimation { } }
210 Behavior on opacity { UbuntuNumberAnimation { } }
@@ -225,7 +226,6 @@ FocusScope {
225 enableMenus: {
226 enableMenus: {
226 return active &&
227 return active &&
227 surface &&
228 surface &&
228− !moveHandler.moving &&
229 (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
229 (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
230 }
230 }
231 menu: sharedAppModel.model
231 menu: sharedAppModel.model
qml/Stage/WindowDecoration.qml+2
@@ -33,6 +33,7 @@ MouseArea {
33 property alias overlayShown: buttons.overlayShown
33 property alias overlayShown: buttons.overlayShown
34 property var menu: undefined
34 property var menu: undefined
35 property bool enableMenus: true
35 property bool enableMenus: true
36+ property bool windowMoving: false
36
37
37 readonly property real buttonsWidth: buttons.width + row.spacing
38 readonly property real buttonsWidth: buttons.width + row.spacing
38
39
@@ -142,6 +143,7 @@ MouseArea {
142 height: menuBarLoader.height
143 height: menuBarLoader.height
143 enableKeyFilter: valid && root.active && root.enableMenus
144 enableKeyFilter: valid && root.active && root.enableMenus
144 unityMenuModel: root.menu
145 unityMenuModel: root.menu
146+ windowMoving: root.windowMoving
145 }
147 }
146
148
147 opacity: !overlayShown && priv.shouldShowMenus ? 1 : 0
149 opacity: !overlayShown && priv.shouldShowMenus ? 1 : 0