Revert "appDisplay: Special case terminal launching"

Having terminal launchers behave differently than any other launchers
is non-obvious and confusing. Remove the special-casing to restore
consistency, we will make the new window action more accessible
instead.
This reverts commit 68faba6bde, 4ed0f3e5f0
and 887a21afb9.

https://bugzilla.gnome.org/show_bug.cgi?id=695010
This commit is contained in:
Florian Müllner 2014-02-11 15:40:47 +01:00
parent 793c6c2f7b
commit 812a61939e

View File

@ -46,21 +46,6 @@ const INDICATORS_ANIMATION_MAX_TIME = 0.75;
const PAGE_SWITCH_TRESHOLD = 0.2; const PAGE_SWITCH_TRESHOLD = 0.2;
const PAGE_SWITCH_TIME = 0.3; const PAGE_SWITCH_TIME = 0.3;
function _getCategories(info) {
let categoriesStr = info.get_categories();
if (!categoriesStr)
return [];
return categoriesStr.split(';');
}
function _isTerminal(app) {
let info = app.get_app_info();
if (!info)
return false;
let categories = _getCategories(info);
return categories.indexOf('TerminalEmulator') > -1;
}
function _listsIntersect(a, b) { function _listsIntersect(a, b) {
for (let itemA of a) for (let itemA of a)
if (b.indexOf(itemA) >= 0) if (b.indexOf(itemA) >= 0)
@ -888,7 +873,7 @@ const AppSearchProvider = new Lang.Class({
let app = this._appSys.lookup_app(result); let app = this._appSys.lookup_app(result);
let event = Clutter.get_current_event(); let event = Clutter.get_current_event();
let modifiers = event ? event.get_state() : 0; let modifiers = event ? event.get_state() : 0;
let openNewWindow = (modifiers & Clutter.ModifierType.CONTROL_MASK) || _isTerminal(app); let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
if (openNewWindow) if (openNewWindow)
app.open_new_window(-1); app.open_new_window(-1);
@ -1466,9 +1451,8 @@ const AppIcon = new Lang.Class({
_onActivate: function (event) { _onActivate: function (event) {
let modifiers = event.get_state(); let modifiers = event.get_state();
if ((modifiers & Clutter.ModifierType.CONTROL_MASK if (modifiers & Clutter.ModifierType.CONTROL_MASK
&& this.app.state == Shell.AppState.RUNNING) && this.app.state == Shell.AppState.RUNNING) {
|| _isTerminal(this.app)) {
this.app.open_new_window(-1); this.app.open_new_window(-1);
} else { } else {
this.app.activate(); this.app.activate();