-
Notifications
You must be signed in to change notification settings - Fork 24
/
extension.js
33 lines (27 loc) · 850 Bytes
/
extension.js
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
const Main = imports.ui.main;
const ExtensionUtils = imports.misc.extensionUtils;
const Config = imports.misc.config;
let _id;
function _disable_hot_corners() {
// Disables all hot corners
Main.layoutManager.hotCorners.forEach(function(hot_corner) {
if (!hot_corner) {
return;
}
hot_corner._toggleOverview = function() {};
hot_corner._pressureBarrier._trigger = function() {};
});
}
function init() {
}
function enable() {
_disable_hot_corners();
// Hot corners may be re-created afterwards (for example, If there's a monitor change).
// So we catch all changes.
_id = Main.layoutManager.connect('hot-corners-changed', _disable_hot_corners);
}
function disable() {
// Disconnects the callback and re-creates the hot corners
Main.layoutManager.disconnect(_id);
Main.layoutManager._updateHotCorners();
}