Skip to content

Commit 95e0f41

Browse files
authored
qredshift@quintao - Fix applet on 5.4 (#4407)
* qredshift@quintao - Fix applet on 5.4 * Use non-deprecated function for all versions * Keep original order * Do not emit new value when scrollposition hasn't changed
1 parent ea97ced commit 95e0f41

File tree

1 file changed

+6
-9
lines changed
  • qredshift@quintao/files/qredshift@quintao/js

1 file changed

+6
-9
lines changed

qredshift@quintao/files/qredshift@quintao/js/QUtils.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,8 @@ class QPopupSlider extends QPopupItem {
485485

486486
this.emit('drag-begin');
487487
this._dragging = true;
488-
489-
490-
// FIXME: we should only grab the specific device that originated
491-
// the event, but for some weird reason events are still delivered
492-
// outside the slider if using clutter_grab_pointer_for_device
493-
Clutter.grab_pointer(this.slider);
488+
489+
event.get_device().grab(this.slider);
494490
this._signals.connect(this.slider, 'button-release-event', this._endDragging.bind(this));
495491
this._signals.connect(this.slider, 'motion-event', this._motionEvent.bind(this));
496492

@@ -499,12 +495,11 @@ class QPopupSlider extends QPopupItem {
499495
this._moveHandle(absX, absY);
500496
}
501497

502-
_endDragging() {
498+
_endDragging(actor, event) {
503499
if (this._dragging) {
504500
this._signals.disconnect('button-release-event', this.slider);
505501
this._signals.disconnect('motion-event', this.slider);
506-
507-
Clutter.ungrab_pointer();
502+
event.get_device().ungrab(this.slider);
508503
this._dragging = false;
509504

510505
this.emit('drag-end');
@@ -550,6 +545,8 @@ class QPopupSlider extends QPopupItem {
550545
} else if (direction == Clutter.ScrollDirection.UP) {
551546
newvalue += this.STEP;
552547
}
548+
else
549+
return;
553550

554551
// qLOG('LOG', this._signals);
555552

0 commit comments

Comments
 (0)