[gnome-shell-extensions] window-list: Restrict right-click actions to windows in list
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] window-list: Restrict right-click actions to windows in list
- Date: Tue, 11 Feb 2014 17:00:09 +0000 (UTC)
commit 9c6c00f8a3b2979f3c28619b3f4afe4e64738a5c
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 7 22:49:41 2014 +0100
window-list: Restrict right-click actions to windows in list
While the list of windows in the left-click menu is filtered by
workspace, the minimize/maximize/close actions in the right-click
menu apply to all application windows on all workspaces.
This is fairly confusing, so restrict the actions to only apply
to windows that do appear in the left-click list.
https://bugzilla.gnome.org/show_bug.cgi?id=724134
extensions/window-list/extension.js | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index fed1915..a0c9dd4 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -271,7 +271,7 @@ const AppContextMenu = new Lang.Class({
this._minimizeItem = new PopupMenu.PopupMenuItem(_("Minimize all"));
this._minimizeItem.connect('activate', Lang.bind(this, function() {
- this._app.get_windows().forEach(function(w) {
+ this._getWindowList().forEach(function(w) {
w.minimize();
});
}));
@@ -279,7 +279,7 @@ const AppContextMenu = new Lang.Class({
this._unminimizeItem = new PopupMenu.PopupMenuItem(_("Unminimize all"));
this._unminimizeItem.connect('activate', Lang.bind(this, function() {
- this._app.get_windows().forEach(function(w) {
+ this._getWindowList().forEach(function(w) {
w.unminimize();
});
}));
@@ -287,7 +287,7 @@ const AppContextMenu = new Lang.Class({
this._maximizeItem = new PopupMenu.PopupMenuItem(_("Maximize all"));
this._maximizeItem.connect('activate', Lang.bind(this, function() {
- this._app.get_windows().forEach(function(w) {
+ this._getWindowList().forEach(function(w) {
w.maximize(Meta.MaximizeFlags.HORIZONTAL |
Meta.MaximizeFlags.VERTICAL);
});
@@ -296,7 +296,7 @@ const AppContextMenu = new Lang.Class({
this._unmaximizeItem = new PopupMenu.PopupMenuItem(_("Unmaximize all"));
this._unmaximizeItem.connect('activate', Lang.bind(this, function() {
- this._app.get_windows().forEach(function(w) {
+ this._getWindowList().forEach(function(w) {
w.unmaximize(Meta.MaximizeFlags.HORIZONTAL |
Meta.MaximizeFlags.VERTICAL);
});
@@ -305,15 +305,22 @@ const AppContextMenu = new Lang.Class({
let item = new PopupMenu.PopupMenuItem(_("Close all"));
item.connect('activate', Lang.bind(this, function() {
- this._app.get_windows().forEach(function(w) {
+ this._getWindowList().forEach(function(w) {
w.delete(global.get_current_time());
});
}));
this.addMenuItem(item);
},
+ _getWindowList: function() {
+ let workspace = global.screen.get_active_workspace();
+ return this._app.get_windows().filter(function(win) {
+ return win.located_on_workspace(workspace);
+ });
+ },
+
open: function(animate) {
- let windows = this._app.get_windows();
+ let windows = this._getWindowList();
this._minimizeItem.actor.visible = windows.some(function(w) {
return !w.minimized;
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]