viewSelector: Bind <Ctrl>+<Return> for open new window

https://bugzilla.gnome.org/show_bug.cgi?id=613082
This commit is contained in:
Maxim Ermilov 2011-07-16 23:27:05 +04:00
parent 8d5d4159a3
commit 203dedfb3a
2 changed files with 21 additions and 7 deletions

View File

@ -327,8 +327,16 @@ BaseAppSearchProvider.prototype = {
params = Params.parse(params, { workspace: null,
timestamp: null });
let workspace = params.workspace ? params.workspace.index() : -1;
let event = Clutter.get_current_event();
let modifiers = event ? Shell.get_event_state(event) : 0;
let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
let app = this._appSys.get_app(id);
app.activate(params.workspace ? params.workspace.index() : -1);
if (openNewWindow)
app.open_new_window(workspace);
else
app.activate(workspace);
},
dragActivateResult: function(id, params) {

View File

@ -141,13 +141,19 @@ SearchTab.prototype = {
'edit-find');
this._text.connect('text-changed', Lang.bind(this, this._onTextChanged));
this._text.connect('activate', Lang.bind(this, function (se) {
if (this._searchTimeoutId > 0) {
Mainloop.source_remove(this._searchTimeoutId);
this._doSearch();
this._text.connect('key-press-event', Lang.bind(this, function (o, e) {
// We can't connect to 'activate' here because search providers
// might want to do something with the modifiers in activateSelected.
let symbol = e.get_key_symbol();
if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
if (this._searchTimeoutId > 0) {
Mainloop.source_remove(this._searchTimeoutId);
this._doSearch();
}
this._searchResults.activateSelected();
return true;
}
this._searchResults.activateSelected();
return true;
return false;
}));
this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));