mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-15 00:34:05 +09:00
Merge pull request #350 from moqmar/master
Fix touchscreen behaviour for taskbarAppIcon (#223)
This commit is contained in:
21
appIcons.js
21
appIcons.js
@@ -103,6 +103,27 @@ var taskbarAppIcon = new Lang.Class({
|
||||
this.window = appInfo.window;
|
||||
this.isLauncher = appInfo.isLauncher;
|
||||
|
||||
// Fix touchscreen issues before the listener is added by the parent constructor.
|
||||
this._onTouchEvent = function(actor, event) {
|
||||
if (event.type() == Clutter.EventType.TOUCH_BEGIN) {
|
||||
// Open the popup menu on long press.
|
||||
this._setPopupTimeout();
|
||||
} else if (this._menuTimeoutId != 0 && (event.type() == Clutter.EventType.TOUCH_END || event.type() == Clutter.EventType.TOUCH_CANCEL)) {
|
||||
// Activate/launch the application.
|
||||
this.activate(1);
|
||||
this._removeMenuTimeout();
|
||||
}
|
||||
// Disable dragging via touch screen as it's buggy as hell. Not perfect for tablet users, but the alternative is way worse.
|
||||
// Also, EVENT_PROPAGATE launches applications twice with this solution, so this.activate(1) above must only be called if there's already a window.
|
||||
return Clutter.EVENT_STOP;
|
||||
};
|
||||
// Hack for missing TOUCH_END event.
|
||||
this._onLeaveEvent = function(actor, event) {
|
||||
this.actor.fake_release();
|
||||
if (this._menuTimeoutId != 0) this.activate(1); // Activate/launch the application if TOUCH_END didn't fire.
|
||||
this._removeMenuTimeout();
|
||||
};
|
||||
|
||||
this.parent(appInfo.app, iconParams, onActivateOverride);
|
||||
|
||||
this._dot.set_width(0);
|
||||
|
||||
Reference in New Issue
Block a user