1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
diff --git a/extensions/dock/extension.js b/extensions/dock/extension.js
index 8af0d3e..faa71d8 100644
--- a/extensions/dock/extension.js
+++ b/extensions/dock/extension.js
@@ -25,7 +25,7 @@ const AltTab = imports.ui.altTab;
const Gettext = imports.gettext.domain('gnome-shell-extensions');
const _ = Gettext.gettext;
-const DOCKICON_SIZE = 48;
+const DOCKICON_SIZE = 30;
const DND_RAISE_APP_TIMEOUT = 500;
function Dock() {
@@ -91,6 +91,7 @@ Dock.prototype = {
let icons = 0;
let nFavorites = 0;
+
for (let id in favorites) {
let app = favorites[id];
let display = new DockIcon(app);
@@ -120,7 +121,8 @@ Dock.prototype = {
let primary = global.get_primary_monitor();
let height = (icons)*(this._item_size + this._spacing) + 2*this._spacing;
this.actor.set_size(this._item_size + 4*this._spacing, height);
- this.actor.set_position(primary.width-this._item_size-this._spacing-2, (primary.height-height)/2);
+// this.actor.set_position(primary.width-this._item_size-this._spacing-2, (primary.height-height)/2);
+ this.actor.set_position(-this._spacing-2, (primary.height-height)/2);
},
_getPreferredWidth: function (grid, forHeight, alloc) {
@@ -235,6 +237,7 @@ DockIcon.prototype = {
this._has_focus = false;
else
this._has_focus = true;
+
return false;
},
@@ -289,6 +292,7 @@ DockIcon.prototype = {
this._removeMenuTimeout();
this.actor.fake_release();
+
if (!this._menu) {
this._menu = new DockIconMenu(this);
this._menu.connect('activate-window', Lang.bind(this, function (menu, window) {
@@ -302,7 +306,11 @@ DockIcon.prototype = {
this._menuManager.addMenu(this._menu, true);
}
- this._menu.popup();
+ if (!this._menu.isOpen) {
+ this._menu.popup();
+ } else {
+ this._menu.close(true);
+ }
return false;
},
@@ -343,13 +351,14 @@ DockIcon.prototype = {
let focusedApp = tracker.focus_app;
if (this.app == focusedApp) {
- let windows = this.app.get_windows();
+ this.popupMenu();
+/* let windows = this.app.get_windows();
let current_workspace = global.screen.get_active_workspace();
for (let i = 0; i < windows.length; i++) {
let w = windows[i];
if (w.get_workspace() == current_workspace)
w.minimize();
- }
+ }*/
} else {
this.app.activate(-1);
}
@@ -371,7 +380,7 @@ DockIconMenu.prototype = {
__proto__: AppDisplay.AppIconMenu.prototype,
_init: function(source) {
- PopupMenu.PopupMenu.prototype._init.call(this, source.actor, St.Align.MIDDLE, St.Side.RIGHT, 0);
+ PopupMenu.PopupMenu.prototype._init.call(this, source.actor, St.Align.MIDDLE, St.Side.LEFT, 0);
this._source = source;
@@ -400,6 +409,10 @@ DockIconMenu.prototype = {
let activeWorkspace = global.screen.get_active_workspace();
let separatorShown = windows.length > 0 && windows[0].get_workspace() != activeWorkspace;
+ this._newWindowMenuItem = windows.length > 0 ? this._appendMenuItem(_("New Window")) : null;
+ this._launchAppItem = windows.length == 0 ? this._appendMenuItem(_("Launch Application")) : null;
+ this._appendSeparator();
+
for (let i = 0; i < windows.length; i++) {
if (!separatorShown && windows[i].get_workspace() != activeWorkspace) {
this._appendSeparator();
@@ -414,15 +427,14 @@ DockIconMenu.prototype = {
let isFavorite = AppFavorites.getAppFavorites().isFavorite(this._source.app.get_id());
- this._newWindowMenuItem = windows.length > 0 ? this._appendMenuItem(_("New Window")) : null;
- this._quitAppMenuItem = windows.length >0 ? this._appendMenuItem(_("Quit Application")) : null;
+/* this._quitAppMenuItem = windows.length >0 ? this._appendMenuItem(_("Quit Application")) : null;
if (windows.length > 0)
this._appendSeparator();
this._toggleFavoriteMenuItem = this._appendMenuItem(isFavorite ?
_("Remove from Favorites")
- : _("Add to Favorites"));
+ : _("Add to Favorites"));*/
this._highlightedItem = null;
},
@@ -431,6 +443,8 @@ DockIconMenu.prototype = {
if (child._window) {
let metaWindow = child._window;
this.emit('activate-window', metaWindow);
+ } else if (child == this._launchAppItem) {
+ this._source.app.activate(-1);
} else if (child == this._newWindowMenuItem) {
let current_workspace = global.screen.get_active_workspace().index();
this._source.app.open_new_window(current_workspace);
|