Skip to content

Commit

Permalink
Display preview on click when using TOGGLE-SHOWPREVIEW
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesg99 committed Aug 13, 2019
1 parent 6d20184 commit 4e1bf58
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions appIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,8 @@ var taskbarAppIcon = Utils.defineClass({
}

let appCount = this.getAppIconInterestingWindows().length;
if (!(buttonAction == "TOGGLE-SHOWPREVIEW") || (appCount <= 1))
this._previewMenu.close(true);
let previewedAppIcon = this._previewMenu.getCurrentAppIcon();
this._previewMenu.close();

// We check if the app is running, and that the # of windows is > 0 in
// case we use workspace isolation,
Expand Down Expand Up @@ -791,10 +791,7 @@ var taskbarAppIcon = Utils.defineClass({
if (appHasFocus || button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK) {
// minimize all windows on double click and always in the case of primary click without
// additional modifiers
let click_count = 0;
if (Clutter.EventType.CLUTTER_BUTTON_PRESS)
click_count = event.get_click_count();
let all_windows = (button == 1 && ! modifiers) || click_count > 1;
let all_windows = (button == 1 && ! modifiers) || event.get_click_count() > 1;
minimizeWindow(this.app, all_windows, this._dtpSettings, monitor);
}
else
Expand Down Expand Up @@ -834,14 +831,15 @@ var taskbarAppIcon = Utils.defineClass({
else
activateFirstWindow(this.app, this._dtpSettings, monitor);
} else {
// minimize all windows if double clicked
if (Clutter.EventType.CLUTTER_BUTTON_PRESS) {
let click_count = event.get_click_count();
if(click_count > 1) {
minimizeWindow(this.app, true, this._dtpSettings, monitor);
}
if (event.get_click_count() > 1) {
// minimize all windows if double clicked
minimizeWindow(this.app, true, this._dtpSettings, monitor);
} else if (previewedAppIcon != this) {
this._previewMenu.open(this);
}
}

this.emit('sync-tooltip');
}
}
else
this.app.activate();
Expand Down

0 comments on commit 4e1bf58

Please sign in to comment.