-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
display_module.js
47 lines (40 loc) · 1.04 KB
/
display_module.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
This file has been copied from EasyScreenCast/display_module.js [1], with no
edits. We primarily need the set_cursor method as it is used in selection.js
[1]: https://github.com/EasyScreenCast/EasyScreenCast/blob/e2ec24d/display_module.js
*/
'use strict';
/**
* @type {{_display(): Meta_Display, number_of_displays(): int}}
*/
const DisplayApi = {
/**
* Returns the Wayland display or screen
*
* @returns {Meta.Display}
*/
_display() {
return global.display || global.screen;
},
/**
* @returns {int}
* @public
*/
number_displays() {
return this._display().get_n_monitors();
},
/**
* @param {number} displayIndex the monitor number
* @returns {Meta.Rectangle}
*/
display_geometry_for_index(displayIndex) {
return this._display().get_monitor_geometry(displayIndex);
},
/**
* @param {Meta.Cursor} cursor the new cursor to set
*/
set_cursor(cursor) {
this._display().set_cursor(cursor);
},
};
export {DisplayApi};