New upstream version 20200627
Tobias Frost
3 years ago
5 | 5 | |
6 | 6 | all: hidetopbar.zip |
7 | 7 | |
8 | schemas: | |
9 | mkdir ./schemas/ | |
10 | glib-compile-schemas --strict --targetdir=./schemas/ . | |
8 | schemas/gschemas.compiled: | |
9 | glib-compile-schemas --strict ./schemas/ | |
11 | 10 | |
12 | hidetopbar.zip: schemas | |
11 | hidetopbar.zip: schemas/gschemas.compiled | |
13 | 12 | zip hidetopbar.zip -r $(JS_FILES) metadata.json locale/*/*/*.mo schemas |
14 | 13 | |
15 | 14 | clean: |
16 | rm -rf hidetopbar.zip schemas | |
15 | rm -rf hidetopbar.zip schemas/gschemas.compiled |
7 | 7 | Maintained by Thomas Vogt. |
8 | 8 | With contributions by Philip Witte and Mathieu Lutfy. |
9 | 9 | |
10 | Installing from gnome.org: | |
11 | -------------------------- | |
12 | ||
13 | The recommended way of installing Hide Top Bar is via the official builds on | |
14 | [gnome.org/.../hide-top-bar/](https://extensions.gnome.org/extension/545/hide-top-bar/). | |
15 | ||
16 | If you're installing via a Chrome browser, make sure you read the | |
17 | [GNOME Shell integration for Chrome Installation | |
18 | Guide](https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation). | |
19 | ||
10 | 20 | Local installation: |
11 | 21 | ------------------- |
12 | 22 | |
13 | Compile the gsettings schema by running | |
14 | ||
15 | make schemas | |
16 | ||
17 | Install this in your extensions directory | |
18 | ||
19 | ~/.local/share/gnome-shell/extensions/ | |
20 | ||
21 | and restart GNOME Shell. Example: | |
23 | If you insist on installing from source, check out the source code into your local extensions directory, compile by running `make`, install and restart GNOME Shell. Example: | |
22 | 24 | |
23 | 25 | cd ~/.local/share/gnome-shell/extensions/ |
24 | 26 | git clone https://github.com/mlutfy/hidetopbar.git hidetopbar@mathieu.bidon.ca |
25 | 27 | cd hidetopbar@mathieu.bidon.ca |
26 | make schemas | |
28 | make | |
27 | 29 | cd .. |
28 | 30 | gnome-extensions enable hidetopbar@mathieu.bidon.ca |
29 | 31 | gnome-shell --replace & |
30 | 32 | |
31 | 33 | The last commandline restarts GNOME Shell. |
32 | 34 | |
33 | You can also manage extensions from https://extensions.gnome.org/local/ | |
35 | Updating the language strings: | |
36 | ------------------------------ | |
34 | 37 | |
35 | Installing from gnome.org: | |
36 | -------------------------- | |
38 | Whenever you notice that there are localizable strings in Hide Top Bar that are not | |
39 | covered by the strings in `./locale/`, you can regenerate the `*.pot`-file using the | |
40 | following command: | |
37 | 41 | |
38 | You can install the extension directly from | |
39 | [gnome.org/.../hide-top-bar/](https://extensions.gnome.org/extension/545/hide-top-bar/). | |
40 | ||
41 | If you're installing via a Chrome browser, make sure you read the | |
42 | [GNOME Shell integration for Chrome Installation | |
43 | Guide](https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation). | |
42 | xgettext --output=./locale/hidetopbar.pot --language=JavaScript *.js | |
44 | 43 | |
45 | 44 | License: |
46 | 45 | -------- |
47 | 46 | |
48 | Copyright (c) 2013-2017 Thomas Vogt. | |
47 | Copyright (c) 2013-2020 Thomas Vogt. | |
49 | 48 | |
50 | 49 | Copyright (c) 2012-2013 Mathieu Lutfy. |
51 | 50 |
7 | 7 | */ |
8 | 8 | |
9 | 9 | const GLib = imports.gi.GLib; |
10 | const Lang = imports.lang; | |
11 | const Mainloop = imports.mainloop; | |
12 | 10 | const Meta = imports.gi.Meta; |
13 | 11 | const Shell = imports.gi.Shell; |
14 | 12 | |
19 | 17 | const Convenience = Me.imports.convenience; |
20 | 18 | |
21 | 19 | // A good compromise between reactivity and efficiency; to be tuned. |
22 | const INTELLIHIDE_CHECK_INTERVAL = 200; | |
20 | const INTELLIHIDE_CHECK_INTERVAL = 100; | |
23 | 21 | |
24 | 22 | const OverlapStatus = { |
25 | 23 | UNDEFINED: -1, |
36 | 34 | // List of windows type taken into account. Order is important (keep the original |
37 | 35 | // enum order). |
38 | 36 | const handledWindowTypes = [ |
39 | Meta.WindowType.NORMAL, | |
40 | Meta.WindowType.DOCK, | |
41 | Meta.WindowType.DIALOG, | |
42 | Meta.WindowType.MODAL_DIALOG, | |
43 | Meta.WindowType.TOOLBAR, | |
44 | Meta.WindowType.MENU, | |
45 | Meta.WindowType.UTILITY, | |
46 | Meta.WindowType.SPLASHSCREEN | |
37 | Meta.WindowType.NORMAL, | |
38 | Meta.WindowType.DOCK, | |
39 | Meta.WindowType.DIALOG, | |
40 | Meta.WindowType.MODAL_DIALOG, | |
41 | Meta.WindowType.TOOLBAR, | |
42 | Meta.WindowType.MENU, | |
43 | Meta.WindowType.UTILITY, | |
44 | Meta.WindowType.SPLASHSCREEN | |
47 | 45 | ]; |
48 | 46 | |
49 | /* | |
47 | /** | |
50 | 48 | * A rough and ugly implementation of the intellihide behaviour. |
51 | 49 | * Intallihide object: emit 'status-changed' signal when the overlap of windows |
52 | 50 | * with the provided targetBoxClutter.ActorBox changes; |
53 | * | |
54 | */ | |
55 | ||
56 | var intellihide = new Lang.Class({ | |
57 | Name: 'intellihide', | |
58 | ||
59 | _init: function(settings, monitorIndex) { | |
60 | ||
51 | */ | |
52 | var Intellihide = class HideTopBar_Intellihide { | |
53 | ||
54 | constructor(settings, monitorIndex) { | |
61 | 55 | // Load settings |
62 | 56 | this._settings = settings; |
63 | 57 | this._monitorIndex = monitorIndex; |
73 | 67 | |
74 | 68 | this._checkOverlapTimeoutContinue = false; |
75 | 69 | this._checkOverlapTimeoutId = 0; |
76 | ||
77 | let stackingManager; | |
78 | if (global.screen) | |
79 | stackingManager = global.screen; // mutter < 3.29 | |
80 | else | |
81 | stackingManager = global.display; // mutter >= 3.29 | |
82 | ||
83 | let monitorManager; | |
84 | if (global.screen) | |
85 | monitorManager = global.screen; // mutter < 3.29 | |
86 | else | |
87 | monitorManager = Main.layoutManager; // mutter >= 3.29 | |
70 | ||
71 | this._trackedWindows = new Map(); | |
88 | 72 | |
89 | 73 | // Connect global signals |
90 | 74 | this._signalsHandler.add([ |
91 | 75 | // Listen for notification banners to appear or disappear |
92 | Main.messageTray.actor, | |
76 | Main.messageTray, | |
93 | 77 | 'show', |
94 | Lang.bind(this, this._checkOverlap) | |
95 | ], [ | |
96 | Main.messageTray.actor, | |
78 | this._checkOverlap.bind(this) | |
79 | ], [ | |
80 | Main.messageTray, | |
97 | 81 | 'hide', |
98 | Lang.bind(this, this._checkOverlap) | |
82 | this._checkOverlap.bind(this) | |
99 | 83 | ], [ |
100 | 84 | // Add signals on windows created from now on |
101 | 85 | global.display, |
102 | 86 | 'window-created', |
103 | Lang.bind(this, this._windowCreated) | |
87 | this._windowCreated.bind(this) | |
104 | 88 | ], [ |
105 | 89 | // triggered for instance when the window list order changes, |
106 | 90 | // included when the workspace is switched |
107 | stackingManager, | |
91 | global.display, | |
108 | 92 | 'restacked', |
109 | Lang.bind(this, this._checkOverlap) | |
93 | this._checkOverlap.bind(this) | |
110 | 94 | ], [ |
111 | 95 | // when windows are alwasy on top, the focus window can change |
112 | 96 | // without the windows being restacked. Thus monitor window focus change. |
113 | 97 | this._tracker, |
114 | 98 | 'notify::focus-app', |
115 | Lang.bind(this, this._checkOverlap) | |
99 | this._checkOverlap.bind(this) | |
116 | 100 | ], [ |
117 | 101 | // update wne monitor changes, for instance in multimonitor when monitor are attached |
118 | monitorManager, | |
102 | Meta.MonitorManager.get(), | |
119 | 103 | 'monitors-changed', |
120 | Lang.bind(this, this._checkOverlap ) | |
104 | this._checkOverlap.bind(this) | |
121 | 105 | ]); |
122 | }, | |
123 | ||
124 | destroy: function() { | |
106 | } | |
107 | ||
108 | destroy() { | |
125 | 109 | // Disconnect global signals |
126 | 110 | this._signalsHandler.destroy(); |
127 | 111 | |
128 | 112 | // Remove residual windows signals |
129 | 113 | this.disable(); |
130 | }, | |
131 | ||
132 | enable: function() { | |
114 | } | |
115 | ||
116 | enable() { | |
133 | 117 | this._isEnabled = true; |
134 | 118 | this._status = OverlapStatus.UNDEFINED; |
135 | global.get_window_actors().forEach(function(win) { | |
136 | this._addWindowSignals(win.get_meta_window()); | |
119 | global.get_window_actors().forEach(function(wa) { | |
120 | this._addWindowSignals(wa); | |
137 | 121 | }, this); |
138 | 122 | this._doCheckOverlap(); |
139 | }, | |
140 | ||
141 | disable: function() { | |
123 | } | |
124 | ||
125 | disable() { | |
142 | 126 | this._isEnabled = false; |
143 | global.get_window_actors().forEach(function(win) { | |
144 | this._removeWindowSignals(win.get_meta_window()); | |
145 | }, this); | |
127 | ||
128 | for (let wa of this._trackedWindows.keys()) { | |
129 | this._removeWindowSignals(wa); | |
130 | } | |
131 | this._trackedWindows.clear(); | |
146 | 132 | |
147 | 133 | if (this._checkOverlapTimeoutId > 0) { |
148 | Mainloop.source_remove(this._checkOverlapTimeoutId); | |
134 | GLib.source_remove(this._checkOverlapTimeoutId); | |
149 | 135 | this._checkOverlapTimeoutId = 0; |
150 | 136 | } |
151 | }, | |
152 | ||
153 | _windowCreated: function(display, meta_win) { | |
154 | this._addWindowSignals(meta_win); | |
155 | }, | |
156 | ||
157 | _addWindowSignals: function(meta_win) { | |
158 | if (!meta_win || !this._handledWindow(meta_win)) | |
137 | } | |
138 | ||
139 | _windowCreated(display, metaWindow) { | |
140 | this._addWindowSignals(metaWindow.get_compositor_private()); | |
141 | } | |
142 | ||
143 | _addWindowSignals(wa) { | |
144 | if (!this._handledWindow(wa)) | |
159 | 145 | return; |
160 | ||
161 | meta_win.dtd_onPositionChanged = meta_win.connect('position-changed', Lang.bind(this, this._checkOverlap, meta_win)); | |
162 | ||
163 | meta_win.dtd_onSizeChanged = meta_win.connect('size-changed', Lang.bind(this, this._checkOverlap, meta_win)); | |
164 | }, | |
165 | ||
166 | _removeWindowSignals: function(meta_win) { | |
167 | if (meta_win && meta_win.dtd_onSizeChanged) { | |
168 | meta_win.disconnect(meta_win.dtd_onSizeChanged); | |
169 | delete meta_win.dtd_onSizeChanged; | |
170 | } | |
171 | ||
172 | if (meta_win && meta_win.dtd_onPositionChanged) { | |
173 | meta_win.disconnect(meta_win.dtd_onPositionChanged); | |
174 | delete meta_win.dtd_onPositionChanged; | |
175 | } | |
176 | }, | |
177 | ||
178 | updateTargetBox: function(box) { | |
146 | let signalId = wa.connect('allocation-changed', this._checkOverlap.bind(this)); | |
147 | this._trackedWindows.set(wa, signalId); | |
148 | wa.connect('destroy', this._removeWindowSignals.bind(this)); | |
149 | } | |
150 | ||
151 | _removeWindowSignals(wa) { | |
152 | if (this._trackedWindows.get(wa)) { | |
153 | wa.disconnect(this._trackedWindows.get(wa)); | |
154 | this._trackedWindows.delete(wa); | |
155 | } | |
156 | } | |
157 | ||
158 | updateTargetBox(box) { | |
179 | 159 | this._targetBox = box; |
180 | 160 | this._checkOverlap(); |
181 | }, | |
182 | ||
183 | forceUpdate: function() { | |
161 | } | |
162 | ||
163 | forceUpdate() { | |
184 | 164 | this._status = OverlapStatus.UNDEFINED; |
185 | 165 | this._doCheckOverlap(); |
186 | }, | |
187 | ||
188 | getOverlapStatus: function() { | |
166 | } | |
167 | ||
168 | getOverlapStatus() { | |
189 | 169 | return (this._status == OverlapStatus.TRUE); |
190 | }, | |
191 | ||
192 | _checkOverlap: function() { | |
170 | } | |
171 | ||
172 | _checkOverlap() { | |
193 | 173 | if (!this._isEnabled || (this._targetBox == null)) |
194 | 174 | return; |
195 | 175 | |
201 | 181 | |
202 | 182 | this._doCheckOverlap(); |
203 | 183 | |
204 | this._checkOverlapTimeoutId = Mainloop.timeout_add(INTELLIHIDE_CHECK_INTERVAL, Lang.bind(this, function() { | |
184 | this._checkOverlapTimeoutId = GLib.timeout_add( | |
185 | GLib.PRIORITY_DEFAULT, INTELLIHIDE_CHECK_INTERVAL, () => { | |
205 | 186 | this._doCheckOverlap(); |
206 | 187 | if (this._checkOverlapTimeoutContinue) { |
207 | 188 | this._checkOverlapTimeoutContinue = false; |
210 | 191 | this._checkOverlapTimeoutId = 0; |
211 | 192 | return GLib.SOURCE_REMOVE; |
212 | 193 | } |
213 | })); | |
214 | }, | |
215 | ||
216 | _doCheckOverlap: function() { | |
194 | }); | |
195 | } | |
196 | ||
197 | _doCheckOverlap() { | |
217 | 198 | |
218 | 199 | if (!this._isEnabled || (this._targetBox == null)) |
219 | 200 | return; |
232 | 213 | let topWindow = null; |
233 | 214 | for (let i = windows.length - 1; i >= 0; i--) { |
234 | 215 | let meta_win = windows[i].get_meta_window(); |
235 | if (this._handledWindow(meta_win) && (meta_win.get_monitor() == this._monitorIndex)) { | |
216 | if (this._handledWindow(windows[i]) && (meta_win.get_monitor() == this._monitorIndex)) { | |
236 | 217 | topWindow = meta_win; |
237 | 218 | break; |
238 | 219 | } |
266 | 247 | } |
267 | 248 | |
268 | 249 | // Check if notification banner overlaps |
269 | if (Main.messageTray.actor.visible) { | |
270 | let rect = Main.messageTray.actor.get_allocation_box(), | |
250 | if (Main.messageTray.visible) { | |
251 | let rect = Main.messageTray.get_allocation_box(), | |
271 | 252 | test = (rect.x1 < this._targetBox.x2) && |
272 | 253 | (rect.x2 > this._targetBox.x1) && |
273 | 254 | (rect.y1 < this._targetBox.y2) && |
281 | 262 | this.emit('status-changed', this._status); |
282 | 263 | } |
283 | 264 | |
284 | }, | |
265 | } | |
285 | 266 | |
286 | 267 | // Filter interesting windows to be considered for intellihide. |
287 | 268 | // Consider all windows visible on the current workspace. |
288 | 269 | // Optionally skip windows of other applications |
289 | _intellihideFilterInteresting: function(wa) { | |
270 | _intellihideFilterInteresting(wa) { | |
290 | 271 | let meta_win = wa.get_meta_window(); |
291 | if (!meta_win || !this._handledWindow(meta_win)) { | |
272 | if (!this._handledWindow(wa)) | |
292 | 273 | return false; |
293 | } | |
294 | ||
295 | let workspaceManager; | |
296 | if (global.screen) | |
297 | workspaceManager = global.screen; // mutter < 3.29 | |
298 | else | |
299 | workspaceManager = global.workspace_manager; // mutter >= 3.29 | |
300 | ||
301 | let currentWorkspace = workspaceManager.get_active_workspace_index(); | |
274 | ||
275 | let currentWorkspace = global.workspace_manager.get_active_workspace_index(); | |
302 | 276 | let wksp = meta_win.get_workspace(); |
303 | 277 | let wksp_index = wksp.index(); |
304 | 278 | |
305 | 279 | // Depending on the intellihide mode, exclude non-relevent windows |
306 | 280 | if (this._settings.get_boolean('enable-active-window')) { |
307 | // Skip windows of other apps | |
308 | if (this._focusApp) { | |
309 | // The DropDownTerminal extension is not an application per se | |
310 | // so we match its window by wm class instead | |
311 | if (meta_win.get_wm_class() == 'DropDownTerminalWindow') { | |
312 | return true; | |
281 | // Skip windows of other apps | |
282 | if (this._focusApp) { | |
283 | // The DropDownTerminal extension is not an application per se | |
284 | // so we match its window by wm class instead | |
285 | if (meta_win.get_wm_class() == 'DropDownTerminalWindow') | |
286 | return true; | |
287 | ||
288 | let currentApp = this._tracker.get_window_app(meta_win); | |
289 | let focusWindow = global.display.get_focus_window() | |
290 | ||
291 | // Consider half maximized windows side by side | |
292 | // and windows which are alwayson top | |
293 | if((currentApp != this._focusApp) && (currentApp != this._topApp) | |
294 | && !((focusWindow && focusWindow.maximized_vertically && !focusWindow.maximized_horizontally) | |
295 | && (meta_win.maximized_vertically && !meta_win.maximized_horizontally) | |
296 | && meta_win.get_monitor() == focusWindow.get_monitor()) | |
297 | && !meta_win.is_above()) | |
298 | return false; | |
313 | 299 | } |
314 | ||
315 | let currentApp = this._tracker.get_window_app(meta_win); | |
316 | let focusWindow = global.display.get_focus_window() | |
317 | ||
318 | // Consider half maximized windows side by side | |
319 | // and windows which are alwayson top | |
320 | if((currentApp != this._focusApp) && (currentApp != this._topApp) | |
321 | && !((focusWindow && focusWindow.maximized_vertically && !focusWindow.maximized_horizontally) | |
322 | && (meta_win.maximized_vertically && !meta_win.maximized_horizontally) | |
323 | && meta_win.get_monitor() == focusWindow.get_monitor()) | |
324 | && !meta_win.is_above()) { | |
325 | return false; | |
326 | } | |
327 | } | |
328 | } | |
329 | ||
330 | if ( wksp_index == currentWorkspace && meta_win.showing_on_its_workspace() ) { | |
300 | } | |
301 | ||
302 | if ( wksp_index == currentWorkspace && meta_win.showing_on_its_workspace() ) | |
331 | 303 | return true; |
332 | } else { | |
304 | else | |
333 | 305 | return false; |
334 | } | |
335 | ||
336 | }, | |
306 | ||
307 | } | |
337 | 308 | |
338 | 309 | // Filter windows by type |
339 | 310 | // inspired by Opacify@gnome-shell.localdomain.pl |
340 | _handledWindow: function(metaWindow) { | |
311 | _handledWindow(wa) { | |
312 | let metaWindow = wa.get_meta_window(); | |
313 | ||
314 | if (!metaWindow) | |
315 | return false; | |
316 | ||
341 | 317 | // The DropDownTerminal extension uses the POPUP_MENU window type hint |
342 | 318 | // so we match its window by wm class instead |
343 | 319 | if (metaWindow.get_wm_class() == 'DropDownTerminalWindow') |
346 | 322 | let wtype = metaWindow.get_window_type(); |
347 | 323 | for (let i = 0; i < handledWindowTypes.length; i++) { |
348 | 324 | var hwtype = handledWindowTypes[i]; |
349 | if (hwtype == wtype) { | |
325 | if (hwtype == wtype) | |
350 | 326 | return true; |
351 | } else if (hwtype > wtype) { | |
327 | else if (hwtype > wtype) | |
352 | 328 | return false; |
353 | } | |
354 | 329 | } |
355 | 330 | return false; |
356 | 331 | } |
357 | }); | |
358 | ||
359 | Signals.addSignalMethods(intellihide.prototype); | |
360 | ||
332 | }; | |
333 | ||
334 | Signals.addSignalMethods(Intellihide.prototype); |
Binary diff not shown
0 | 0 | # HIDETOPBAR. |
1 | 1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
2 | 2 | # This file is distributed under the same license as the PACKAGE package. |
3 | # David Medina <rbndavid@gmail.com>, 2017. | |
3 | # David Medina <rbndavid@gmail.com>, 2017, 2020. | |
4 | 4 | # |
5 | 5 | msgid "" |
6 | 6 | msgstr "" |
7 | 7 | "Project-Id-Version: \n" |
8 | 8 | "Report-Msgid-Bugs-To: \n" |
9 | "POT-Creation-Date: 2017-07-27 18:54+0200\n" | |
10 | "PO-Revision-Date: 2017-07-27 19:22+0200\n" | |
9 | "POT-Creation-Date: 2020-05-22 10:57+0200\n" | |
10 | "PO-Revision-Date: 2020-05-27 18:51+0200\n" | |
11 | "Last-Translator: \n" | |
11 | 12 | "Language-Team: \n" |
13 | "Language: ca\n" | |
12 | 14 | "MIME-Version: 1.0\n" |
13 | 15 | "Content-Type: text/plain; charset=UTF-8\n" |
14 | 16 | "Content-Transfer-Encoding: 8bit\n" |
15 | "X-Generator: Poedit 1.8.7.1\n" | |
16 | "Last-Translator: \n" | |
17 | "X-Generator: Poedit 2.3\n" | |
17 | 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" |
18 | "Language: ca\n" | |
19 | 19 | |
20 | #: prefs.js:26 | |
20 | #: prefs.js:39 | |
21 | 21 | msgid "<b>Sensitivity</b>" |
22 | 22 | msgstr "<b>Sensibilitat</b>" |
23 | 23 | |
24 | #: prefs.js:33 | |
24 | #: prefs.js:46 | |
25 | 25 | msgid "Show panel when mouse approaches edge of the screen" |
26 | 26 | msgstr "Mostra la barra quan el ratolà s'apropi a la vora de la pantalla." |
27 | 27 | |
28 | #: prefs.js:34 | |
28 | #: prefs.js:47 | |
29 | msgid "In the above case, also show panel when fullscreen." | |
30 | msgstr "En el cas anterior, mostra també la barra en pantalla completa." | |
31 | ||
32 | #: prefs.js:48 | |
29 | 33 | msgid "Keep hot corner sensitive, even in hidden state" |
30 | msgstr "Mantén el cantó actiu sensible, tot i en mode ocult." | |
34 | msgstr "Mantén el cantó actiu sensible, fins i tot en mode ocult." | |
31 | 35 | |
32 | #: prefs.js:35 | |
36 | #: prefs.js:49 | |
33 | 37 | msgid "In the above case show overview, too" |
34 | 38 | msgstr "En el cas anterior, mostra també la vista general." |
35 | 39 | |
36 | #: prefs.js:61 | |
40 | #: prefs.js:74 | |
37 | 41 | msgid "Pressure barrier's threshold." |
38 | msgstr "Llindar de pressió al ratolÃ." | |
42 | msgstr "Llindar de la pressió " | |
39 | 43 | |
40 | #: prefs.js:62 | |
44 | #: prefs.js:75 | |
41 | 45 | msgid "Pressure barrier's timeout." |
42 | msgstr "Retard de la pressió." | |
46 | msgstr "Temps d'espera de la pressió" | |
43 | 47 | |
44 | #: prefs.js:92 | |
48 | #: prefs.js:104 | |
45 | 49 | msgid "<b>Animation</b>" |
46 | 50 | msgstr "<b>Animació</b>" |
47 | 51 | |
48 | #: prefs.js:99 | |
52 | #: prefs.js:111 | |
49 | 53 | msgid "Slide animation time when entering/leaving overview." |
50 | msgstr "Durada de l'animació en entrar o sortir de la vista general." | |
54 | msgstr "Durada de l'animació lliscant en entrar o sortir de la vista general:" | |
51 | 55 | |
52 | #: prefs.js:100 | |
56 | #: prefs.js:112 | |
53 | 57 | msgid "Slide animation time when mouse approaches edge of the screen." |
54 | msgstr "Durada de l'animació quan el ratolà s'apropi a la vora de la pantalla." | |
58 | msgstr "Durada de l'animació quan el ratolà s'apropi a la vora de la pantalla:" | |
55 | 59 | |
56 | #: prefs.js:130 | |
60 | #: prefs.js:141 | |
57 | 61 | msgid "<b>Keyboard shortcuts</b>" |
58 | 62 | msgstr "<b>Dreceres del teclat</b>" |
59 | 63 | |
60 | #: prefs.js:194 | |
64 | #: prefs.js:203 | |
61 | 65 | msgid "Key that triggers the bar to be shown." |
62 | msgstr "Tecla que fa que es mostri la barra." | |
66 | msgstr "Tecla que fa que la barra es mostri:" | |
63 | 67 | |
64 | #: prefs.js:215 | |
68 | #: prefs.js:223 | |
65 | 69 | msgid "Delay before the bar rehides after key press." |
66 | msgstr "Retard de l'ocultació de la barra després de prémer una tecla." | |
70 | msgstr "Retard de la reocultació de la barra després de prémer una tecla:" | |
67 | 71 | |
68 | #: prefs.js:231 | |
72 | #: prefs.js:239 | |
69 | 73 | msgid "Pressing the shortcut again rehides the panel." |
70 | msgstr "Tornar a prémer la drecera fa que la barra s'oculti." | |
74 | msgstr "Tornar a prémer la drecera torna a ocultar la barra." | |
71 | 75 | |
72 | #: prefs.js:261 | |
76 | #: prefs.js:268 | |
73 | 77 | msgid "<b>Intellihide</b>" |
74 | 78 | msgstr "<b>Ocultació intel·ligent</b>" |
75 | 79 | |
76 | #: prefs.js:268 | |
80 | #: prefs.js:275 | |
77 | 81 | msgid "Only hide panel when a window takes the space" |
78 | 82 | msgstr "Oculta la barra només quan una finestra n'ocupi l'espai." |
79 | 83 | |
80 | #: prefs.js:269 | |
84 | #: prefs.js:276 | |
81 | 85 | msgid "Only when the active window takes the space" |
82 | 86 | msgstr "Oculta la barra només quan la finestra activa n'ocupi l'espai." |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2015-10-24 15:24+0800\n" | |
10 | "POT-Creation-Date: 2020-05-22 10:57+0200\n" | |
11 | 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
16 | 16 | "Content-Type: text/plain; charset=CHARSET\n" |
17 | 17 | "Content-Transfer-Encoding: 8bit\n" |
18 | 18 | |
19 | #: prefs.js:26 | |
19 | #: prefs.js:39 | |
20 | 20 | msgid "<b>Sensitivity</b>" |
21 | 21 | msgstr "" |
22 | 22 | |
23 | #: prefs.js:33 | |
23 | #: prefs.js:46 | |
24 | 24 | msgid "Show panel when mouse approaches edge of the screen" |
25 | 25 | msgstr "" |
26 | 26 | |
27 | #: prefs.js:34 | |
27 | #: prefs.js:47 | |
28 | msgid "In the above case, also show panel when fullscreen." | |
29 | msgstr "" | |
30 | ||
31 | #: prefs.js:48 | |
28 | 32 | msgid "Keep hot corner sensitive, even in hidden state" |
29 | 33 | msgstr "" |
30 | 34 | |
31 | #: prefs.js:35 | |
35 | #: prefs.js:49 | |
32 | 36 | msgid "In the above case show overview, too" |
33 | 37 | msgstr "" |
34 | 38 | |
35 | #: prefs.js:61 | |
39 | #: prefs.js:74 | |
36 | 40 | msgid "Pressure barrier's threshold." |
37 | 41 | msgstr "" |
38 | 42 | |
39 | #: prefs.js:62 | |
43 | #: prefs.js:75 | |
40 | 44 | msgid "Pressure barrier's timeout." |
41 | 45 | msgstr "" |
42 | 46 | |
43 | #: prefs.js:92 | |
47 | #: prefs.js:104 | |
44 | 48 | msgid "<b>Animation</b>" |
45 | 49 | msgstr "" |
46 | 50 | |
47 | #: prefs.js:99 | |
51 | #: prefs.js:111 | |
48 | 52 | msgid "Slide animation time when entering/leaving overview." |
49 | 53 | msgstr "" |
50 | 54 | |
51 | #: prefs.js:100 | |
55 | #: prefs.js:112 | |
52 | 56 | msgid "Slide animation time when mouse approaches edge of the screen." |
53 | 57 | msgstr "" |
54 | 58 | |
55 | #: prefs.js:130 | |
59 | #: prefs.js:141 | |
56 | 60 | msgid "<b>Keyboard shortcuts</b>" |
57 | 61 | msgstr "" |
58 | 62 | |
59 | #: prefs.js:194 | |
63 | #: prefs.js:203 | |
60 | 64 | msgid "Key that triggers the bar to be shown." |
61 | 65 | msgstr "" |
62 | 66 | |
63 | #: prefs.js:215 | |
67 | #: prefs.js:223 | |
64 | 68 | msgid "Delay before the bar rehides after key press." |
65 | 69 | msgstr "" |
66 | 70 | |
67 | #: prefs.js:231 | |
71 | #: prefs.js:239 | |
68 | 72 | msgid "Pressing the shortcut again rehides the panel." |
69 | 73 | msgstr "" |
70 | 74 | |
71 | #: prefs.js:261 | |
75 | #: prefs.js:268 | |
72 | 76 | msgid "<b>Intellihide</b>" |
73 | 77 | msgstr "" |
74 | 78 | |
75 | #: prefs.js:268 | |
79 | #: prefs.js:275 | |
76 | 80 | msgid "Only hide panel when a window takes the space" |
77 | 81 | msgstr "" |
78 | 82 | |
79 | #: prefs.js:269 | |
83 | #: prefs.js:276 | |
80 | 84 | msgid "Only when the active window takes the space" |
81 | 85 | msgstr "" |
0 | 0 | { |
1 | "shell-version": ["3.20","3.22","3.24","3.26","3.28","3.30","3.32","3.34","3.36"], | |
1 | "shell-version": ["3.32","3.34","3.36"], | |
2 | 2 | "uuid": "hidetopbar@mathieu.bidon.ca", |
3 | 3 | "name": "Hide Top Bar", |
4 | 4 | "settings-schema": "org.gnome.shell.extensions.hidetopbar", |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | <schemalist> | |
2 | <schema id="org.gnome.shell.extensions.hidetopbar" path="/org/gnome/shell/extensions/hidetopbar/"> | |
3 | <key name="hot-corner" type="b"> | |
4 | <default>false</default> | |
5 | <summary>Keep hot corner sensitive or not</summary> | |
6 | <description> | |
7 | Set to "true" to keep hot corner sensitive even when panel is in hidden | |
8 | state. Set to "false" to get rid of the hot corner in hidden state. | |
9 | </description> | |
10 | </key> | |
11 | <key name="mouse-sensitive" type="b"> | |
12 | <default>false</default> | |
13 | <summary>Show panel when mouse approaches edge of the screen</summary> | |
14 | <description> | |
15 | Set to "true" to show panel not only in overview but also when the mouse | |
16 | approaches the edge of the screen. | |
17 | </description> | |
18 | </key> | |
19 | <key name="mouse-sensitive-fullscreen-window" type="b"> | |
20 | <default>true</default> | |
21 | <summary>Also show panel when mouse approaches edge of the screen when fullscreen.</summary> | |
22 | <description> | |
23 | Set to "true" to also show panel when mouse approaches edge of the screen when windows are in fullscreen mode. | |
24 | </description> | |
25 | </key> | |
26 | <key name="mouse-triggers-overview" type="b"> | |
27 | <default>false</default> | |
28 | <summary>Show overview when mouse approaches edge of the screen</summary> | |
29 | <description> | |
30 | When "mouse-sensitive" is set to "true" and this key is activated, not | |
31 | only the panel but also the overview is shown when the mouse approaches | |
32 | the edge of the screen. | |
33 | </description> | |
34 | </key> | |
35 | <key name="animation-time-overview" type="d"> | |
36 | <default>0.4</default> | |
37 | <summary>Slide in/out animation time</summary> | |
38 | <description> | |
39 | Amount of time it takes for the tweener to slide the panel in/out when | |
40 | entering/leaving overview. | |
41 | </description> | |
42 | </key> | |
43 | <key name="animation-time-autohide" type="d"> | |
44 | <default>0.2</default> | |
45 | <summary>Slide in/out animation time</summary> | |
46 | <description> | |
47 | Amount of time it takes for the tweener to slide the panel in/out when | |
48 | the mouse approaches the edge of the screen. | |
49 | </description> | |
50 | </key> | |
51 | <key name="pressure-threshold" type="i"> | |
52 | <default>100</default> | |
53 | <summary>Pressure barrier's threshold</summary> | |
54 | <description> | |
55 | Number of pixels the mouse has to overrun in order to trigger the | |
56 | pressure barrier. | |
57 | </description> | |
58 | </key> | |
59 | <key name="pressure-timeout" type="i"> | |
60 | <default>1000</default> | |
61 | <summary>Pressure barrier's timeout</summary> | |
62 | <description> | |
63 | Amount of time before pressure barrier is triggered. | |
64 | </description> | |
65 | </key> | |
66 | <key name="shortcut-keybind" type="as"> | |
67 | <default>[]</default> | |
68 | <summary>"show bar" shortcut</summary> | |
69 | <description> | |
70 | Keyboard shortcut that triggers the bar to be shown. | |
71 | </description> | |
72 | </key> | |
73 | <key name="shortcut-delay" type="d"> | |
74 | <default>1.0</default> | |
75 | <summary>Delay after key press</summary> | |
76 | <description> | |
77 | Delay before bar rehides automatically after key press. The value 0.0 | |
78 | means unlimited delay. | |
79 | </description> | |
80 | </key> | |
81 | <key name="shortcut-toggles" type="b"> | |
82 | <default>true</default> | |
83 | <summary>Enable toggling behaviour</summary> | |
84 | <description> | |
85 | Pressing the shortcut again rehides the panel. | |
86 | </description> | |
87 | </key> | |
88 | <key name="enable-intellihide" type="b"> | |
89 | <default>true</default> | |
90 | <summary>Enable intellihide feature</summary> | |
91 | <description> | |
92 | When enabled, the panel will only hide if a window takes the space. | |
93 | </description> | |
94 | </key> | |
95 | <key name="enable-active-window" type="b"> | |
96 | <default>true</default> | |
97 | <summary>Enable Intellihide only for active window</summary> | |
98 | <description> | |
99 | When enabled, the panel will only hide if the active window | |
100 | takes the space. | |
101 | </description> | |
102 | </key> | |
103 | </schema> | |
104 | </schemalist> |
0 | 0 | |
1 | const Lang = imports.lang; | |
2 | const Mainloop = imports.mainloop; | |
1 | const GLib = imports.gi.GLib; | |
3 | 2 | const Meta = imports.gi.Meta; |
4 | 3 | const Shell = imports.gi.Shell; |
5 | 4 | const Clutter = imports.gi.Clutter; |
6 | 5 | |
7 | 6 | const Main = imports.ui.main; |
8 | 7 | const Layout = imports.ui.layout; |
9 | const Tweener = imports.ui.tweener; | |
10 | 8 | |
11 | 9 | const Me = imports.misc.extensionUtils.getCurrentExtension(); |
12 | 10 | const Convenience = Me.imports.convenience; |
27 | 25 | ); |
28 | 26 | } |
29 | 27 | |
30 | var PanelVisibilityManager = new Lang.Class({ | |
31 | Name: 'PanelVisibilityManager', | |
32 | ||
33 | _init: function(settings, monitorIndex) { | |
34 | this._settings = settings; | |
28 | var PanelVisibilityManager = class HideTopBar_PanelVisibilityManager { | |
29 | ||
30 | constructor(settings, monitorIndex) { | |
35 | 31 | this._monitorIndex = monitorIndex; |
36 | 32 | this._base_y = PanelBox.y; |
33 | this._settings = settings; | |
37 | 34 | this._preventHide = false; |
38 | 35 | this._intellihideBlock = false; |
39 | 36 | this._staticBox = new Clutter.ActorBox(); |
40 | this._tweenActive = false; | |
37 | this._animationActive = false; | |
41 | 38 | this._shortcutTimeout = 0; |
42 | 39 | |
43 | 40 | Main.layoutManager.removeChrome(PanelBox); |
58 | 55 | // Load settings |
59 | 56 | this._bindSettingsChanges(); |
60 | 57 | this._updateSettingsMouseSensitive(); |
61 | this._intellihide = new Intellihide.intellihide(this._settings, this._monitorIndex); | |
58 | this._intellihide = new Intellihide.Intellihide(this._settings, this._monitorIndex); | |
62 | 59 | |
63 | 60 | this._updateHotCorner(false); |
64 | 61 | this._updateStaticBox(); |
65 | this._bindTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, this._bindUIChanges)); | |
66 | }, | |
67 | ||
68 | hide: function(animationTime, trigger) { | |
62 | this._bindTimeoutId = GLib.timeout_add( | |
63 | GLib.PRIORITY_DEFAULT, 100, this._bindUIChanges.bind(this)); | |
64 | } | |
65 | ||
66 | hide(animationTime, trigger) { | |
69 | 67 | DEBUG("hide(" + trigger + ")"); |
70 | 68 | if(this._preventHide) return; |
71 | 69 | |
79 | 77 | mouse[0] < this._staticBox.x2); |
80 | 78 | if(trigger == "mouse-left" && mouse_is_over) return; |
81 | 79 | |
82 | if(this._tweenActive) { | |
83 | Tweener.removeTweens(PanelBox, "y"); | |
84 | this._tweenActive = false; | |
85 | } | |
86 | ||
87 | this._tweenActive = true; | |
88 | Tweener.addTween(PanelBox, { | |
80 | if(this._animationActive) { | |
81 | PanelBox.remove_all_transitions(); | |
82 | this._animationActive = false; | |
83 | } | |
84 | ||
85 | this._animationActive = true; | |
86 | PanelBox.ease({ | |
89 | 87 | y: this._base_y + delta_y, |
90 | time: animationTime, | |
91 | transition: 'easeOutQuad', | |
92 | onComplete: Lang.bind(this, function() { | |
93 | this._tweenActive = false; | |
88 | duration: animationTime * 1000, | |
89 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
90 | onComplete: () => { | |
91 | this._animationActive = false; | |
94 | 92 | PanelBox.hide(); |
95 | 93 | reallocateTopIcons(); |
96 | 94 | this._updateHotCorner(true); |
97 | }) | |
95 | } | |
98 | 96 | }); |
99 | }, | |
100 | ||
101 | show: function(animationTime, trigger) { | |
97 | } | |
98 | ||
99 | show(animationTime, trigger) { | |
102 | 100 | DEBUG("show(" + trigger + ")"); |
103 | 101 | if(trigger == "mouse-enter" |
104 | 102 | && this._settings.get_boolean('mouse-triggers-overview')) { |
105 | 103 | Main.overview.show(); |
106 | 104 | } |
107 | 105 | |
108 | if(this._tweenActive) { | |
109 | Tweener.removeTweens(PanelBox, "y"); | |
110 | this._tweenActive = false; | |
106 | if(this._animationActive) { | |
107 | PanelBox.remove_all_transitions(); | |
108 | this._animationActive = false; | |
111 | 109 | } |
112 | 110 | |
113 | 111 | this._updateHotCorner(false); |
115 | 113 | if(trigger == "destroy" |
116 | 114 | || ( |
117 | 115 | trigger == "showing-overview" |
118 | && global.get_pointer()[1] < this._panelHeight | |
116 | && global.get_pointer()[1] < PanelBox.height | |
119 | 117 | && this._settings.get_boolean('hot-corner') |
120 | 118 | ) |
121 | 119 | ) { |
122 | 120 | PanelBox.y = this._base_y; |
123 | 121 | reallocateTopIcons(); |
124 | 122 | } else { |
125 | this._tweenActive = true; | |
126 | Tweener.addTween(PanelBox, { | |
123 | this._animationActive = true; | |
124 | PanelBox.ease({ | |
127 | 125 | y: this._base_y, |
128 | time: animationTime, | |
129 | transition: 'easeOutQuad', | |
130 | onComplete: Lang.bind(this, function() { | |
131 | this._tweenActive = false; | |
126 | duration: animationTime * 1000, | |
127 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
128 | onComplete: () => { | |
129 | this._animationActive = false; | |
132 | 130 | this._updateStaticBox(); |
133 | 131 | reallocateTopIcons(); |
134 | }) | |
132 | } | |
135 | 133 | }); |
136 | 134 | } |
137 | }, | |
138 | ||
139 | _handleMenus: function() { | |
135 | } | |
136 | ||
137 | _handleMenus() { | |
140 | 138 | if(!Main.overview.visible) { |
141 | 139 | let blocker = Main.panel.menuManager.activeMenu; |
142 | 140 | if(blocker == null) { |
148 | 146 | this._blockerMenu = blocker; |
149 | 147 | this._menuEvent = this._blockerMenu.connect( |
150 | 148 | 'open-state-changed', |
151 | Lang.bind(this, function(menu, open) { | |
149 | (menu, open) => { | |
152 | 150 | if(!open && this._blockerMenu !== null) { |
153 | 151 | this._blockerMenu.disconnect(this._menuEvent); |
154 | 152 | this._menuEvent=null; |
155 | 153 | this._blockerMenu=null; |
156 | 154 | this._handleMenus(); |
157 | 155 | } |
158 | }) | |
156 | } | |
159 | 157 | ); |
160 | 158 | } |
161 | 159 | } |
162 | }, | |
163 | ||
164 | _handleShortcut: function () { | |
160 | } | |
161 | ||
162 | _handleShortcut() { | |
165 | 163 | var delay_time = this._settings.get_double('shortcut-delay'); |
166 | 164 | if(this._shortcutTimeout) { |
167 | Mainloop.source_remove(this._shortcutTimeout); | |
165 | GLib.source_remove(this._shortcutTimeout); | |
168 | 166 | this._shortcutTimeout = null; |
169 | 167 | if(delay_time < 0.05 |
170 | 168 | || this._settings.get_boolean('shortcut-toggles')) { |
187 | 185 | if(delay_time > 0.05) { |
188 | 186 | this.show(delay_time/5.0, "shortcut"); |
189 | 187 | |
190 | this._shortcutTimeout = Mainloop.timeout_add( | |
191 | delay_time*1200, | |
192 | Lang.bind(this, function () { | |
188 | this._shortcutTimeout = GLib.timeout_add( | |
189 | GLib.PRIORITY_DEFAULT, delay_time*1200, | |
190 | () => { | |
193 | 191 | this._preventHide = false; |
194 | 192 | this._intellihideBlock = false; |
195 | 193 | this._handleMenus(); |
196 | 194 | this._shortcutTimeout = null; |
197 | 195 | return false; |
198 | }) | |
196 | } | |
199 | 197 | ); |
200 | 198 | } else { |
201 | 199 | this.show( |
210 | 208 | // Main -> panel -> _leftBox -> (StBin) -> (panel-button) |
211 | 209 | // Main.panel._leftBox.first_child.first_child.grab_key_focus(); |
212 | 210 | } |
213 | }, | |
214 | ||
215 | _disablePressureBarrier: function() { | |
211 | } | |
212 | ||
213 | _disablePressureBarrier() { | |
216 | 214 | if(this._panelBarrier && this._panelPressure) { |
217 | 215 | this._panelPressure.removeBarrier(this._panelBarrier); |
218 | 216 | this._panelBarrier.destroy(); |
219 | 217 | } |
220 | }, | |
221 | ||
222 | _initPressureBarrier: function() { | |
218 | } | |
219 | ||
220 | _initPressureBarrier() { | |
223 | 221 | this._panelPressure = new Layout.PressureBarrier( |
224 | 222 | this._settings.get_int('pressure-threshold'), |
225 | this._settings.get_int('pressure-timeout'), | |
223 | this._settings.get_int('pressure-timeout'), | |
226 | 224 | ShellActionMode.NORMAL |
227 | 225 | ); |
228 | 226 | this._panelPressure.connect( |
229 | 227 | 'trigger', |
230 | Lang.bind(this, function(barrier) { | |
228 | (barrier) => { | |
231 | 229 | if ( (Main.layoutManager.primaryMonitor.inFullscreen) && (!this._settings.get_boolean('mouse-sensitive-fullscreen-window')) ) { |
232 | 230 | return; |
233 | 231 | } |
235 | 233 | this._settings.get_double('animation-time-autohide'), |
236 | 234 | "mouse-enter" |
237 | 235 | ); |
238 | }) | |
236 | } | |
239 | 237 | ); |
240 | 238 | let anchor_y = PanelBox.get_pivot_point()[1], |
241 | 239 | direction = Meta.BarrierDirection.POSITIVE_Y; |
252 | 250 | directions: direction |
253 | 251 | }); |
254 | 252 | this._panelPressure.addBarrier(this._panelBarrier); |
255 | }, | |
256 | ||
257 | _updateStaticBox: function() { | |
253 | } | |
254 | ||
255 | _updateStaticBox() { | |
258 | 256 | DEBUG("_updateStaticBox()"); |
259 | 257 | let anchor_y = PanelBox.get_pivot_point()[1]; |
260 | 258 | this._staticBox.init_rect( |
261 | 259 | PanelBox.x, PanelBox.y-anchor_y, PanelBox.width, PanelBox.height |
262 | 260 | ); |
263 | 261 | this._intellihide.updateTargetBox(this._staticBox); |
264 | }, | |
265 | ||
266 | _updateHotCorner: function(panel_hidden) { | |
262 | } | |
263 | ||
264 | _updateHotCorner(panel_hidden) { | |
267 | 265 | let HotCorner = null; |
268 | 266 | for(var i = 0; i < Main.layoutManager.hotCorners.length; i++){ |
269 | 267 | let hc = Main.layoutManager.hotCorners[i]; |
276 | 274 | if(!panel_hidden || this._settings.get_boolean('hot-corner')) { |
277 | 275 | HotCorner.setBarrierSize(PanelBox.height); |
278 | 276 | } else { |
279 | Mainloop.timeout_add(100, function () { | |
277 | GLib.timeout_add(GLib.PRIORITY_DEFAULT, 100, function () { | |
280 | 278 | HotCorner.setBarrierSize(0) |
281 | 279 | }); |
282 | 280 | } |
283 | 281 | } |
284 | }, | |
285 | ||
286 | _updateSettingsHotCorner: function() { | |
282 | } | |
283 | ||
284 | _updateSettingsHotCorner() { | |
287 | 285 | this.hide(0.1, "hot-corner-setting-changed"); |
288 | }, | |
289 | ||
290 | _updateSettingsMouseSensitive: function() { | |
286 | } | |
287 | ||
288 | _updateSettingsMouseSensitive() { | |
291 | 289 | if(this._settings.get_boolean('mouse-sensitive')) { |
292 | 290 | this._disablePressureBarrier(); |
293 | 291 | this._initPressureBarrier(); |
294 | 292 | } else this._disablePressureBarrier(); |
295 | }, | |
296 | ||
297 | _updateIntellihideStatus: function() { | |
293 | } | |
294 | ||
295 | _updateIntellihideStatus() { | |
298 | 296 | if(this._settings.get_boolean('enable-intellihide')) { |
299 | 297 | this._intellihideBlock = false; |
300 | 298 | this._preventHide = false; |
305 | 303 | this._preventHide = false; |
306 | 304 | this.hide(0, "init"); |
307 | 305 | } |
308 | }, | |
309 | ||
310 | _updatePreventHide: function() { | |
306 | } | |
307 | ||
308 | _updatePreventHide() { | |
311 | 309 | if(this._intellihideBlock) return; |
312 | 310 | |
313 | 311 | this._preventHide = !this._intellihide.getOverlapStatus(); |
316 | 314 | this.show(animTime, "intellihide"); |
317 | 315 | else if(!Main.overview.visible) |
318 | 316 | this.hide(animTime, "intellihide"); |
319 | }, | |
320 | ||
321 | _bindUIChanges: function () { | |
317 | } | |
318 | ||
319 | _bindUIChanges() { | |
322 | 320 | let monitorManager; |
323 | 321 | if (global.screen) |
324 | 322 | monitorManager = global.screen; // mutter < 3.29 |
330 | 328 | [ |
331 | 329 | Main.overview, |
332 | 330 | 'showing', |
333 | Lang.bind(this, function() { | |
331 | () => { | |
334 | 332 | this.show( |
335 | 333 | this._settings.get_double('animation-time-overview'), |
336 | 334 | "showing-overview" |
337 | 335 | ); |
338 | }) | |
336 | } | |
339 | 337 | ], |
340 | 338 | [ |
341 | 339 | Main.overview, |
342 | 340 | 'hiding', |
343 | Lang.bind(this, function() { | |
341 | () => { | |
344 | 342 | this.hide( |
345 | 343 | this._settings.get_double('animation-time-overview'), |
346 | 344 | "hiding-overview" |
347 | 345 | ); |
348 | }) | |
349 | ], | |
350 | [ | |
351 | Main.panel.actor, | |
346 | } | |
347 | ], | |
348 | [ | |
349 | Main.panel, | |
352 | 350 | 'leave-event', |
353 | Lang.bind(this, this._handleMenus) | |
351 | this._handleMenus.bind(this) | |
354 | 352 | ], |
355 | 353 | [ |
356 | 354 | PanelBox, |
357 | 355 | 'notify::anchor-y', |
358 | Lang.bind(this, function () { | |
356 | () => { | |
359 | 357 | this._updateStaticBox(); |
360 | 358 | this._updateSettingsMouseSensitive(); |
361 | }) | |
359 | } | |
362 | 360 | ], |
363 | 361 | [ |
364 | 362 | monitorManager, |
365 | 363 | 'monitors-changed', |
366 | Lang.bind(this, function () { | |
364 | () => { | |
367 | 365 | this._base_y = PanelBox.y; |
368 | 366 | this._updateStaticBox(); |
369 | 367 | this._updateSettingsMouseSensitive(); |
370 | }) | |
368 | } | |
371 | 369 | ], |
372 | 370 | [ |
373 | 371 | this._intellihide, |
374 | 372 | 'status-changed', |
375 | Lang.bind(this, this._updatePreventHide) | |
373 | this._updatePreventHide.bind(this) | |
376 | 374 | ] |
377 | 375 | ); |
378 | 376 | |
379 | 377 | Main.wm.addKeybinding("shortcut-keybind", |
380 | 378 | this._settings, Meta.KeyBindingFlags.NONE, |
381 | 379 | ShellActionMode.NORMAL, |
382 | Lang.bind(this, this._handleShortcut) | |
380 | this._handleShortcut.bind(this) | |
383 | 381 | ); |
384 | 382 | |
385 | 383 | this._updateIntellihideStatus(); |
386 | }, | |
387 | ||
388 | _bindSettingsChanges: function() { | |
384 | } | |
385 | ||
386 | _bindSettingsChanges() { | |
389 | 387 | this._signalsHandler = new Convenience.GlobalSignalsHandler(); |
390 | 388 | this._signalsHandler.addWithLabel("settings", |
391 | 389 | [ |
392 | 390 | this._settings, |
393 | 391 | 'changed::hot-corner', |
394 | Lang.bind(this, this._updateSettingsHotCorner) | |
392 | this._updateSettingsHotCorner.bind(this) | |
395 | 393 | ], |
396 | 394 | [ |
397 | 395 | this._settings, |
398 | 396 | 'changed::mouse-sensitive', |
399 | Lang.bind(this, this._updateSettingsMouseSensitive) | |
397 | this._updateSettingsMouseSensitive.bind(this) | |
400 | 398 | ], |
401 | 399 | [ |
402 | 400 | this._settings, |
403 | 401 | 'changed::pressure-timeout', |
404 | Lang.bind(this, this._updateSettingsMouseSensitive) | |
402 | this._updateSettingsMouseSensitive.bind(this) | |
405 | 403 | ], |
406 | 404 | [ |
407 | 405 | this._settings, |
408 | 406 | 'changed::pressure-threshold', |
409 | Lang.bind(this, this._updateSettingsMouseSensitive) | |
407 | this._updateSettingsMouseSensitive.bind(this) | |
410 | 408 | ], |
411 | 409 | [ |
412 | 410 | this._settings, |
413 | 411 | 'changed::enable-intellihide', |
414 | Lang.bind(this, this._updateIntellihideStatus) | |
412 | this._updateIntellihideStatus.bind(this) | |
415 | 413 | ], |
416 | 414 | [ |
417 | 415 | this._settings, |
418 | 416 | 'changed::enable-active-window', |
419 | Lang.bind(this, this._updateIntellihideStatus) | |
417 | this._updateIntellihideStatus.bind(this) | |
420 | 418 | ] |
421 | 419 | ); |
422 | }, | |
423 | ||
424 | destroy: function() { | |
425 | Mainloop.source_remove(this._bindTimeoutId); | |
420 | } | |
421 | ||
422 | destroy() { | |
423 | GLib.source_remove(this._bindTimeoutId); | |
426 | 424 | this._intellihide.destroy(); |
427 | 425 | this._signalsHandler.destroy(); |
428 | 426 | Main.wm.removeKeybinding("shortcut-keybind"); |
437 | 435 | trackFullscreen: true |
438 | 436 | }); |
439 | 437 | } |
440 | }); | |
438 | }; |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | <schemalist> | |
2 | <schema id="org.gnome.shell.extensions.hidetopbar" path="/org/gnome/shell/extensions/hidetopbar/"> | |
3 | <key name="hot-corner" type="b"> | |
4 | <default>false</default> | |
5 | <summary>Keep hot corner sensitive or not</summary> | |
6 | <description> | |
7 | Set to "true" to keep hot corner sensitive even when panel is in hidden | |
8 | state. Set to "false" to get rid of the hot corner in hidden state. | |
9 | </description> | |
10 | </key> | |
11 | <key name="mouse-sensitive" type="b"> | |
12 | <default>false</default> | |
13 | <summary>Show panel when mouse approaches edge of the screen</summary> | |
14 | <description> | |
15 | Set to "true" to show panel not only in overview but also when the mouse | |
16 | approaches the edge of the screen. | |
17 | </description> | |
18 | </key> | |
19 | <key name="mouse-sensitive-fullscreen-window" type="b"> | |
20 | <default>true</default> | |
21 | <summary>Also show panel when mouse approaches edge of the screen when fullscreen.</summary> | |
22 | <description> | |
23 | Set to "true" to also show panel when mouse approaches edge of the screen when windows are in fullscreen mode. | |
24 | </description> | |
25 | </key> | |
26 | <key name="mouse-triggers-overview" type="b"> | |
27 | <default>false</default> | |
28 | <summary>Show overview when mouse approaches edge of the screen</summary> | |
29 | <description> | |
30 | When "mouse-sensitive" is set to "true" and this key is activated, not | |
31 | only the panel but also the overview is shown when the mouse approaches | |
32 | the edge of the screen. | |
33 | </description> | |
34 | </key> | |
35 | <key name="animation-time-overview" type="d"> | |
36 | <default>0.4</default> | |
37 | <summary>Slide in/out animation time</summary> | |
38 | <description> | |
39 | Amount of time it takes for the tweener to slide the panel in/out when | |
40 | entering/leaving overview. | |
41 | </description> | |
42 | </key> | |
43 | <key name="animation-time-autohide" type="d"> | |
44 | <default>0.2</default> | |
45 | <summary>Slide in/out animation time</summary> | |
46 | <description> | |
47 | Amount of time it takes for the tweener to slide the panel in/out when | |
48 | the mouse approaches the edge of the screen. | |
49 | </description> | |
50 | </key> | |
51 | <key name="pressure-threshold" type="i"> | |
52 | <default>100</default> | |
53 | <summary>Pressure barrier's threshold</summary> | |
54 | <description> | |
55 | Number of pixels the mouse has to overrun in order to trigger the | |
56 | pressure barrier. | |
57 | </description> | |
58 | </key> | |
59 | <key name="pressure-timeout" type="i"> | |
60 | <default>1000</default> | |
61 | <summary>Pressure barrier's timeout</summary> | |
62 | <description> | |
63 | Amount of time before pressure barrier is triggered. | |
64 | </description> | |
65 | </key> | |
66 | <key name="shortcut-keybind" type="as"> | |
67 | <default>[]</default> | |
68 | <summary>"show bar" shortcut</summary> | |
69 | <description> | |
70 | Keyboard shortcut that triggers the bar to be shown. | |
71 | </description> | |
72 | </key> | |
73 | <key name="shortcut-delay" type="d"> | |
74 | <default>1.0</default> | |
75 | <summary>Delay after key press</summary> | |
76 | <description> | |
77 | Delay before bar rehides automatically after key press. The value 0.0 | |
78 | means unlimited delay. | |
79 | </description> | |
80 | </key> | |
81 | <key name="shortcut-toggles" type="b"> | |
82 | <default>true</default> | |
83 | <summary>Enable toggling behaviour</summary> | |
84 | <description> | |
85 | Pressing the shortcut again rehides the panel. | |
86 | </description> | |
87 | </key> | |
88 | <key name="enable-intellihide" type="b"> | |
89 | <default>true</default> | |
90 | <summary>Enable intellihide feature</summary> | |
91 | <description> | |
92 | When enabled, the panel will only hide if a window takes the space. | |
93 | </description> | |
94 | </key> | |
95 | <key name="enable-active-window" type="b"> | |
96 | <default>true</default> | |
97 | <summary>Enable Intellihide only for active window</summary> | |
98 | <description> | |
99 | When enabled, the panel will only hide if the active window | |
100 | takes the space. | |
101 | </description> | |
102 | </key> | |
103 | </schema> | |
104 | </schemalist> |