Compare commits
567 Commits
Author | SHA1 | Date | |
---|---|---|---|
852303f71b | |||
ba804de15e | |||
093603b35e | |||
b436f3ebcb | |||
efea769bbe | |||
0e1622af9e | |||
b1f4ac10da | |||
2fc6384bca | |||
6ad9c99040 | |||
56b6e65317 | |||
b80b22e78d | |||
4917b0423b | |||
abfbf1f972 | |||
283e50ab7c | |||
1c0be1a36b | |||
00437750ed | |||
32b1e8d0eb | |||
51cdd34a4b | |||
9dce262192 | |||
03cc09126f | |||
6d9c6ba577 | |||
cbc24b4205 | |||
c85273fa6b | |||
d6d5c42e4b | |||
fce14a43b9 | |||
7fcaf63291 | |||
990c171bed | |||
112b139a9e | |||
923d926345 | |||
3c6f59ae6d | |||
84bbedb3b3 | |||
f541562acc | |||
beddbc0583 | |||
2f840174cb | |||
015559a207 | |||
98d6c4e8dd | |||
1675b54738 | |||
44cbd1e718 | |||
0dc1e1e99a | |||
1029e683d3 | |||
cf1d09b482 | |||
a436226266 | |||
33ff3dc44f | |||
2e77ed712c | |||
9d6ccb6072 | |||
5091eab280 | |||
6d38bc69ca | |||
adc8b1ba89 | |||
38777b41a5 | |||
263320696e | |||
e6153bb578 | |||
c723a1b72a | |||
0b56416d30 | |||
0c5716b018 | |||
1fa1333e13 | |||
6edd3c4b93 | |||
72a8522a10 | |||
b91903555a | |||
6b78f58a75 | |||
e62c0757c3 | |||
9168f6055e | |||
8993de76f0 | |||
01fedeed8f | |||
757e4b6731 | |||
c2b70101f2 | |||
9d4a3a614d | |||
2af7264cff | |||
a96c8d91b5 | |||
3541a57570 | |||
18155fc6ea | |||
b83c93ad62 | |||
d0dab5a6d1 | |||
c9708b140c | |||
dd846f1ba2 | |||
ec3653240a | |||
b689b35b7d | |||
01a927f388 | |||
41d5b1455f | |||
b710c6e275 | |||
4c9f42eea9 | |||
2b0731ab81 | |||
a9b803f075 | |||
73436b5276 | |||
20dcc8aa87 | |||
fdac0602db | |||
e5272c84d7 | |||
1812db7aa8 | |||
260405a49e | |||
71d37bffdf | |||
95436a08b5 | |||
13137aad9d | |||
71f55643b2 | |||
5c550daecb | |||
4e0492c517 | |||
f386103bc1 | |||
26e66aa4fd | |||
4420f52080 | |||
b4082063de | |||
bde974087a | |||
d93b51e135 | |||
730a68dffc | |||
f06c257952 | |||
7afab2c28c | |||
16a18f2ae7 | |||
704e08dc08 | |||
60311aa4d1 | |||
cceb74706a | |||
578ae29ed2 | |||
701d110493 | |||
d1cbf6c7a9 | |||
b64ce217e4 | |||
783dbe2aa9 | |||
f4ce1cf462 | |||
d04d6e069d | |||
40de201056 | |||
18234ea91a | |||
e3f3297cba | |||
e1ea1d2954 | |||
8e23ff8111 | |||
8a50a8e64c | |||
fae207811a | |||
1d86424942 | |||
2bc8175219 | |||
1e31caf0b8 | |||
8e24ac6b26 | |||
427b9ac75f | |||
f50205e9b4 | |||
168cfdd86b | |||
d339c94c18 | |||
97509bf1d2 | |||
4a9c2ee805 | |||
51e1e6d15c | |||
f0d2509dc3 | |||
95bb194356 | |||
de8b43a45d | |||
82be010fd8 | |||
2a0c116757 | |||
6cdaec4001 | |||
ed4baec40f | |||
9e8883c922 | |||
9bb64da895 | |||
049f348e25 | |||
be190cc4d9 | |||
0893789b34 | |||
7b5c6b657a | |||
9363fd3524 | |||
0ad242a81e | |||
7031449f01 | |||
06df79286d | |||
9297d87775 | |||
ef56b14553 | |||
30ff76272e | |||
52a7481ba6 | |||
14cfd74f08 | |||
fa97f7141b | |||
03bcd4c05b | |||
89574abc83 | |||
602078cbde | |||
96f63b08c2 | |||
d66cd0d206 | |||
ff13ad9e71 | |||
5e4b65d37e | |||
51fd0875d1 | |||
75f8903c7e | |||
124eb1ca18 | |||
b5d925817f | |||
c134091268 | |||
ff89693998 | |||
c26860dcb7 | |||
6757c7d20a | |||
751189253a | |||
21187a4cec | |||
b7db56ca9b | |||
261d36ba72 | |||
1e72874192 | |||
f29dbd1f18 | |||
b60836932a | |||
bf47d1b22d | |||
4ea0fca4fc | |||
809f820cd4 | |||
75235624b2 | |||
5ea54426b9 | |||
4aabcd9e7d | |||
918b3eeb42 | |||
482c655590 | |||
86b5a43008 | |||
d7cb2eeebc | |||
770231c2d7 | |||
ecdf62d63e | |||
d885486397 | |||
1524abc947 | |||
cb9842e4a4 | |||
140ab4dec1 | |||
845122497b | |||
d51a622fc0 | |||
e90466347a | |||
73f8c1c482 | |||
0ff75941ea | |||
e4bb2037ca | |||
481014ac9e | |||
6dbcb5f9da | |||
c1f06daf88 | |||
0717f76362 | |||
da738988cd | |||
e86e88ea47 | |||
ae338af1e8 | |||
3f9cc0ed37 | |||
8f8ecdb983 | |||
8f547c9d5d | |||
821f3e8ddf | |||
81be25bbd6 | |||
26d27fdbf8 | |||
c7e597cf72 | |||
e4db68a1da | |||
980a90f8fb | |||
87e4bf52b7 | |||
a368df61ac | |||
5e66b104dc | |||
08a5f41505 | |||
ec36762309 | |||
aa70020bc8 | |||
1e77e6fc79 | |||
68203e7091 | |||
cff0752bcc | |||
45d8e11123 | |||
5aee714b70 | |||
3c3c3b7c69 | |||
6ba2913075 | |||
75c4e1cd63 | |||
fb4a4ca4a2 | |||
4c2c1297be | |||
c5dbdad5fc | |||
4e05bcd3b6 | |||
3555550d5e | |||
8e05fa2728 | |||
d7c3050e2d | |||
89ba8562c3 | |||
82da73baff | |||
b2eeda9b46 | |||
0db41a3773 | |||
8d7f7e61dd | |||
3f4b253dac | |||
e4cbe5126a | |||
8357739ef8 | |||
6bef9334b7 | |||
8c49f45ac8 | |||
46600740fe | |||
c281e868a0 | |||
039431a73f | |||
d4f8ea1c53 | |||
96f5e2b33e | |||
93a542d52c | |||
f4fcba74ff | |||
cadbf7cd8b | |||
dd8e1aef51 | |||
15dc37a139 | |||
c23ad83c59 | |||
4a6f550acb | |||
8078d78c30 | |||
d7185d71c6 | |||
522ecba180 | |||
9b22f6183f | |||
b2c35e4fb0 | |||
af543daf1c | |||
baeb4079ee | |||
f91f9801b4 | |||
c5634335b0 | |||
2b4317349f | |||
96bfd1f8be | |||
33ab53068e | |||
40123ae6da | |||
df149524d4 | |||
f0ee9cdcf8 | |||
a3257e8df5 | |||
d2cf13eff4 | |||
8cd352b72b | |||
c210052dc6 | |||
0561af66e7 | |||
1e9b170d87 | |||
be02f76aa7 | |||
687928e7b7 | |||
ffdf3feb04 | |||
a60b8b3b50 | |||
3d6add68c7 | |||
85e055ffe3 | |||
1691e422e7 | |||
f442c9510e | |||
0de98eb772 | |||
30172b5625 | |||
8ae99a6898 | |||
5cfe5bf8c8 | |||
c790c01a3b | |||
d4a947b475 | |||
60d7999b6a | |||
c040d08b97 | |||
3a53b25873 | |||
d8e6f654a3 | |||
fdfcacf1db | |||
d3efbcce9b | |||
ac34dbe353 | |||
e0f3e13456 | |||
fdd9def922 | |||
771050f4d7 | |||
8451df977c | |||
ff55cf017e | |||
d36a180852 | |||
12c7f693d0 | |||
e0a8cb565e | |||
46547ae027 | |||
68745328df | |||
4582d7a183 | |||
cc5ed2fbf5 | |||
a2545d186a | |||
1ea22a5281 | |||
090057d2df | |||
b3aab7f401 | |||
8154728d09 | |||
5569090d1c | |||
fc3bc7678d | |||
8914a46669 | |||
e7ec373aee | |||
fe131f926d | |||
35d21c0bca | |||
b487846c0a | |||
7bbce1d5ad | |||
bf40d96a83 | |||
2d650e51a5 | |||
85d2837466 | |||
25985868e8 | |||
393c6c6805 | |||
775d6ec431 | |||
988f996407 | |||
315c8820ca | |||
8a89de04a2 | |||
63abfc163d | |||
f58cb34065 | |||
ece1329145 | |||
989118981b | |||
c511c469fe | |||
dac05c7e53 | |||
c90e7ce258 | |||
963f96292d | |||
989ee6593b | |||
2a8eea1ff5 | |||
55c287280b | |||
1fdd4ff313 | |||
3522338b3d | |||
61e3349dc7 | |||
dc27db0897 | |||
f09fbb19cf | |||
846fa77b37 | |||
b57bcf823f | |||
548e19a7cd | |||
4ae04d5aa8 | |||
5d5ca80d17 | |||
d81237b9d6 | |||
71b3b03b2f | |||
8c909e37e9 | |||
6508fa4349 | |||
ce8fb83c36 | |||
58ec607818 | |||
f06223df48 | |||
9a8ced9f5b | |||
67c45e5648 | |||
b88ed3f251 | |||
669b0f193a | |||
9cad7ae975 | |||
48e6a58250 | |||
d2583aa47b | |||
0ab34fe21f | |||
0f947d4ff9 | |||
9dc421875b | |||
9c3c9a155e | |||
faaed642a7 | |||
9b99b67fea | |||
693dd79d28 | |||
400d045a6a | |||
e20cf1ac78 | |||
8d4e650a95 | |||
82fd68b985 | |||
6ddd43f361 | |||
4e2ae30a47 | |||
32bc064d10 | |||
87606c6a6b | |||
955afb8711 | |||
3309031fd1 | |||
a2235c269a | |||
1cf2c9edd0 | |||
64a3ecf9b1 | |||
f144ed6e87 | |||
a47e0f9845 | |||
0737c8f416 | |||
fba350eaad | |||
6d5e93b00b | |||
f526e592fe | |||
751a94ab5d | |||
e0e128e207 | |||
137e6c8493 | |||
72751c2d92 | |||
b84fa852f6 | |||
d20961f323 | |||
5a01395a2b | |||
e59ca7053b | |||
6895592a7b | |||
eed27a2a4c | |||
43c6afa80f | |||
7d60f418e7 | |||
94dca1606f | |||
27774582b6 | |||
7dc08b06b1 | |||
a9d73b1017 | |||
25e4d0ba8b | |||
2d56395921 | |||
0ecddafc20 | |||
af34c8d2f4 | |||
5223599145 | |||
c96af776d6 | |||
34da48453e | |||
13dcd78be1 | |||
3bfa9916da | |||
b17017679b | |||
9d7832ea44 | |||
49605c7b00 | |||
bf8b9cecf5 | |||
c291291304 | |||
e08a4acd06 | |||
0397a104ba | |||
a41c1d4fda | |||
8ae3ed907a | |||
31cd8f738c | |||
a4cd9e0038 | |||
e06109c23c | |||
05485fe04c | |||
13062af7ef | |||
5e254666b0 | |||
d29eb8646a | |||
f1af37f220 | |||
d3880c0bff | |||
4dfa39457e | |||
325ff73c5b | |||
1fa4e3b1b2 | |||
f89091d0f0 | |||
859927df39 | |||
e7512fcd79 | |||
2b70151794 | |||
153b7d525d | |||
2e80995f19 | |||
9232cbf8a7 | |||
55f74bb863 | |||
b02e3719b3 | |||
3ba4304da9 | |||
49d6db34b7 | |||
63a0e521fd | |||
c00d79bae2 | |||
30d902f898 | |||
8f9da6f801 | |||
20648e9207 | |||
614fe202e0 | |||
c3646a7642 | |||
772df91762 | |||
c90910731f | |||
ba69cd99d1 | |||
fb6e341efd | |||
3dc4f01113 | |||
d94d0f60c8 | |||
8d79f6f4c8 | |||
c5e5bb0be1 | |||
8d139bbd95 | |||
fb1bb291eb | |||
3199620a83 | |||
c88bb66369 | |||
a60d57ea1f | |||
527ce66cd4 | |||
40415a6849 | |||
1ff638a51f | |||
2a9ccf2e2c | |||
2909d91c13 | |||
0dba12193d | |||
02f40b3b63 | |||
1fd51efc7f | |||
6f881f232e | |||
be12c71534 | |||
6aa1b817c9 | |||
300961e19e | |||
b191e9ef91 | |||
5ec5978d4a | |||
f4d90bc127 | |||
bfa34914db | |||
8d1e4659d1 | |||
b3b91f1699 | |||
ff4c5270d3 | |||
e240f7ea59 | |||
9f1ad5d86d | |||
a1ab32af0f | |||
3fac0632a8 | |||
c2b518929d | |||
c422d82752 | |||
da0c7fc2b6 | |||
167bc080d9 | |||
7d7a15f978 | |||
1b5cf0b8a8 | |||
306b005943 | |||
d229abf07d | |||
6f6251c0bc | |||
fd034e3551 | |||
f9bee05d49 | |||
37c6fbc6b2 | |||
9719604b79 | |||
b6262f0666 | |||
6c0bd207e9 | |||
91b13effc8 | |||
143ab6ac7f | |||
3e5b90dbba | |||
b82039e324 | |||
83862d04a0 | |||
52d07f6d9b | |||
21de88c3ba | |||
456ca3d3e0 | |||
f4ba3e4ab8 | |||
d4db5a59c1 | |||
4aee87a31b | |||
e8f5a842b1 | |||
5c681a76b6 | |||
53a24e6ddd | |||
b27c89f836 | |||
9f870aa1c7 | |||
c9cfeb8318 | |||
497e66ce6a | |||
bc973b80d7 | |||
85846d88f0 | |||
6b7c85b079 | |||
d80ef67d1d | |||
62f3457a95 | |||
636ab4b0e9 | |||
23e382dd33 | |||
f5a170ce46 | |||
fbd6beea2c | |||
360f5b1642 | |||
f0a785df9d | |||
e2c1bfbedd | |||
7e5a1cfd90 | |||
07deda593a | |||
1ca39e8586 | |||
402fd8ec29 | |||
fbe2e30f38 | |||
fb6ead2881 | |||
7ff7fb5d3b | |||
8030d9ad32 | |||
45bc850715 | |||
51a913730e | |||
0a4974ac8c | |||
1666fa195d | |||
a9df4e7516 | |||
343b3351f1 | |||
407b12c3cb | |||
455a8f3076 | |||
5067bda61a | |||
e138b6e3af | |||
9bc9d5165f | |||
26c2cb9f65 | |||
da44649e6f | |||
a0def23940 | |||
f49b58cf97 | |||
cadd9a99c0 | |||
7061889a29 | |||
764527c8c9 | |||
18742fcc32 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -60,7 +60,6 @@ src/calendar-server/evolution-calendar.desktop
|
|||||||
src/calendar-server/org.gnome.Shell.CalendarServer.service
|
src/calendar-server/org.gnome.Shell.CalendarServer.service
|
||||||
src/gnome-shell
|
src/gnome-shell
|
||||||
src/gnome-shell-calendar-server
|
src/gnome-shell-calendar-server
|
||||||
src/gnome-shell-extension-prefs
|
|
||||||
src/gnome-shell-extension-tool
|
src/gnome-shell-extension-tool
|
||||||
src/gnome-shell-hotplug-sniffer
|
src/gnome-shell-hotplug-sniffer
|
||||||
src/gnome-shell-perf-helper
|
src/gnome-shell-perf-helper
|
||||||
|
@ -9,7 +9,6 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
BUNDLE: "extensions-git.flatpak"
|
BUNDLE: "extensions-git.flatpak"
|
||||||
JS_LOG: "js-report.txt"
|
JS_LOG: "js-report.txt"
|
||||||
POT_LOG: "pot-update.txt"
|
|
||||||
|
|
||||||
.only_default: &only_default
|
.only_default: &only_default
|
||||||
only:
|
only:
|
||||||
@ -18,7 +17,7 @@ variables:
|
|||||||
- merge_requests
|
- merge_requests
|
||||||
|
|
||||||
check_commit_log:
|
check_commit_log:
|
||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
|
||||||
stage: review
|
stage: review
|
||||||
variables:
|
variables:
|
||||||
GIT_DEPTH: "100"
|
GIT_DEPTH: "100"
|
||||||
@ -28,10 +27,10 @@ check_commit_log:
|
|||||||
- merge_requests
|
- merge_requests
|
||||||
|
|
||||||
js_check:
|
js_check:
|
||||||
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2
|
||||||
stage: review
|
stage: review
|
||||||
script:
|
script:
|
||||||
- find js -name '*.js' -exec js60 -c -s '{}' ';' 2>&1 | tee $JS_LOG
|
- find js -name '*.js' -exec js68 -c -s '{}' ';' 2>&1 | tee $JS_LOG
|
||||||
- (! grep -q . $JS_LOG)
|
- (! grep -q . $JS_LOG)
|
||||||
<<: *only_default
|
<<: *only_default
|
||||||
artifacts:
|
artifacts:
|
||||||
@ -40,7 +39,7 @@ js_check:
|
|||||||
when: on_failure
|
when: on_failure
|
||||||
|
|
||||||
eslint:
|
eslint:
|
||||||
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2
|
||||||
stage: review
|
stage: review
|
||||||
script:
|
script:
|
||||||
- ./.gitlab-ci/run-eslint.sh
|
- ./.gitlab-ci/run-eslint.sh
|
||||||
@ -51,22 +50,23 @@ eslint:
|
|||||||
when: always
|
when: always
|
||||||
|
|
||||||
potfile_check:
|
potfile_check:
|
||||||
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2
|
||||||
stage: review
|
stage: review
|
||||||
script:
|
script:
|
||||||
- ./.gitlab-ci/check-potfiles.sh
|
- ./.gitlab-ci/check-potfiles.sh
|
||||||
<<: *only_default
|
<<: *only_default
|
||||||
|
|
||||||
no_template_check:
|
no_template_check:
|
||||||
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2
|
||||||
stage: review
|
stage: review
|
||||||
script:
|
script:
|
||||||
- ./.gitlab-ci/check-template-strings.sh
|
- ./.gitlab-ci/check-template-strings.sh
|
||||||
<<: *only_default
|
<<: *only_default
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
|
||||||
stage: build
|
stage: build
|
||||||
|
needs: []
|
||||||
before_script:
|
before_script:
|
||||||
- .gitlab-ci/checkout-mutter.sh
|
- .gitlab-ci/checkout-mutter.sh
|
||||||
- meson mutter mutter/build --prefix=/usr -Dtests=false
|
- meson mutter mutter/build --prefix=/usr -Dtests=false
|
||||||
@ -83,8 +83,9 @@ build:
|
|||||||
- build
|
- build
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
|
||||||
stage: test
|
stage: test
|
||||||
|
needs: ["build"]
|
||||||
variables:
|
variables:
|
||||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||||
NO_AT_BRIDGE: "1"
|
NO_AT_BRIDGE: "1"
|
||||||
@ -99,24 +100,9 @@ test:
|
|||||||
- build/meson-logs/testlog.txt
|
- build/meson-logs/testlog.txt
|
||||||
when: on_failure
|
when: on_failure
|
||||||
|
|
||||||
test-pot:
|
|
||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
|
||||||
stage: test
|
|
||||||
before_script:
|
|
||||||
- ninja -C mutter/build install
|
|
||||||
script:
|
|
||||||
# Check that pot files are generated correctly:
|
|
||||||
# https://savannah.gnu.org/bugs/?50920#comment5
|
|
||||||
- ninja -C build gnome-shell-pot 2>&1 | awk '
|
|
||||||
BEGIN { start=0; }
|
|
||||||
start==1 { print $0; }
|
|
||||||
/gnome-shell-pot/ { start=1; }
|
|
||||||
' | tee $POT_LOG
|
|
||||||
- (! grep -q . $POT_LOG)
|
|
||||||
<<: *only_default
|
|
||||||
|
|
||||||
flatpak:
|
flatpak:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs: []
|
||||||
variables:
|
variables:
|
||||||
SUBPROJECT: "subprojects/extensions-app"
|
SUBPROJECT: "subprojects/extensions-app"
|
||||||
# Your manifest path
|
# Your manifest path
|
||||||
@ -124,11 +110,7 @@ flatpak:
|
|||||||
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||||
FLATPAK_MODULE: "gnome-extensions-app"
|
FLATPAK_MODULE: "gnome-extensions-app"
|
||||||
APP_ID: "org.gnome.Extensions"
|
APP_ID: "org.gnome.Extensions"
|
||||||
MESON_ARGS: "$SUBPROJECT"
|
|
||||||
extends: .flatpak
|
extends: .flatpak
|
||||||
before_script:
|
|
||||||
- flatpak run --command=$SUBPROJECT/generate-translations.sh
|
|
||||||
--filesystem=host org.gnome.Sdk//master
|
|
||||||
<<: *only_default
|
<<: *only_default
|
||||||
|
|
||||||
nightly:
|
nightly:
|
||||||
|
24
.gitlab-ci/Dockerfile
Normal file
24
.gitlab-ci/Dockerfile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Rebuild and push with
|
||||||
|
#
|
||||||
|
# cd .gitlab-ci/
|
||||||
|
# podman build --format docker --no-cache -t registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2 .
|
||||||
|
# podman push registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM registry.fedoraproject.org/fedora:32
|
||||||
|
|
||||||
|
RUN dnf -y update && dnf -y upgrade && \
|
||||||
|
dnf install -y 'dnf-command(copr)' git && \
|
||||||
|
|
||||||
|
# For syntax checks with `find . -name '*.js' -exec js68 -c -s '{}' ';'`
|
||||||
|
dnf install -y findutils mozjs68-devel && \
|
||||||
|
|
||||||
|
# For static analysis with eslint
|
||||||
|
dnf install -y nodejs && \
|
||||||
|
npm install -g eslint && \
|
||||||
|
|
||||||
|
# Shameless plug for my own tooling; useful for generating zip
|
||||||
|
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
||||||
|
dnf install -y gnome-extensions-tool meson && \
|
||||||
|
|
||||||
|
dnf clean all
|
@ -1,18 +0,0 @@
|
|||||||
FROM registry.fedoraproject.org/fedora:latest
|
|
||||||
|
|
||||||
RUN dnf -y update && dnf -y upgrade && \
|
|
||||||
dnf install -y 'dnf-command(copr)' git && \
|
|
||||||
|
|
||||||
# For syntax checks with `find . -name '*.js' -exec js60 -c -s '{}' ';'`
|
|
||||||
dnf install -y findutils mozjs60-devel && \
|
|
||||||
|
|
||||||
# For static analysis with eslint
|
|
||||||
dnf install -y nodejs && \
|
|
||||||
npm install -g eslint && \
|
|
||||||
|
|
||||||
# Shameless plug for my own tooling; useful for generating zip
|
|
||||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
|
||||||
dnf install -y gnome-extensions-tool meson && \
|
|
||||||
|
|
||||||
dnf clean all && \
|
|
||||||
rm -rf /var/cache/dnf
|
|
@ -6,6 +6,11 @@ globs=('*.js' '*.c')
|
|||||||
# find source files that contain gettext keywords
|
# find source files that contain gettext keywords
|
||||||
files=$(grep -lR ${globs[@]/#/--include=} '\(gettext\|[^I_)]_\)(' $srcdirs)
|
files=$(grep -lR ${globs[@]/#/--include=} '\(gettext\|[^I_)]_\)(' $srcdirs)
|
||||||
|
|
||||||
|
# filter out excluded files
|
||||||
|
if [ -f po/POTFILES.skip ]; then
|
||||||
|
files=$(for f in $files; do ! grep -q ^$f po/POTFILES.skip && echo $f; done)
|
||||||
|
fi
|
||||||
|
|
||||||
# find those that aren't listed in POTFILES.in
|
# find those that aren't listed in POTFILES.in
|
||||||
missing=$(for f in $files; do ! grep -q ^$f po/POTFILES.in && echo $f; done)
|
missing=$(for f in $files; do ! grep -q ^$f po/POTFILES.in && echo $f; done)
|
||||||
|
|
||||||
|
@ -18,12 +18,14 @@ run_eslint() {
|
|||||||
local extra_args=ARGS_$1
|
local extra_args=ARGS_$1
|
||||||
local output_var=OUTPUT_$1
|
local output_var=OUTPUT_$1
|
||||||
local output=${!output_var}
|
local output=${!output_var}
|
||||||
|
local cache=.eslintcache-${1,,}
|
||||||
|
|
||||||
# ensure output exists even if eslint doesn't report any errors
|
# ensure output exists even if eslint doesn't report any errors
|
||||||
mkdir -p $(dirname $output)
|
mkdir -p $(dirname $output)
|
||||||
touch $output
|
touch $output
|
||||||
|
|
||||||
eslint -f unix ${!extra_args} -o $output js subprojects/extensions-app/js
|
eslint -f unix --cache --cache-location $cache ${!extra_args} -o $output \
|
||||||
|
js subprojects/extensions-app/js
|
||||||
}
|
}
|
||||||
|
|
||||||
list_commit_range_additions() {
|
list_commit_range_additions() {
|
||||||
|
@ -131,7 +131,7 @@ whenever possible, that is when not inheriting from GObjects.
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
For GObject inheritence, we use the GObject.registerClass() function provided
|
For GObject inheritance, we use the GObject.registerClass() function provided
|
||||||
by gjs.
|
by gjs.
|
||||||
```javascript
|
```javascript
|
||||||
var MyActor = GObject.registerClass(
|
var MyActor = GObject.registerClass(
|
||||||
|
193
NEWS
193
NEWS
@ -1,3 +1,178 @@
|
|||||||
|
3.37.91
|
||||||
|
=======
|
||||||
|
* Fix potential stack overflow in libcroco [Michael; !1404]
|
||||||
|
* Fix page removal in app picker [Georges; !1406]
|
||||||
|
* Fix "old style" VPN authentication [Florian; !1407]
|
||||||
|
* Fix X11 session login [Benjamin; !1418]
|
||||||
|
* Fix week number alignment when using font-scaling [Joonas; !1415]
|
||||||
|
* Fix lock screen on systems without GLSL shader support [Zephaniah; #3071]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Jonas, Georges, Andre, Will, Björn;
|
||||||
|
!1396, !1359, !1408, !1409, !1414, !1413, !1416, #3073]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Ådahl, Benjamin Berg, Michael Catanzaro, Björn Daase, Joonas Henriksson,
|
||||||
|
Zephaniah E. Loss-Cutler-Hull, Andre Moreira Magalhaes, Florian Müllner,
|
||||||
|
Georges Basile Stavracas Neto, Will Thompson
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Fran Dieguez [gl], Jordi Mas [ca], Daniel Mustieles [es],
|
||||||
|
Florentina Mușat [ro], Akarshan Biswas [bn_IN], Baurzhan Muftakhidinov [kk],
|
||||||
|
Piotr Drąg [pl], Rafael Fontenelle [pt_BR], Emin Tufan Çetin [tr],
|
||||||
|
sicklylife [ja], Danial Behzadi [fa], Jiri Grönroos [fi], Goran Vidović [hr],
|
||||||
|
Matej Urbančič [sl], Boyuan Yang [zh_CN]
|
||||||
|
|
||||||
|
3.37.90
|
||||||
|
=======
|
||||||
|
* Fix extension updates when many extensions are installed [Jeremias; !1363]
|
||||||
|
* Fix missing icons in on-screen keyboard [Emre; #2631, #3007]
|
||||||
|
* Fix delay when showing calendar events [Sebastian; #2992]
|
||||||
|
* Allow rearranging items in app picker [Georges; !1284]
|
||||||
|
* Fix top bar navigation when NumLock is active [Olivier; #550]
|
||||||
|
* Delay login animation until wallpaper has loaded [Michael; #734996]
|
||||||
|
* Reset auth prompt on login screen on VT switch before fade in [Ray; #2997]
|
||||||
|
* Move screencasting into a separate service [Jonas Å.; !1372]
|
||||||
|
* Replace loaded terms with more descriptive one [Olivier; !1393]
|
||||||
|
* Add "Boot Options" support to restart dialog [Hans; !199]
|
||||||
|
* Move "Restart" into a separate menu item/dialog [Florian; #2202]
|
||||||
|
* Default to not installing updates on low battery [Michael; #2717]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Daniel V., Georges, Jonas Å.,
|
||||||
|
Daniel G., Carlos, Benjamin, Piotr, Andre, Jonas D., Andy; !1357, !1356,
|
||||||
|
#2969, #2969, !1358, !1371, #3005, !1380, #3022, !1381, !895, !1387, !1386,
|
||||||
|
!1385, #3037, !1389, !1390, !1391, !1383, !1399, #2983, !1403]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Ådahl, Benjamin Berg, Michael Catanzaro, Piotr Drąg, Jonas Dreßler,
|
||||||
|
Olivier Fourdan, Carlos Garnacho, Hans de Goede, Andy Holmes,
|
||||||
|
Sebastian Keller, Andre Moreira Magalhaes, Daniel García Moreno,
|
||||||
|
Florian Müllner, Georges Basile Stavracas Neto, Jeremias Ortega, Ray Strode,
|
||||||
|
Emre Uyguroglu, Daniel van Vugt
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Tim Sabsch [de], Boyuan Yang [zh_CN], Fabio Tomat [fur],
|
||||||
|
Efstathios Iosifidis [el], Rafael Fontenelle [pt_BR], Yuri Chornoivan [uk],
|
||||||
|
Daniel Șerbănescu [ro], Jordi Mas [ca], Daniel Mustieles [es],
|
||||||
|
Emin Tufan Çetin [tr], Asier Sarasua Garmendia [eu]
|
||||||
|
|
||||||
|
3.37.3
|
||||||
|
======
|
||||||
|
* Refactor and clean up window picker
|
||||||
|
[Jonas D., Florian; !1297, !1298, !1305, !1345, !1353]
|
||||||
|
* Move calendar events out of notifications list [Florian; !1282]
|
||||||
|
* Refine app folder dialogs [Georges; !1301]
|
||||||
|
* Hide switch-user button on lock screen if unsupported [Chingkai; #2687]
|
||||||
|
* Refactor and clean up app picker pagination [Georges; !1271]
|
||||||
|
* Add API to retrieve specified mimetypes from clipboards [Carlos; !1321]
|
||||||
|
* Support prepending workspace with horizontal layouts [Florian; #2916]
|
||||||
|
* Update microphone icon on input volume changes [fludixx; #2902]
|
||||||
|
* Cache labels on GPU [Daniel; !1329]
|
||||||
|
* Fix regressions in redesigned modal dialogs [Florian, Jonas D.; #2491, !1336]
|
||||||
|
* Use GIcon for all application icons [Florian; !1342]
|
||||||
|
* Support pre-authenticated logins in vmware environments [yun341; #1983]
|
||||||
|
* Better support sandboxed apps with multiple .desktop files [Florian; #219]
|
||||||
|
* Fix on-screen keyboard size in portrait orientation [Florian; #2349]
|
||||||
|
* Plugged leaks [Sebastian, Daniel, Florian; !1306, !1319, !1341]
|
||||||
|
* Misc. bug fixes and cleanups [Jonas D., Georges, Marco, Florian, Sebastian,
|
||||||
|
MOZGIII, Daniel, Mariana, Jonas Å.; !1296, !1295, #2643, !1300, !1309,
|
||||||
|
!1119, #2901, !1313, !1251, !1285, !1307, !1318, !1310, !1320, !1327, !1315,
|
||||||
|
!1289, !1331, !1332, !1333, !1334, !1340, !1287, !1308, !1346, !1299, !1343,
|
||||||
|
!1351, !1352, !1322]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Chingkai, Jonas Dreßler, Carlos Garnacho,
|
||||||
|
Sebastian Keller, MOZGIII, Florian Müllner, Georges Basile Stavracas Neto,
|
||||||
|
Mariana Picolo, Daniel van Vugt, fludixx, yun341, Jonas Ådahl
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Daniel Mustieles [es], Boyuan Yang [zh_CN], Yuri Chornoivan [uk],
|
||||||
|
Jordi Mas [ca], sicklylife [ja], Emin Tufan Çetin [tr],
|
||||||
|
Baurzhan Muftakhidinov [kk], Florentina Mușat [ro], Aurimas Černius [lt],
|
||||||
|
Rūdolfs Mazurs [lv]
|
||||||
|
|
||||||
|
3.37.2
|
||||||
|
======
|
||||||
|
* Add support for "PrefersNonDefaultGPU" desktop key [Bastien; !1226]
|
||||||
|
* Only start systemd units when running under systemd
|
||||||
|
[Carlos, Florian; #2755, !1242, !1252]
|
||||||
|
* Fix "ghost" media controls [Bryan; #2776]
|
||||||
|
* Fix zombie sockets from extensions downloader [Michael; #2774]
|
||||||
|
* Update world clocks offsets when timezone changes [Bryan; #2209]
|
||||||
|
* Support scrolling anywhere in slider menu items [Peter; #2795]
|
||||||
|
* Fix "Do Not Disturb" setting getting reset on startup [Florian; #2804]
|
||||||
|
* Only allow updates for extensions that aren't cached [Florian; !1248]
|
||||||
|
* Fix matching notifications by PID [Florian; #2592]
|
||||||
|
* Indicate extension errors in Extensions app [Florian; #2337]
|
||||||
|
* Add clipboard API for querying supported mimetypes [Andy; #2819]
|
||||||
|
* Add preview to color picker [Florian; #451]
|
||||||
|
* Improve world clocks styling [PrOF-kk; #2825]
|
||||||
|
* Remove Frequent view from app picker [Georges; !880]
|
||||||
|
* Fix pad OSD glitches [Carlos; !1290]
|
||||||
|
* Expose actor tree in looking glass [Georges; !1292]
|
||||||
|
* Fixed crashes [Jonas D., Florian; #2709, #2757]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, AsciiWolf, Michael, Piotr, Ting-Wei,
|
||||||
|
Amr, Alexander, Bryan, Georges, Jonas D., Andy, Björn, Koki, Carlos; !1229,
|
||||||
|
!1231, !1233, !1235, #2578, #2735, #2751, #2602, #2777, !1249, #2796, !1268,
|
||||||
|
!1269, !1265, !1245, !1273, #2816, !1274, !1263, !1188, !1276, #2652, !1277,
|
||||||
|
!1281, #2286, !1267, !1286, !1279, !1288, !1293, !1294, !1291]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
AsciiWolf, Michael Catanzaro, Björn Daase, Jonas Dreßler, Bryan Dunsmore,
|
||||||
|
Koki Fukuda, Carlos Garnacho, Andy Holmes, Amr Ibrahim, Soslan Khubulov,
|
||||||
|
Ting-Wei Lan, Michael Lass, Alexander Mikhaylenko, Florian Müllner,
|
||||||
|
Georges Basile Stavracas Neto, Bastien Nocera, PrOF-kk, Peter Simonyi
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Fabio Tomat [fur], Cheng-Chia Tseng [zh_TW], Yuri Chornoivan [uk],
|
||||||
|
Dušan Kazik [sk], Piotr Drąg [pl], Soslan Khubulov [os],
|
||||||
|
Daniel Mustieles [es], Nathan Follens [nl], Bruce Cowan [en_GB],
|
||||||
|
Florentina Mușat [ro], Milo Casagrande [it], Anders Jonsson [sv],
|
||||||
|
Charles Monzat [fr], Danial Behzadi [fa], sicklylife [ja], Kukuh Syafaat [id],
|
||||||
|
Jordi Mas [ca], Emin Tufan Çetin [tr], Jiri Grönroos [fi], Марко Костић [sr],
|
||||||
|
Christian Kirbach [de], Changwoo Ryu [ko], Matej Urbančič [sl]
|
||||||
|
|
||||||
|
3.37.1
|
||||||
|
======
|
||||||
|
* Improve bluetooth submenu title [Mariana; #2340]
|
||||||
|
* Add openPrefs() convenience method for extensions [Florian; !1163]
|
||||||
|
* Bring back support for empty StIcons [Andre, Jonas D.; !1173, !1178]
|
||||||
|
* Wake up screen when unlocking programmatically [Florian; !1158]
|
||||||
|
* Improve extensions tool error reporting [Florian; #2391]
|
||||||
|
* Improve handling of scale-factor changes [Georges; !1176]
|
||||||
|
* Tone down weekend days with events in calendar [Jakub; #2588]
|
||||||
|
* Fix showing bluetooth submenu when devices were set up [Florian; !1174]
|
||||||
|
* Add support for parental controls filtering [Philip W.; !465]
|
||||||
|
* Provide alternative extension templates [Florian; !812]
|
||||||
|
* Improve weather section's empty state [Mariana; #2179]
|
||||||
|
* Fix translations of folder names [Florian; #2623]
|
||||||
|
* Drop Tweener [Jonas Å.; !1200]
|
||||||
|
* Match ASCII alternatives of system actions [Will; #2688]
|
||||||
|
* Fix delay on lock screen after entering wrong password [Jonas D.; #2655]
|
||||||
|
* Use globalThis instead of window [Andy; #2322]
|
||||||
|
* Inhibit remote access when disabled by session mode [Jonas Å.; !1210]
|
||||||
|
* Improve calendar-server performance [Milan; #1875]
|
||||||
|
* Add gnome-shell-extension-prefs wrapper for compatibility [Florian; !1220]
|
||||||
|
* Fix stuck lock screen after unlock [Jonas D., Florian; #2446]
|
||||||
|
* Fixed crashes [Jonas D., Florian, Carlos; #2584, #2625, !1223, !1218]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Jonas Å., Marco, Andre, Georges,
|
||||||
|
Jonas D., Jan, Philip Ch.,, Xiaoguang, Will, Jordan, Matthew, qarmin;
|
||||||
|
!1126, !1155, !1156, !1165, !1168, !1169, #2551, #2563, !1172, !1175, !1179,
|
||||||
|
!1160, #2562, #2578, !1184, #2559, !1186, #2607, !1191, !1194, !1199, !1203,
|
||||||
|
#2649, #2628, !1205, !1206, !1208, !1207, !1211, !1214, !1213, !1192, !1217,
|
||||||
|
!1219, #1615, #2691, !1094, !1177]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Philip Chimento, Milan Crha, Jonas Dreßler,
|
||||||
|
Carlos Garnacho, Andy Holmes, Matthew Leeds, Andre Moreira Magalhaes,
|
||||||
|
Florian Müllner, Georges Basile Stavracas Neto, Jordan Petridis,
|
||||||
|
Mariana Picolo, Jakub Steiner, Will Thompson, Jan Tojnar, Xiaoguang Wang,
|
||||||
|
Philip Withnall, qarmin, Jonas Ådahl
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Fabio Tomat [fur], Cheng-Chia Tseng [zh_TW], Danial Behzadi [fa],
|
||||||
|
Jiri Grönroos [fi], Ibai Oihanguren Sala [eu], Марко Костић [sr],
|
||||||
|
Rūdolfs Mazurs [lv], Yuri Chornoivan [uk], Carmen Bianca BAKKER [eo],
|
||||||
|
Dingzhong Chen [zh_CN], Rafael Fontenelle [pt_BR], Petr Kovář [cs],
|
||||||
|
Asier Sarasua Garmendia [eu], Daniel Mustieles [es], Emin Tufan Çetin [tr]
|
||||||
|
|
||||||
3.36.0
|
3.36.0
|
||||||
======
|
======
|
||||||
* Fix off-by-1900 error in date conversions [Florian; !1061]
|
* Fix off-by-1900 error in date conversions [Florian; !1061]
|
||||||
@ -110,7 +285,7 @@ Translators:
|
|||||||
* Handle extension updates [Florian; !945]
|
* Handle extension updates [Florian; !945]
|
||||||
* Animate showing and hiding caps-lock warning [Jonas; !952]
|
* Animate showing and hiding caps-lock warning [Jonas; !952]
|
||||||
* Support "auto" lengths in CSS [Florian; !971]
|
* Support "auto" lengths in CSS [Florian; !971]
|
||||||
* Turn extension-prefs into the offical Extensions app [Florian; #1968]
|
* Turn extension-prefs into the official Extensions app [Florian; #1968]
|
||||||
* Sandbox the portal helper [Michael; !983]
|
* Sandbox the portal helper [Michael; !983]
|
||||||
* Misc. bug fixes and cleanups [Florian, Björn, Jakub, Alexander, Daniel V.,
|
* Misc. bug fixes and cleanups [Florian, Björn, Jakub, Alexander, Daniel V.,
|
||||||
Jonas, nana-4, Carlos, Sebastian, Daniel G., Georges, Piotr; !918, !917,
|
Jonas, nana-4, Carlos, Sebastian, Daniel G., Georges, Piotr; !918, !917,
|
||||||
@ -399,7 +574,7 @@ Translators:
|
|||||||
======
|
======
|
||||||
* Fix keeping actors visible in scrollviews [Marco; #1061]
|
* Fix keeping actors visible in scrollviews [Marco; #1061]
|
||||||
* Move some chrome above popup windows [Jonas D.; !358]
|
* Move some chrome above popup windows [Jonas D.; !358]
|
||||||
* Include 'sandboxed-app-id' in winodw introspection info [Florian; #1289]
|
* Include 'sandboxed-app-id' in window introspection info [Florian; #1289]
|
||||||
* Port to libecal-2.0 [Milan; !501]
|
* Port to libecal-2.0 [Milan; !501]
|
||||||
* Support TCRYPT in mount password dialog [segfault; !126]
|
* Support TCRYPT in mount password dialog [segfault; !126]
|
||||||
* Misc. bug fixes and cleanups [Florian, Marco, Veerasamy; !517, #745, !499,
|
* Misc. bug fixes and cleanups [Florian, Marco, Veerasamy; !517, #745, !499,
|
||||||
@ -948,7 +1123,7 @@ Translations:
|
|||||||
* gdm: Fix "Not listed" focus indication [Florian; #784040]
|
* gdm: Fix "Not listed" focus indication [Florian; #784040]
|
||||||
* Fix missing icons in freedesktop notifications [Florian; #784245]
|
* Fix missing icons in freedesktop notifications [Florian; #784245]
|
||||||
* gdm: Disable user list when empty [Xiaoguang; #731320]
|
* gdm: Disable user list when empty [Xiaoguang; #731320]
|
||||||
* gdm: Allow empty reponse to PAM messages [Ray; #784360]
|
* gdm: Allow empty response to PAM messages [Ray; #784360]
|
||||||
* Fix blocked clicks in shutdown dialog [Florian; #781738]
|
* Fix blocked clicks in shutdown dialog [Florian; #781738]
|
||||||
* Show OSD popup when changing volume via scroll wheel [Florian; #781028]
|
* Show OSD popup when changing volume via scroll wheel [Florian; #781028]
|
||||||
* Refine list search results [Rares; #749957]
|
* Refine list search results [Rares; #749957]
|
||||||
@ -2408,7 +2583,7 @@ Translations:
|
|||||||
* Merge the wayland branch [Giovanni, Neil; #707467]
|
* Merge the wayland branch [Giovanni, Neil; #707467]
|
||||||
* Make search entry behave better in RTL locales [Matthias, Florian; #705779]
|
* Make search entry behave better in RTL locales [Matthias, Florian; #705779]
|
||||||
* Allow to change app pages with pageUp/pageDown keys [Carlos; #707979]
|
* Allow to change app pages with pageUp/pageDown keys [Carlos; #707979]
|
||||||
* Set approriate a11y states on expandable menu items [Alejandro; #708038]
|
* Set appropriate a11y states on expandable menu items [Alejandro; #708038]
|
||||||
* Improve page indicator animation [Carlos; #707565]
|
* Improve page indicator animation [Carlos; #707565]
|
||||||
* Misc bug fixes and cleanups [Florian, Olivier, Jasper, Giovanni, Magdalen,
|
* Misc bug fixes and cleanups [Florian, Olivier, Jasper, Giovanni, Magdalen,
|
||||||
Adel, Carlos, Rico, Joanmarie; #707308, #707430, #707508, #707557, #707600,
|
Adel, Carlos, Rico, Joanmarie; #707308, #707430, #707508, #707557, #707600,
|
||||||
@ -3692,7 +3867,7 @@ Translations:
|
|||||||
* Update the calendar code to use ECalClient [Giovanni; #671177]
|
* Update the calendar code to use ECalClient [Giovanni; #671177]
|
||||||
* Update jhbuild script to use the main moduleset [Owen, Will; #668440]
|
* Update jhbuild script to use the main moduleset [Owen, Will; #668440]
|
||||||
* StTextureCache: code cleanup, evict unused icons, merge together
|
* StTextureCache: code cleanup, evict unused icons, merge together
|
||||||
simulataneous requests for the same icon [Jasper; #670771, #671656, #672273]
|
simultaneous requests for the same icon [Jasper; #670771, #671656, #672273]
|
||||||
* Clean up St for recent Clutter changes and fix bugs. StContainer and
|
* Clean up St for recent Clutter changes and fix bugs. StContainer and
|
||||||
StGroup are removed [Jasper, Florian; #670034, #670640, #670904]
|
StGroup are removed [Jasper, Florian; #670034, #670640, #670904]
|
||||||
* Code cleanup [Adel, Jasper, Rui; #613194, #671086, #671103]
|
* Code cleanup [Adel, Jasper, Rui; #613194, #671086, #671103]
|
||||||
@ -3827,7 +4002,7 @@ Translations:
|
|||||||
[Stefano; #664201]
|
[Stefano; #664201]
|
||||||
- Delay rearranging windows in the overview as long as the pointer
|
- Delay rearranging windows in the overview as long as the pointer
|
||||||
is over a window [Vit; #645325]
|
is over a window [Vit; #645325]
|
||||||
* Add a GConf => DConf migration file for overriden Mutter settings
|
* Add a GConf => DConf migration file for overridden Mutter settings
|
||||||
[Florian; #667636]
|
[Florian; #667636]
|
||||||
* When a VPN connection is active, show that as the network icon
|
* When a VPN connection is active, show that as the network icon
|
||||||
[Giovanni; #665115]
|
[Giovanni; #665115]
|
||||||
@ -4074,7 +4249,7 @@ Translations:
|
|||||||
- Add fingerprint reader support [Ray; #657823]
|
- Add fingerprint reader support [Ray; #657823]
|
||||||
- Add a power button offering the choice of Suspend/Restart/Power off
|
- Add a power button offering the choice of Suspend/Restart/Power off
|
||||||
[Ray; #657822]
|
[Ray; #657822]
|
||||||
- Remove the option to view the current keyboad layout [Matthias; #659164]
|
- Remove the option to view the current keyboard layout [Matthias; #659164]
|
||||||
- Make Control-Alt-Tab work for full keyboard access [Ray; #659177]
|
- Make Control-Alt-Tab work for full keyboard access [Ray; #659177]
|
||||||
* Frequently initiate a full garbage collection; Spidermonkey isn't very good
|
* Frequently initiate a full garbage collection; Spidermonkey isn't very good
|
||||||
at tracking the amount of resources we have allocated so this hopefully will
|
at tracking the amount of resources we have allocated so this hopefully will
|
||||||
@ -4291,7 +4466,7 @@ Translations:
|
|||||||
* Fix selection highlighting for light-on-dark entries [Jasper; #643768]
|
* Fix selection highlighting for light-on-dark entries [Jasper; #643768]
|
||||||
* Make control-Return in the overview open a new window [Maxim]
|
* Make control-Return in the overview open a new window [Maxim]
|
||||||
* Delay showing the alt-Tab switcher to reduce visual noise when
|
* Delay showing the alt-Tab switcher to reduce visual noise when
|
||||||
flipping betweeen windows [Dan; #652346]
|
flipping between windows [Dan; #652346]
|
||||||
* When we have vertically stacked monitors, put the message tray
|
* When we have vertically stacked monitors, put the message tray
|
||||||
on the bottom one [Dan; #636963]
|
on the bottom one [Dan; #636963]
|
||||||
* Fix various problems with keynav and the Activities button
|
* Fix various problems with keynav and the Activities button
|
||||||
@ -4442,7 +4617,7 @@ Translations:
|
|||||||
- Fix missing device descriptions with multiple devices of the
|
- Fix missing device descriptions with multiple devices of the
|
||||||
same type [Giovanni]
|
same type [Giovanni]
|
||||||
https://bugzilla.gnome.org/show_bug.cgi?id=646074
|
https://bugzilla.gnome.org/show_bug.cgi?id=646074
|
||||||
- Label ad-hoc neworks with an appropriate icon [Dan]
|
- Label ad-hoc networks with an appropriate icon [Dan]
|
||||||
https://bugzilla.gnome.org/show_bug.cgi?id=646141
|
https://bugzilla.gnome.org/show_bug.cgi?id=646141
|
||||||
- Fix displaying some devices states as "invalid" [Dan]
|
- Fix displaying some devices states as "invalid" [Dan]
|
||||||
https://bugzilla.gnome.org/show_bug.cgi?id=646946
|
https://bugzilla.gnome.org/show_bug.cgi?id=646946
|
||||||
|
@ -123,7 +123,7 @@ def locale_to_xkb(locale, name):
|
|||||||
if xkb:
|
if xkb:
|
||||||
return xkb
|
return xkb
|
||||||
else:
|
else:
|
||||||
raise KeyError("layout %s explicitely disabled in overrides"
|
raise KeyError("layout %s explicitly disabled in overrides"
|
||||||
% locale)
|
% locale)
|
||||||
xkb_names = sorted(name_to_xkb.keys())
|
xkb_names = sorted(name_to_xkb.keys())
|
||||||
if name in xkb_names:
|
if name in xkb_names:
|
||||||
|
@ -20,6 +20,12 @@
|
|||||||
<method name="ListSessions">
|
<method name="ListSessions">
|
||||||
<arg name="sessions" type="a(susso)" direction="out"/>
|
<arg name="sessions" type="a(susso)" direction="out"/>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="CanRebootToBootLoaderMenu">
|
||||||
|
<arg type="s" direction="out"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetRebootToBootLoaderMenu">
|
||||||
|
<arg type="t" direction="in"/>
|
||||||
|
</method>
|
||||||
<signal name="PrepareForSleep">
|
<signal name="PrepareForSleep">
|
||||||
<arg type="b" direction="out"/>
|
<arg type="b" direction="out"/>
|
||||||
</signal>
|
</signal>
|
||||||
|
191
data/dbus-interfaces/org.gnome.Mutter.ScreenCast.xml
Normal file
191
data/dbus-interfaces/org.gnome.Mutter.ScreenCast.xml
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<!DOCTYPE node PUBLIC
|
||||||
|
'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'
|
||||||
|
'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>
|
||||||
|
<node>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
org.gnome.Mutter.ScreenCast:
|
||||||
|
@short_description: Screen cast interface
|
||||||
|
|
||||||
|
This API is private and not intended to be used outside of the integrated
|
||||||
|
system that uses libmutter. No compatibility between versions are
|
||||||
|
promised.
|
||||||
|
-->
|
||||||
|
<interface name="org.gnome.Mutter.ScreenCast">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
CreateSession:
|
||||||
|
@properties: Properties
|
||||||
|
@session_path: Path to the new session object
|
||||||
|
|
||||||
|
* "remote-desktop-session-id" (s): The ID of a remote desktop session.
|
||||||
|
Remote desktop driven screen casts
|
||||||
|
are started and stopped by the remote
|
||||||
|
desktop session.
|
||||||
|
* "disable-animations" (b): Set to "true" if the screen cast application
|
||||||
|
would prefer animations to be globally
|
||||||
|
disabled, while the session is running. Default
|
||||||
|
is "false". Available since version 3.
|
||||||
|
-->
|
||||||
|
<method name="CreateSession">
|
||||||
|
<arg name="properties" type="a{sv}" direction="in" />
|
||||||
|
<arg name="session_path" type="o" direction="out" />
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Version:
|
||||||
|
@short_description: API version
|
||||||
|
-->
|
||||||
|
<property name="Version" type="i" access="read" />
|
||||||
|
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
org.gnome.Mutter.ScreenCast.Session:
|
||||||
|
@short_description: Screen cast session
|
||||||
|
-->
|
||||||
|
<interface name="org.gnome.Mutter.ScreenCast.Session">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Start:
|
||||||
|
|
||||||
|
Start the screen cast session
|
||||||
|
-->
|
||||||
|
<method name="Start" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Stop:
|
||||||
|
|
||||||
|
Stop the screen cast session
|
||||||
|
-->
|
||||||
|
<method name="Stop" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Closed:
|
||||||
|
|
||||||
|
The session has closed.
|
||||||
|
-->
|
||||||
|
<signal name="Closed" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
RecordMonitor:
|
||||||
|
@connector: Connector of the monitor to record
|
||||||
|
@properties: Properties
|
||||||
|
@stream_path: Path to the new stream object
|
||||||
|
|
||||||
|
Record a single monitor.
|
||||||
|
|
||||||
|
Available @properties include:
|
||||||
|
|
||||||
|
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
|
||||||
|
Available since API version 2.
|
||||||
|
* "is-recording" (b): Whether this is a screen recording. May be
|
||||||
|
be used for choosing panel icon.
|
||||||
|
Default: false. Available since API version 4.
|
||||||
|
|
||||||
|
Available cursor mode values:
|
||||||
|
|
||||||
|
0: hidden - cursor is not included in the stream
|
||||||
|
1: embedded - cursor is included in the framebuffer
|
||||||
|
2: metadata - cursor is included as metadata in the PipeWire stream
|
||||||
|
-->
|
||||||
|
<method name="RecordMonitor">
|
||||||
|
<arg name="connector" type="s" direction="in" />
|
||||||
|
<arg name="properties" type="a{sv}" direction="in" />
|
||||||
|
<arg name="stream_path" type="o" direction="out" />
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
RecordWindow:
|
||||||
|
@properties: Properties used determining what window to select
|
||||||
|
@stream_path: Path to the new stream object
|
||||||
|
|
||||||
|
Supported since API version 2.
|
||||||
|
|
||||||
|
Record a single window. The cursor will not be included.
|
||||||
|
|
||||||
|
Available @properties include:
|
||||||
|
|
||||||
|
* "window-id" (t): Id of the window to record.
|
||||||
|
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see RecordMonitor).
|
||||||
|
* "is-recording" (b): Whether this is a screen recording. May be
|
||||||
|
be used for choosing panel icon.
|
||||||
|
Default: false. Available since API version 4.
|
||||||
|
|
||||||
|
-->
|
||||||
|
<method name="RecordWindow">
|
||||||
|
<arg name="properties" type="a{sv}" direction="in" />
|
||||||
|
<arg name="stream_path" type="o" direction="out" />
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
RecordArea:
|
||||||
|
@x: X position of the recorded area
|
||||||
|
@y: Y position of the recorded area
|
||||||
|
@width: width of the recorded area
|
||||||
|
@height: height of the recorded area
|
||||||
|
@properties: Properties
|
||||||
|
@stream_path: Path to the new stream object
|
||||||
|
|
||||||
|
Record an area of the stage. The coordinates are in stage coordinates.
|
||||||
|
The size of the stream does not necessarily match the size of the
|
||||||
|
recorded area, and will depend on DPI scale of the affected monitors.
|
||||||
|
|
||||||
|
Available @properties include:
|
||||||
|
|
||||||
|
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
|
||||||
|
Available since API version 2.
|
||||||
|
* "is-recording" (b): Whether this is a screen recording. May be
|
||||||
|
be used for choosing panel icon.
|
||||||
|
Default: false. Available since API version 4.
|
||||||
|
|
||||||
|
Available cursor mode values:
|
||||||
|
|
||||||
|
0: hidden - cursor is not included in the stream
|
||||||
|
1: embedded - cursor is included in the framebuffer
|
||||||
|
2: metadata - cursor is included as metadata in the PipeWire stream
|
||||||
|
-->
|
||||||
|
<method name="RecordArea">
|
||||||
|
<arg name="x" type="i" direction="in" />
|
||||||
|
<arg name="y" type="i" direction="in" />
|
||||||
|
<arg name="width" type="i" direction="in" />
|
||||||
|
<arg name="height" type="i" direction="in" />
|
||||||
|
<arg name="properties" type="a{sv}" direction="in" />
|
||||||
|
<arg name="stream_path" type="o" direction="out" />
|
||||||
|
</method>
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
org.gnome.Mutter.ScreenCast.Stream:
|
||||||
|
@short_description: Screen cast stream
|
||||||
|
-->
|
||||||
|
<interface name="org.gnome.Mutter.ScreenCast.Stream">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
PipeWireStreamAdded:
|
||||||
|
@short_description: Pipewire stream added
|
||||||
|
|
||||||
|
A signal emitted when PipeWire stream for the screen cast stream has
|
||||||
|
been created. The @node_id corresponds to the PipeWire stream node.
|
||||||
|
-->
|
||||||
|
<signal name="PipeWireStreamAdded">
|
||||||
|
<annotation name="org.gtk.GDBus.C.Name" value="pipewire-stream-added"/>
|
||||||
|
<arg name="node_id" type="u" direction="out" />
|
||||||
|
</signal>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Parameters:
|
||||||
|
@short_description: Optional stream parameters
|
||||||
|
|
||||||
|
Available parameters include:
|
||||||
|
|
||||||
|
* "position" (ii): Position of the source of the stream in the
|
||||||
|
compositor coordinate space.
|
||||||
|
* "size" (ii): Size of the source of the stream in the compositor
|
||||||
|
coordinate space.
|
||||||
|
-->
|
||||||
|
<property name="Parameters" type="a{sv}" access="read" />
|
||||||
|
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
</node>
|
@ -1,12 +1,19 @@
|
|||||||
<node>
|
<node>
|
||||||
<interface name="org.gnome.Shell.CalendarServer">
|
<interface name="org.gnome.Shell.CalendarServer">
|
||||||
<method name="GetEvents">
|
<method name="SetTimeRange">
|
||||||
<arg type="x" direction="in" />
|
<arg type="x" name="since" direction="in"/>
|
||||||
<arg type="x" direction="in" />
|
<arg type="x" name="until" direction="in"/>
|
||||||
<arg type="b" direction="in" />
|
<arg type="b" name="force_reload" direction="in"/>
|
||||||
<arg type="a(sssbxxa{sv})" direction="out" />
|
|
||||||
</method>
|
</method>
|
||||||
|
<signal name="EventsAddedOrUpdated">
|
||||||
|
<arg type="a(ssbxxa{sv})" name="events" direction="out"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="EventsRemoved">
|
||||||
|
<arg type="as" name="ids" direction="out"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="ClientDisappeared">
|
||||||
|
<arg type="s" name="source_uid" direction="out"/>
|
||||||
|
</signal>
|
||||||
<property name="HasCalendars" type="b" access="read" />
|
<property name="HasCalendars" type="b" access="read" />
|
||||||
<signal name="Changed" />
|
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
@ -70,6 +70,14 @@
|
|||||||
-->
|
-->
|
||||||
<property name="AnimationsEnabled" type="b" access="read"/>
|
<property name="AnimationsEnabled" type="b" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
ScreenSize:
|
||||||
|
@short_description: The size of the screen
|
||||||
|
|
||||||
|
Since: 3
|
||||||
|
-->
|
||||||
|
<property name="ScreenSize" type="(ii)" access="read"/>
|
||||||
|
|
||||||
<property name="version" type="u" access="read"/>
|
<property name="version" type="u" access="read"/>
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
<gresources>
|
<gresources>
|
||||||
<gresource prefix="/org/gnome/shell/dbus-interfaces">
|
<gresource prefix="/org/gnome/shell/dbus-interfaces">
|
||||||
<file preprocess="xml-stripblanks">net.hadess.SensorProxy.xml</file>
|
<file preprocess="xml-stripblanks">net.hadess.SensorProxy.xml</file>
|
||||||
<file preprocess="xml-stripblanks">net.hadess.SwitcherooControl.xml</file>
|
|
||||||
<file preprocess="xml-stripblanks">org.freedesktop.Application.xml</file>
|
<file preprocess="xml-stripblanks">org.freedesktop.Application.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.freedesktop.bolt1.Device.xml</file>
|
<file preprocess="xml-stripblanks">org.freedesktop.bolt1.Device.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.freedesktop.bolt1.Manager.xml</file>
|
<file preprocess="xml-stripblanks">org.freedesktop.bolt1.Manager.xml</file>
|
||||||
@ -29,6 +28,7 @@
|
|||||||
<file preprocess="xml-stripblanks">org.freedesktop.UPower.xml</file>
|
<file preprocess="xml-stripblanks">org.freedesktop.UPower.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.gnome.Magnifier.xml</file>
|
<file preprocess="xml-stripblanks">org.gnome.Magnifier.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.gnome.Magnifier.ZoomRegion.xml</file>
|
<file preprocess="xml-stripblanks">org.gnome.Magnifier.ZoomRegion.xml</file>
|
||||||
|
<file preprocess="xml-stripblanks">org.gnome.Mutter.ScreenCast.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.gnome.ScreenSaver.xml</file>
|
<file preprocess="xml-stripblanks">org.gnome.ScreenSaver.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.gnome.SessionManager.EndSessionDialog.xml</file>
|
<file preprocess="xml-stripblanks">org.gnome.SessionManager.EndSessionDialog.xml</file>
|
||||||
<file preprocess="xml-stripblanks">org.gnome.SessionManager.Inhibitor.xml</file>
|
<file preprocess="xml-stripblanks">org.gnome.SessionManager.Inhibitor.xml</file>
|
||||||
|
@ -6,24 +6,25 @@
|
|||||||
<file>checkbox-off-focused.svg</file>
|
<file>checkbox-off-focused.svg</file>
|
||||||
<file>checkbox-off.svg</file>
|
<file>checkbox-off.svg</file>
|
||||||
<file>checkbox.svg</file>
|
<file>checkbox.svg</file>
|
||||||
|
<file alias="icons/scalable/actions/color-pick.svg">color-pick.svg</file>
|
||||||
<file>dash-placeholder.svg</file>
|
<file>dash-placeholder.svg</file>
|
||||||
<file>gnome-shell.css</file>
|
<file>gnome-shell.css</file>
|
||||||
<file>gnome-shell-high-contrast.css</file>
|
<file>gnome-shell-high-contrast.css</file>
|
||||||
<file alias="icons/message-indicator-symbolic.svg">message-indicator-symbolic.svg</file>
|
<file alias="icons/scalable/status/message-indicator-symbolic.svg">message-indicator-symbolic.svg</file>
|
||||||
<file>no-events.svg</file>
|
<file>no-events.svg</file>
|
||||||
<file>no-notifications.svg</file>
|
<file>no-notifications.svg</file>
|
||||||
<file>pad-osd.css</file>
|
<file>pad-osd.css</file>
|
||||||
<file alias="icons/eye-open-negative-filled-symbolic.svg">eye-open-negative-filled-symbolic.svg</file>
|
<file alias="icons/scalable/status/eye-open-negative-filled-symbolic.svg">eye-open-negative-filled-symbolic.svg</file>
|
||||||
<file alias="icons/eye-not-looking-symbolic.svg">eye-not-looking-symbolic.svg</file>
|
<file alias="icons/scalable/status/eye-not-looking-symbolic.svg">eye-not-looking-symbolic.svg</file>
|
||||||
<file alias="icons/pointer-double-click-symbolic.svg">pointer-double-click-symbolic.svg</file>
|
<file alias="icons/scalable/actions/pointer-double-click-symbolic.svg">pointer-double-click-symbolic.svg</file>
|
||||||
<file alias="icons/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
|
<file alias="icons/scalable/actions/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
|
||||||
<file alias="icons/pointer-primary-click-symbolic.svg">pointer-primary-click-symbolic.svg</file>
|
<file alias="icons/scalable/actions/pointer-primary-click-symbolic.svg">pointer-primary-click-symbolic.svg</file>
|
||||||
<file alias="icons/pointer-secondary-click-symbolic.svg">pointer-secondary-click-symbolic.svg</file>
|
<file alias="icons/scalable/actions/pointer-secondary-click-symbolic.svg">pointer-secondary-click-symbolic.svg</file>
|
||||||
<file alias="icons/keyboard-caps-lock-filled-symbolic.svg">keyboard-caps-lock-filled-symbolic.svg</file>
|
<file alias="icons/scalable/status/keyboard-caps-lock-filled-symbolic.svg">keyboard-caps-lock-filled-symbolic.svg</file>
|
||||||
<file alias="icons/keyboard-enter-symbolic.svg">keyboard-enter-symbolic.svg</file>
|
<file alias="icons/scalable/status/keyboard-enter-symbolic.svg">keyboard-enter-symbolic.svg</file>
|
||||||
<file alias="icons/keyboard-hide-symbolic.svg">keyboard-hide-symbolic.svg</file>
|
<file alias="icons/scalable/status/keyboard-hide-symbolic.svg">keyboard-hide-symbolic.svg</file>
|
||||||
<file alias="icons/keyboard-layout-filled-symbolic.svg">keyboard-layout-filled-symbolic.svg</file>
|
<file alias="icons/scalable/status/keyboard-layout-filled-symbolic.svg">keyboard-layout-filled-symbolic.svg</file>
|
||||||
<file alias="icons/keyboard-shift-filled-symbolic.svg">keyboard-shift-filled-symbolic.svg</file>
|
<file alias="icons/scalable/status/keyboard-shift-filled-symbolic.svg">keyboard-shift-filled-symbolic.svg</file>
|
||||||
<file>process-working.svg</file>
|
<file>process-working.svg</file>
|
||||||
<file>toggle-off.svg</file>
|
<file>toggle-off.svg</file>
|
||||||
<file>toggle-off-dark.svg</file>
|
<file>toggle-off-dark.svg</file>
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=GNOME Shell on Wayland
|
|
||||||
DefaultDependencies=no
|
|
||||||
|
|
||||||
Requisite=gnome-session-initialized.target
|
|
||||||
PartOf=gnome-session-initialized.target
|
|
||||||
Before=gnome-session-initialized.target
|
|
||||||
|
|
||||||
Requires=gnome-shell-wayland.service
|
|
||||||
After=gnome-shell-wayland.service
|
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 6.1 KiB |
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M6.5 1.031c-.371 0-.742-.035-1.11.016-.367.05-.73.203-.972.476-.125.141-.215.309-.266.485-.047.18-.054.367-.02.55.032.184.102.356.192.516.09.164.203.309.317.457L5 4H2a1.8 1.8 0 00-.41.035.791.791 0 00-.36.195.791.791 0 00-.195.36C1 4.723 1 4.863 1 5v2.75l.77-.344c.265-.117.542-.23.832-.242.289-.016.586.074.812.254.227.18.383.441.465.723.082.277.101.57.121.859.02.316.04.637-.016.95-.058.312-.199.616-.43.831a1.264 1.264 0 01-.874.32c-.317-.007-.618-.128-.91-.257L1 10.5V14c0 .137.004.277.035.41a.791.791 0 00.195.36c.098.097.227.16.36.195.133.035.273.035.41.035h3l-.328-.68c-.14-.293-.274-.597-.29-.922-.015-.32.095-.652.31-.894.214-.242.523-.39.84-.453.316-.067.644-.059.968-.059.324 0 .652-.008.969.059.316.062.625.21.84.453.214.242.324.574.308.894-.015.325-.148.63-.289.922L8 15h3a1.8 1.8 0 00.41-.035.791.791 0 00.36-.195.791.791 0 00.195-.36C12 14.277 12 14.137 12 14v-3.563l.703.297c.29.125.59.239.902.246.313.004.63-.101.864-.308.238-.203.386-.496.46-.8C15 9.565 15 9.25 15 8.937c0-.313 0-.63-.07-.934-.075-.305-.223-.598-.461-.8a1.288 1.288 0 00-.864-.31c-.312.008-.613.122-.902.247L12 7.437V5a1.8 1.8 0 00-.035-.41.791.791 0 00-.195-.36.791.791 0 00-.36-.195C11.277 4 11.137 4 11 4H8l.36-.469c.113-.148.226-.293.316-.457.09-.16.16-.332.191-.515a1.248 1.248 0 00-.02-.551 1.256 1.256 0 00-.265-.485c-.242-.273-.605-.425-.973-.476-.367-.05-.738-.016-1.109-.016zm0 0" fill="#474747"/></svg>
|
After Width: | Height: | Size: 1.4 KiB |
1
data/icons/meson.build
Normal file
1
data/icons/meson.build
Normal file
@ -0,0 +1 @@
|
|||||||
|
install_subdir('hicolor', install_dir: icondir)
|
@ -1,5 +1,6 @@
|
|||||||
desktop_files = [
|
desktop_files = [
|
||||||
'org.gnome.Shell.desktop',
|
'org.gnome.Shell.desktop',
|
||||||
|
'org.gnome.Shell.Extensions.desktop',
|
||||||
]
|
]
|
||||||
service_files = []
|
service_files = []
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ endforeach
|
|||||||
|
|
||||||
|
|
||||||
subdir('dbus-interfaces')
|
subdir('dbus-interfaces')
|
||||||
|
subdir('icons')
|
||||||
subdir('theme')
|
subdir('theme')
|
||||||
|
|
||||||
data_resources = [
|
data_resources = [
|
||||||
@ -99,22 +101,21 @@ if have_systemd
|
|||||||
unitconf.set('bindir', bindir)
|
unitconf.set('bindir', bindir)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'gnome-shell-x11.service.in',
|
input: 'org.gnome.Shell@x11.service.in',
|
||||||
output: 'gnome-shell-x11.service',
|
output: 'org.gnome.Shell@x11.service',
|
||||||
configuration: unitconf,
|
configuration: unitconf,
|
||||||
install_dir: systemduserunitdir
|
install_dir: systemduserunitdir
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'gnome-shell-wayland.service.in',
|
input: 'org.gnome.Shell@wayland.service.in',
|
||||||
output: 'gnome-shell-wayland.service',
|
output: 'org.gnome.Shell@wayland.service',
|
||||||
configuration: unitconf,
|
configuration: unitconf,
|
||||||
install_dir: systemduserunitdir
|
install_dir: systemduserunitdir
|
||||||
)
|
)
|
||||||
|
|
||||||
units = files('gnome-shell-x11.target',
|
units = files('org.gnome.Shell.target',
|
||||||
'gnome-shell-wayland.target',
|
'org.gnome.Shell-disable-extensions.service')
|
||||||
'gnome-shell-disable-extensions.service')
|
|
||||||
|
|
||||||
install_data(units, install_dir: systemduserunitdir)
|
install_data(units, install_dir: systemduserunitdir)
|
||||||
endif
|
endif
|
||||||
|
10
data/org.gnome.Shell.Extensions.desktop.in.in
Normal file
10
data/org.gnome.Shell.Extensions.desktop.in.in
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
# Keep in sync with subprojects/extensions-app
|
||||||
|
Name=Extensions
|
||||||
|
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
|
||||||
|
Icon=org.gnome.Shell.Extensions
|
||||||
|
# Never launch this, just provide name+icon to portal dialog
|
||||||
|
Exec=false
|
||||||
|
OnlyShowIn=GNOME;
|
||||||
|
NoDisplay=true
|
@ -1,10 +1,10 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=GNOME Shell on X11
|
Description=GNOME Shell
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|
||||||
Requisite=gnome-session-initialized.target
|
Requisite=gnome-session-initialized.target
|
||||||
PartOf=gnome-session-initialized.target
|
PartOf=gnome-session-initialized.target
|
||||||
Before=gnome-session-initialized.target
|
Before=gnome-session-initialized.target
|
||||||
|
|
||||||
Requires=gnome-shell-x11.service
|
Wants=org.gnome.Shell@wayland.service
|
||||||
After=gnome-shell-x11.service
|
Wants=org.gnome.Shell@x11.service
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=GNOME Shell on Wayland
|
Description=GNOME Shell on Wayland
|
||||||
# On wayland, force a session shutdown
|
# On wayland, force a session shutdown
|
||||||
OnFailure=gnome-shell-disable-extensions.service gnome-session-shutdown.target
|
OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-shutdown.target
|
||||||
OnFailureJobMode=replace-irreversibly
|
OnFailureJobMode=replace-irreversibly
|
||||||
CollectMode=inactive-or-failed
|
CollectMode=inactive-or-failed
|
||||||
RefuseManualStart=on
|
RefuseManualStart=on
|
||||||
@ -13,18 +13,21 @@ Requisite=gnome-session-initialized.target
|
|||||||
PartOf=gnome-session-initialized.target
|
PartOf=gnome-session-initialized.target
|
||||||
Before=gnome-session-initialized.target
|
Before=gnome-session-initialized.target
|
||||||
|
|
||||||
# The units already conflict because they use the same BusName
|
|
||||||
#Conflicts=gnome-shell-x11.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Slice=session.slice
|
||||||
Type=notify
|
Type=notify
|
||||||
|
# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I
|
||||||
|
# with systemd >= 245. Also, the current solution is kind of painful
|
||||||
|
# as systemd had a bug where it retries the condition.
|
||||||
|
# Only start if the template instance matches the session type.
|
||||||
|
ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'
|
||||||
ExecStart=@bindir@/gnome-shell
|
ExecStart=@bindir@/gnome-shell
|
||||||
|
|
||||||
# unset some environment variables that were set by the shell and won't work now that the shell is gone
|
|
||||||
ExecStopPost=-systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY
|
|
||||||
|
|
||||||
# Exit code 1 means we are probably *not* dealing with an extension failure
|
# Exit code 1 means we are probably *not* dealing with an extension failure
|
||||||
SuccessExitStatus=1
|
SuccessExitStatus=1
|
||||||
|
|
||||||
|
# unset some environment variables that were set by the shell and won't work now that the shell is gone
|
||||||
|
ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY'
|
||||||
|
|
||||||
# On wayland we cannot restart
|
# On wayland we cannot restart
|
||||||
Restart=no
|
Restart=no
|
||||||
# Kill any stubborn child processes after this long
|
# Kill any stubborn child processes after this long
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=GNOME Shell on X11
|
Description=GNOME Shell on X11
|
||||||
# On X11, try to show the GNOME Session Failed screen
|
# On X11, try to show the GNOME Session Failed screen
|
||||||
OnFailure=gnome-shell-disable-extensions.service gnome-session-failed.target
|
OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-failed.target
|
||||||
OnFailureJobMode=replace
|
OnFailureJobMode=replace
|
||||||
CollectMode=inactive-or-failed
|
CollectMode=inactive-or-failed
|
||||||
RefuseManualStart=on
|
RefuseManualStart=on
|
||||||
@ -13,18 +13,24 @@ Requisite=gnome-session-initialized.target
|
|||||||
PartOf=gnome-session-initialized.target
|
PartOf=gnome-session-initialized.target
|
||||||
Before=gnome-session-initialized.target
|
Before=gnome-session-initialized.target
|
||||||
|
|
||||||
# The units already conflict because they use the same BusName
|
|
||||||
#Conflicts=gnome-shell-wayland.service
|
|
||||||
|
|
||||||
# Limit startup frequency more than the default
|
# Limit startup frequency more than the default
|
||||||
StartLimitIntervalSec=15s
|
StartLimitIntervalSec=15s
|
||||||
StartLimitBurst=3
|
StartLimitBurst=3
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Slice=session.slice
|
||||||
Type=notify
|
Type=notify
|
||||||
|
# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I
|
||||||
|
# with systemd >= 245. Also, the current solution is kind of painful
|
||||||
|
# as systemd had a bug where it retries the condition.
|
||||||
|
# Only start if the template instance matches the session type.
|
||||||
|
ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'
|
||||||
ExecStart=@bindir@/gnome-shell
|
ExecStart=@bindir@/gnome-shell
|
||||||
# Exit code 1 means we are probably *not* dealing with an extension failure
|
# Exit code 1 means we are probably *not* dealing with an extension failure
|
||||||
SuccessExitStatus=1
|
SuccessExitStatus=1
|
||||||
|
|
||||||
|
# On X11 we do not need to unset any variables
|
||||||
|
|
||||||
# On X11 we want to restart on-success (Alt+F2 + r) and on-failure.
|
# On X11 we want to restart on-success (Alt+F2 + r) and on-failure.
|
||||||
Restart=always
|
Restart=always
|
||||||
# Do not wait before restarting the shell
|
# Do not wait before restarting the shell
|
@ -109,6 +109,17 @@
|
|||||||
the shell.
|
the shell.
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="app-picker-layout" type="aa{sv}">
|
||||||
|
<default>[]</default>
|
||||||
|
<summary>Layout of the app picker</summary>
|
||||||
|
<description>
|
||||||
|
Layout of the app picker. Each entry in the array is a page. Pages are
|
||||||
|
stored in the order they appear in GNOME Shell. Each page contains an
|
||||||
|
“application id” → 'data' pair. Currently, the following values are
|
||||||
|
stored as 'data':
|
||||||
|
• “position”: the position of the application icon in the page
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
<child name="keybindings" schema="org.gnome.shell.keybindings"/>
|
<child name="keybindings" schema="org.gnome.shell.keybindings"/>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
|
94
data/theme/color-pick.svg
Normal file
94
data/theme/color-pick.svg
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="5.4116011mm"
|
||||||
|
height="5.1374583mm"
|
||||||
|
viewBox="0 0 5.4116011 5.1374583"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5595"
|
||||||
|
inkscape:version="0.92.4 (unknown)"
|
||||||
|
sodipodi:docname="color-pick.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5589">
|
||||||
|
<filter
|
||||||
|
inkscape:collect="always"
|
||||||
|
x="-0.10291173"
|
||||||
|
width="1.2058235"
|
||||||
|
y="-0.065432459"
|
||||||
|
height="1.1308649"
|
||||||
|
id="filter5601"
|
||||||
|
style="color-interpolation-filters:sRGB">
|
||||||
|
<feGaussianBlur
|
||||||
|
inkscape:collect="always"
|
||||||
|
stdDeviation="0.610872"
|
||||||
|
id="feGaussianBlur5603" />
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="15.839192"
|
||||||
|
inkscape:cx="39.387731"
|
||||||
|
inkscape:cy="12.554326"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1016"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5592">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-103.12753,-146.26461)">
|
||||||
|
<circle
|
||||||
|
r="8.4810486"
|
||||||
|
cy="9.82623"
|
||||||
|
cx="10.226647"
|
||||||
|
id="circle7584"
|
||||||
|
style="color:#000000;display:inline;overflow:visible;opacity:0.6;vector-effect:none;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;filter:url(#filter5601)"
|
||||||
|
transform="matrix(0.26458333,0,0,0.26458333,103.12753,146.26461)" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;display:inline;overflow:visible;opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.26399338;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
|
||||||
|
d="m 108.07728,148.64122 c 0,1.2393 -1.00465,2.24394 -2.24395,2.24394 -1.23929,0 -2.24716,-1.00465 -2.25221,-2.24394 l -0.009,-2.24458 2.26136,6.4e-4 c 1.2393,3.4e-4 2.24395,1.00464 2.24395,2.24394 z"
|
||||||
|
id="path7523-7"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ssscss" />
|
||||||
|
<circle
|
||||||
|
style="color:#000000;display:inline;overflow:visible;opacity:1;vector-effect:none;fill:#50dbb5;fill-opacity:1;stroke:none;stroke-width:0.36885914;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
|
||||||
|
id="path7482-1"
|
||||||
|
cx="105.83707"
|
||||||
|
cy="148.64352"
|
||||||
|
r="1.844296" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
@function draw_button_hilight_color($c) {
|
@function draw_button_hilight_color($c) {
|
||||||
//
|
//
|
||||||
// calculate the right top hilight color for buttons
|
// calculate the right top highlight color for buttons
|
||||||
//
|
//
|
||||||
// $c: base color;
|
// $c: base color;
|
||||||
//
|
//
|
||||||
|
@ -1,21 +1,15 @@
|
|||||||
/* App Grid */
|
/* App Grid */
|
||||||
|
|
||||||
$app_icon_size: 96px;
|
$app_icon_size: 96px;
|
||||||
$app_icon_padding: 24px;
|
|
||||||
|
|
||||||
// app icons
|
// app icons
|
||||||
.icon-grid {
|
.icon-grid {
|
||||||
-shell-grid-horizontal-item-size: $app_icon_size + $app_icon_padding * 2;
|
row-spacing: $base_spacing * 6;
|
||||||
-shell-grid-vertical-item-size: $app_icon_size + $app_icon_padding * 2;
|
column-spacing: $base_spacing * 6;
|
||||||
spacing: $base_spacing * 6;
|
max-row-spacing: $base_spacing * 12;
|
||||||
|
max-column-spacing: $base_spacing * 12;
|
||||||
.overview-icon {
|
|
||||||
icon-size: $app_icon_size;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//.app-display { spacing: 20px; }
|
|
||||||
|
|
||||||
/* App Icons */
|
/* App Icons */
|
||||||
|
|
||||||
$app_grid_fg_color: #fff;
|
$app_grid_fg_color: #fff;
|
||||||
@ -44,8 +38,8 @@ $app_grid_fg_color: #fff;
|
|||||||
.app-folder-dialog {
|
.app-folder-dialog {
|
||||||
border-radius: $modal_radius * 1.5;
|
border-radius: $modal_radius * 1.5;
|
||||||
border: 1px solid $osd_outer_borders_color;
|
border: 1px solid $osd_outer_borders_color;
|
||||||
spacing: 12px;
|
|
||||||
background-color: transparentize(darken($osd_bg_color,10%), 0.05);
|
background-color: transparentize(darken($osd_bg_color,10%), 0.05);
|
||||||
|
padding: 12px;
|
||||||
|
|
||||||
& .folder-name-container {
|
& .folder-name-container {
|
||||||
padding: 24px 36px 0;
|
padding: 24px 36px 0;
|
||||||
@ -54,7 +48,7 @@ $app_grid_fg_color: #fff;
|
|||||||
& .folder-name-label,
|
& .folder-name-label,
|
||||||
& .folder-name-entry {
|
& .folder-name-entry {
|
||||||
font-size: 18pt;
|
font-size: 18pt;
|
||||||
font-weight: bold;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
& .folder-name-entry { width: 300px }
|
& .folder-name-entry { width: 300px }
|
||||||
@ -73,11 +67,24 @@ $app_grid_fg_color: #fff;
|
|||||||
& > StIcon { icon-size: 16px }
|
& > StIcon { icon-size: 16px }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
& .icon-grid {
|
||||||
|
row-spacing: $base_spacing * 2;
|
||||||
|
column-spacing: $base_spacing * 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
& .page-indicators {
|
||||||
|
margin-bottom: 18px;
|
||||||
|
|
||||||
|
.page-indicator {
|
||||||
|
padding: 15px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.app-folder-dialog-container {
|
.app-folder-dialog-container {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
width: 800px;
|
width: 620px;
|
||||||
height: 600px;
|
height: 620px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-folder-icon {
|
.app-folder-icon {
|
||||||
@ -123,15 +130,11 @@ $app_grid_fg_color: #fff;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Some hacks I don't even know
|
// Some hacks I don't even know
|
||||||
.all-apps,
|
.all-apps {
|
||||||
.frequent-apps > StBoxLayout {
|
|
||||||
// horizontal padding to make sure scrollbars or dash don't overlap content
|
// horizontal padding to make sure scrollbars or dash don't overlap content
|
||||||
padding: 0px 88px 10px 88px;
|
padding: 0px 88px 10px 88px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label when no frequent apps
|
|
||||||
.no-frequent-applications-label { @extend %status_text; }
|
|
||||||
|
|
||||||
// shutdown and other actions in the grid
|
// shutdown and other actions in the grid
|
||||||
.system-action-icon {
|
.system-action-icon {
|
||||||
background-color: rgba(0,0,0,0.8);
|
background-color: rgba(0,0,0,0.8);
|
||||||
@ -139,44 +142,3 @@ $app_grid_fg_color: #fff;
|
|||||||
border-radius: 99px;
|
border-radius: 99px;
|
||||||
icon-size: $app_icon_size * 0.5;
|
icon-size: $app_icon_size * 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Frequent | All toggle */
|
|
||||||
|
|
||||||
// container
|
|
||||||
.app-view-controls {
|
|
||||||
padding-bottom: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// buttons
|
|
||||||
.app-view-control {
|
|
||||||
padding: 4px 32px;
|
|
||||||
margin: 0 4px;
|
|
||||||
|
|
||||||
&, &:hover, &:checked {
|
|
||||||
@include button(undecorated);
|
|
||||||
color: darken($osd_fg_color, 25%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $osd_fg_color;
|
|
||||||
box-shadow: inset 0 -2px darken($osd_fg_color, 25%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
box-shadow: inset 0 -2px $osd_fg_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:checked {
|
|
||||||
color: $osd_fg_color;
|
|
||||||
box-shadow: inset 0 -2px $selected_bg_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
border-right-width: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -153,9 +153,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.calendar-day-with-events {
|
.calendar-day-with-events {
|
||||||
color: lighten($fg_color,10%);
|
|
||||||
font-weight: bold;
|
|
||||||
background-image: url("resource:///org/gnome/shell/theme/calendar-today.svg");
|
background-image: url("resource:///org/gnome/shell/theme/calendar-today.svg");
|
||||||
|
&.calendar-work-day {
|
||||||
|
color: lighten($fg_color,10%);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-other-month-day {
|
.calendar-other-month-day {
|
||||||
@ -168,13 +170,38 @@
|
|||||||
height: 1.8em;
|
height: 1.8em;
|
||||||
width: 2.3em;
|
width: 2.3em;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 0.5em 0 0;
|
|
||||||
margin: 6px;
|
margin: 6px;
|
||||||
background-color: darken($bg_color, 2%);
|
background-color: darken($bg_color, 2%);
|
||||||
color: lighten($fg_color, 5%);
|
color: lighten($fg_color, 5%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Events */
|
||||||
|
.events-button {
|
||||||
|
@include notification_bubble;
|
||||||
|
padding: $base_padding * 2;
|
||||||
|
|
||||||
|
.events-box {
|
||||||
|
spacing: $base_spacing;
|
||||||
|
}
|
||||||
|
|
||||||
|
.events-list {
|
||||||
|
spacing: 2 * $base_spacing;
|
||||||
|
}
|
||||||
|
|
||||||
|
.events-title {
|
||||||
|
color: desaturate(darken($fg_color,40%), 10%);
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: $base_margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-time {
|
||||||
|
color: darken($fg_color,20%);
|
||||||
|
font-feature-settings: "tnum";
|
||||||
|
@include fontsize($base_font_size - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* World clocks */
|
/* World clocks */
|
||||||
.world-clocks-button {
|
.world-clocks-button {
|
||||||
@include notification_bubble;
|
@include notification_bubble;
|
||||||
@ -202,9 +229,11 @@
|
|||||||
.world-clocks-time {
|
.world-clocks-time {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $fg_color;
|
color: $fg_color;
|
||||||
font-feature-settings: "lnum";
|
font-feature-settings: "tnum";
|
||||||
@include fontsize($base_font_size);
|
@include fontsize($base_font_size);
|
||||||
text-align: right;
|
|
||||||
|
&:ltr { text-align: right; }
|
||||||
|
&:rtl { text-align: left; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// timezone offset label
|
// timezone offset label
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
font-size: 18pt;
|
font-size: 18pt;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
|
|
||||||
&.leightweight {
|
&.lightweight {
|
||||||
font-size: 13pt;
|
font-size: 13pt;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
@ -138,11 +138,10 @@
|
|||||||
.user-widget.horizontal .user-widget-label {
|
.user-widget.horizontal .user-widget-label {
|
||||||
@include fontsize($base_font_size + 2);
|
@include fontsize($base_font_size + 2);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: left;
|
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
|
|
||||||
&:ltr { padding-left: 14px; }
|
&:ltr { padding-left: 14px; text-align: left; }
|
||||||
&:rtl { padding-right: 14px; }
|
&:rtl { padding-right: 14px; text-align: right; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-widget.vertical .user-widget-label {
|
.user-widget.vertical .user-widget-label {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
/* Looking Glass */
|
/* Looking Glass */
|
||||||
|
|
||||||
|
$text_fg_color: #ccc;
|
||||||
|
|
||||||
// Dialog
|
// Dialog
|
||||||
#LookingGlassDialog {
|
#LookingGlassDialog {
|
||||||
background-color: $osd_bg_color;
|
background-color: $osd_bg_color;
|
||||||
@ -52,6 +54,11 @@
|
|||||||
&:hover { color: lighten($link_color, 10%); }
|
&:hover { color: lighten($link_color, 10%); }
|
||||||
&:active { color: darken($link_color, 10%); }
|
&:active { color: darken($link_color, 10%); }
|
||||||
}
|
}
|
||||||
|
.actor-link {
|
||||||
|
color: $text_fg_color;
|
||||||
|
&:hover { color: lighten($text_fg_color, 20%); }
|
||||||
|
&:active { color: darken($text_fg_color, 20%); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.lg-completions-text {
|
.lg-completions-text {
|
||||||
|
@ -71,9 +71,11 @@
|
|||||||
> .event-time {
|
> .event-time {
|
||||||
color: transparentize($fg_color, 0.5);
|
color: transparentize($fg_color, 0.5);
|
||||||
@include fontsize($base_font_size - 2);
|
@include fontsize($base_font_size - 2);
|
||||||
text-align: right;
|
|
||||||
/* HACK: the label should be baseline-aligned with a 1em label, fake this with some bottom padding */
|
/* HACK: the label should be baseline-aligned with a 1em label, fake this with some bottom padding */
|
||||||
padding-bottom: 0.13em;
|
padding-bottom: 0.13em;
|
||||||
|
|
||||||
|
&:ltr { text-align: right };
|
||||||
|
&:rtl { text-align: left };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Notifications & Mesage Tray */
|
/* Notifications & Message Tray */
|
||||||
|
|
||||||
$notification_banner_height: 64px;
|
$notification_banner_height: 64px;
|
||||||
$notification_banner_width: 34em;
|
$notification_banner_width: 34em;
|
||||||
|
@ -76,8 +76,10 @@ $popover_arrow_height: 12px;
|
|||||||
|
|
||||||
// container for radio and check boxes
|
// container for radio and check boxes
|
||||||
.popup-menu-ornament {
|
.popup-menu-ornament {
|
||||||
text-align: right;
|
|
||||||
width: 1.2em;
|
width: 1.2em;
|
||||||
|
|
||||||
|
&:ltr { text-align: right };
|
||||||
|
&:rtl { text-align: left };
|
||||||
}
|
}
|
||||||
|
|
||||||
// separator
|
// separator
|
||||||
|
@ -54,6 +54,10 @@
|
|||||||
@extend %status_text;
|
@extend %status_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grid-search-results {
|
||||||
|
spacing: $base_spacing * 6;
|
||||||
|
}
|
||||||
|
|
||||||
// Search results with icons
|
// Search results with icons
|
||||||
.grid-search-result {
|
.grid-search-result {
|
||||||
@extend %app-well-app;
|
@extend %app-well-app;
|
||||||
|
@ -16,7 +16,7 @@ $slider_size: 15px;
|
|||||||
-barlevel-overdrive-color: $destructive_color;
|
-barlevel-overdrive-color: $destructive_color;
|
||||||
-barlevel-overdrive-border-color: if($variant == 'light', darken($destructive_color, 4%), lighten($destructive_color, 2%)); //trough border when red;
|
-barlevel-overdrive-border-color: if($variant == 'light', darken($destructive_color, 4%), lighten($destructive_color, 2%)); //trough border when red;
|
||||||
-barlevel-overdrive-separator-width:1px;
|
-barlevel-overdrive-separator-width:1px;
|
||||||
// slider hander
|
// slider handler
|
||||||
-slider-handle-radius: $slider_size * 0.5; // half the size of the size
|
-slider-handle-radius: $slider_size * 0.5; // half the size of the size
|
||||||
-slider-handle-border-width: 1px;
|
-slider-handle-border-width: 1px;
|
||||||
-slider-handle-border-color: if($variant == 'light', $borders_color, $fg_color);
|
-slider-handle-border-color: if($variant == 'light', $borders_color, $fg_color);
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
/* Window Picker */
|
/* Window Picker */
|
||||||
|
|
||||||
$window_picker_spacing: $base_spacing * 2; // 16px
|
$window_picker_spacing: $base_spacing; // 6px
|
||||||
$window_picker_padding: $base_padding * 2; // 16px
|
$window_picker_padding: $base_padding * 2; // 12px
|
||||||
|
|
||||||
$window_thumbnail_border_color:transparentize($selected_fg_color, 0.65);
|
$window_thumbnail_border_color:transparentize($selected_fg_color, 0.65);
|
||||||
|
|
||||||
$window_close_button_size: 24px;
|
$window_close_button_size: 24px;
|
||||||
$window_close_button_padding: 3px;
|
$window_close_button_padding: 3px;
|
||||||
|
|
||||||
|
$window_clone_border_size: 6px;
|
||||||
|
|
||||||
// Window picker
|
// Window picker
|
||||||
.window-picker {
|
.window-picker {
|
||||||
// Space between window thumbnails
|
// Space between window thumbnails
|
||||||
-horizontal-spacing: $window_picker_spacing;
|
spacing: $window_picker_spacing;
|
||||||
-vertical-spacing: $window_picker_spacing;
|
|
||||||
// Padding for container around window thumbnails
|
// Padding for container around window thumbnails
|
||||||
padding: $window_picker_padding;
|
padding: $window_picker_padding;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ $window_close_button_padding: 3px;
|
|||||||
|
|
||||||
// Borders on window thumbnails
|
// Borders on window thumbnails
|
||||||
.window-clone-border {
|
.window-clone-border {
|
||||||
border-width: 6px;
|
border-width: $window_clone_border_size;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: $window_thumbnail_border_color;
|
border-color: $window_thumbnail_border_color;
|
||||||
border-radius: $base_border_radius + 2;
|
border-radius: $base_border_radius + 2;
|
||||||
@ -54,8 +55,6 @@ $window_close_button_padding: 3px;
|
|||||||
width: $window_close_button_size;
|
width: $window_close_button_size;
|
||||||
box-shadow: -1px 1px 5px 0px rgba(0,0,0,0.5);
|
box-shadow: -1px 1px 5px 0px rgba(0,0,0,0.5);
|
||||||
|
|
||||||
-shell-close-overlap: $window_close_button_size * 0.5;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: lighten($selected_bg_color, 5%);
|
background-color: lighten($selected_bg_color, 5%);
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,8 @@ private_headers = [
|
|||||||
'gactionobservable.h',
|
'gactionobservable.h',
|
||||||
'gactionobserver.h',
|
'gactionobserver.h',
|
||||||
'shell-network-agent.h',
|
'shell-network-agent.h',
|
||||||
'shell-recorder-src.h'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if not enable_recorder
|
|
||||||
private_headers += 'shell-recorder.h'
|
|
||||||
endif
|
|
||||||
|
|
||||||
exclude_directories = [
|
exclude_directories = [
|
||||||
'calendar-server',
|
'calendar-server',
|
||||||
'hotplug-sniffer',
|
'hotplug-sniffer',
|
||||||
|
@ -25,6 +25,8 @@ var ServiceImplementation = class {
|
|||||||
|
|
||||||
// subclasses may override this to disable automatic shutdown
|
// subclasses may override this to disable automatic shutdown
|
||||||
this._autoShutdown = true;
|
this._autoShutdown = true;
|
||||||
|
|
||||||
|
this._queueShutdownCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
// subclasses may override this to own additional names
|
// subclasses may override this to own additional names
|
||||||
|
@ -8,6 +8,12 @@ dbus_services = {
|
|||||||
'org.gnome.Shell.Notifications': 'notifications',
|
'org.gnome.Shell.Notifications': 'notifications',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if enable_recorder
|
||||||
|
dbus_services += {
|
||||||
|
'org.gnome.Shell.Screencast': 'screencast',
|
||||||
|
}
|
||||||
|
endif
|
||||||
|
|
||||||
config_dir = '@0@/..'.format(meson.current_build_dir())
|
config_dir = '@0@/..'.format(meson.current_build_dir())
|
||||||
|
|
||||||
foreach service, dir : dbus_services
|
foreach service, dir : dbus_services
|
||||||
|
@ -9,6 +9,8 @@ const { ServiceImplementation } = imports.dbusService;
|
|||||||
const NotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
|
const NotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
|
||||||
const NotificationsProxy = Gio.DBusProxy.makeProxyWrapper(NotificationsIface);
|
const NotificationsProxy = Gio.DBusProxy.makeProxyWrapper(NotificationsIface);
|
||||||
|
|
||||||
|
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
||||||
|
|
||||||
var NotificationDaemon = class extends ServiceImplementation {
|
var NotificationDaemon = class extends ServiceImplementation {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(NotificationsIface, '/org/freedesktop/Notifications');
|
super(NotificationsIface, '/org/freedesktop/Notifications');
|
||||||
@ -42,7 +44,15 @@ var NotificationDaemon = class extends ServiceImplementation {
|
|||||||
null, null);
|
null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
NotifyAsync(params, invocation) {
|
async NotifyAsync(params, invocation) {
|
||||||
|
const pid = await this._getSenderPid(invocation.get_sender());
|
||||||
|
const hints = params[6];
|
||||||
|
|
||||||
|
params[6] = {
|
||||||
|
...hints,
|
||||||
|
'sender-pid': new GLib.Variant('u', pid),
|
||||||
|
};
|
||||||
|
|
||||||
this._proxy.NotifyRemote(...params, (res, error) => {
|
this._proxy.NotifyRemote(...params, (res, error) => {
|
||||||
if (this._handleError(invocation, error))
|
if (this._handleError(invocation, error))
|
||||||
return;
|
return;
|
||||||
@ -77,4 +87,19 @@ var NotificationDaemon = class extends ServiceImplementation {
|
|||||||
invocation.return_value(new GLib.Variant('(ssss)', res));
|
invocation.return_value(new GLib.Variant('(ssss)', res));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _getSenderPid(sender) {
|
||||||
|
const res = await Gio.DBus.session.call(
|
||||||
|
'org.freedesktop.DBus',
|
||||||
|
'/',
|
||||||
|
'org.freedesktop.DBus',
|
||||||
|
'GetConnectionUnixProcessID',
|
||||||
|
new GLib.Variant('(s)', [sender]),
|
||||||
|
new GLib.VariantType('(u)'),
|
||||||
|
Gio.DBusCallFlags.NONE,
|
||||||
|
-1,
|
||||||
|
null);
|
||||||
|
const [pid] = res.deepUnpack();
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
11
js/dbusServices/org.gnome.Shell.Screencast.src.gresource.xml
Normal file
11
js/dbusServices/org.gnome.Shell.Screencast.src.gresource.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gresources>
|
||||||
|
<gresource prefix="/org/gnome/Shell/Screencast/js">
|
||||||
|
<file>main.js</file>
|
||||||
|
<file>screencastService.js</file>
|
||||||
|
<file>dbusService.js</file>
|
||||||
|
|
||||||
|
<file>misc/config.js</file>
|
||||||
|
<file>misc/fileUtils.js</file>
|
||||||
|
</gresource>
|
||||||
|
</gresources>
|
11
js/dbusServices/screencast/main.js
Normal file
11
js/dbusServices/screencast/main.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* exported main */
|
||||||
|
|
||||||
|
const { DBusService } = imports.dbusService;
|
||||||
|
const { ScreencastService } = imports.screencastService;
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
const service = new DBusService(
|
||||||
|
'org.gnome.Shell.Screencast',
|
||||||
|
new ScreencastService());
|
||||||
|
service.run();
|
||||||
|
}
|
458
js/dbusServices/screencast/screencastService.js
Normal file
458
js/dbusServices/screencast/screencastService.js
Normal file
@ -0,0 +1,458 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
/* exported ScreencastService */
|
||||||
|
|
||||||
|
const { Gio, GLib, Gst } = imports.gi;
|
||||||
|
|
||||||
|
const { loadInterfaceXML, loadSubInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
const { ServiceImplementation } = imports.dbusService;
|
||||||
|
|
||||||
|
const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');
|
||||||
|
|
||||||
|
const IntrospectIface = loadInterfaceXML('org.gnome.Shell.Introspect');
|
||||||
|
const IntrospectProxy = Gio.DBusProxy.makeProxyWrapper(IntrospectIface);
|
||||||
|
|
||||||
|
const ScreenCastIface = loadSubInterfaceXML(
|
||||||
|
'org.gnome.Mutter.ScreenCast', 'org.gnome.Mutter.ScreenCast');
|
||||||
|
const ScreenCastSessionIface = loadSubInterfaceXML(
|
||||||
|
'org.gnome.Mutter.ScreenCast.Session', 'org.gnome.Mutter.ScreenCast');
|
||||||
|
const ScreenCastStreamIface = loadSubInterfaceXML(
|
||||||
|
'org.gnome.Mutter.ScreenCast.Stream', 'org.gnome.Mutter.ScreenCast');
|
||||||
|
const ScreenCastProxy = Gio.DBusProxy.makeProxyWrapper(ScreenCastIface);
|
||||||
|
const ScreenCastSessionProxy = Gio.DBusProxy.makeProxyWrapper(ScreenCastSessionIface);
|
||||||
|
const ScreenCastStreamProxy = Gio.DBusProxy.makeProxyWrapper(ScreenCastStreamIface);
|
||||||
|
|
||||||
|
const DEFAULT_PIPELINE = 'vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux';
|
||||||
|
const DEFAULT_FRAMERATE = 30;
|
||||||
|
const DEFAULT_DRAW_CURSOR = true;
|
||||||
|
|
||||||
|
const PipelineState = {
|
||||||
|
INIT: 0,
|
||||||
|
PLAYING: 1,
|
||||||
|
FLUSHING: 2,
|
||||||
|
STOPPED: 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
const SessionState = {
|
||||||
|
INIT: 0,
|
||||||
|
ACTIVE: 1,
|
||||||
|
STOPPED: 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
var Recorder = class {
|
||||||
|
constructor(sessionPath, x, y, width, height, filePath, options,
|
||||||
|
invocation,
|
||||||
|
onErrorCallback) {
|
||||||
|
this._startInvocation = invocation;
|
||||||
|
this._dbusConnection = invocation.get_connection();
|
||||||
|
this._onErrorCallback = onErrorCallback;
|
||||||
|
this._stopInvocation = null;
|
||||||
|
|
||||||
|
this._pipelineIsPlaying = false;
|
||||||
|
this._sessionIsActive = false;
|
||||||
|
|
||||||
|
this._x = x;
|
||||||
|
this._y = y;
|
||||||
|
this._width = width;
|
||||||
|
this._height = height;
|
||||||
|
this._filePath = filePath;
|
||||||
|
|
||||||
|
this._pipelineString = DEFAULT_PIPELINE;
|
||||||
|
this._framerate = DEFAULT_FRAMERATE;
|
||||||
|
this._drawCursor = DEFAULT_DRAW_CURSOR;
|
||||||
|
|
||||||
|
this._applyOptions(options);
|
||||||
|
this._watchSender(invocation.get_sender());
|
||||||
|
|
||||||
|
this._initSession(sessionPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
_applyOptions(options) {
|
||||||
|
for (const option in options)
|
||||||
|
options[option] = options[option].deep_unpack();
|
||||||
|
|
||||||
|
if (options['pipeline'] !== undefined)
|
||||||
|
this._pipelineString = options['pipeline'];
|
||||||
|
if (options['framerate'] !== undefined)
|
||||||
|
this._framerate = options['framerate'];
|
||||||
|
if ('draw-cursor' in options)
|
||||||
|
this._drawCursor = options['draw-cursor'];
|
||||||
|
}
|
||||||
|
|
||||||
|
_watchSender(sender) {
|
||||||
|
this._nameWatchId = this._dbusConnection.watch_name(
|
||||||
|
sender,
|
||||||
|
Gio.BusNameWatcherFlags.NONE,
|
||||||
|
null,
|
||||||
|
this._senderVanished.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
_unwatchSender() {
|
||||||
|
if (this._nameWatchId !== 0) {
|
||||||
|
this._dbusConnection.unwatch_name(this._nameWatchId);
|
||||||
|
this._nameWatchId = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_senderVanished() {
|
||||||
|
this._unwatchSender();
|
||||||
|
|
||||||
|
this.stopRecording(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
_notifyStopped() {
|
||||||
|
this._unwatchSender();
|
||||||
|
if (this._onStartedCallback)
|
||||||
|
this._onStartedCallback(this, false);
|
||||||
|
else if (this._onStoppedCallback)
|
||||||
|
this._onStoppedCallback(this);
|
||||||
|
else
|
||||||
|
this._onErrorCallback(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onSessionClosed() {
|
||||||
|
switch (this._pipelineState) {
|
||||||
|
case PipelineState.STOPPED:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this._pipeline.set_state(Gst.State.NULL);
|
||||||
|
log(`Unexpected pipeline state: ${this._pipelineState}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this._notifyStopped();
|
||||||
|
}
|
||||||
|
|
||||||
|
_initSession(sessionPath) {
|
||||||
|
this._sessionProxy = new ScreenCastSessionProxy(Gio.DBus.session,
|
||||||
|
'org.gnome.Mutter.ScreenCast',
|
||||||
|
sessionPath);
|
||||||
|
this._sessionProxy.connectSignal('Closed', this._onSessionClosed.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
_startPipeline(nodeId) {
|
||||||
|
this._ensurePipeline(nodeId);
|
||||||
|
|
||||||
|
const bus = this._pipeline.get_bus();
|
||||||
|
bus.add_watch(bus, this._onBusMessage.bind(this));
|
||||||
|
|
||||||
|
this._pipeline.set_state(Gst.State.PLAYING);
|
||||||
|
this._pipelineState = PipelineState.PLAYING;
|
||||||
|
|
||||||
|
this._onStartedCallback(this, true);
|
||||||
|
this._onStartedCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
startRecording(onStartedCallback) {
|
||||||
|
this._onStartedCallback = onStartedCallback;
|
||||||
|
|
||||||
|
const [streamPath] = this._sessionProxy.RecordAreaSync(
|
||||||
|
this._x, this._y,
|
||||||
|
this._width, this._height,
|
||||||
|
{
|
||||||
|
'is-recording': GLib.Variant.new('b', true),
|
||||||
|
'cursor-mode': GLib.Variant.new('u', this._drawCursor ? 1 : 0),
|
||||||
|
});
|
||||||
|
|
||||||
|
this._streamProxy = new ScreenCastStreamProxy(Gio.DBus.session,
|
||||||
|
'org.gnome.ScreenCast.Stream',
|
||||||
|
streamPath);
|
||||||
|
|
||||||
|
this._streamProxy.connectSignal('PipeWireStreamAdded',
|
||||||
|
(proxy, sender, params) => {
|
||||||
|
const [nodeId] = params;
|
||||||
|
this._startPipeline(nodeId);
|
||||||
|
});
|
||||||
|
this._sessionProxy.StartSync();
|
||||||
|
this._sessionState = SessionState.ACTIVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
stopRecording(onStoppedCallback) {
|
||||||
|
this._pipelineState = PipelineState.FLUSHING;
|
||||||
|
this._onStoppedCallback = onStoppedCallback;
|
||||||
|
this._pipeline.send_event(Gst.Event.new_eos());
|
||||||
|
}
|
||||||
|
|
||||||
|
_stopSession() {
|
||||||
|
this._sessionProxy.StopSync();
|
||||||
|
this._sessionState = SessionState.STOPPED;
|
||||||
|
}
|
||||||
|
|
||||||
|
_onBusMessage(bus, message, _) {
|
||||||
|
switch (message.type) {
|
||||||
|
case Gst.MessageType.EOS:
|
||||||
|
this._pipeline.set_state(Gst.State.NULL);
|
||||||
|
|
||||||
|
switch (this._pipelineState) {
|
||||||
|
case PipelineState.FLUSHING:
|
||||||
|
this._pipelineState = PipelineState.STOPPED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (this._sessionState) {
|
||||||
|
case SessionState.ACTIVE:
|
||||||
|
this._stopSession();
|
||||||
|
break;
|
||||||
|
case SessionState.STOPPED:
|
||||||
|
this._notifyStopped();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_substituteThreadCount(pipelineDescr) {
|
||||||
|
const numProcessors = GLib.get_num_processors();
|
||||||
|
const numThreads = Math.min(Math.max(1, numProcessors), 64);
|
||||||
|
return pipelineDescr.replace(/%T/, numThreads);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ensurePipeline(nodeId) {
|
||||||
|
const framerate = this._framerate;
|
||||||
|
|
||||||
|
let fullPipeline = `
|
||||||
|
pipewiresrc path=${nodeId}
|
||||||
|
do-timestamp=true
|
||||||
|
keepalive-time=1000
|
||||||
|
resend-last=true !
|
||||||
|
video/x-raw,max-framerate=${framerate}/1 !
|
||||||
|
videoconvert !
|
||||||
|
${this._pipelineString} !
|
||||||
|
filesink location="${this._filePath}"`;
|
||||||
|
fullPipeline = this._substituteThreadCount(fullPipeline);
|
||||||
|
|
||||||
|
this._pipeline = Gst.parse_launch_full(fullPipeline,
|
||||||
|
null,
|
||||||
|
Gst.ParseFlags.FATAL_ERRORS);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var ScreencastService = class extends ServiceImplementation {
|
||||||
|
constructor() {
|
||||||
|
super(ScreencastIface, '/org/gnome/Shell/Screencast');
|
||||||
|
|
||||||
|
Gst.init(null);
|
||||||
|
|
||||||
|
this._recorders = new Map();
|
||||||
|
this._senders = new Map();
|
||||||
|
|
||||||
|
this._lockdownSettings = new Gio.Settings({
|
||||||
|
schema_id: 'org.gnome.desktop.lockdown',
|
||||||
|
});
|
||||||
|
|
||||||
|
this._proxy = new ScreenCastProxy(Gio.DBus.session,
|
||||||
|
'org.gnome.Mutter.ScreenCast',
|
||||||
|
'/org/gnome/Mutter/ScreenCast');
|
||||||
|
|
||||||
|
this._introspectProxy = new IntrospectProxy(Gio.DBus.session,
|
||||||
|
'org.gnome.Shell.Introspect',
|
||||||
|
'/org/gnome/Shell/Introspect');
|
||||||
|
}
|
||||||
|
|
||||||
|
_removeRecorder(sender) {
|
||||||
|
this._recorders.delete(sender);
|
||||||
|
if (this._recorders.size === 0)
|
||||||
|
this.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
_addRecorder(sender, recorder) {
|
||||||
|
this._recorders.set(sender, recorder);
|
||||||
|
if (this._recorders.size === 1)
|
||||||
|
this.hold();
|
||||||
|
}
|
||||||
|
|
||||||
|
_getAbsolutePath(filename) {
|
||||||
|
if (GLib.path_is_absolute(filename))
|
||||||
|
return filename;
|
||||||
|
|
||||||
|
let videoDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_VIDEOS);
|
||||||
|
if (!GLib.file_test(videoDir, GLib.FileTest.EXISTS))
|
||||||
|
videoDir = GLib.get_home_dir();
|
||||||
|
|
||||||
|
return GLib.build_filenamev([videoDir, filename]);
|
||||||
|
}
|
||||||
|
|
||||||
|
_generateFilePath(template) {
|
||||||
|
let filename = '';
|
||||||
|
let escape = false;
|
||||||
|
|
||||||
|
[...template].forEach(c => {
|
||||||
|
if (escape) {
|
||||||
|
switch (c) {
|
||||||
|
case '%':
|
||||||
|
filename += '%';
|
||||||
|
break;
|
||||||
|
case 'd': {
|
||||||
|
const datetime = GLib.DateTime.new_now_local();
|
||||||
|
const datestr = datetime.format('%0x');
|
||||||
|
const datestrEscaped = datestr.replace(/\//g, '-');
|
||||||
|
|
||||||
|
filename += datestrEscaped;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 't': {
|
||||||
|
const datetime = GLib.DateTime.new_now_local();
|
||||||
|
const datestr = datetime.format('%0X');
|
||||||
|
const datestrEscaped = datestr.replace(/\//g, ':');
|
||||||
|
|
||||||
|
filename += datestrEscaped;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
log(`Warning: Unknown escape ${c}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
escape = false;
|
||||||
|
} else if (c === '%') {
|
||||||
|
escape = true;
|
||||||
|
} else {
|
||||||
|
filename += c;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (escape)
|
||||||
|
filename += '%';
|
||||||
|
|
||||||
|
return this._getAbsolutePath(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreencastAsync(params, invocation) {
|
||||||
|
let returnValue = [false, ''];
|
||||||
|
|
||||||
|
if (this._lockdownSettings.get_boolean('disable-save-to-disk')) {
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sender = invocation.get_sender();
|
||||||
|
|
||||||
|
if (this._recorders.get(sender)) {
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [sessionPath] = this._proxy.CreateSessionSync({});
|
||||||
|
|
||||||
|
const [fileTemplate, options] = params;
|
||||||
|
const [screenWidth, screenHeight] = this._introspectProxy.ScreenSize;
|
||||||
|
const filePath = this._generateFilePath(fileTemplate);
|
||||||
|
|
||||||
|
let recorder;
|
||||||
|
|
||||||
|
try {
|
||||||
|
recorder = new Recorder(
|
||||||
|
sessionPath,
|
||||||
|
0, 0,
|
||||||
|
screenWidth, screenHeight,
|
||||||
|
fileTemplate,
|
||||||
|
options,
|
||||||
|
invocation,
|
||||||
|
_recorder => this._removeRecorder(sender));
|
||||||
|
} catch (error) {
|
||||||
|
log(`Failed to create recorder: ${error.message}`);
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._addRecorder(sender, recorder);
|
||||||
|
|
||||||
|
try {
|
||||||
|
recorder.startRecording(
|
||||||
|
(_, result) => {
|
||||||
|
if (result) {
|
||||||
|
returnValue = [true, filePath];
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
} else {
|
||||||
|
this._removeRecorder(sender);
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
log(`Failed to start recorder: ${error.message}`);
|
||||||
|
this._removeRecorder(sender);
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreencastAreaAsync(params, invocation) {
|
||||||
|
let returnValue = [false, ''];
|
||||||
|
|
||||||
|
if (this._lockdownSettings.get_boolean('disable-save-to-disk')) {
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sender = invocation.get_sender();
|
||||||
|
|
||||||
|
if (this._recorders.get(sender)) {
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [sessionPath] = this._proxy.CreateSessionSync({});
|
||||||
|
|
||||||
|
const [x, y, width, height, fileTemplate, options] = params;
|
||||||
|
const filePath = this._generateFilePath(fileTemplate);
|
||||||
|
|
||||||
|
let recorder;
|
||||||
|
|
||||||
|
try {
|
||||||
|
recorder = new Recorder(
|
||||||
|
sessionPath,
|
||||||
|
x, y,
|
||||||
|
width, height,
|
||||||
|
filePath,
|
||||||
|
options,
|
||||||
|
invocation,
|
||||||
|
_recorder => this._removeRecorder(sender));
|
||||||
|
} catch (error) {
|
||||||
|
log(`Failed to create recorder: ${error.message}`);
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._addRecorder(sender, recorder);
|
||||||
|
|
||||||
|
try {
|
||||||
|
recorder.startRecording(
|
||||||
|
(_, result) => {
|
||||||
|
if (result) {
|
||||||
|
returnValue = [true, filePath];
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
} else {
|
||||||
|
this._removeRecorder(sender);
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
log(`Failed to start recorder: ${error.message}`);
|
||||||
|
this._removeRecorder(sender);
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StopScreencastAsync(params, invocation) {
|
||||||
|
const sender = invocation.get_sender();
|
||||||
|
|
||||||
|
const recorder = this._recorders.get(sender);
|
||||||
|
if (!recorder) {
|
||||||
|
invocation.return_value(GLib.Variant.new('(b)', [false]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
recorder.stopRecording(() => {
|
||||||
|
this._removeRecorder(sender);
|
||||||
|
invocation.return_value(GLib.Variant.new('(b)', [true]));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
@ -6,10 +6,11 @@ const { Clutter, GObject, Pango, Shell, St } = imports.gi;
|
|||||||
const Animation = imports.ui.animation;
|
const Animation = imports.ui.animation;
|
||||||
const Batch = imports.gdm.batch;
|
const Batch = imports.gdm.batch;
|
||||||
const GdmUtil = imports.gdm.util;
|
const GdmUtil = imports.gdm.util;
|
||||||
const Util = imports.misc.util;
|
const OVirt = imports.gdm.oVirt;
|
||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const ShellEntry = imports.ui.shellEntry;
|
const ShellEntry = imports.ui.shellEntry;
|
||||||
const UserWidget = imports.ui.userWidget;
|
const UserWidget = imports.ui.userWidget;
|
||||||
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
var DEFAULT_BUTTON_WELL_ICON_SIZE = 16;
|
var DEFAULT_BUTTON_WELL_ICON_SIZE = 16;
|
||||||
var DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1000;
|
var DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1000;
|
||||||
@ -71,7 +72,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
this._userVerifier.connect('verification-complete', this._onVerificationComplete.bind(this));
|
this._userVerifier.connect('verification-complete', this._onVerificationComplete.bind(this));
|
||||||
this._userVerifier.connect('reset', this._onReset.bind(this));
|
this._userVerifier.connect('reset', this._onReset.bind(this));
|
||||||
this._userVerifier.connect('smartcard-status-changed', this._onSmartcardStatusChanged.bind(this));
|
this._userVerifier.connect('smartcard-status-changed', this._onSmartcardStatusChanged.bind(this));
|
||||||
this._userVerifier.connect('ovirt-user-authenticated', this._onOVirtUserAuthenticated.bind(this));
|
this._userVerifier.connect('credential-manager-authenticated', this._onCredentialManagerAuthenticated.bind(this));
|
||||||
this.smartcardDetected = this._userVerifier.smartcardDetected;
|
this.smartcardDetected = this._userVerifier.smartcardDetected;
|
||||||
|
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
@ -184,7 +185,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
this._defaultButtonWell.add_constraint(new Clutter.BindConstraint({
|
this._defaultButtonWell.add_constraint(new Clutter.BindConstraint({
|
||||||
source: this.cancelButton,
|
source: this.cancelButton,
|
||||||
coordinate: Clutter.BindCoordinate.SIZE,
|
coordinate: Clutter.BindCoordinate.WIDTH,
|
||||||
}));
|
}));
|
||||||
this._mainBox.add_child(this._defaultButtonWell);
|
this._mainBox.add_child(this._defaultButtonWell);
|
||||||
|
|
||||||
@ -242,7 +243,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
this.emit('prompted');
|
this.emit('prompted');
|
||||||
}
|
}
|
||||||
|
|
||||||
_onOVirtUserAuthenticated() {
|
_onCredentialManagerAuthenticated() {
|
||||||
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED)
|
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED)
|
||||||
this.reset();
|
this.reset();
|
||||||
}
|
}
|
||||||
@ -424,7 +425,13 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateSensitivity(sensitive) {
|
updateSensitivity(sensitive) {
|
||||||
|
if (this._entry.reactive === sensitive)
|
||||||
|
return;
|
||||||
|
|
||||||
this._entry.reactive = sensitive;
|
this._entry.reactive = sensitive;
|
||||||
|
|
||||||
|
if (sensitive)
|
||||||
|
this._entry.grab_key_focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_hide() {
|
vfunc_hide() {
|
||||||
@ -476,7 +483,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
// The user is constant at the unlock screen, so it will immediately
|
// The user is constant at the unlock screen, so it will immediately
|
||||||
// respond to the request with the username
|
// respond to the request with the username
|
||||||
beginRequestType = BeginRequestType.PROVIDE_USERNAME;
|
beginRequestType = BeginRequestType.PROVIDE_USERNAME;
|
||||||
} else if (this._userVerifier.serviceIsForeground(GdmUtil.OVIRT_SERVICE_NAME) ||
|
} else if (this._userVerifier.serviceIsForeground(OVirt.SERVICE_NAME) ||
|
||||||
this._userVerifier.serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME)) {
|
this._userVerifier.serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME)) {
|
||||||
// We don't need to know the username if the user preempted the login screen
|
// We don't need to know the username if the user preempted the login screen
|
||||||
// with a smartcard or with preauthenticated oVirt credentials
|
// with a smartcard or with preauthenticated oVirt credentials
|
||||||
|
24
js/gdm/credentialManager.js
Normal file
24
js/gdm/credentialManager.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
/* exported CredentialManager */
|
||||||
|
|
||||||
|
class CredentialManager {
|
||||||
|
constructor(service) {
|
||||||
|
this._token = null;
|
||||||
|
this._service = service;
|
||||||
|
this._authenticatedSignalId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
get token() {
|
||||||
|
return this._token;
|
||||||
|
}
|
||||||
|
|
||||||
|
set token(t) {
|
||||||
|
this._token = t;
|
||||||
|
if (this._token)
|
||||||
|
this.emit('user-authenticated', this._token);
|
||||||
|
}
|
||||||
|
|
||||||
|
get service() {
|
||||||
|
return this._service;
|
||||||
|
}
|
||||||
|
}
|
@ -589,8 +589,8 @@ var LoginDialog = GObject.registerClass({
|
|||||||
return actorBox;
|
return actorBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(dialogBox, flags) {
|
vfunc_allocate(dialogBox) {
|
||||||
this.set_allocation(dialogBox, flags);
|
this.set_allocation(dialogBox);
|
||||||
|
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
dialogBox = themeNode.get_content_box(dialogBox);
|
dialogBox = themeNode.get_content_box(dialogBox);
|
||||||
@ -719,19 +719,19 @@ var LoginDialog = GObject.registerClass({
|
|||||||
|
|
||||||
// Finally hand out the allocations
|
// Finally hand out the allocations
|
||||||
if (bannerAllocation)
|
if (bannerAllocation)
|
||||||
this._bannerView.allocate(bannerAllocation, flags);
|
this._bannerView.allocate(bannerAllocation);
|
||||||
|
|
||||||
if (authPromptAllocation)
|
if (authPromptAllocation)
|
||||||
this._authPrompt.allocate(authPromptAllocation, flags);
|
this._authPrompt.allocate(authPromptAllocation);
|
||||||
|
|
||||||
if (userSelectionAllocation)
|
if (userSelectionAllocation)
|
||||||
this._userSelectionBox.allocate(userSelectionAllocation, flags);
|
this._userSelectionBox.allocate(userSelectionAllocation);
|
||||||
|
|
||||||
if (logoAllocation)
|
if (logoAllocation)
|
||||||
this._logoBin.allocate(logoAllocation, flags);
|
this._logoBin.allocate(logoAllocation);
|
||||||
|
|
||||||
if (sessionMenuButtonAllocation)
|
if (sessionMenuButtonAllocation)
|
||||||
this._sessionMenuButton.allocate(sessionMenuButtonAllocation, flags);
|
this._sessionMenuButton.allocate(sessionMenuButtonAllocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ensureUserListLoaded() {
|
_ensureUserListLoaded() {
|
||||||
@ -810,12 +810,13 @@ var LoginDialog = GObject.registerClass({
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this._logoBin.destroy_all_children();
|
this._logoBin.destroy_all_children();
|
||||||
if (this._logoFile && this._logoBin.resource_scale > 0) {
|
const resourceScale = this._logoBin.get_resource_scale();
|
||||||
|
if (this._logoFile) {
|
||||||
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||||
this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile,
|
this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile,
|
||||||
-1, -1,
|
-1, -1,
|
||||||
scaleFactor,
|
scaleFactor,
|
||||||
this._logoBin.resource_scale));
|
resourceScale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -952,16 +953,15 @@ var LoginDialog = GObject.registerClass({
|
|||||||
if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
|
if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (this._authPrompt.verificationStatus !== AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
|
||||||
|
this._authPrompt.reset();
|
||||||
|
|
||||||
this._bindOpacity();
|
this._bindOpacity();
|
||||||
this.ease({
|
this.ease({
|
||||||
opacity: 255,
|
opacity: 255,
|
||||||
duration: _FADE_ANIMATION_TIME,
|
duration: _FADE_ANIMATION_TIME,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
onComplete: () => {
|
onComplete: () => this._unbindOpacity(),
|
||||||
if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
|
|
||||||
this._authPrompt.reset();
|
|
||||||
this._unbindOpacity();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
const Credential = imports.gdm.credentialManager;
|
||||||
|
|
||||||
|
var SERVICE_NAME = 'gdm-ovirtcred';
|
||||||
|
|
||||||
const OVirtCredentialsIface = `
|
const OVirtCredentialsIface = `
|
||||||
<node>
|
<node>
|
||||||
@ -28,30 +31,14 @@ function OVirtCredentials() {
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
var OVirtCredentialsManager = class {
|
var OVirtCredentialsManager = class OVirtCredentialsManager extends Credential.CredentialManager {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._token = null;
|
super(SERVICE_NAME);
|
||||||
|
|
||||||
this._credentials = new OVirtCredentials();
|
this._credentials = new OVirtCredentials();
|
||||||
this._credentials.connectSignal('UserAuthenticated',
|
this._credentials.connectSignal('UserAuthenticated',
|
||||||
this._onUserAuthenticated.bind(this));
|
(proxy, sender, [token]) => {
|
||||||
}
|
this.token = token;
|
||||||
|
});
|
||||||
_onUserAuthenticated(proxy, sender, [token]) {
|
|
||||||
this._token = token;
|
|
||||||
this.emit('user-authenticated', token);
|
|
||||||
}
|
|
||||||
|
|
||||||
hasToken() {
|
|
||||||
return this._token != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
getToken() {
|
|
||||||
return this._token;
|
|
||||||
}
|
|
||||||
|
|
||||||
resetToken() {
|
|
||||||
this._token = null;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Signals.addSignalMethods(OVirtCredentialsManager.prototype);
|
Signals.addSignalMethods(OVirtCredentialsManager.prototype);
|
||||||
|
129
js/gdm/util.js
129
js/gdm/util.js
@ -2,20 +2,29 @@
|
|||||||
/* exported BANNER_MESSAGE_KEY, BANNER_MESSAGE_TEXT_KEY, LOGO_KEY,
|
/* exported BANNER_MESSAGE_KEY, BANNER_MESSAGE_TEXT_KEY, LOGO_KEY,
|
||||||
DISABLE_USER_LIST_KEY, fadeInActor, fadeOutActor, cloneAndFadeOutActor */
|
DISABLE_USER_LIST_KEY, fadeInActor, fadeOutActor, cloneAndFadeOutActor */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib } = imports.gi;
|
const { Clutter, Gdm, Gio, GLib } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Batch = imports.gdm.batch;
|
const Batch = imports.gdm.batch;
|
||||||
const Fprint = imports.gdm.fingerprint;
|
const Fprint = imports.gdm.fingerprint;
|
||||||
const OVirt = imports.gdm.oVirt;
|
const OVirt = imports.gdm.oVirt;
|
||||||
|
const Vmware = imports.gdm.vmware;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const SmartcardManager = imports.misc.smartcardManager;
|
const SmartcardManager = imports.misc.smartcardManager;
|
||||||
|
|
||||||
|
Gio._promisify(Gdm.Client.prototype,
|
||||||
|
'open_reauthentication_channel', 'open_reauthentication_channel_finish');
|
||||||
|
Gio._promisify(Gdm.Client.prototype,
|
||||||
|
'get_user_verifier', 'get_user_verifier_finish');
|
||||||
|
Gio._promisify(Gdm.UserVerifierProxy.prototype,
|
||||||
|
'call_begin_verification_for_user', 'call_begin_verification_for_user_finish');
|
||||||
|
Gio._promisify(Gdm.UserVerifierProxy.prototype,
|
||||||
|
'call_begin_verification', 'call_begin_verification_finish');
|
||||||
|
|
||||||
var PASSWORD_SERVICE_NAME = 'gdm-password';
|
var PASSWORD_SERVICE_NAME = 'gdm-password';
|
||||||
var FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
|
var FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
|
||||||
var SMARTCARD_SERVICE_NAME = 'gdm-smartcard';
|
var SMARTCARD_SERVICE_NAME = 'gdm-smartcard';
|
||||||
var OVIRT_SERVICE_NAME = 'gdm-ovirtcred';
|
|
||||||
var FADE_ANIMATION_TIME = 160;
|
var FADE_ANIMATION_TIME = 160;
|
||||||
var CLONE_FADE_ANIMATION_TIME = 250;
|
var CLONE_FADE_ANIMATION_TIME = 250;
|
||||||
|
|
||||||
@ -151,13 +160,20 @@ var ShellUserVerifier = class {
|
|||||||
|
|
||||||
this._failCounter = 0;
|
this._failCounter = 0;
|
||||||
|
|
||||||
this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();
|
this._credentialManagers = {};
|
||||||
|
this._credentialManagers[OVirt.SERVICE_NAME] = OVirt.getOVirtCredentialsManager();
|
||||||
|
this._credentialManagers[Vmware.SERVICE_NAME] = Vmware.getVmwareCredentialsManager();
|
||||||
|
|
||||||
if (this._oVirtCredentialsManager.hasToken())
|
for (let service in this._credentialManagers) {
|
||||||
this._oVirtUserAuthenticated(this._oVirtCredentialsManager.getToken());
|
if (this._credentialManagers[service].token) {
|
||||||
|
this._onCredentialManagerAuthenticated(this._credentialManagers[service],
|
||||||
|
this._credentialManagers[service].token);
|
||||||
|
}
|
||||||
|
|
||||||
this._oVirtUserAuthenticatedId = this._oVirtCredentialsManager.connect('user-authenticated',
|
this._credentialManagers[service]._authenticatedSignalId =
|
||||||
this._oVirtUserAuthenticated.bind(this));
|
this._credentialManagers[service].connect('user-authenticated',
|
||||||
|
this._onCredentialManagerAuthenticated.bind(this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
begin(userName, hold) {
|
begin(userName, hold) {
|
||||||
@ -168,14 +184,12 @@ var ShellUserVerifier = class {
|
|||||||
|
|
||||||
this._checkForFingerprintReader();
|
this._checkForFingerprintReader();
|
||||||
|
|
||||||
if (userName) {
|
// If possible, reauthenticate an already running session,
|
||||||
// If possible, reauthenticate an already running session,
|
// so any session specific credentials get updated appropriately
|
||||||
// so any session specific credentials get updated appropriately
|
if (userName)
|
||||||
this._client.open_reauthentication_channel(userName, this._cancellable,
|
this._openReauthenticationChannel(userName);
|
||||||
this._reauthenticationChannelOpened.bind(this));
|
else
|
||||||
} else {
|
this._getUserVerifier();
|
||||||
this._client.get_user_verifier(this._cancellable, this._userVerifierGot.bind(this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -215,8 +229,11 @@ var ShellUserVerifier = class {
|
|||||||
this._smartcardManager.disconnect(this._smartcardRemovedId);
|
this._smartcardManager.disconnect(this._smartcardRemovedId);
|
||||||
this._smartcardManager = null;
|
this._smartcardManager = null;
|
||||||
|
|
||||||
this._oVirtCredentialsManager.disconnect(this._oVirtUserAuthenticatedId);
|
for (let service in this._credentialManagers) {
|
||||||
this._oVirtCredentialsManager = null;
|
let credentialManager = this._credentialManagers[service];
|
||||||
|
credentialManager.disconnect(credentialManager._authenticatedSignalId);
|
||||||
|
credentialManager = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
answerQuery(serviceName, answer) {
|
answerQuery(serviceName, answer) {
|
||||||
@ -304,9 +321,9 @@ var ShellUserVerifier = class {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_oVirtUserAuthenticated(_token) {
|
_onCredentialManagerAuthenticated(credentialManager, _token) {
|
||||||
this._preemptingService = OVIRT_SERVICE_NAME;
|
this._preemptingService = credentialManager.service;
|
||||||
this.emit('ovirt-user-authenticated');
|
this.emit('credential-manager-authenticated');
|
||||||
}
|
}
|
||||||
|
|
||||||
_checkForSmartcard() {
|
_checkForSmartcard() {
|
||||||
@ -339,10 +356,11 @@ var ShellUserVerifier = class {
|
|||||||
this._verificationFailed(false);
|
this._verificationFailed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_reauthenticationChannelOpened(client, result) {
|
async _openReauthenticationChannel(userName) {
|
||||||
try {
|
try {
|
||||||
this._clearUserVerifier();
|
this._clearUserVerifier();
|
||||||
this._userVerifier = client.open_reauthentication_channel_finish(result);
|
this._userVerifier = await this._client.open_reauthentication_channel(
|
||||||
|
userName, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
return;
|
return;
|
||||||
@ -351,8 +369,7 @@ var ShellUserVerifier = class {
|
|||||||
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there
|
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there
|
||||||
// is no session to reauthenticate. Fall back to performing
|
// is no session to reauthenticate. Fall back to performing
|
||||||
// verification from this login session
|
// verification from this login session
|
||||||
client.get_user_verifier(this._cancellable,
|
this._getUserVerifier();
|
||||||
this._userVerifierGot.bind(this));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,10 +383,11 @@ var ShellUserVerifier = class {
|
|||||||
this._hold.release();
|
this._hold.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
_userVerifierGot(client, result) {
|
async _getUserVerifier() {
|
||||||
try {
|
try {
|
||||||
this._clearUserVerifier();
|
this._clearUserVerifier();
|
||||||
this._userVerifier = client.get_user_verifier_finish(result);
|
this._userVerifier =
|
||||||
|
await this._client.get_user_verifier(this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
return;
|
return;
|
||||||
@ -421,35 +439,25 @@ var ShellUserVerifier = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_startService(serviceName) {
|
async _startService(serviceName) {
|
||||||
this._hold.acquire();
|
this._hold.acquire();
|
||||||
if (this._userName) {
|
try {
|
||||||
this._userVerifier.call_begin_verification_for_user(serviceName, this._userName, this._cancellable, (obj, result) => {
|
if (this._userName) {
|
||||||
try {
|
await this._userVerifier.call_begin_verification_for_user(
|
||||||
obj.call_begin_verification_for_user_finish(result);
|
serviceName, this._userName, this._cancellable);
|
||||||
} catch (e) {
|
} else {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
await this._userVerifier.call_begin_verification(
|
||||||
return;
|
serviceName, this._cancellable);
|
||||||
this._reportInitError('Failed to start verification for user', e);
|
}
|
||||||
return;
|
} catch (e) {
|
||||||
}
|
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
|
return;
|
||||||
this._hold.release();
|
this._reportInitError(this._userName
|
||||||
});
|
? 'Failed to start verification for user'
|
||||||
} else {
|
: 'Failed to start verification', e);
|
||||||
this._userVerifier.call_begin_verification(serviceName, this._cancellable, (obj, result) => {
|
return;
|
||||||
try {
|
|
||||||
obj.call_begin_verification_finish(result);
|
|
||||||
} catch (e) {
|
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
|
||||||
return;
|
|
||||||
this._reportInitError('Failed to start verification', e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._hold.release();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
this._hold.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
_beginVerification() {
|
_beginVerification() {
|
||||||
@ -492,9 +500,12 @@ var ShellUserVerifier = class {
|
|||||||
if (!this.serviceIsForeground(serviceName))
|
if (!this.serviceIsForeground(serviceName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (serviceName == OVIRT_SERVICE_NAME) {
|
let token = null;
|
||||||
// The only question asked by this service is "Token?"
|
if (this._credentialManagers[serviceName])
|
||||||
this.answerQuery(serviceName, this._oVirtCredentialsManager.getToken());
|
token = this._credentialManagers[serviceName].token;
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
this.answerQuery(serviceName, token);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,8 +573,10 @@ var ShellUserVerifier = class {
|
|||||||
// If the login failed with the preauthenticated oVirt credentials
|
// If the login failed with the preauthenticated oVirt credentials
|
||||||
// then discard the credentials and revert to default authentication
|
// then discard the credentials and revert to default authentication
|
||||||
// mechanism.
|
// mechanism.
|
||||||
if (this.serviceIsForeground(OVIRT_SERVICE_NAME)) {
|
let foregroundService = Object.keys(this._credentialManagers).find(service =>
|
||||||
this._oVirtCredentialsManager.resetToken();
|
this.serviceIsForeground(service));
|
||||||
|
if (foregroundService) {
|
||||||
|
this._credentialManagers[foregroundService].token = null;
|
||||||
this._preemptingService = null;
|
this._preemptingService = null;
|
||||||
this._verificationFailed(false);
|
this._verificationFailed(false);
|
||||||
return;
|
return;
|
||||||
|
54
js/gdm/vmware.js
Normal file
54
js/gdm/vmware.js
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
/* exported getVmwareCredentialsManager */
|
||||||
|
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Signals = imports.signals;
|
||||||
|
const Credential = imports.gdm.credentialManager;
|
||||||
|
|
||||||
|
const dbusPath = '/org/vmware/viewagent/Credentials';
|
||||||
|
const dbusInterface = 'org.vmware.viewagent.Credentials';
|
||||||
|
|
||||||
|
var SERVICE_NAME = 'gdm-vmwcred';
|
||||||
|
|
||||||
|
const VmwareCredentialsIface = '<node> \
|
||||||
|
<interface name="' + dbusInterface + '"> \
|
||||||
|
<signal name="UserAuthenticated"> \
|
||||||
|
<arg type="s" name="token"/> \
|
||||||
|
</signal> \
|
||||||
|
</interface> \
|
||||||
|
</node>';
|
||||||
|
|
||||||
|
|
||||||
|
const VmwareCredentialsInfo = Gio.DBusInterfaceInfo.new_for_xml(VmwareCredentialsIface);
|
||||||
|
|
||||||
|
let _vmwareCredentialsManager = null;
|
||||||
|
|
||||||
|
function VmwareCredentials() {
|
||||||
|
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
|
||||||
|
g_interface_name: VmwareCredentialsInfo.name,
|
||||||
|
g_interface_info: VmwareCredentialsInfo,
|
||||||
|
g_name: dbusInterface,
|
||||||
|
g_object_path: dbusPath,
|
||||||
|
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES });
|
||||||
|
self.init(null);
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
var VmwareCredentialsManager = class VmwareCredentialsManager extends Credential.CredentialManager {
|
||||||
|
constructor() {
|
||||||
|
super(SERVICE_NAME);
|
||||||
|
this._credentials = new VmwareCredentials();
|
||||||
|
this._credentials.connectSignal('UserAuthenticated',
|
||||||
|
(proxy, sender, [token]) => {
|
||||||
|
this.token = token;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Signals.addSignalMethods(VmwareCredentialsManager.prototype);
|
||||||
|
|
||||||
|
function getVmwareCredentialsManager() {
|
||||||
|
if (!_vmwareCredentialsManager)
|
||||||
|
_vmwareCredentialsManager = new VmwareCredentialsManager();
|
||||||
|
|
||||||
|
return _vmwareCredentialsManager;
|
||||||
|
}
|
@ -6,6 +6,8 @@
|
|||||||
<file>gdm/fingerprint.js</file>
|
<file>gdm/fingerprint.js</file>
|
||||||
<file>gdm/loginDialog.js</file>
|
<file>gdm/loginDialog.js</file>
|
||||||
<file>gdm/oVirt.js</file>
|
<file>gdm/oVirt.js</file>
|
||||||
|
<file>gdm/credentialManager.js</file>
|
||||||
|
<file>gdm/vmware.js</file>
|
||||||
<file>gdm/realmd.js</file>
|
<file>gdm/realmd.js</file>
|
||||||
<file>gdm/util.js</file>
|
<file>gdm/util.js</file>
|
||||||
|
|
||||||
@ -23,12 +25,14 @@
|
|||||||
<file>misc/modemManager.js</file>
|
<file>misc/modemManager.js</file>
|
||||||
<file>misc/objectManager.js</file>
|
<file>misc/objectManager.js</file>
|
||||||
<file>misc/params.js</file>
|
<file>misc/params.js</file>
|
||||||
|
<file>misc/parentalControlsManager.js</file>
|
||||||
<file>misc/permissionStore.js</file>
|
<file>misc/permissionStore.js</file>
|
||||||
<file>misc/smartcardManager.js</file>
|
<file>misc/smartcardManager.js</file>
|
||||||
<file>misc/systemActions.js</file>
|
<file>misc/systemActions.js</file>
|
||||||
<file>misc/util.js</file>
|
<file>misc/util.js</file>
|
||||||
<file>misc/weather.js</file>
|
<file>misc/weather.js</file>
|
||||||
|
|
||||||
|
<file>perf/basic.js</file>
|
||||||
<file>perf/core.js</file>
|
<file>perf/core.js</file>
|
||||||
<file>perf/hwtest.js</file>
|
<file>perf/hwtest.js</file>
|
||||||
|
|
||||||
@ -89,7 +93,6 @@
|
|||||||
<file>ui/ripples.js</file>
|
<file>ui/ripples.js</file>
|
||||||
<file>ui/runDialog.js</file>
|
<file>ui/runDialog.js</file>
|
||||||
<file>ui/screenShield.js</file>
|
<file>ui/screenShield.js</file>
|
||||||
<file>ui/screencast.js</file>
|
|
||||||
<file>ui/screenshot.js</file>
|
<file>ui/screenshot.js</file>
|
||||||
<file>ui/scripting.js</file>
|
<file>ui/scripting.js</file>
|
||||||
<file>ui/search.js</file>
|
<file>ui/search.js</file>
|
||||||
@ -101,13 +104,13 @@
|
|||||||
<file>ui/swipeTracker.js</file>
|
<file>ui/swipeTracker.js</file>
|
||||||
<file>ui/switcherPopup.js</file>
|
<file>ui/switcherPopup.js</file>
|
||||||
<file>ui/switchMonitor.js</file>
|
<file>ui/switchMonitor.js</file>
|
||||||
<file>ui/tweener.js</file>
|
|
||||||
<file>ui/unlockDialog.js</file>
|
<file>ui/unlockDialog.js</file>
|
||||||
<file>ui/userWidget.js</file>
|
<file>ui/userWidget.js</file>
|
||||||
<file>ui/viewSelector.js</file>
|
<file>ui/viewSelector.js</file>
|
||||||
<file>ui/windowAttentionHandler.js</file>
|
<file>ui/windowAttentionHandler.js</file>
|
||||||
<file>ui/windowMenu.js</file>
|
<file>ui/windowMenu.js</file>
|
||||||
<file>ui/windowManager.js</file>
|
<file>ui/windowManager.js</file>
|
||||||
|
<file>ui/windowPreview.js</file>
|
||||||
<file>ui/workspace.js</file>
|
<file>ui/workspace.js</file>
|
||||||
<file>ui/workspaceSwitcherPopup.js</file>
|
<file>ui/workspaceSwitcherPopup.js</file>
|
||||||
<file>ui/workspaceThumbnail.js</file>
|
<file>ui/workspaceThumbnail.js</file>
|
||||||
@ -134,7 +137,6 @@
|
|||||||
<file>ui/status/volume.js</file>
|
<file>ui/status/volume.js</file>
|
||||||
<file>ui/status/bluetooth.js</file>
|
<file>ui/status/bluetooth.js</file>
|
||||||
<file>ui/status/remoteAccess.js</file>
|
<file>ui/status/remoteAccess.js</file>
|
||||||
<file>ui/status/screencast.js</file>
|
|
||||||
<file>ui/status/system.js</file>
|
<file>ui/status/system.js</file>
|
||||||
<file>ui/status/thunderbolt.js</file>
|
<file>ui/status/thunderbolt.js</file>
|
||||||
</gresource>
|
</gresource>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported ExtensionState, ExtensionType, getCurrentExtension,
|
/* exported ExtensionState, ExtensionType, getCurrentExtension,
|
||||||
getSettings, initTranslations, isOutOfDate, installImporter,
|
getSettings, initTranslations, openPrefs, isOutOfDate,
|
||||||
serializeExtension, deserializeExtension */
|
installImporter, serializeExtension, deserializeExtension */
|
||||||
|
|
||||||
// Common utils for the extension system and the extension
|
// Common utils for the extension system and the extension
|
||||||
// preferences tool
|
// preferences tool
|
||||||
@ -153,6 +153,27 @@ function getSettings(schema) {
|
|||||||
return new Gio.Settings({ settings_schema: schemaObj });
|
return new Gio.Settings({ settings_schema: schemaObj });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* openPrefs:
|
||||||
|
*
|
||||||
|
* Open the preference dialog of the current extension
|
||||||
|
*/
|
||||||
|
function openPrefs() {
|
||||||
|
const extension = getCurrentExtension();
|
||||||
|
|
||||||
|
if (!extension)
|
||||||
|
throw new Error('openPrefs() can only be called from extensions');
|
||||||
|
|
||||||
|
try {
|
||||||
|
const extensionManager = imports.ui.main.extensionManager;
|
||||||
|
extensionManager.openExtensionPrefs(extension.uuid, '', {});
|
||||||
|
} catch (e) {
|
||||||
|
if (e.name === 'ImportError')
|
||||||
|
throw new Error('openPrefs() cannot be called from preferences');
|
||||||
|
logError(e, 'Failed to open extension preferences');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* versionCheck:
|
* versionCheck:
|
||||||
* @param {string[]} required - an array of versions we're compatible with
|
* @param {string[]} required - an array of versions we're compatible with
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported collectFromDatadirs, recursivelyDeleteDir,
|
/* exported collectFromDatadirs, recursivelyDeleteDir,
|
||||||
recursivelyMoveDir, loadInterfaceXML */
|
recursivelyMoveDir, loadInterfaceXML, loadSubInterfaceXML */
|
||||||
|
|
||||||
const { Gio, GLib } = imports.gi;
|
const { Gio, GLib } = imports.gi;
|
||||||
const Config = imports.misc.config;
|
const Config = imports.misc.config;
|
||||||
@ -67,14 +67,19 @@ function recursivelyMoveDir(srcDir, destDir) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let _ifaceResource = null;
|
let _ifaceResource = null;
|
||||||
|
function ensureIfaceResource() {
|
||||||
|
if (_ifaceResource)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// don't use global.datadir so the method is usable from tests/tools
|
||||||
|
let dir = GLib.getenv('GNOME_SHELL_DATADIR') || Config.PKGDATADIR;
|
||||||
|
let path = `${dir}/gnome-shell-dbus-interfaces.gresource`;
|
||||||
|
_ifaceResource = Gio.Resource.load(path);
|
||||||
|
_ifaceResource._register();
|
||||||
|
}
|
||||||
|
|
||||||
function loadInterfaceXML(iface) {
|
function loadInterfaceXML(iface) {
|
||||||
if (!_ifaceResource) {
|
ensureIfaceResource();
|
||||||
// don't use global.datadir so the method is usable from tests/tools
|
|
||||||
let dir = GLib.getenv('GNOME_SHELL_DATADIR') || Config.PKGDATADIR;
|
|
||||||
let path = `${dir}/gnome-shell-dbus-interfaces.gresource`;
|
|
||||||
_ifaceResource = Gio.Resource.load(path);
|
|
||||||
_ifaceResource._register();
|
|
||||||
}
|
|
||||||
|
|
||||||
let uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`;
|
let uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`;
|
||||||
let f = Gio.File.new_for_uri(uri);
|
let f = Gio.File.new_for_uri(uri);
|
||||||
@ -88,3 +93,25 @@ function loadInterfaceXML(iface) {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadSubInterfaceXML(iface, ifaceFile) {
|
||||||
|
let xml = loadInterfaceXML(ifaceFile);
|
||||||
|
if (!xml)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
let ifaceStartTag = `<interface name="${iface}">`;
|
||||||
|
let ifaceStopTag = '</interface>';
|
||||||
|
let ifaceStartIndex = xml.indexOf(ifaceStartTag);
|
||||||
|
let ifaceEndIndex = xml.indexOf(ifaceStopTag, ifaceStartIndex + 1) + ifaceStopTag.length;
|
||||||
|
|
||||||
|
let xmlHeader = '<!DOCTYPE node PUBLIC\n' +
|
||||||
|
'\'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\'\n' +
|
||||||
|
'\'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\'>\n' +
|
||||||
|
'<node>\n';
|
||||||
|
let xmlFooter = '</node>';
|
||||||
|
|
||||||
|
return (
|
||||||
|
xmlHeader +
|
||||||
|
xml.substr(ifaceStartIndex, ifaceEndIndex - ifaceStartIndex) +
|
||||||
|
xmlFooter);
|
||||||
|
}
|
||||||
|
@ -6,6 +6,15 @@ const Signals = imports.signals;
|
|||||||
|
|
||||||
const IBusCandidatePopup = imports.ui.ibusCandidatePopup;
|
const IBusCandidatePopup = imports.ui.ibusCandidatePopup;
|
||||||
|
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'list_engines_async', 'list_engines_async_finish');
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'request_name_async', 'request_name_async_finish');
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'get_global_engine_async', 'get_global_engine_async_finish');
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'set_global_engine_async', 'set_global_engine_async_finish');
|
||||||
|
|
||||||
// Ensure runtime version matches
|
// Ensure runtime version matches
|
||||||
_checkIBusVersion(1, 5, 2);
|
_checkIBusVersion(1, 5, 2);
|
||||||
|
|
||||||
@ -102,16 +111,14 @@ var IBusManager = class {
|
|||||||
|
|
||||||
_onConnected() {
|
_onConnected() {
|
||||||
this._cancellable = new Gio.Cancellable();
|
this._cancellable = new Gio.Cancellable();
|
||||||
this._ibus.list_engines_async(-1, this._cancellable,
|
this._initEngines();
|
||||||
this._initEngines.bind(this));
|
this._initPanelService();
|
||||||
this._ibus.request_name_async(IBus.SERVICE_PANEL,
|
|
||||||
IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable,
|
|
||||||
this._initPanelService.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_initEngines(ibus, result) {
|
async _initEngines() {
|
||||||
try {
|
try {
|
||||||
let enginesList = this._ibus.list_engines_async_finish(result);
|
const enginesList =
|
||||||
|
await this._ibus.list_engines_async(-1, this._cancellable);
|
||||||
for (let i = 0; i < enginesList.length; ++i) {
|
for (let i = 0; i < enginesList.length; ++i) {
|
||||||
let name = enginesList[i].get_name();
|
let name = enginesList[i].get_name();
|
||||||
this._engines.set(name, enginesList[i]);
|
this._engines.set(name, enginesList[i]);
|
||||||
@ -126,9 +133,10 @@ var IBusManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_initPanelService(ibus, result) {
|
async _initPanelService() {
|
||||||
try {
|
try {
|
||||||
this._ibus.request_name_async_finish(result);
|
await this._ibus.request_name_async(IBus.SERVICE_PANEL,
|
||||||
|
IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
logError(e);
|
logError(e);
|
||||||
@ -163,19 +171,15 @@ var IBusManager = class {
|
|||||||
this._panelService.connect('set-content-type', this._setContentType.bind(this));
|
this._panelService.connect('set-content-type', this._setContentType.bind(this));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
// If an engine is already active we need to get its properties
|
|
||||||
this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, res) => {
|
|
||||||
let engine;
|
|
||||||
try {
|
|
||||||
engine = this._ibus.get_global_engine_async_finish(res);
|
|
||||||
if (!engine)
|
|
||||||
return;
|
|
||||||
} catch (e) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._engineChanged(this._ibus, engine.get_name());
|
|
||||||
});
|
|
||||||
this._updateReadiness();
|
this._updateReadiness();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// If an engine is already active we need to get its properties
|
||||||
|
const engine =
|
||||||
|
await this._ibus.get_global_engine_async(-1, this._cancellable);
|
||||||
|
this._engineChanged(this._ibus, engine.get_name());
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateReadiness() {
|
_updateReadiness() {
|
||||||
@ -223,7 +227,7 @@ var IBusManager = class {
|
|||||||
return this._engines.get(id);
|
return this._engines.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEngine(id, callback) {
|
async setEngine(id, callback) {
|
||||||
// Send id even if id == this._currentEngineName
|
// Send id even if id == this._currentEngineName
|
||||||
// because 'properties-registered' signal can be emitted
|
// because 'properties-registered' signal can be emitted
|
||||||
// while this._ibusSources == null on a lock screen.
|
// while this._ibusSources == null on a lock screen.
|
||||||
@ -233,18 +237,16 @@ var IBusManager = class {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._ibus.set_global_engine_async(id,
|
try {
|
||||||
this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
|
await this._ibus.set_global_engine_async(id,
|
||||||
this._cancellable, (_bus, res) => {
|
this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
|
||||||
try {
|
this._cancellable);
|
||||||
this._ibus.set_global_engine_async_finish(res);
|
} catch (e) {
|
||||||
} catch (e) {
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
logError(e);
|
||||||
logError(e);
|
}
|
||||||
}
|
if (callback)
|
||||||
if (callback)
|
callback();
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preloadEngines(ids) {
|
preloadEngines(ids) {
|
||||||
|
@ -4,6 +4,9 @@ const { Clutter, GLib, Gio, GObject, IBus } = imports.gi;
|
|||||||
|
|
||||||
const Keyboard = imports.ui.status.keyboard;
|
const Keyboard = imports.ui.status.keyboard;
|
||||||
|
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'create_input_context_async', 'create_input_context_async_finish');
|
||||||
|
|
||||||
var HIDE_PANEL_TIME = 50;
|
var HIDE_PANEL_TIME = 50;
|
||||||
|
|
||||||
var InputMethod = GObject.registerClass(
|
var InputMethod = GObject.registerClass(
|
||||||
@ -46,15 +49,11 @@ class InputMethod extends Clutter.InputMethod {
|
|||||||
this._currentSource = this._inputSourceManager.currentSource;
|
this._currentSource = this._inputSourceManager.currentSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onConnected() {
|
async _onConnected() {
|
||||||
this._cancellable = new Gio.Cancellable();
|
this._cancellable = new Gio.Cancellable();
|
||||||
this._ibus.create_input_context_async('gnome-shell', -1,
|
|
||||||
this._cancellable, this._setContext.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
_setContext(bus, res) {
|
|
||||||
try {
|
try {
|
||||||
this._context = this._ibus.create_input_context_async_finish(res);
|
this._context = await this._ibus.create_input_context_async(
|
||||||
|
'gnome-shell', -1, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
logError(e);
|
logError(e);
|
||||||
|
@ -3,9 +3,9 @@ const { Gio, GLib, Meta, Shell, St } = imports.gi;
|
|||||||
|
|
||||||
const INTROSPECT_SCHEMA = 'org.gnome.shell';
|
const INTROSPECT_SCHEMA = 'org.gnome.shell';
|
||||||
const INTROSPECT_KEY = 'introspect';
|
const INTROSPECT_KEY = 'introspect';
|
||||||
const APP_WHITELIST = ['org.freedesktop.impl.portal.desktop.gtk'];
|
const APP_ALLOWLIST = ['org.freedesktop.impl.portal.desktop.gtk'];
|
||||||
|
|
||||||
const INTROSPECT_DBUS_API_VERSION = 2;
|
const INTROSPECT_DBUS_API_VERSION = 3;
|
||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
@ -46,19 +46,24 @@ var IntrospectService = class {
|
|||||||
|
|
||||||
this._syncRunningApplications();
|
this._syncRunningApplications();
|
||||||
|
|
||||||
this._whitelistMap = new Map();
|
this._allowlistMap = new Map();
|
||||||
APP_WHITELIST.forEach(appName => {
|
APP_ALLOWLIST.forEach(appName => {
|
||||||
Gio.DBus.watch_name(Gio.BusType.SESSION,
|
Gio.DBus.watch_name(Gio.BusType.SESSION,
|
||||||
appName,
|
appName,
|
||||||
Gio.BusNameWatcherFlags.NONE,
|
Gio.BusNameWatcherFlags.NONE,
|
||||||
(conn, name, owner) => this._whitelistMap.set(name, owner),
|
(conn, name, owner) => this._allowlistMap.set(name, owner),
|
||||||
(conn, name) => this._whitelistMap.delete(name));
|
(conn, name) => this._allowlistMap.delete(name));
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings = St.Settings.get();
|
this._settings = St.Settings.get();
|
||||||
this._settings.connect('notify::enable-animations',
|
this._settings.connect('notify::enable-animations',
|
||||||
this._syncAnimationsEnabled.bind(this));
|
this._syncAnimationsEnabled.bind(this));
|
||||||
this._syncAnimationsEnabled();
|
this._syncAnimationsEnabled();
|
||||||
|
|
||||||
|
const monitorManager = Meta.MonitorManager.get();
|
||||||
|
monitorManager.connect('monitors-changed',
|
||||||
|
this._syncScreenSize.bind(this));
|
||||||
|
this._syncScreenSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
_isStandaloneApp(app) {
|
_isStandaloneApp(app) {
|
||||||
@ -69,8 +74,8 @@ var IntrospectService = class {
|
|||||||
return this._introspectSettings.get_boolean(INTROSPECT_KEY);
|
return this._introspectSettings.get_boolean(INTROSPECT_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
_isSenderWhitelisted(sender) {
|
_isSenderAllowed(sender) {
|
||||||
return [...this._whitelistMap.values()].includes(sender);
|
return [...this._allowlistMap.values()].includes(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
_getSandboxedAppId(app) {
|
_getSandboxedAppId(app) {
|
||||||
@ -133,7 +138,7 @@ var IntrospectService = class {
|
|||||||
if (this._isIntrospectEnabled())
|
if (this._isIntrospectEnabled())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this._isSenderWhitelisted(invocation.get_sender()))
|
if (this._isSenderAllowed(invocation.get_sender()))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -209,10 +214,28 @@ var IntrospectService = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_syncScreenSize() {
|
||||||
|
const oldScreenWidth = this._screenWidth;
|
||||||
|
const oldScreenHeight = this._screenHeight;
|
||||||
|
this._screenWidth = global.screen_width;
|
||||||
|
this._screenHeight = global.screen_height;
|
||||||
|
|
||||||
|
if (oldScreenWidth !== this._screenWidth ||
|
||||||
|
oldScreenHeight !== this._screenHeight) {
|
||||||
|
const variant = new GLib.Variant('(ii)',
|
||||||
|
[this._screenWidth, this._screenHeight]);
|
||||||
|
this._dbusImpl.emit_property_changed('ScreenSize', variant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get AnimationsEnabled() {
|
get AnimationsEnabled() {
|
||||||
return this._animationsEnabled;
|
return this._animationsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get ScreenSize() {
|
||||||
|
return [this._screenWidth, this._screenHeight];
|
||||||
|
}
|
||||||
|
|
||||||
get version() {
|
get version() {
|
||||||
return INTROSPECT_DBUS_API_VERSION;
|
return INTROSPECT_DBUS_API_VERSION;
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,7 @@ function getCompletions(text, commandHeader, globalCompletionList) {
|
|||||||
[expr_, base, attrHead] = matches;
|
[expr_, base, attrHead] = matches;
|
||||||
|
|
||||||
methods = getPropertyNamesFromExpression(base, commandHeader).filter(
|
methods = getPropertyNamesFromExpression(base, commandHeader).filter(
|
||||||
attr => attr.slice(0, attrHead.length) == attrHead
|
attr => attr.slice(0, attrHead.length) === attrHead);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for the empty expression or partially entered words
|
// Look for the empty expression or partially entered words
|
||||||
@ -34,8 +33,7 @@ function getCompletions(text, commandHeader, globalCompletionList) {
|
|||||||
if (text == '' || matches) {
|
if (text == '' || matches) {
|
||||||
[expr_, attrHead] = matches;
|
[expr_, attrHead] = matches;
|
||||||
methods = globalCompletionList.filter(
|
methods = globalCompletionList.filter(
|
||||||
attr => attr.slice(0, attrHead.length) == attrHead
|
attr => attr.slice(0, attrHead.length) === attrHead);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported getKeyboardManager, holdKeyboard, releaseKeyboard */
|
/* exported getKeyboardManager, holdKeyboard, releaseKeyboard */
|
||||||
|
|
||||||
const { GLib, GnomeDesktop, Meta } = imports.gi;
|
const { GLib, GnomeDesktop } = imports.gi;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
@ -62,11 +62,11 @@ var KeyboardManager = class {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this._currentKeymap = { layouts, variants, options };
|
this._currentKeymap = { layouts, variants, options };
|
||||||
Meta.get_backend().set_keymap(layouts, variants, options);
|
global.backend.set_keymap(layouts, variants, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
_applyLayoutGroupIndex(idx) {
|
_applyLayoutGroupIndex(idx) {
|
||||||
Meta.get_backend().lock_layout_group(idx);
|
global.backend.lock_layout_group(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(id) {
|
apply(id) {
|
||||||
|
@ -50,25 +50,22 @@ function canLock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function registerSessionWithGDM() {
|
async function registerSessionWithGDM() {
|
||||||
log("Registering session with GDM");
|
log("Registering session with GDM");
|
||||||
Gio.DBus.system.call('org.gnome.DisplayManager',
|
try {
|
||||||
'/org/gnome/DisplayManager/Manager',
|
await Gio.DBus.system.call(
|
||||||
'org.gnome.DisplayManager.Manager',
|
'org.gnome.DisplayManager',
|
||||||
'RegisterSession',
|
'/org/gnome/DisplayManager/Manager',
|
||||||
GLib.Variant.new('(a{sv})', [{}]), null,
|
'org.gnome.DisplayManager.Manager',
|
||||||
Gio.DBusCallFlags.NONE, -1, null,
|
'RegisterSession',
|
||||||
(source, result) => {
|
GLib.Variant.new('(a{sv})', [{}]), null,
|
||||||
try {
|
Gio.DBusCallFlags.NONE, -1, null);
|
||||||
source.call_finish(result);
|
} catch (e) {
|
||||||
} catch (e) {
|
if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
|
||||||
if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
|
log(`Error registering session with GDM: ${e.message}`);
|
||||||
log(`Error registering session with GDM: ${e.message}`);
|
else
|
||||||
else
|
log('Not calling RegisterSession(): method not exported, GDM too old?');
|
||||||
log("Not calling RegisterSession(): method not exported, GDM too old?");
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let _loginManager = null;
|
let _loginManager = null;
|
||||||
@ -161,6 +158,23 @@ var LoginManagerSystemd = class {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canRebootToBootLoaderMenu(asyncCallback) {
|
||||||
|
this._proxy.CanRebootToBootLoaderMenuRemote((result, error) => {
|
||||||
|
if (error) {
|
||||||
|
asyncCallback(false, false);
|
||||||
|
} else {
|
||||||
|
const needsAuth = result[0] === 'challenge';
|
||||||
|
const canRebootToBootLoaderMenu = needsAuth || result[0] === 'yes';
|
||||||
|
asyncCallback(canRebootToBootLoaderMenu, needsAuth);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setRebootToBootLoaderMenu() {
|
||||||
|
/* Parameter is timeout in usec, show to menu for 60 seconds */
|
||||||
|
this._proxy.SetRebootToBootLoaderMenuRemote(60000000);
|
||||||
|
}
|
||||||
|
|
||||||
listSessions(asyncCallback) {
|
listSessions(asyncCallback) {
|
||||||
this._proxy.ListSessionsRemote((result, error) => {
|
this._proxy.ListSessionsRemote((result, error) => {
|
||||||
if (error)
|
if (error)
|
||||||
@ -174,24 +188,19 @@ var LoginManagerSystemd = class {
|
|||||||
this._proxy.SuspendRemote(true);
|
this._proxy.SuspendRemote(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
inhibit(reason, callback) {
|
async inhibit(reason, callback) {
|
||||||
let inVariant = GLib.Variant.new('(ssss)',
|
try {
|
||||||
['sleep',
|
const inVariant = new GLib.Variant('(ssss)',
|
||||||
'GNOME Shell',
|
['sleep', 'GNOME Shell', reason, 'delay']);
|
||||||
reason,
|
const [outVariant_, fdList] =
|
||||||
'delay']);
|
await this._proxy.call_with_unix_fd_list('Inhibit',
|
||||||
this._proxy.call_with_unix_fd_list('Inhibit', inVariant, 0, -1, null, null,
|
inVariant, 0, -1, null, null);
|
||||||
(proxy, result) => {
|
const [fd] = fdList.steal_fds();
|
||||||
let fd = -1;
|
callback(new Gio.UnixInputStream({ fd }));
|
||||||
try {
|
} catch (e) {
|
||||||
let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
|
logError(e, 'Error getting systemd inhibitor');
|
||||||
fd = fdList.steal_fds()[0];
|
callback(null);
|
||||||
callback(new Gio.UnixInputStream({ fd }));
|
}
|
||||||
} catch (e) {
|
|
||||||
logError(e, "Error getting systemd inhibitor");
|
|
||||||
callback(null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_prepareForSleep(proxy, sender, [aboutToSuspend]) {
|
_prepareForSleep(proxy, sender, [aboutToSuspend]) {
|
||||||
@ -211,6 +220,13 @@ var LoginManagerDummy = class {
|
|||||||
asyncCallback(false, false);
|
asyncCallback(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canRebootToBootLoaderMenu(asyncCallback) {
|
||||||
|
asyncCallback(false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
setRebootToBootLoaderMenu() {
|
||||||
|
}
|
||||||
|
|
||||||
listSessions(asyncCallback) {
|
listSessions(asyncCallback) {
|
||||||
asyncCallback([]);
|
asyncCallback([]);
|
||||||
}
|
}
|
||||||
|
@ -57,9 +57,7 @@ var ObjectManager = class {
|
|||||||
// Start out inhibiting load until at least the proxy
|
// Start out inhibiting load until at least the proxy
|
||||||
// manager is loaded and the remote objects are fetched
|
// manager is loaded and the remote objects are fetched
|
||||||
this._numLoadInhibitors = 1;
|
this._numLoadInhibitors = 1;
|
||||||
this._managerProxy.init_async(GLib.PRIORITY_DEFAULT,
|
this._initManagerProxy();
|
||||||
this._cancellable,
|
|
||||||
this._onManagerProxyLoaded.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_tryToCompleteLoad() {
|
_tryToCompleteLoad() {
|
||||||
@ -73,7 +71,7 @@ var ObjectManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_addInterface(objectPath, interfaceName, onFinished) {
|
async _addInterface(objectPath, interfaceName, onFinished) {
|
||||||
let info = this._interfaceInfos[interfaceName];
|
let info = this._interfaceInfos[interfaceName];
|
||||||
|
|
||||||
if (!info) {
|
if (!info) {
|
||||||
@ -89,40 +87,38 @@ var ObjectManager = class {
|
|||||||
g_interface_info: info,
|
g_interface_info: info,
|
||||||
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
|
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
|
||||||
|
|
||||||
proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable, (initable, result) => {
|
try {
|
||||||
try {
|
await proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable);
|
||||||
initable.init_finish(result);
|
} catch (e) {
|
||||||
} catch (e) {
|
logError(e, `could not initialize proxy for interface ${interfaceName}`);
|
||||||
logError(e, `could not initialize proxy for interface ${interfaceName}`);
|
|
||||||
|
|
||||||
if (onFinished)
|
|
||||||
onFinished();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let isNewObject;
|
|
||||||
if (!this._objects[objectPath]) {
|
|
||||||
this._objects[objectPath] = {};
|
|
||||||
isNewObject = true;
|
|
||||||
} else {
|
|
||||||
isNewObject = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._objects[objectPath][interfaceName] = proxy;
|
|
||||||
|
|
||||||
if (!this._interfaces[interfaceName])
|
|
||||||
this._interfaces[interfaceName] = [];
|
|
||||||
|
|
||||||
this._interfaces[interfaceName].push(proxy);
|
|
||||||
|
|
||||||
if (isNewObject)
|
|
||||||
this.emit('object-added', objectPath);
|
|
||||||
|
|
||||||
this.emit('interface-added', interfaceName, proxy);
|
|
||||||
|
|
||||||
if (onFinished)
|
if (onFinished)
|
||||||
onFinished();
|
onFinished();
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let isNewObject;
|
||||||
|
if (!this._objects[objectPath]) {
|
||||||
|
this._objects[objectPath] = {};
|
||||||
|
isNewObject = true;
|
||||||
|
} else {
|
||||||
|
isNewObject = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._objects[objectPath][interfaceName] = proxy;
|
||||||
|
|
||||||
|
if (!this._interfaces[interfaceName])
|
||||||
|
this._interfaces[interfaceName] = [];
|
||||||
|
|
||||||
|
this._interfaces[interfaceName].push(proxy);
|
||||||
|
|
||||||
|
if (isNewObject)
|
||||||
|
this.emit('object-added', objectPath);
|
||||||
|
|
||||||
|
this.emit('interface-added', interfaceName, proxy);
|
||||||
|
|
||||||
|
if (onFinished)
|
||||||
|
onFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeInterface(objectPath, interfaceName) {
|
_removeInterface(objectPath, interfaceName) {
|
||||||
@ -151,9 +147,10 @@ var ObjectManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onManagerProxyLoaded(initable, result) {
|
async _initManagerProxy() {
|
||||||
try {
|
try {
|
||||||
initable.init_finish(result);
|
await this._managerProxy.init_async(
|
||||||
|
GLib.PRIORITY_DEFAULT, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e, `could not initialize object manager for object ${this._serviceName}`);
|
logError(e, `could not initialize object manager for object ${this._serviceName}`);
|
||||||
|
|
||||||
|
146
js/misc/parentalControlsManager.js
Normal file
146
js/misc/parentalControlsManager.js
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018, 2019, 2020 Endless Mobile, Inc.
|
||||||
|
//
|
||||||
|
// This is a GNOME Shell component to wrap the interactions over
|
||||||
|
// D-Bus with the malcontent library.
|
||||||
|
//
|
||||||
|
// Licensed under the GNU General Public License Version 2
|
||||||
|
//
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU General Public License
|
||||||
|
// as published by the Free Software Foundation; either version 2
|
||||||
|
// of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
/* exported getDefault */
|
||||||
|
|
||||||
|
const { Gio, GObject, Shell } = imports.gi;
|
||||||
|
|
||||||
|
// We require libmalcontent ≥ 0.6.0
|
||||||
|
const HAVE_MALCONTENT = imports.package.checkSymbol(
|
||||||
|
'Malcontent', '0', 'ManagerGetValueFlags');
|
||||||
|
|
||||||
|
var Malcontent = null;
|
||||||
|
if (HAVE_MALCONTENT) {
|
||||||
|
Malcontent = imports.gi.Malcontent;
|
||||||
|
Gio._promisify(Malcontent.Manager.prototype, 'get_app_filter_async', 'get_app_filter_finish');
|
||||||
|
}
|
||||||
|
|
||||||
|
let _singleton = null;
|
||||||
|
|
||||||
|
function getDefault() {
|
||||||
|
if (_singleton === null)
|
||||||
|
_singleton = new ParentalControlsManager();
|
||||||
|
|
||||||
|
return _singleton;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A manager class which provides cached access to the constructing user’s
|
||||||
|
// parental controls settings. It’s possible for the user’s parental controls
|
||||||
|
// to change at runtime if the Parental Controls application is used by an
|
||||||
|
// administrator from within the user’s session.
|
||||||
|
var ParentalControlsManager = GObject.registerClass({
|
||||||
|
Signals: {
|
||||||
|
'app-filter-changed': {},
|
||||||
|
},
|
||||||
|
}, class ParentalControlsManager extends GObject.Object {
|
||||||
|
_init() {
|
||||||
|
super._init();
|
||||||
|
|
||||||
|
this._initialized = false;
|
||||||
|
this._disabled = false;
|
||||||
|
this._appFilter = null;
|
||||||
|
|
||||||
|
this._initializeManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
async _initializeManager() {
|
||||||
|
if (!HAVE_MALCONTENT) {
|
||||||
|
log('Skipping parental controls support as it’s disabled');
|
||||||
|
this._initialized = true;
|
||||||
|
this.emit('app-filter-changed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
log(`Getting parental controls for user ${Shell.util_get_uid()}`);
|
||||||
|
try {
|
||||||
|
const connection = await Gio.DBus.get(Gio.BusType.SYSTEM, null);
|
||||||
|
this._manager = new Malcontent.Manager({ connection });
|
||||||
|
this._appFilter = await this._manager.get_app_filter_async(
|
||||||
|
Shell.util_get_uid(),
|
||||||
|
Malcontent.ManagerGetValueFlags.NONE,
|
||||||
|
null);
|
||||||
|
} catch (e) {
|
||||||
|
if (e.matches(Malcontent.ManagerError, Malcontent.ManagerError.DISABLED)) {
|
||||||
|
log('Parental controls globally disabled');
|
||||||
|
this._disabled = true;
|
||||||
|
} else {
|
||||||
|
logError(e, 'Failed to get parental controls settings');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this._manager.connect('app-filter-changed', this._onAppFilterChanged.bind(this));
|
||||||
|
|
||||||
|
// Signal initialisation is complete.
|
||||||
|
this._initialized = true;
|
||||||
|
this.emit('app-filter-changed');
|
||||||
|
}
|
||||||
|
|
||||||
|
async _onAppFilterChanged(manager, uid) {
|
||||||
|
// Emit 'changed' signal only if app-filter is changed for currently logged-in user.
|
||||||
|
let currentUid = Shell.util_get_uid();
|
||||||
|
if (currentUid !== uid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
this._appFilter = await this._manager.get_app_filter_async(
|
||||||
|
currentUid,
|
||||||
|
Malcontent.ManagerGetValueFlags.NONE,
|
||||||
|
null);
|
||||||
|
this.emit('app-filter-changed');
|
||||||
|
} catch (e) {
|
||||||
|
// Log an error and keep the old app filter.
|
||||||
|
logError(e, `Failed to get new MctAppFilter for uid ${Shell.util_get_uid()} on app-filter-changed`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get initialized() {
|
||||||
|
return this._initialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate whether the given app (a Gio.DesktopAppInfo) should be shown
|
||||||
|
// on the desktop, in search results, etc. The app should be shown if:
|
||||||
|
// - The .desktop file doesn’t say it should be hidden.
|
||||||
|
// - The executable from the .desktop file’s Exec line isn’t denied in
|
||||||
|
// the user’s parental controls.
|
||||||
|
// - None of the flatpak app IDs from the X-Flatpak and the
|
||||||
|
// X-Flatpak-RenamedFrom lines are denied in the user’s parental
|
||||||
|
// controls.
|
||||||
|
shouldShowApp(appInfo) {
|
||||||
|
// Quick decision?
|
||||||
|
if (!appInfo.should_show())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Are parental controls enabled (at configure time or runtime)?
|
||||||
|
if (!HAVE_MALCONTENT || this._disabled)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Have we finished initialising yet?
|
||||||
|
if (!this.initialized) {
|
||||||
|
log(`Warning: Hiding app because parental controls not yet initialised: ${appInfo.get_id()}`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._appFilter.is_appinfo_allowed(appInfo);
|
||||||
|
}
|
||||||
|
});
|
@ -21,6 +21,7 @@ const SENSOR_OBJECT_PATH = '/net/hadess/SensorProxy';
|
|||||||
const SensorProxyInterface = loadInterfaceXML('net.hadess.SensorProxy');
|
const SensorProxyInterface = loadInterfaceXML('net.hadess.SensorProxy');
|
||||||
|
|
||||||
const POWER_OFF_ACTION_ID = 'power-off';
|
const POWER_OFF_ACTION_ID = 'power-off';
|
||||||
|
const RESTART_ACTION_ID = 'restart';
|
||||||
const LOCK_SCREEN_ACTION_ID = 'lock-screen';
|
const LOCK_SCREEN_ACTION_ID = 'lock-screen';
|
||||||
const LOGOUT_ACTION_ID = 'logout';
|
const LOGOUT_ACTION_ID = 'logout';
|
||||||
const SUSPEND_ACTION_ID = 'suspend';
|
const SUSPEND_ACTION_ID = 'suspend';
|
||||||
@ -40,41 +41,38 @@ function getDefault() {
|
|||||||
|
|
||||||
const SystemActions = GObject.registerClass({
|
const SystemActions = GObject.registerClass({
|
||||||
Properties: {
|
Properties: {
|
||||||
'can-power-off': GObject.ParamSpec.boolean('can-power-off',
|
'can-power-off': GObject.ParamSpec.boolean(
|
||||||
'can-power-off',
|
'can-power-off', 'can-power-off', 'can-power-off',
|
||||||
'can-power-off',
|
GObject.ParamFlags.READABLE,
|
||||||
GObject.ParamFlags.READABLE,
|
false),
|
||||||
false),
|
'can-restart': GObject.ParamSpec.boolean(
|
||||||
'can-suspend': GObject.ParamSpec.boolean('can-suspend',
|
'can-restart', 'can-restart', 'can-restart',
|
||||||
'can-suspend',
|
GObject.ParamFlags.READABLE,
|
||||||
'can-suspend',
|
false),
|
||||||
GObject.ParamFlags.READABLE,
|
'can-suspend': GObject.ParamSpec.boolean(
|
||||||
false),
|
'can-suspend', 'can-suspend', 'can-suspend',
|
||||||
'can-lock-screen': GObject.ParamSpec.boolean('can-lock-screen',
|
GObject.ParamFlags.READABLE,
|
||||||
'can-lock-screen',
|
false),
|
||||||
'can-lock-screen',
|
'can-lock-screen': GObject.ParamSpec.boolean(
|
||||||
GObject.ParamFlags.READABLE,
|
'can-lock-screen', 'can-lock-screen', 'can-lock-screen',
|
||||||
false),
|
GObject.ParamFlags.READABLE,
|
||||||
'can-switch-user': GObject.ParamSpec.boolean('can-switch-user',
|
false),
|
||||||
'can-switch-user',
|
'can-switch-user': GObject.ParamSpec.boolean(
|
||||||
'can-switch-user',
|
'can-switch-user', 'can-switch-user', 'can-switch-user',
|
||||||
GObject.ParamFlags.READABLE,
|
GObject.ParamFlags.READABLE,
|
||||||
false),
|
false),
|
||||||
'can-logout': GObject.ParamSpec.boolean('can-logout',
|
'can-logout': GObject.ParamSpec.boolean(
|
||||||
'can-logout',
|
'can-logout', 'can-logout', 'can-logout',
|
||||||
'can-logout',
|
GObject.ParamFlags.READABLE,
|
||||||
GObject.ParamFlags.READABLE,
|
false),
|
||||||
false),
|
'can-lock-orientation': GObject.ParamSpec.boolean(
|
||||||
'can-lock-orientation': GObject.ParamSpec.boolean('can-lock-orientation',
|
'can-lock-orientation', 'can-lock-orientation', 'can-lock-orientation',
|
||||||
'can-lock-orientation',
|
GObject.ParamFlags.READABLE,
|
||||||
'can-lock-orientation',
|
false),
|
||||||
GObject.ParamFlags.READABLE,
|
'orientation-lock-icon': GObject.ParamSpec.string(
|
||||||
false),
|
'orientation-lock-icon', 'orientation-lock-icon', 'orientation-lock-icon',
|
||||||
'orientation-lock-icon': GObject.ParamSpec.string('orientation-lock-icon',
|
GObject.ParamFlags.READWRITE,
|
||||||
'orientation-lock-icon',
|
null),
|
||||||
'orientation-lock-icon',
|
|
||||||
GObject.ParamFlags.READWRITE,
|
|
||||||
null),
|
|
||||||
},
|
},
|
||||||
}, class SystemActions extends GObject.Object {
|
}, class SystemActions extends GObject.Object {
|
||||||
_init() {
|
_init() {
|
||||||
@ -83,13 +81,25 @@ const SystemActions = GObject.registerClass({
|
|||||||
this._canHavePowerOff = true;
|
this._canHavePowerOff = true;
|
||||||
this._canHaveSuspend = true;
|
this._canHaveSuspend = true;
|
||||||
|
|
||||||
|
function tokenizeKeywords(keywords) {
|
||||||
|
return keywords.split(';').map(keyword => GLib.str_tokenize_and_fold(keyword, null)).flat(2);
|
||||||
|
}
|
||||||
|
|
||||||
this._actions = new Map();
|
this._actions = new Map();
|
||||||
this._actions.set(POWER_OFF_ACTION_ID, {
|
this._actions.set(POWER_OFF_ACTION_ID, {
|
||||||
// Translators: The name of the power-off action in search
|
// Translators: The name of the power-off action in search
|
||||||
name: C_("search-result", "Power Off"),
|
name: C_("search-result", "Power Off"),
|
||||||
iconName: 'system-shutdown-symbolic',
|
iconName: 'system-shutdown-symbolic',
|
||||||
// Translators: A list of keywords that match the power-off action, separated by semicolons
|
// Translators: A list of keywords that match the power-off action, separated by semicolons
|
||||||
keywords: _('power off;shutdown;reboot;restart;halt;stop').split(/[; ]/),
|
keywords: tokenizeKeywords(_('power off;shutdown;halt;stop')),
|
||||||
|
available: false,
|
||||||
|
});
|
||||||
|
this._actions.set(RESTART_ACTION_ID, {
|
||||||
|
// Translators: The name of the restart action in search
|
||||||
|
name: C_('search-result', 'Restart'),
|
||||||
|
iconName: 'system-reboot-symbolic',
|
||||||
|
// Translators: A list of keywords that match the restart action, separated by semicolons
|
||||||
|
keywords: tokenizeKeywords(_('reboot;restart;')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
this._actions.set(LOCK_SCREEN_ACTION_ID, {
|
this._actions.set(LOCK_SCREEN_ACTION_ID, {
|
||||||
@ -97,15 +107,15 @@ const SystemActions = GObject.registerClass({
|
|||||||
name: C_("search-result", "Lock Screen"),
|
name: C_("search-result", "Lock Screen"),
|
||||||
iconName: 'system-lock-screen-symbolic',
|
iconName: 'system-lock-screen-symbolic',
|
||||||
// Translators: A list of keywords that match the lock screen action, separated by semicolons
|
// Translators: A list of keywords that match the lock screen action, separated by semicolons
|
||||||
keywords: _("lock screen").split(/[; ]/),
|
keywords: tokenizeKeywords(_('lock screen')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
this._actions.set(LOGOUT_ACTION_ID, {
|
this._actions.set(LOGOUT_ACTION_ID, {
|
||||||
// Translators: The name of the logout action in search
|
// Translators: The name of the logout action in search
|
||||||
name: C_("search-result", "Log Out"),
|
name: C_("search-result", "Log Out"),
|
||||||
iconName: 'application-exit-symbolic',
|
iconName: 'system-log-out-symbolic',
|
||||||
// Translators: A list of keywords that match the logout action, separated by semicolons
|
// Translators: A list of keywords that match the logout action, separated by semicolons
|
||||||
keywords: _("logout;log out;sign off").split(/[; ]/),
|
keywords: tokenizeKeywords(_('logout;log out;sign off')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
this._actions.set(SUSPEND_ACTION_ID, {
|
this._actions.set(SUSPEND_ACTION_ID, {
|
||||||
@ -113,7 +123,7 @@ const SystemActions = GObject.registerClass({
|
|||||||
name: C_("search-result", "Suspend"),
|
name: C_("search-result", "Suspend"),
|
||||||
iconName: 'media-playback-pause-symbolic',
|
iconName: 'media-playback-pause-symbolic',
|
||||||
// Translators: A list of keywords that match the suspend action, separated by semicolons
|
// Translators: A list of keywords that match the suspend action, separated by semicolons
|
||||||
keywords: _("suspend;sleep").split(/[; ]/),
|
keywords: tokenizeKeywords(_('suspend;sleep')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
this._actions.set(SWITCH_USER_ACTION_ID, {
|
this._actions.set(SWITCH_USER_ACTION_ID, {
|
||||||
@ -121,14 +131,14 @@ const SystemActions = GObject.registerClass({
|
|||||||
name: C_("search-result", "Switch User"),
|
name: C_("search-result", "Switch User"),
|
||||||
iconName: 'system-switch-user-symbolic',
|
iconName: 'system-switch-user-symbolic',
|
||||||
// Translators: A list of keywords that match the switch user action, separated by semicolons
|
// Translators: A list of keywords that match the switch user action, separated by semicolons
|
||||||
keywords: _("switch user").split(/[; ]/),
|
keywords: tokenizeKeywords(_('switch user')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
this._actions.set(LOCK_ORIENTATION_ACTION_ID, {
|
this._actions.set(LOCK_ORIENTATION_ACTION_ID, {
|
||||||
name: '',
|
name: '',
|
||||||
iconName: '',
|
iconName: '',
|
||||||
// Translators: A list of keywords that match the lock orientation action, separated by semicolons
|
// Translators: A list of keywords that match the lock orientation action, separated by semicolons
|
||||||
keywords: _("lock orientation;unlock orientation;screen;rotation").split(/[; ]/),
|
keywords: tokenizeKeywords(_('lock orientation;unlock orientation;screen;rotation')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -199,6 +209,11 @@ const SystemActions = GObject.registerClass({
|
|||||||
return this._actions.get(POWER_OFF_ACTION_ID).available;
|
return this._actions.get(POWER_OFF_ACTION_ID).available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
get can_restart() {
|
||||||
|
return this._actions.get(RESTART_ACTION_ID).available;
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
get can_suspend() {
|
get can_suspend() {
|
||||||
return this._actions.get(SUSPEND_ACTION_ID).available;
|
return this._actions.get(SUSPEND_ACTION_ID).available;
|
||||||
@ -277,7 +292,7 @@ const SystemActions = GObject.registerClass({
|
|||||||
|
|
||||||
getMatchingActions(terms) {
|
getMatchingActions(terms) {
|
||||||
// terms is a list of strings
|
// terms is a list of strings
|
||||||
terms = terms.map(term => term.toLowerCase());
|
terms = terms.map(term => GLib.str_tokenize_and_fold(term, null)[0]);
|
||||||
|
|
||||||
let results = [];
|
let results = [];
|
||||||
|
|
||||||
@ -302,6 +317,9 @@ const SystemActions = GObject.registerClass({
|
|||||||
case POWER_OFF_ACTION_ID:
|
case POWER_OFF_ACTION_ID:
|
||||||
this.activatePowerOff();
|
this.activatePowerOff();
|
||||||
break;
|
break;
|
||||||
|
case RESTART_ACTION_ID:
|
||||||
|
this.activateRestart();
|
||||||
|
break;
|
||||||
case LOCK_SCREEN_ACTION_ID:
|
case LOCK_SCREEN_ACTION_ID:
|
||||||
this.activateLockScreen();
|
this.activateLockScreen();
|
||||||
break;
|
break;
|
||||||
@ -343,6 +361,9 @@ const SystemActions = GObject.registerClass({
|
|||||||
this._loginScreenSettings.get_boolean(DISABLE_RESTART_KEY));
|
this._loginScreenSettings.get_boolean(DISABLE_RESTART_KEY));
|
||||||
this._actions.get(POWER_OFF_ACTION_ID).available = this._canHavePowerOff && !disabled;
|
this._actions.get(POWER_OFF_ACTION_ID).available = this._canHavePowerOff && !disabled;
|
||||||
this.notify('can-power-off');
|
this.notify('can-power-off');
|
||||||
|
|
||||||
|
this._actions.get(RESTART_ACTION_ID).available = this._canHavePowerOff && !disabled;
|
||||||
|
this.notify('can-restart');
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateHaveSuspend() {
|
_updateHaveSuspend() {
|
||||||
@ -441,6 +462,13 @@ const SystemActions = GObject.registerClass({
|
|||||||
this._session.ShutdownRemote(0);
|
this._session.ShutdownRemote(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activateRestart() {
|
||||||
|
if (!this._actions.get(RESTART_ACTION_ID).available)
|
||||||
|
throw new Error('The restart action is not available!');
|
||||||
|
|
||||||
|
this._session.RebootRemote();
|
||||||
|
}
|
||||||
|
|
||||||
activateSuspend() {
|
activateSuspend() {
|
||||||
if (!this._actions.get(SUSPEND_ACTION_ID).available)
|
if (!this._actions.get(SUSPEND_ACTION_ID).available)
|
||||||
throw new Error('The suspend action is not available!');
|
throw new Error('The suspend action is not available!');
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine,
|
/* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine,
|
||||||
formatTime, formatTimeSpan, createTimeLabel, insertSorted,
|
formatTime, formatTimeSpan, createTimeLabel, insertSorted,
|
||||||
makeCloseButton, ensureActorVisibleInScrollView, wiggle */
|
ensureActorVisibleInScrollView, wiggle */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Shell, St, GnomeDesktop } = imports.gi;
|
const { Clutter, Gio, GLib, Shell, St, GnomeDesktop } = imports.gi;
|
||||||
const Gettext = imports.gettext;
|
const Gettext = imports.gettext;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -363,51 +363,6 @@ function insertSorted(array, val, cmp) {
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
var CloseButton = GObject.registerClass(
|
|
||||||
class CloseButton extends St.Button {
|
|
||||||
_init(boxpointer) {
|
|
||||||
super._init({
|
|
||||||
style_class: 'notification-close',
|
|
||||||
x_expand: true,
|
|
||||||
y_expand: true,
|
|
||||||
x_align: Clutter.ActorAlign.END,
|
|
||||||
y_align: Clutter.ActorAlign.START,
|
|
||||||
});
|
|
||||||
|
|
||||||
this._boxPointer = boxpointer;
|
|
||||||
if (boxpointer)
|
|
||||||
this._boxPointer.connect('arrow-side-changed', this._sync.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
_computeBoxPointerOffset() {
|
|
||||||
if (!this._boxPointer || !this._boxPointer.get_stage())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
let side = this._boxPointer.arrowSide;
|
|
||||||
if (side == St.Side.TOP)
|
|
||||||
return this._boxPointer.getArrowHeight();
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_sync() {
|
|
||||||
let themeNode = this.get_theme_node();
|
|
||||||
|
|
||||||
let offY = this._computeBoxPointerOffset();
|
|
||||||
this.translation_x = themeNode.get_length('-shell-close-overlap-x');
|
|
||||||
this.translation_y = themeNode.get_length('-shell-close-overlap-y') + offY;
|
|
||||||
}
|
|
||||||
|
|
||||||
vfunc_style_changed() {
|
|
||||||
this._sync();
|
|
||||||
super.vfunc_style_changed();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function makeCloseButton(boxpointer) {
|
|
||||||
return new CloseButton(boxpointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ensureActorVisibleInScrollView(scrollView, actor) {
|
function ensureActorVisibleInScrollView(scrollView, actor) {
|
||||||
let adjustment = scrollView.vscroll.adjustment;
|
let adjustment = scrollView.vscroll.adjustment;
|
||||||
let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
|
let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
|
||||||
|
@ -7,6 +7,8 @@ const PermissionStore = imports.misc.permissionStore;
|
|||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
|
Gio._promisify(Geoclue.Simple, 'new', 'new_finish');
|
||||||
|
|
||||||
const WeatherIntegrationIface = loadInterfaceXML('org.gnome.Shell.WeatherIntegration');
|
const WeatherIntegrationIface = loadInterfaceXML('org.gnome.Shell.WeatherIntegration');
|
||||||
|
|
||||||
const WEATHER_BUS_NAME = 'org.gnome.Weather';
|
const WEATHER_BUS_NAME = 'org.gnome.Weather';
|
||||||
@ -79,16 +81,7 @@ var WeatherClient = class {
|
|||||||
this._weatherApp = null;
|
this._weatherApp = null;
|
||||||
this._weatherProxy = null;
|
this._weatherProxy = null;
|
||||||
|
|
||||||
let nodeInfo = Gio.DBusNodeInfo.new_for_xml(WeatherIntegrationIface);
|
this._createWeatherProxy();
|
||||||
Gio.DBusProxy.new(
|
|
||||||
Gio.DBus.session,
|
|
||||||
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
|
|
||||||
nodeInfo.lookup_interface(WEATHER_INTEGRATION_IFACE),
|
|
||||||
WEATHER_BUS_NAME,
|
|
||||||
WEATHER_OBJECT_PATH,
|
|
||||||
WEATHER_INTEGRATION_IFACE,
|
|
||||||
null,
|
|
||||||
this._onWeatherProxyReady.bind(this));
|
|
||||||
|
|
||||||
this._settings = new Gio.Settings({
|
this._settings = new Gio.Settings({
|
||||||
schema_id: 'org.gnome.shell.weather',
|
schema_id: 'org.gnome.shell.weather',
|
||||||
@ -146,9 +139,17 @@ var WeatherClient = class {
|
|||||||
(!this._needsAuth || this._weatherAuthorized);
|
(!this._needsAuth || this._weatherAuthorized);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onWeatherProxyReady(o, res) {
|
async _createWeatherProxy() {
|
||||||
|
const nodeInfo = Gio.DBusNodeInfo.new_for_xml(WeatherIntegrationIface);
|
||||||
try {
|
try {
|
||||||
this._weatherProxy = Gio.DBusProxy.new_finish(res);
|
this._weatherProxy = await Gio.DBusProxy.new(
|
||||||
|
Gio.DBus.session,
|
||||||
|
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
|
||||||
|
nodeInfo.lookup_interface(WEATHER_INTEGRATION_IFACE),
|
||||||
|
WEATHER_BUS_NAME,
|
||||||
|
WEATHER_OBJECT_PATH,
|
||||||
|
WEATHER_INTEGRATION_IFACE,
|
||||||
|
null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(`Failed to create GNOME Weather proxy: ${e}`);
|
log(`Failed to create GNOME Weather proxy: ${e}`);
|
||||||
return;
|
return;
|
||||||
@ -239,25 +240,23 @@ var WeatherClient = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_startGClueService() {
|
async _startGClueService() {
|
||||||
if (this._gclueStarting)
|
if (this._gclueStarting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._gclueStarting = true;
|
this._gclueStarting = true;
|
||||||
|
|
||||||
Geoclue.Simple.new('org.gnome.Shell', Geoclue.AccuracyLevel.CITY, null,
|
try {
|
||||||
(o, res) => {
|
this._gclueService = await Geoclue.Simple.new(
|
||||||
try {
|
'org.gnome.Shell', Geoclue.AccuracyLevel.CITY, null);
|
||||||
this._gclueService = Geoclue.Simple.new_finish(res);
|
} catch (e) {
|
||||||
} catch (e) {
|
log(`Failed to connect to Geoclue2 service: ${e.message}`);
|
||||||
log(`Failed to connect to Geoclue2 service: ${e.message}`);
|
this._setLocation(this._mostRecentLocation);
|
||||||
this._setLocation(this._mostRecentLocation);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
this._gclueStarted = true;
|
||||||
this._gclueStarted = true;
|
this._gclueService.get_client().distance_threshold = 100;
|
||||||
this._gclueService.get_client().distance_threshold = 100;
|
this._updateLocationMonitoring();
|
||||||
this._updateLocationMonitoring();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onGClueLocationChanged() {
|
_onGClueLocationChanged() {
|
||||||
|
146
js/perf/basic.js
Normal file
146
js/perf/basic.js
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
/* exported run, finish, script_topBarNavDone, script_notificationShowDone,
|
||||||
|
script_notificationCloseDone, script_overviewShowDone,
|
||||||
|
script_applicationsShowStart, script_applicationsShowDone, METRICS,
|
||||||
|
*/
|
||||||
|
/* eslint camelcase: ["error", { properties: "never", allow: ["^script_"] }] */
|
||||||
|
|
||||||
|
const { St } = imports.gi;
|
||||||
|
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
const Scripting = imports.ui.scripting;
|
||||||
|
|
||||||
|
// This script tests the most important (basic) functionality of the shell.
|
||||||
|
|
||||||
|
var METRICS = {};
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
/* eslint-disable no-await-in-loop */
|
||||||
|
Scripting.defineScriptEvent('topBarNavStart', 'Starting to navigate the top bar');
|
||||||
|
Scripting.defineScriptEvent('topBarNavDone', 'Done navigating the top bar');
|
||||||
|
Scripting.defineScriptEvent('notificationShowStart', 'Showing a notification');
|
||||||
|
Scripting.defineScriptEvent('notificationShowDone', 'Done showing a notification');
|
||||||
|
Scripting.defineScriptEvent('notificationCloseStart', 'Closing a notification');
|
||||||
|
Scripting.defineScriptEvent('notificationCloseDone', 'Done closing a notification');
|
||||||
|
Scripting.defineScriptEvent('overviewShowStart', 'Starting to show the overview');
|
||||||
|
Scripting.defineScriptEvent('overviewShowDone', 'Overview finished showing');
|
||||||
|
Scripting.defineScriptEvent('applicationsShowStart', 'Starting to switch to applications view');
|
||||||
|
Scripting.defineScriptEvent('applicationsShowDone', 'Done switching to applications view');
|
||||||
|
|
||||||
|
Main.overview.connect('shown',
|
||||||
|
() => Scripting.scriptEvent('overviewShowDone'));
|
||||||
|
|
||||||
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
|
// navigate through top bar
|
||||||
|
Scripting.scriptEvent('topBarNavStart');
|
||||||
|
Main.panel.statusArea.aggregateMenu.menu.open();
|
||||||
|
await Scripting.sleep(400);
|
||||||
|
|
||||||
|
const { menuManager } = Main.panel;
|
||||||
|
while (menuManager.activeMenu &&
|
||||||
|
Main.panel.navigate_focus(menuManager.activeMenu.sourceActor,
|
||||||
|
St.DirectionType.TAB_BACKWARD, false))
|
||||||
|
await Scripting.sleep(400);
|
||||||
|
Scripting.scriptEvent('topBarNavDone');
|
||||||
|
|
||||||
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
|
// notification
|
||||||
|
const source = new MessageTray.SystemNotificationSource();
|
||||||
|
Main.messageTray.add(source);
|
||||||
|
|
||||||
|
Scripting.scriptEvent('notificationShowStart');
|
||||||
|
source.connect('notification-show',
|
||||||
|
() => Scripting.scriptEvent('notificationShowDone'));
|
||||||
|
|
||||||
|
const notification = new MessageTray.Notification(source,
|
||||||
|
'A test notification');
|
||||||
|
source.showNotification(notification);
|
||||||
|
await Scripting.sleep(400);
|
||||||
|
|
||||||
|
Main.panel.statusArea.dateMenu.menu.open();
|
||||||
|
await Scripting.sleep(400);
|
||||||
|
|
||||||
|
Scripting.scriptEvent('notificationCloseStart');
|
||||||
|
notification.connect('destroy',
|
||||||
|
() => Scripting.scriptEvent('notificationCloseDone'));
|
||||||
|
|
||||||
|
notification.destroy();
|
||||||
|
await Scripting.sleep(400);
|
||||||
|
|
||||||
|
Main.panel.statusArea.dateMenu.menu.close();
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
|
// overview (window picker)
|
||||||
|
Scripting.scriptEvent('overviewShowStart');
|
||||||
|
Main.overview.show();
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
Main.overview.hide();
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
|
// overview (app picker)
|
||||||
|
Main.overview.show();
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
|
Scripting.scriptEvent('applicationsShowStart');
|
||||||
|
// eslint-disable-next-line require-atomic-updates
|
||||||
|
Main.overview.dash.showAppsButton.checked = true;
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
Scripting.scriptEvent('applicationsShowDone');
|
||||||
|
// eslint-disable-next-line require-atomic-updates
|
||||||
|
Main.overview.dash.showAppsButton.checked = false;
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
|
Main.overview.hide();
|
||||||
|
await Scripting.waitLeisure();
|
||||||
|
/* eslint-enable no-await-in-loop */
|
||||||
|
}
|
||||||
|
|
||||||
|
let topBarNav = false;
|
||||||
|
let notificationShown = false;
|
||||||
|
let notificationClosed = false;
|
||||||
|
let windowPickerShown = false;
|
||||||
|
let appPickerShown = false;
|
||||||
|
|
||||||
|
function script_topBarNavDone() {
|
||||||
|
topBarNav = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function script_notificationShowDone() {
|
||||||
|
notificationShown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function script_notificationCloseDone() {
|
||||||
|
notificationClosed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function script_overviewShowDone() {
|
||||||
|
windowPickerShown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function script_applicationsShowDone() {
|
||||||
|
appPickerShown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function finish() {
|
||||||
|
if (!topBarNav)
|
||||||
|
throw new Error('Failed to navigate top bar');
|
||||||
|
|
||||||
|
if (!notificationShown)
|
||||||
|
throw new Error('Failed to show notification');
|
||||||
|
|
||||||
|
if (!notificationClosed)
|
||||||
|
throw new Error('Failed to close notification');
|
||||||
|
|
||||||
|
if (!windowPickerShown)
|
||||||
|
throw new Error('Failed to show window picker');
|
||||||
|
|
||||||
|
if (!appPickerShown)
|
||||||
|
throw new Error('Failed to show app picker');
|
||||||
|
}
|
@ -70,7 +70,8 @@ let WINDOW_CONFIGS = [
|
|||||||
{ width: 640, height: 480, alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha' },
|
{ width: 640, height: 480, alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha' },
|
||||||
];
|
];
|
||||||
|
|
||||||
function *run() {
|
async function run() {
|
||||||
|
/* eslint-disable no-await-in-loop */
|
||||||
Scripting.defineScriptEvent("overviewShowStart", "Starting to show the overview");
|
Scripting.defineScriptEvent("overviewShowStart", "Starting to show the overview");
|
||||||
Scripting.defineScriptEvent("overviewShowDone", "Overview finished showing");
|
Scripting.defineScriptEvent("overviewShowDone", "Overview finished showing");
|
||||||
Scripting.defineScriptEvent("afterShowHide", "After a show/hide cycle for the overview");
|
Scripting.defineScriptEvent("afterShowHide", "After a show/hide cycle for the overview");
|
||||||
@ -84,7 +85,7 @@ function *run() {
|
|||||||
Scripting.scriptEvent('overviewShowDone');
|
Scripting.scriptEvent('overviewShowDone');
|
||||||
});
|
});
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
for (let i = 0; i < 2 * WINDOW_CONFIGS.length; i++) {
|
for (let i = 0; i < 2 * WINDOW_CONFIGS.length; i++) {
|
||||||
// We go to the overview twice for each configuration; the first time
|
// We go to the overview twice for each configuration; the first time
|
||||||
@ -92,49 +93,50 @@ function *run() {
|
|||||||
// a clean set of numbers.
|
// a clean set of numbers.
|
||||||
if ((i % 2) == 0) {
|
if ((i % 2) == 0) {
|
||||||
let config = WINDOW_CONFIGS[i / 2];
|
let config = WINDOW_CONFIGS[i / 2];
|
||||||
yield Scripting.destroyTestWindows();
|
await Scripting.destroyTestWindows();
|
||||||
|
|
||||||
for (let k = 0; k < config.count; k++) {
|
for (let k = 0; k < config.count; k++) {
|
||||||
yield Scripting.createTestWindow({ width: config.width,
|
await Scripting.createTestWindow({ width: config.width,
|
||||||
height: config.height,
|
height: config.height,
|
||||||
alpha: config.alpha,
|
alpha: config.alpha,
|
||||||
maximized: config.maximized });
|
maximized: config.maximized });
|
||||||
}
|
}
|
||||||
|
|
||||||
yield Scripting.waitTestWindows();
|
await Scripting.waitTestWindows();
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
}
|
}
|
||||||
|
|
||||||
Scripting.scriptEvent('overviewShowStart');
|
Scripting.scriptEvent('overviewShowStart');
|
||||||
Main.overview.show();
|
Main.overview.show();
|
||||||
|
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
System.gc();
|
System.gc();
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
Scripting.collectStatistics();
|
Scripting.collectStatistics();
|
||||||
Scripting.scriptEvent('afterShowHide');
|
Scripting.scriptEvent('afterShowHide');
|
||||||
}
|
}
|
||||||
|
|
||||||
yield Scripting.destroyTestWindows();
|
await Scripting.destroyTestWindows();
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
Main.overview.show();
|
Main.overview.show();
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
for (let i = 0; i < 2; i++) {
|
for (let i = 0; i < 2; i++) {
|
||||||
Scripting.scriptEvent('applicationsShowStart');
|
Scripting.scriptEvent('applicationsShowStart');
|
||||||
// eslint-disable-next-line require-atomic-updates
|
// eslint-disable-next-line require-atomic-updates
|
||||||
Main.overview.dash.showAppsButton.checked = true;
|
Main.overview.dash.showAppsButton.checked = true;
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
Scripting.scriptEvent('applicationsShowDone');
|
Scripting.scriptEvent('applicationsShowDone');
|
||||||
// eslint-disable-next-line require-atomic-updates
|
// eslint-disable-next-line require-atomic-updates
|
||||||
Main.overview.dash.showAppsButton.checked = false;
|
Main.overview.dash.showAppsButton.checked = false;
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
}
|
}
|
||||||
|
/* eslint-enable no-await-in-loop */
|
||||||
}
|
}
|
||||||
|
|
||||||
let showingOverview = false;
|
let showingOverview = false;
|
||||||
|
@ -94,7 +94,8 @@ function extractBootTimestamp() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function *run() {
|
async function run() {
|
||||||
|
/* eslint-disable no-await-in-loop */
|
||||||
Scripting.defineScriptEvent("desktopShown", "Finished initial animation");
|
Scripting.defineScriptEvent("desktopShown", "Finished initial animation");
|
||||||
Scripting.defineScriptEvent("overviewShowStart", "Starting to show the overview");
|
Scripting.defineScriptEvent("overviewShowStart", "Starting to show the overview");
|
||||||
Scripting.defineScriptEvent("overviewShowDone", "Overview finished showing");
|
Scripting.defineScriptEvent("overviewShowDone", "Overview finished showing");
|
||||||
@ -110,7 +111,7 @@ function *run() {
|
|||||||
Scripting.defineScriptEvent("geditLaunch", "gedit application launch");
|
Scripting.defineScriptEvent("geditLaunch", "gedit application launch");
|
||||||
Scripting.defineScriptEvent("geditFirstFrame", "first frame of gedit window drawn");
|
Scripting.defineScriptEvent("geditFirstFrame", "first frame of gedit window drawn");
|
||||||
|
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
Scripting.scriptEvent('desktopShown');
|
Scripting.scriptEvent('desktopShown');
|
||||||
|
|
||||||
let interfaceSettings = new Gio.Settings({
|
let interfaceSettings = new Gio.Settings({
|
||||||
@ -120,22 +121,22 @@ function *run() {
|
|||||||
|
|
||||||
Scripting.scriptEvent('overviewShowStart');
|
Scripting.scriptEvent('overviewShowStart');
|
||||||
Main.overview.show();
|
Main.overview.show();
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
Scripting.scriptEvent('overviewShowDone');
|
Scripting.scriptEvent('overviewShowDone');
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
Scripting.scriptEvent('applicationsShowStart');
|
Scripting.scriptEvent('applicationsShowStart');
|
||||||
// eslint-disable-next-line require-atomic-updates
|
// eslint-disable-next-line require-atomic-updates
|
||||||
Main.overview.dash.showAppsButton.checked = true;
|
Main.overview.dash.showAppsButton.checked = true;
|
||||||
|
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
Scripting.scriptEvent('applicationsShowDone');
|
Scripting.scriptEvent('applicationsShowDone');
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
yield Scripting.waitLeisure();
|
await Scripting.waitLeisure();
|
||||||
|
|
||||||
// --------------------- //
|
// --------------------- //
|
||||||
// Tests of redraw speed //
|
// Tests of redraw speed //
|
||||||
@ -145,46 +146,46 @@ function *run() {
|
|||||||
global.frame_finish_timestamp = true;
|
global.frame_finish_timestamp = true;
|
||||||
|
|
||||||
for (let k = 0; k < 5; k++)
|
for (let k = 0; k < 5; k++)
|
||||||
yield Scripting.createTestWindow({ maximized: true });
|
await Scripting.createTestWindow({ maximized: true });
|
||||||
yield Scripting.waitTestWindows();
|
await Scripting.waitTestWindows();
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
Scripting.scriptEvent('mainViewDrawStart');
|
Scripting.scriptEvent('mainViewDrawStart');
|
||||||
yield waitAndDraw(1000);
|
await waitAndDraw(1000);
|
||||||
Scripting.scriptEvent('mainViewDrawDone');
|
Scripting.scriptEvent('mainViewDrawDone');
|
||||||
|
|
||||||
Main.overview.show();
|
Main.overview.show();
|
||||||
Scripting.waitLeisure();
|
Scripting.waitLeisure();
|
||||||
|
|
||||||
yield Scripting.sleep(1500);
|
await Scripting.sleep(1500);
|
||||||
|
|
||||||
Scripting.scriptEvent('overviewDrawStart');
|
Scripting.scriptEvent('overviewDrawStart');
|
||||||
yield waitAndDraw(1000);
|
await waitAndDraw(1000);
|
||||||
Scripting.scriptEvent('overviewDrawDone');
|
Scripting.scriptEvent('overviewDrawDone');
|
||||||
|
|
||||||
yield Scripting.destroyTestWindows();
|
await Scripting.destroyTestWindows();
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
|
|
||||||
yield Scripting.createTestWindow({ maximized: true,
|
await Scripting.createTestWindow({ maximized: true,
|
||||||
redraws: true });
|
redraws: true });
|
||||||
yield Scripting.waitTestWindows();
|
await Scripting.waitTestWindows();
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
Scripting.scriptEvent('redrawTestStart');
|
Scripting.scriptEvent('redrawTestStart');
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
Scripting.scriptEvent('redrawTestDone');
|
Scripting.scriptEvent('redrawTestDone');
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
Scripting.scriptEvent('collectTimings');
|
Scripting.scriptEvent('collectTimings');
|
||||||
|
|
||||||
yield Scripting.destroyTestWindows();
|
await Scripting.destroyTestWindows();
|
||||||
|
|
||||||
global.frame_timestamps = false;
|
global.frame_timestamps = false;
|
||||||
global.frame_finish_timestamp = false;
|
global.frame_finish_timestamp = false;
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
let appSys = Shell.AppSystem.get_default();
|
let appSys = Shell.AppSystem.get_default();
|
||||||
let app = appSys.lookup_app('org.gnome.gedit.desktop');
|
let app = appSys.lookup_app('org.gnome.gedit.desktop');
|
||||||
@ -197,21 +198,22 @@ function *run() {
|
|||||||
throw new Error('gedit was already running');
|
throw new Error('gedit was already running');
|
||||||
|
|
||||||
while (windows.length == 0) {
|
while (windows.length == 0) {
|
||||||
yield waitSignal(global.display, 'window-created');
|
await waitSignal(global.display, 'window-created');
|
||||||
windows = app.get_windows();
|
windows = app.get_windows();
|
||||||
}
|
}
|
||||||
|
|
||||||
let actor = windows[0].get_compositor_private();
|
let actor = windows[0].get_compositor_private();
|
||||||
yield waitSignal(actor, 'first-frame');
|
await waitSignal(actor, 'first-frame');
|
||||||
Scripting.scriptEvent('geditFirstFrame');
|
Scripting.scriptEvent('geditFirstFrame');
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
windows[0].delete(global.get_current_time());
|
windows[0].delete(global.get_current_time());
|
||||||
|
|
||||||
yield Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
|
||||||
interfaceSettings.set_boolean('enable-animations', true);
|
interfaceSettings.set_boolean('enable-animations', true);
|
||||||
|
/* eslint-enable no-await-in-loop */
|
||||||
}
|
}
|
||||||
|
|
||||||
let overviewShowStart;
|
let overviewShowStart;
|
||||||
|
@ -68,8 +68,8 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||||||
this._items = this._switcherList.icons;
|
this._items = this._switcherList.icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box) {
|
||||||
super.vfunc_allocate(box, flags);
|
super.vfunc_allocate(box);
|
||||||
|
|
||||||
// Allocate the thumbnails
|
// Allocate the thumbnails
|
||||||
// We try to avoid overflowing the screen so we base the resulting size on
|
// We try to avoid overflowing the screen so we base the resulting size on
|
||||||
@ -102,7 +102,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||||||
this._thumbnails.addClones(primary.y + primary.height - bottomPadding - childBox.y1);
|
this._thumbnails.addClones(primary.y + primary.height - bottomPadding - childBox.y1);
|
||||||
let [, childNaturalHeight] = this._thumbnails.get_preferred_height(-1);
|
let [, childNaturalHeight] = this._thumbnails.get_preferred_height(-1);
|
||||||
childBox.y2 = childBox.y1 + childNaturalHeight;
|
childBox.y2 = childBox.y1 + childNaturalHeight;
|
||||||
this._thumbnails.allocate(childBox, flags);
|
this._thumbnails.allocate(childBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,8 +681,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
// Cache the window list now; we don't handle dynamic changes here,
|
// Cache the window list now; we don't handle dynamic changes here,
|
||||||
// and we don't want to be continually retrieving it
|
// and we don't want to be continually retrieving it
|
||||||
appIcon.cachedWindows = allWindows.filter(
|
appIcon.cachedWindows = allWindows.filter(
|
||||||
w => windowTracker.get_window_app(w) == appIcon.app
|
w => windowTracker.get_window_app(w) === appIcon.app);
|
||||||
);
|
|
||||||
if (appIcon.cachedWindows.length > 0)
|
if (appIcon.cachedWindows.length > 0)
|
||||||
this._addIcon(appIcon);
|
this._addIcon(appIcon);
|
||||||
}
|
}
|
||||||
@ -717,7 +716,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
let iconSpacing = labelNaturalHeight + iconPadding + iconBorder;
|
let iconSpacing = labelNaturalHeight + iconPadding + iconBorder;
|
||||||
let totalSpacing = this._list.spacing * (this._items.length - 1);
|
let totalSpacing = this._list.spacing * (this._items.length - 1);
|
||||||
|
|
||||||
// We just assume the whole screen here due to weirdness happing with the passed width
|
// We just assume the whole screen here due to weirdness happening with the passed width
|
||||||
let primary = Main.layoutManager.primaryMonitor;
|
let primary = Main.layoutManager.primaryMonitor;
|
||||||
let parentPadding = this.get_parent().get_theme_node().get_horizontal_padding();
|
let parentPadding = this.get_parent().get_theme_node().get_horizontal_padding();
|
||||||
let availWidth = primary.width - parentPadding - this.get_theme_node().get_horizontal_padding();
|
let availWidth = primary.width - parentPadding - this.get_theme_node().get_horizontal_padding();
|
||||||
@ -750,9 +749,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
return super.vfunc_get_preferred_height(forWidth);
|
return super.vfunc_get_preferred_height(forWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box) {
|
||||||
// Allocate the main list items
|
// Allocate the main list items
|
||||||
super.vfunc_allocate(box, flags);
|
super.vfunc_allocate(box);
|
||||||
|
|
||||||
let contentBox = this.get_theme_node().get_content_box(box);
|
let contentBox = this.get_theme_node().get_content_box(box);
|
||||||
|
|
||||||
@ -767,7 +766,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
childBox.x2 = childBox.x1 + arrowWidth;
|
childBox.x2 = childBox.x1 + arrowWidth;
|
||||||
childBox.y1 = contentBox.y1 + itemBox.y2 + arrowHeight;
|
childBox.y1 = contentBox.y1 + itemBox.y2 + arrowHeight;
|
||||||
childBox.y2 = childBox.y1 + arrowHeight;
|
childBox.y2 = childBox.y1 + arrowHeight;
|
||||||
this._arrows[i].allocate(childBox, flags);
|
this._arrows[i].allocate(childBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,6 +852,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
if (index === -1)
|
if (index === -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this._arrows[index].destroy();
|
||||||
|
this._arrows.splice(index, 1);
|
||||||
|
|
||||||
this.icons.splice(index, 1);
|
this.icons.splice(index, 1);
|
||||||
this.removeItem(index);
|
this.removeItem(index);
|
||||||
}
|
}
|
||||||
@ -1057,28 +1059,28 @@ class WindowSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
return [minHeight, natHeight];
|
return [minHeight, natHeight];
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box) {
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
let contentBox = themeNode.get_content_box(box);
|
let contentBox = themeNode.get_content_box(box);
|
||||||
|
const labelHeight = this._label.height;
|
||||||
|
const totalLabelHeight =
|
||||||
|
labelHeight + themeNode.get_padding(St.Side.BOTTOM);
|
||||||
|
|
||||||
let childBox = new Clutter.ActorBox();
|
box.y2 -= totalLabelHeight;
|
||||||
childBox.x1 = contentBox.x1;
|
super.vfunc_allocate(box);
|
||||||
childBox.x2 = contentBox.x2;
|
|
||||||
childBox.y2 = contentBox.y2;
|
|
||||||
childBox.y1 = childBox.y2 - this._label.height;
|
|
||||||
this._label.allocate(childBox, flags);
|
|
||||||
|
|
||||||
let totalLabelHeight = this._label.height + themeNode.get_padding(St.Side.BOTTOM);
|
|
||||||
childBox.x1 = box.x1;
|
|
||||||
childBox.x2 = box.x2;
|
|
||||||
childBox.y1 = box.y1;
|
|
||||||
childBox.y2 = box.y2 - totalLabelHeight;
|
|
||||||
super.vfunc_allocate(childBox, flags);
|
|
||||||
|
|
||||||
// Hooking up the parent vfunc will call this.set_allocation() with
|
// Hooking up the parent vfunc will call this.set_allocation() with
|
||||||
// the height without the label height, so call it again with the
|
// the height without the label height, so call it again with the
|
||||||
// correct size here.
|
// correct size here.
|
||||||
this.set_allocation(box, flags);
|
box.y2 += totalLabelHeight;
|
||||||
|
this.set_allocation(box);
|
||||||
|
|
||||||
|
const childBox = new Clutter.ActorBox();
|
||||||
|
childBox.x1 = contentBox.x1;
|
||||||
|
childBox.x2 = contentBox.x2;
|
||||||
|
childBox.y2 = contentBox.y2;
|
||||||
|
childBox.y1 = childBox.y2 - labelHeight;
|
||||||
|
this._label.allocate(childBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
highlight(index, justOutline) {
|
highlight(index, justOutline) {
|
||||||
|
@ -15,8 +15,7 @@ class Animation extends St.Bin {
|
|||||||
const themeContext = St.ThemeContext.get_for_stage(global.stage);
|
const themeContext = St.ThemeContext.get_for_stage(global.stage);
|
||||||
|
|
||||||
super._init({
|
super._init({
|
||||||
width: width * themeContext.scale_factor,
|
style: `width: ${width}px; height: ${height}px;`,
|
||||||
height: height * themeContext.scale_factor,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
@ -61,7 +60,7 @@ class Animation extends St.Bin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_loadFile(file, width, height) {
|
_loadFile(file, width, height) {
|
||||||
let [validResourceScale, resourceScale] = this.get_resource_scale();
|
const resourceScale = this.get_resource_scale();
|
||||||
let wasPlaying = this._isPlaying;
|
let wasPlaying = this._isPlaying;
|
||||||
|
|
||||||
if (this._isPlaying)
|
if (this._isPlaying)
|
||||||
@ -70,12 +69,6 @@ class Animation extends St.Bin {
|
|||||||
this._isLoaded = false;
|
this._isLoaded = false;
|
||||||
this.destroy_all_children();
|
this.destroy_all_children();
|
||||||
|
|
||||||
if (!validResourceScale) {
|
|
||||||
if (wasPlaying)
|
|
||||||
this.play();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let textureCache = St.TextureCache.get_default();
|
let textureCache = St.TextureCache.get_default();
|
||||||
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||||
this._animations = textureCache.load_sliced_image(file, width, height,
|
this._animations = textureCache.load_sliced_image(file, width, height,
|
||||||
|
2261
js/ui/appDisplay.js
2261
js/ui/appDisplay.js
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@
|
|||||||
/* exported getAppFavorites */
|
/* exported getAppFavorites */
|
||||||
|
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
|
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -12,6 +13,7 @@ const RENAMED_DESKTOP_IDS = {
|
|||||||
'cheese.desktop': 'org.gnome.Cheese.desktop',
|
'cheese.desktop': 'org.gnome.Cheese.desktop',
|
||||||
'dconf-editor.desktop': 'ca.desrt.dconf-editor.desktop',
|
'dconf-editor.desktop': 'ca.desrt.dconf-editor.desktop',
|
||||||
'empathy.desktop': 'org.gnome.Empathy.desktop',
|
'empathy.desktop': 'org.gnome.Empathy.desktop',
|
||||||
|
'eog.desktop': 'org.gnome.eog.desktop',
|
||||||
'epiphany.desktop': 'org.gnome.Epiphany.desktop',
|
'epiphany.desktop': 'org.gnome.Epiphany.desktop',
|
||||||
'evolution.desktop': 'org.gnome.Evolution.desktop',
|
'evolution.desktop': 'org.gnome.Evolution.desktop',
|
||||||
'file-roller.desktop': 'org.gnome.FileRoller.desktop',
|
'file-roller.desktop': 'org.gnome.FileRoller.desktop',
|
||||||
@ -64,6 +66,13 @@ const RENAMED_DESKTOP_IDS = {
|
|||||||
|
|
||||||
class AppFavorites {
|
class AppFavorites {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
// Filter the apps through the user’s parental controls.
|
||||||
|
this._parentalControlsManager = ParentalControlsManager.getDefault();
|
||||||
|
this._parentalControlsManager.connect('app-filter-changed', () => {
|
||||||
|
this.reload();
|
||||||
|
this.emit('changed');
|
||||||
|
});
|
||||||
|
|
||||||
this.FAVORITE_APPS_KEY = 'favorite-apps';
|
this.FAVORITE_APPS_KEY = 'favorite-apps';
|
||||||
this._favorites = {};
|
this._favorites = {};
|
||||||
global.settings.connect('changed::%s'.format(this.FAVORITE_APPS_KEY), this._onFavsChanged.bind(this));
|
global.settings.connect('changed::%s'.format(this.FAVORITE_APPS_KEY), this._onFavsChanged.bind(this));
|
||||||
@ -95,7 +104,7 @@ class AppFavorites {
|
|||||||
global.settings.set_strv(this.FAVORITE_APPS_KEY, ids);
|
global.settings.set_strv(this.FAVORITE_APPS_KEY, ids);
|
||||||
|
|
||||||
let apps = ids.map(id => appSys.lookup_app(id))
|
let apps = ids.map(id => appSys.lookup_app(id))
|
||||||
.filter(app => app != null);
|
.filter(app => app !== null && this._parentalControlsManager.shouldShowApp(app.app_info));
|
||||||
this._favorites = {};
|
this._favorites = {};
|
||||||
for (let i = 0; i < apps.length; i++) {
|
for (let i = 0; i < apps.length; i++) {
|
||||||
let app = apps[i];
|
let app = apps[i];
|
||||||
@ -134,6 +143,9 @@ class AppFavorites {
|
|||||||
if (!app)
|
if (!app)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!this._parentalControlsManager.shouldShowApp(app.app_info))
|
||||||
|
return false;
|
||||||
|
|
||||||
let ids = this._getIds();
|
let ids = this._getIds();
|
||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
ids.push(appId);
|
ids.push(appId);
|
||||||
|
@ -147,9 +147,8 @@ var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
|
|||||||
_onDeviceSelected(dialog, device) {
|
_onDeviceSelected(dialog, device) {
|
||||||
let connection = this._dbusImpl.get_connection();
|
let connection = this._dbusImpl.get_connection();
|
||||||
let info = this._dbusImpl.get_info();
|
let info = this._dbusImpl.get_info();
|
||||||
let deviceName = Object.keys(AudioDevice).filter(
|
const deviceName = Object.keys(AudioDevice)
|
||||||
dev => AudioDevice[dev] == device
|
.filter(dev => AudioDevice[dev] === device)[0].toLowerCase();
|
||||||
)[0].toLowerCase();
|
|
||||||
connection.emit_signal(this._audioSelectionDialog._sender,
|
connection.emit_signal(this._audioSelectionDialog._sender,
|
||||||
this._dbusImpl.get_object_path(),
|
this._dbusImpl.get_object_path(),
|
||||||
info ? info.name : null,
|
info ? info.name : null,
|
||||||
|
@ -347,6 +347,8 @@ var Background = GObject.registerClass({
|
|||||||
this.set_color(color);
|
this.set_color(color);
|
||||||
else
|
else
|
||||||
this.set_gradient(shadingType, color, secondColor);
|
this.set_gradient(shadingType, color, secondColor);
|
||||||
|
|
||||||
|
this._setLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
_watchFile(file) {
|
_watchFile(file) {
|
||||||
@ -512,8 +514,8 @@ var SystemBackground = GObject.registerClass({
|
|||||||
super._init({
|
super._init({
|
||||||
meta_display: global.display,
|
meta_display: global.display,
|
||||||
monitor: 0,
|
monitor: 0,
|
||||||
background: _systemBackground,
|
|
||||||
});
|
});
|
||||||
|
this.content.background = _systemBackground;
|
||||||
|
|
||||||
let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
|
let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
|
||||||
this.emit('loaded');
|
this.emit('loaded');
|
||||||
@ -712,13 +714,18 @@ var BackgroundManager = class BackgroundManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let newBackgroundActor = this._createBackgroundActor();
|
let newBackgroundActor = this._createBackgroundActor();
|
||||||
newBackgroundActor.vignette_sharpness = this.backgroundActor.vignette_sharpness;
|
|
||||||
newBackgroundActor.brightness = this.backgroundActor.brightness;
|
const oldContent = this.backgroundActor.content;
|
||||||
|
const newContent = newBackgroundActor.content;
|
||||||
|
|
||||||
|
newContent.vignette_sharpness = oldContent.vignette_sharpness;
|
||||||
|
newContent.brightness = oldContent.brightness;
|
||||||
|
|
||||||
newBackgroundActor.visible = this.backgroundActor.visible;
|
newBackgroundActor.visible = this.backgroundActor.visible;
|
||||||
|
|
||||||
this._newBackgroundActor = newBackgroundActor;
|
this._newBackgroundActor = newBackgroundActor;
|
||||||
|
|
||||||
let background = newBackgroundActor.background;
|
const { background } = newBackgroundActor.content;
|
||||||
|
|
||||||
if (background.isLoaded) {
|
if (background.isLoaded) {
|
||||||
this._swapBackgroundActor();
|
this._swapBackgroundActor();
|
||||||
@ -738,6 +745,8 @@ var BackgroundManager = class BackgroundManager {
|
|||||||
let backgroundActor = new Meta.BackgroundActor({
|
let backgroundActor = new Meta.BackgroundActor({
|
||||||
meta_display: global.display,
|
meta_display: global.display,
|
||||||
monitor: this._monitorIndex,
|
monitor: this._monitorIndex,
|
||||||
|
});
|
||||||
|
backgroundActor.content.set({
|
||||||
background,
|
background,
|
||||||
vignette: this._vignette,
|
vignette: this._vignette,
|
||||||
vignette_sharpness: 0.5,
|
vignette_sharpness: 0.5,
|
||||||
@ -758,10 +767,27 @@ var BackgroundManager = class BackgroundManager {
|
|||||||
this._updateBackgroundActor();
|
this._updateBackgroundActor();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let loadedSignalId;
|
||||||
|
if (background.isLoaded) {
|
||||||
|
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
|
||||||
|
this.emit('loaded');
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
loadedSignalId = background.connect('loaded', () => {
|
||||||
|
background.disconnect(loadedSignalId);
|
||||||
|
loadedSignalId = null;
|
||||||
|
this.emit('loaded');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
backgroundActor.connect('destroy', () => {
|
backgroundActor.connect('destroy', () => {
|
||||||
if (changeSignalId)
|
if (changeSignalId)
|
||||||
background.disconnect(changeSignalId);
|
background.disconnect(changeSignalId);
|
||||||
|
|
||||||
|
if (loadedSignalId)
|
||||||
|
background.disconnect(loadedSignalId);
|
||||||
|
|
||||||
if (backgroundActor.loadedSignalId)
|
if (backgroundActor.loadedSignalId)
|
||||||
background.disconnect(backgroundActor.loadedSignalId);
|
background.disconnect(backgroundActor.loadedSignalId);
|
||||||
});
|
});
|
||||||
|
@ -30,8 +30,8 @@ var BarLevel = GObject.registerClass({
|
|||||||
accessible_role: Atk.Role.LEVEL_BAR,
|
accessible_role: Atk.Role.LEVEL_BAR,
|
||||||
};
|
};
|
||||||
super._init(Object.assign(defaultParams, params));
|
super._init(Object.assign(defaultParams, params));
|
||||||
this.connect('allocation-changed', (actor, box) => {
|
this.connect('notify::allocation', () => {
|
||||||
this._barLevelWidth = box.get_width();
|
this._barLevelWidth = this.allocation.get_width();
|
||||||
});
|
});
|
||||||
|
|
||||||
this._customAccessible = St.GenericAccessible.new_for_actor(this);
|
this._customAccessible = St.GenericAccessible.new_for_actor(this);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported BoxPointer */
|
/* exported BoxPointer */
|
||||||
|
|
||||||
const { Clutter, GObject, Shell, St } = imports.gi;
|
const { Clutter, GObject, St } = imports.gi;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
@ -196,8 +196,13 @@ var BoxPointer = GObject.registerClass({
|
|||||||
return themeNode.adjust_preferred_height(...height);
|
return themeNode.adjust_preferred_height(...height);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box) {
|
||||||
this.set_allocation(box, flags);
|
if (this._sourceActor && this._sourceActor.mapped) {
|
||||||
|
this._reposition(box);
|
||||||
|
this._updateFlip(box);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.set_allocation(box);
|
||||||
|
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
let borderWidth = themeNode.get_length('-arrow-border-width');
|
let borderWidth = themeNode.get_length('-arrow-border-width');
|
||||||
@ -209,7 +214,7 @@ var BoxPointer = GObject.registerClass({
|
|||||||
childBox.y1 = 0;
|
childBox.y1 = 0;
|
||||||
childBox.x2 = availWidth;
|
childBox.x2 = availWidth;
|
||||||
childBox.y2 = availHeight;
|
childBox.y2 = availHeight;
|
||||||
this._border.allocate(childBox, flags);
|
this._border.allocate(childBox);
|
||||||
|
|
||||||
childBox.x1 = borderWidth;
|
childBox.x1 = borderWidth;
|
||||||
childBox.y1 = borderWidth;
|
childBox.y1 = borderWidth;
|
||||||
@ -229,13 +234,7 @@ var BoxPointer = GObject.registerClass({
|
|||||||
childBox.x2 -= rise;
|
childBox.x2 -= rise;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.bin.allocate(childBox, flags);
|
this.bin.allocate(childBox);
|
||||||
|
|
||||||
if (this._sourceActor && this._sourceActor.mapped) {
|
|
||||||
this._reposition(box);
|
|
||||||
this._updateFlip(box);
|
|
||||||
this.set_allocation(box, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_drawBorder(area) {
|
_drawBorder(area) {
|
||||||
@ -454,15 +453,16 @@ var BoxPointer = GObject.registerClass({
|
|||||||
let alignment = this._arrowAlignment;
|
let alignment = this._arrowAlignment;
|
||||||
let monitorIndex = Main.layoutManager.findIndexForActor(sourceActor);
|
let monitorIndex = Main.layoutManager.findIndexForActor(sourceActor);
|
||||||
|
|
||||||
this._sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
|
this._sourceExtents = sourceActor.get_transformed_extents();
|
||||||
this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
|
this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
|
||||||
|
|
||||||
// Position correctly relative to the sourceActor
|
// Position correctly relative to the sourceActor
|
||||||
let sourceNode = sourceActor.get_theme_node();
|
let sourceNode = sourceActor.get_theme_node();
|
||||||
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
|
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
|
||||||
let sourceAllocation = this._sourceAllocation;
|
let sourceTopLeft = this._sourceExtents.get_top_left();
|
||||||
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
|
let sourceBottomRight = this._sourceExtents.get_bottom_right();
|
||||||
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
|
let sourceCenterX = sourceTopLeft.x + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
|
||||||
|
let sourceCenterY = sourceTopLeft.y + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
|
||||||
let [, , natWidth, natHeight] = this.get_preferred_size();
|
let [, , natWidth, natHeight] = this.get_preferred_size();
|
||||||
|
|
||||||
// We also want to keep it onscreen, and separated from the
|
// We also want to keep it onscreen, and separated from the
|
||||||
@ -482,16 +482,16 @@ var BoxPointer = GObject.registerClass({
|
|||||||
|
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
resY = sourceAllocation.y2 + gap;
|
resY = sourceBottomRight.y + gap;
|
||||||
break;
|
break;
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
resY = sourceAllocation.y1 - natHeight - gap;
|
resY = sourceTopLeft.y - natHeight - gap;
|
||||||
break;
|
break;
|
||||||
case St.Side.LEFT:
|
case St.Side.LEFT:
|
||||||
resX = sourceAllocation.x2 + gap;
|
resX = sourceBottomRight.x + gap;
|
||||||
break;
|
break;
|
||||||
case St.Side.RIGHT:
|
case St.Side.RIGHT:
|
||||||
resX = sourceAllocation.x1 - natWidth - gap;
|
resX = sourceTopLeft.x - natWidth - gap;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,29 +587,30 @@ var BoxPointer = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_calculateArrowSide(arrowSide) {
|
_calculateArrowSide(arrowSide) {
|
||||||
let sourceAllocation = this._sourceAllocation;
|
let sourceTopLeft = this._sourceExtents.get_top_left();
|
||||||
|
let sourceBottomRight = this._sourceExtents.get_bottom_right();
|
||||||
let [, , boxWidth, boxHeight] = this.get_preferred_size();
|
let [, , boxWidth, boxHeight] = this.get_preferred_size();
|
||||||
let workarea = this._workArea;
|
let workarea = this._workArea;
|
||||||
|
|
||||||
switch (arrowSide) {
|
switch (arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
if (sourceAllocation.y2 + boxHeight > workarea.y + workarea.height &&
|
if (sourceBottomRight.y + boxHeight > workarea.y + workarea.height &&
|
||||||
boxHeight < sourceAllocation.y1 - workarea.y)
|
boxHeight < sourceTopLeft.y - workarea.y)
|
||||||
return St.Side.BOTTOM;
|
return St.Side.BOTTOM;
|
||||||
break;
|
break;
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
if (sourceAllocation.y1 - boxHeight < workarea.y &&
|
if (sourceTopLeft.y - boxHeight < workarea.y &&
|
||||||
boxHeight < workarea.y + workarea.height - sourceAllocation.y2)
|
boxHeight < workarea.y + workarea.height - sourceBottomRight.y)
|
||||||
return St.Side.TOP;
|
return St.Side.TOP;
|
||||||
break;
|
break;
|
||||||
case St.Side.LEFT:
|
case St.Side.LEFT:
|
||||||
if (sourceAllocation.x2 + boxWidth > workarea.x + workarea.width &&
|
if (sourceBottomRight.x + boxWidth > workarea.x + workarea.width &&
|
||||||
boxWidth < sourceAllocation.x1 - workarea.x)
|
boxWidth < sourceTopLeft.x - workarea.x)
|
||||||
return St.Side.RIGHT;
|
return St.Side.RIGHT;
|
||||||
break;
|
break;
|
||||||
case St.Side.RIGHT:
|
case St.Side.RIGHT:
|
||||||
if (sourceAllocation.x1 - boxWidth < workarea.x &&
|
if (sourceTopLeft.x - boxWidth < workarea.x &&
|
||||||
boxWidth < workarea.x + workarea.width - sourceAllocation.x2)
|
boxWidth < workarea.x + workarea.width - sourceBottomRight.x)
|
||||||
return St.Side.LEFT;
|
return St.Side.LEFT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ const { loadInterfaceXML } = imports.misc.fileUtils;
|
|||||||
|
|
||||||
var MSECS_IN_DAY = 24 * 60 * 60 * 1000;
|
var MSECS_IN_DAY = 24 * 60 * 60 * 1000;
|
||||||
var SHOW_WEEKDATE_KEY = 'show-weekdate';
|
var SHOW_WEEKDATE_KEY = 'show-weekdate';
|
||||||
var ELLIPSIS_CHAR = '\u2026';
|
|
||||||
|
|
||||||
var MESSAGE_ICON_SIZE = -1; // pick up from CSS
|
var MESSAGE_ICON_SIZE = -1; // pick up from CSS
|
||||||
|
|
||||||
@ -32,10 +31,6 @@ function sameDay(dateA, dateB) {
|
|||||||
return sameMonth(dateA, dateB) && (dateA.getDate() == dateB.getDate());
|
return sameMonth(dateA, dateB) && (dateA.getDate() == dateB.getDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
function isToday(date) {
|
|
||||||
return sameDay(new Date(), date);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _isWorkDay(date) {
|
function _isWorkDay(date) {
|
||||||
/* Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */
|
/* Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */
|
||||||
let days = C_('calendar-no-work', "06");
|
let days = C_('calendar-no-work', "06");
|
||||||
@ -199,46 +194,52 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
|
|
||||||
this._initialized = false;
|
this._initialized = false;
|
||||||
this._dbusProxy = new CalendarServer();
|
this._dbusProxy = new CalendarServer();
|
||||||
this._dbusProxy.init_async(GLib.PRIORITY_DEFAULT, null, (object, result) => {
|
this._initProxy();
|
||||||
let loaded = false;
|
}
|
||||||
|
|
||||||
try {
|
async _initProxy() {
|
||||||
this._dbusProxy.init_finish(result);
|
let loaded = false;
|
||||||
loaded = true;
|
|
||||||
} catch (e) {
|
try {
|
||||||
if (e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) {
|
await this._dbusProxy.init_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
// Ignore timeouts and install signals as normal, because with high
|
loaded = true;
|
||||||
// probability the service will appear later on, and we will get a
|
} catch (e) {
|
||||||
// NameOwnerChanged which will finish loading
|
// Ignore timeouts and install signals as normal, because with high
|
||||||
//
|
// probability the service will appear later on, and we will get a
|
||||||
// (But still _initialized to false, because the proxy does not know
|
// NameOwnerChanged which will finish loading
|
||||||
// about the HasCalendars property and would cause an exception trying
|
//
|
||||||
// to read it)
|
// (But still _initialized to false, because the proxy does not know
|
||||||
} else {
|
// about the HasCalendars property and would cause an exception trying
|
||||||
log('Error loading calendars: %s'.format(e.message));
|
// to read it)
|
||||||
return;
|
if (!e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) {
|
||||||
}
|
log('Error loading calendars: %s'.format(e.message));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this._dbusProxy.connectSignal('Changed', this._onChanged.bind(this));
|
this._dbusProxy.connectSignal('EventsAddedOrUpdated',
|
||||||
|
this._onEventsAddedOrUpdated.bind(this));
|
||||||
|
this._dbusProxy.connectSignal('EventsRemoved',
|
||||||
|
this._onEventsRemoved.bind(this));
|
||||||
|
this._dbusProxy.connectSignal('ClientDisappeared',
|
||||||
|
this._onClientDisappeared.bind(this));
|
||||||
|
|
||||||
this._dbusProxy.connect('notify::g-name-owner', () => {
|
this._dbusProxy.connect('notify::g-name-owner', () => {
|
||||||
if (this._dbusProxy.g_name_owner)
|
if (this._dbusProxy.g_name_owner)
|
||||||
this._onNameAppeared();
|
|
||||||
else
|
|
||||||
this._onNameVanished();
|
|
||||||
});
|
|
||||||
|
|
||||||
this._dbusProxy.connect('g-properties-changed', () => {
|
|
||||||
this.notify('has-calendars');
|
|
||||||
});
|
|
||||||
|
|
||||||
this._initialized = loaded;
|
|
||||||
if (loaded) {
|
|
||||||
this.notify('has-calendars');
|
|
||||||
this._onNameAppeared();
|
this._onNameAppeared();
|
||||||
}
|
else
|
||||||
|
this._onNameVanished();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._dbusProxy.connect('g-properties-changed', () => {
|
||||||
|
this.notify('has-calendars');
|
||||||
|
});
|
||||||
|
|
||||||
|
this._initialized = loaded;
|
||||||
|
if (loaded) {
|
||||||
|
this.notify('has-calendars');
|
||||||
|
this._onNameAppeared();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
@ -257,7 +258,7 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_resetCache() {
|
_resetCache() {
|
||||||
this._events = [];
|
this._events = new Map();
|
||||||
this._lastRequestBegin = null;
|
this._lastRequestBegin = null;
|
||||||
this._lastRequestEnd = null;
|
this._lastRequestEnd = null;
|
||||||
}
|
}
|
||||||
@ -273,28 +274,47 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
this.emit('changed');
|
this.emit('changed');
|
||||||
}
|
}
|
||||||
|
|
||||||
_onChanged() {
|
_onEventsAddedOrUpdated(dbusProxy, nameOwner, argArray) {
|
||||||
this._loadEvents(false);
|
const [appointments = []] = argArray;
|
||||||
|
let changed = false;
|
||||||
|
|
||||||
|
for (let n = 0; n < appointments.length; n++) {
|
||||||
|
const [id, summary, allDay, startTime, endTime] = appointments[n];
|
||||||
|
const date = new Date(startTime * 1000);
|
||||||
|
const end = new Date(endTime * 1000);
|
||||||
|
let event = new CalendarEvent(id, date, end, summary, allDay);
|
||||||
|
this._events.set(event.id, event);
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
this.emit('changed');
|
||||||
}
|
}
|
||||||
|
|
||||||
_onEventsReceived(results, _error) {
|
_onEventsRemoved(dbusProxy, nameOwner, argArray) {
|
||||||
let newEvents = [];
|
const [ids = []] = argArray;
|
||||||
let appointments = results[0] || [];
|
|
||||||
for (let n = 0; n < appointments.length; n++) {
|
|
||||||
let a = appointments[n];
|
|
||||||
let date = new Date(a[4] * 1000);
|
|
||||||
let end = new Date(a[5] * 1000);
|
|
||||||
let id = a[0];
|
|
||||||
let summary = a[1];
|
|
||||||
let allDay = a[3];
|
|
||||||
let event = new CalendarEvent(id, date, end, summary, allDay);
|
|
||||||
newEvents.push(event);
|
|
||||||
}
|
|
||||||
newEvents.sort((ev1, ev2) => ev1.date.getTime() - ev2.date.getTime());
|
|
||||||
|
|
||||||
this._events = newEvents;
|
let changed = false;
|
||||||
this._isLoading = false;
|
for (const id of ids)
|
||||||
this.emit('changed');
|
changed |= this._events.delete(id);
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
this.emit('changed');
|
||||||
|
}
|
||||||
|
|
||||||
|
_onClientDisappeared(dbusProxy, nameOwner, argArray) {
|
||||||
|
let [sourceUid = ''] = argArray;
|
||||||
|
sourceUid += '\n';
|
||||||
|
|
||||||
|
let changed = false;
|
||||||
|
for (const id of this._events.keys()) {
|
||||||
|
if (id.startsWith(sourceUid))
|
||||||
|
changed |= this._events.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
this.emit('changed');
|
||||||
}
|
}
|
||||||
|
|
||||||
_loadEvents(forceReload) {
|
_loadEvents(forceReload) {
|
||||||
@ -303,33 +323,38 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (this._curRequestBegin && this._curRequestEnd) {
|
if (this._curRequestBegin && this._curRequestEnd) {
|
||||||
this._dbusProxy.GetEventsRemote(this._curRequestBegin.getTime() / 1000,
|
if (forceReload) {
|
||||||
this._curRequestEnd.getTime() / 1000,
|
this._events.clear();
|
||||||
forceReload,
|
this.emit('changed');
|
||||||
this._onEventsReceived.bind(this),
|
}
|
||||||
Gio.DBusCallFlags.NONE);
|
this._dbusProxy.SetTimeRangeRemote(
|
||||||
|
this._curRequestBegin.getTime() / 1000,
|
||||||
|
this._curRequestEnd.getTime() / 1000,
|
||||||
|
forceReload,
|
||||||
|
Gio.DBusCallFlags.NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
requestRange(begin, end) {
|
requestRange(begin, end) {
|
||||||
if (!(_datesEqual(begin, this._lastRequestBegin) && _datesEqual(end, this._lastRequestEnd))) {
|
if (!(_datesEqual(begin, this._lastRequestBegin) && _datesEqual(end, this._lastRequestEnd))) {
|
||||||
this._isLoading = true;
|
|
||||||
this._lastRequestBegin = begin;
|
this._lastRequestBegin = begin;
|
||||||
this._lastRequestEnd = end;
|
this._lastRequestEnd = end;
|
||||||
this._curRequestBegin = begin;
|
this._curRequestBegin = begin;
|
||||||
this._curRequestEnd = end;
|
this._curRequestEnd = end;
|
||||||
this._loadEvents(false);
|
this._loadEvents(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*_getFilteredEvents(begin, end) {
|
||||||
|
for (const event of this._events.values()) {
|
||||||
|
if (_dateIntervalsOverlap(event.date, event.end, begin, end))
|
||||||
|
yield event;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getEvents(begin, end) {
|
getEvents(begin, end) {
|
||||||
let result = [];
|
let result = [...this._getFilteredEvents(begin, end)];
|
||||||
for (let n = 0; n < this._events.length; n++) {
|
|
||||||
let event = this._events[n];
|
|
||||||
|
|
||||||
if (_dateIntervalsOverlap(event.date, event.end, begin, end))
|
|
||||||
result.push(event);
|
|
||||||
}
|
|
||||||
result.sort((event1, event2) => {
|
result.sort((event1, event2) => {
|
||||||
// sort events by end time on ending day
|
// sort events by end time on ending day
|
||||||
let d1 = event1.date < begin && event1.end <= end ? event1.end : event1.date;
|
let d1 = event1.date < begin && event1.end <= end ? event1.end : event1.date;
|
||||||
@ -343,12 +368,8 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
let dayBegin = _getBeginningOfDay(day);
|
let dayBegin = _getBeginningOfDay(day);
|
||||||
let dayEnd = _getEndOfDay(day);
|
let dayEnd = _getEndOfDay(day);
|
||||||
|
|
||||||
let events = this.getEvents(dayBegin, dayEnd);
|
const { done } = this._getFilteredEvents(dayBegin, dayEnd).next();
|
||||||
|
return !done;
|
||||||
if (events.length == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -659,6 +680,7 @@ var Calendar = GObject.registerClass({
|
|||||||
style_class: 'calendar-day-base calendar-week-number',
|
style_class: 'calendar-day-base calendar-week-number',
|
||||||
can_focus: true });
|
can_focus: true });
|
||||||
let weekFormat = Shell.util_translate_time_string(N_("Week %V"));
|
let weekFormat = Shell.util_translate_time_string(N_("Week %V"));
|
||||||
|
label.clutter_text.y_align = Clutter.ActorAlign.CENTER;
|
||||||
label.accessible_name = iter.toLocaleFormat(weekFormat);
|
label.accessible_name = iter.toLocaleFormat(weekFormat);
|
||||||
layout.attach(label, rtl ? 7 : 0, row, 1, 1);
|
layout.attach(label, rtl ? 7 : 0, row, 1, 1);
|
||||||
}
|
}
|
||||||
@ -697,61 +719,6 @@ var Calendar = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var EventMessage = GObject.registerClass(
|
|
||||||
class EventMessage extends MessageList.Message {
|
|
||||||
_init(event, date) {
|
|
||||||
super._init('', event.summary);
|
|
||||||
|
|
||||||
this._event = event;
|
|
||||||
this._date = date;
|
|
||||||
|
|
||||||
this.setTitle(this._formatEventTime());
|
|
||||||
|
|
||||||
this._icon = new St.Icon({ icon_name: 'x-office-calendar-symbolic' });
|
|
||||||
this.setIcon(this._icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
vfunc_style_changed() {
|
|
||||||
let iconVisible = this.get_parent().has_style_pseudo_class('first-child');
|
|
||||||
this._icon.opacity = iconVisible ? 255 : 0;
|
|
||||||
super.vfunc_style_changed();
|
|
||||||
}
|
|
||||||
|
|
||||||
_formatEventTime() {
|
|
||||||
let periodBegin = _getBeginningOfDay(this._date);
|
|
||||||
let periodEnd = _getEndOfDay(this._date);
|
|
||||||
let allDay = this._event.allDay || (this._event.date <= periodBegin &&
|
|
||||||
this._event.end >= periodEnd);
|
|
||||||
let title;
|
|
||||||
if (allDay) {
|
|
||||||
/* Translators: Shown in calendar event list for all day events
|
|
||||||
* Keep it short, best if you can use less then 10 characters
|
|
||||||
*/
|
|
||||||
title = C_("event list time", "All Day");
|
|
||||||
} else {
|
|
||||||
let date = this._event.date >= periodBegin
|
|
||||||
? this._event.date
|
|
||||||
: this._event.end;
|
|
||||||
title = Util.formatTime(date, { timeOnly: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL;
|
|
||||||
if (this._event.date < periodBegin && !this._event.allDay) {
|
|
||||||
if (rtl)
|
|
||||||
title = '%s%s'.format(title, ELLIPSIS_CHAR);
|
|
||||||
else
|
|
||||||
title = '%s%s'.format(ELLIPSIS_CHAR, title);
|
|
||||||
}
|
|
||||||
if (this._event.end > periodEnd && !this._event.allDay) {
|
|
||||||
if (rtl)
|
|
||||||
title = '%s%s'.format(ELLIPSIS_CHAR, title);
|
|
||||||
else
|
|
||||||
title = '%s%s'.format(title, ELLIPSIS_CHAR);
|
|
||||||
}
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var NotificationMessage = GObject.registerClass(
|
var NotificationMessage = GObject.registerClass(
|
||||||
class NotificationMessage extends MessageList.Message {
|
class NotificationMessage extends MessageList.Message {
|
||||||
_init(notification) {
|
_init(notification) {
|
||||||
@ -817,148 +784,6 @@ class NotificationMessage extends MessageList.Message {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var EventsSection = GObject.registerClass(
|
|
||||||
class EventsSection extends MessageList.MessageListSection {
|
|
||||||
_init() {
|
|
||||||
super._init();
|
|
||||||
|
|
||||||
this._desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
|
|
||||||
this._desktopSettings.connect('changed', this._reloadEvents.bind(this));
|
|
||||||
this._eventSource = new EmptyEventSource();
|
|
||||||
|
|
||||||
this._messageById = new Map();
|
|
||||||
|
|
||||||
this._title = new St.Button({ style_class: 'events-section-title',
|
|
||||||
label: '',
|
|
||||||
can_focus: true });
|
|
||||||
this._title.child.x_align = Clutter.ActorAlign.START;
|
|
||||||
this.insert_child_below(this._title, null);
|
|
||||||
|
|
||||||
this._title.connect('clicked', this._onTitleClicked.bind(this));
|
|
||||||
this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
|
|
||||||
|
|
||||||
this._appSys = Shell.AppSystem.get_default();
|
|
||||||
this._appSys.connect('installed-changed',
|
|
||||||
this._appInstalledChanged.bind(this));
|
|
||||||
this._appInstalledChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
setEventSource(eventSource) {
|
|
||||||
if (!(eventSource instanceof EventSourceBase))
|
|
||||||
throw new Error('Event source is not valid type');
|
|
||||||
|
|
||||||
this._eventSource = eventSource;
|
|
||||||
this._eventSource.connect('changed', this._reloadEvents.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
get allowed() {
|
|
||||||
return Main.sessionMode.showCalendarEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
_updateTitle() {
|
|
||||||
this._title.visible = !isToday(this._date);
|
|
||||||
|
|
||||||
if (!this._title.visible)
|
|
||||||
return;
|
|
||||||
|
|
||||||
let dayFormat;
|
|
||||||
let now = new Date();
|
|
||||||
if (sameYear(this._date, now)) {
|
|
||||||
/* Translators: Shown on calendar heading when selected day occurs on current year */
|
|
||||||
dayFormat = Shell.util_translate_time_string(NC_("calendar heading", "%A, %B %-d"));
|
|
||||||
} else {
|
|
||||||
/* Translators: Shown on calendar heading when selected day occurs on different year */
|
|
||||||
dayFormat = Shell.util_translate_time_string(NC_("calendar heading", "%A, %B %-d, %Y"));
|
|
||||||
}
|
|
||||||
this._title.label = this._date.toLocaleFormat(dayFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
_reloadEvents() {
|
|
||||||
if (this._eventSource.isLoading)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this._reloading = true;
|
|
||||||
|
|
||||||
let periodBegin = _getBeginningOfDay(this._date);
|
|
||||||
let periodEnd = _getEndOfDay(this._date);
|
|
||||||
let events = this._eventSource.getEvents(periodBegin, periodEnd);
|
|
||||||
|
|
||||||
let ids = events.map(e => e.id);
|
|
||||||
this._messageById.forEach((message, id) => {
|
|
||||||
if (ids.includes(id))
|
|
||||||
return;
|
|
||||||
this._messageById.delete(id);
|
|
||||||
this.removeMessage(message);
|
|
||||||
});
|
|
||||||
|
|
||||||
for (let i = 0; i < events.length; i++) {
|
|
||||||
let event = events[i];
|
|
||||||
|
|
||||||
let message = this._messageById.get(event.id);
|
|
||||||
if (!message) {
|
|
||||||
message = new EventMessage(event, this._date);
|
|
||||||
this._messageById.set(event.id, message);
|
|
||||||
this.addMessage(message, false);
|
|
||||||
} else {
|
|
||||||
this.moveMessage(message, i, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this._reloading = false;
|
|
||||||
this._sync();
|
|
||||||
}
|
|
||||||
|
|
||||||
_appInstalledChanged() {
|
|
||||||
this._calendarApp = undefined;
|
|
||||||
this._title.reactive = this._getCalendarApp() != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
_getCalendarApp() {
|
|
||||||
if (this._calendarApp !== undefined)
|
|
||||||
return this._calendarApp;
|
|
||||||
|
|
||||||
let apps = Gio.AppInfo.get_recommended_for_type('text/calendar');
|
|
||||||
if (apps && (apps.length > 0)) {
|
|
||||||
let app = Gio.AppInfo.get_default_for_type('text/calendar', false);
|
|
||||||
let defaultInRecommended = apps.some(a => a.equal(app));
|
|
||||||
this._calendarApp = defaultInRecommended ? app : apps[0];
|
|
||||||
} else {
|
|
||||||
this._calendarApp = null;
|
|
||||||
}
|
|
||||||
return this._calendarApp;
|
|
||||||
}
|
|
||||||
|
|
||||||
_onTitleClicked() {
|
|
||||||
Main.overview.hide();
|
|
||||||
Main.panel.closeCalendar();
|
|
||||||
|
|
||||||
let appInfo = this._getCalendarApp();
|
|
||||||
if (appInfo.get_id() === 'org.gnome.Evolution.desktop') {
|
|
||||||
let app = this._appSys.lookup_app('evolution-calendar.desktop');
|
|
||||||
if (app)
|
|
||||||
appInfo = app.app_info;
|
|
||||||
}
|
|
||||||
appInfo.launch([], global.create_app_launch_context(0, -1));
|
|
||||||
}
|
|
||||||
|
|
||||||
setDate(date) {
|
|
||||||
super.setDate(date);
|
|
||||||
this._updateTitle();
|
|
||||||
this._reloadEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
_shouldShow() {
|
|
||||||
return !this.empty || !isToday(this._date);
|
|
||||||
}
|
|
||||||
|
|
||||||
_sync() {
|
|
||||||
if (this._reloading)
|
|
||||||
return;
|
|
||||||
|
|
||||||
super._sync();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var TimeLabel = GObject.registerClass(
|
var TimeLabel = GObject.registerClass(
|
||||||
class NotificationTimeLabel extends St.Label {
|
class NotificationTimeLabel extends St.Label {
|
||||||
_init(datetime) {
|
_init(datetime) {
|
||||||
@ -1055,10 +880,6 @@ class NotificationSection extends MessageList.MessageListSection {
|
|||||||
});
|
});
|
||||||
super.vfunc_map();
|
super.vfunc_map();
|
||||||
}
|
}
|
||||||
|
|
||||||
_shouldShow() {
|
|
||||||
return !this.empty && isToday(this._date);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var Placeholder = GObject.registerClass(
|
var Placeholder = GObject.registerClass(
|
||||||
@ -1067,41 +888,13 @@ class Placeholder extends St.BoxLayout {
|
|||||||
super._init({ style_class: 'message-list-placeholder', vertical: true });
|
super._init({ style_class: 'message-list-placeholder', vertical: true });
|
||||||
this._date = new Date();
|
this._date = new Date();
|
||||||
|
|
||||||
let todayFile = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/no-notifications.svg');
|
const file = Gio.File.new_for_uri(
|
||||||
let otherFile = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/no-events.svg');
|
'resource:///org/gnome/shell/theme/no-notifications.svg');
|
||||||
this._todayIcon = new Gio.FileIcon({ file: todayFile });
|
this._icon = new St.Icon({ gicon: new Gio.FileIcon({ file }) });
|
||||||
this._otherIcon = new Gio.FileIcon({ file: otherFile });
|
|
||||||
|
|
||||||
this._icon = new St.Icon();
|
|
||||||
this.add_actor(this._icon);
|
this.add_actor(this._icon);
|
||||||
|
|
||||||
this._label = new St.Label();
|
this._label = new St.Label({ text: _('No Notifications') });
|
||||||
this.add_actor(this._label);
|
this.add_actor(this._label);
|
||||||
|
|
||||||
this._sync();
|
|
||||||
}
|
|
||||||
|
|
||||||
setDate(date) {
|
|
||||||
if (sameDay(this._date, date))
|
|
||||||
return;
|
|
||||||
this._date = date;
|
|
||||||
this._sync();
|
|
||||||
}
|
|
||||||
|
|
||||||
_sync() {
|
|
||||||
let today = isToday(this._date);
|
|
||||||
if (today && this._icon.gicon == this._todayIcon)
|
|
||||||
return;
|
|
||||||
if (!today && this._icon.gicon == this._otherIcon)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (today) {
|
|
||||||
this._icon.gicon = this._todayIcon;
|
|
||||||
this._label.text = _("No Notifications");
|
|
||||||
} else {
|
|
||||||
this._icon.gicon = this._otherIcon;
|
|
||||||
this._label.text = _("No Events");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1166,8 +959,8 @@ class CalendarMessageList extends St.Widget {
|
|||||||
child: this._dndSwitch,
|
child: this._dndSwitch,
|
||||||
label_actor: dndLabel,
|
label_actor: dndLabel,
|
||||||
});
|
});
|
||||||
this._dndButton.bind_property('checked',
|
this._dndSwitch.bind_property('state',
|
||||||
this._dndSwitch, 'state',
|
this._dndButton, 'checked',
|
||||||
GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE);
|
GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE);
|
||||||
hbox.add_child(this._dndButton);
|
hbox.add_child(this._dndButton);
|
||||||
|
|
||||||
@ -1202,9 +995,6 @@ class CalendarMessageList extends St.Widget {
|
|||||||
this._notificationSection = new NotificationSection();
|
this._notificationSection = new NotificationSection();
|
||||||
this._addSection(this._notificationSection);
|
this._addSection(this._notificationSection);
|
||||||
|
|
||||||
this._eventsSection = new EventsSection();
|
|
||||||
this._addSection(this._eventsSection);
|
|
||||||
|
|
||||||
Main.sessionMode.connect('updated', this._sync.bind(this));
|
Main.sessionMode.connect('updated', this._sync.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1240,13 +1030,4 @@ class CalendarMessageList extends St.Widget {
|
|||||||
let canClear = sections.some(s => s.canClear && s.visible);
|
let canClear = sections.some(s => s.canClear && s.visible);
|
||||||
this._clearButton.reactive = canClear;
|
this._clearButton.reactive = canClear;
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventSource(eventSource) {
|
|
||||||
this._eventsSection.setEventSource(eventSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
setDate(date) {
|
|
||||||
this._sectionList.get_children().forEach(s => s.setDate(date));
|
|
||||||
this._placeholder.setDate(date);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
@ -13,17 +13,13 @@ var ComponentManager = class {
|
|||||||
_sessionUpdated() {
|
_sessionUpdated() {
|
||||||
let newEnabledComponents = Main.sessionMode.components;
|
let newEnabledComponents = Main.sessionMode.components;
|
||||||
|
|
||||||
newEnabledComponents.filter(
|
newEnabledComponents
|
||||||
name => !this._enabledComponents.includes(name)
|
.filter(name => !this._enabledComponents.includes(name))
|
||||||
).forEach(name => {
|
.forEach(name => this._enableComponent(name));
|
||||||
this._enableComponent(name);
|
|
||||||
});
|
|
||||||
|
|
||||||
this._enabledComponents.filter(
|
this._enabledComponents
|
||||||
name => !newEnabledComponents.includes(name)
|
.filter(name => !newEnabledComponents.includes(name))
|
||||||
).forEach(name => {
|
.forEach(name => this._disableComponent(name));
|
||||||
this._disableComponent(name);
|
|
||||||
});
|
|
||||||
|
|
||||||
this._enabledComponents = newEnabledComponents;
|
this._enabledComponents = newEnabledComponents;
|
||||||
}
|
}
|
||||||
|
@ -125,8 +125,7 @@ var ContentTypeDiscoverer = class {
|
|||||||
_emitCallback(mount, contentTypes = []) {
|
_emitCallback(mount, contentTypes = []) {
|
||||||
// we're not interested in win32 software content types here
|
// we're not interested in win32 software content types here
|
||||||
contentTypes = contentTypes.filter(
|
contentTypes = contentTypes.filter(
|
||||||
type => type != 'x-content/win32-software'
|
type => type !== 'x-content/win32-software');
|
||||||
);
|
|
||||||
|
|
||||||
let apps = [];
|
let apps = [];
|
||||||
contentTypes.forEach(type => {
|
contentTypes.forEach(type => {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
/* exported Component */
|
/* exported Component */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
|
||||||
|
const ByteArray = imports.byteArray;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
@ -10,6 +11,7 @@ const MessageTray = imports.ui.messageTray;
|
|||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
const ShellEntry = imports.ui.shellEntry;
|
const ShellEntry = imports.ui.shellEntry;
|
||||||
|
|
||||||
|
Gio._promisify(Shell.NetworkAgent.prototype, 'init_async', 'init_finish');
|
||||||
Gio._promisify(Shell.NetworkAgent.prototype,
|
Gio._promisify(Shell.NetworkAgent.prototype,
|
||||||
'search_vpn_plugin', 'search_vpn_plugin_finish');
|
'search_vpn_plugin', 'search_vpn_plugin_finish');
|
||||||
|
|
||||||
@ -482,39 +484,37 @@ var VPNRequestHandler = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_readStdoutOldStyle() {
|
async _readStdoutOldStyle() {
|
||||||
this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null, (stream, result) => {
|
const [line, len_] =
|
||||||
let [line, len_] = this._dataStdout.read_line_finish_utf8(result);
|
await this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
|
|
||||||
if (line == null) {
|
if (line === null) {
|
||||||
// end of file
|
// end of file
|
||||||
this._stdout.close(null);
|
this._stdout.close(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._vpnChildProcessLineOldStyle(line);
|
this._vpnChildProcessLineOldStyle(ByteArray.toString(line));
|
||||||
|
|
||||||
// try to read more!
|
// try to read more!
|
||||||
this._readStdoutOldStyle();
|
this._readStdoutOldStyle();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_readStdoutNewStyle() {
|
async _readStdoutNewStyle() {
|
||||||
this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null, (stream, result) => {
|
const cnt =
|
||||||
let cnt = this._dataStdout.fill_finish(result);
|
await this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null);
|
||||||
|
|
||||||
if (cnt == 0) {
|
if (cnt === 0) {
|
||||||
// end of file
|
// end of file
|
||||||
this._showNewStyleDialog();
|
this._showNewStyleDialog();
|
||||||
|
|
||||||
this._stdout.close(null);
|
this._stdout.close(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to read more
|
// Try to read more
|
||||||
this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size());
|
this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size());
|
||||||
this._readStdoutNewStyle();
|
this._readStdoutNewStyle();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_showNewStyleDialog() {
|
_showNewStyleDialog() {
|
||||||
@ -523,13 +523,7 @@ var VPNRequestHandler = class {
|
|||||||
let contentOverride;
|
let contentOverride;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data = this._dataStdout.peek_buffer();
|
data = ByteArray.toGBytes(this._dataStdout.peek_buffer());
|
||||||
|
|
||||||
if (data instanceof Uint8Array)
|
|
||||||
data = imports.byteArray.toGBytes(data);
|
|
||||||
else
|
|
||||||
data = data.toGBytes();
|
|
||||||
|
|
||||||
keyfile.load_from_bytes(data, GLib.KeyFileFlags.NONE);
|
keyfile.load_from_bytes(data, GLib.KeyFileFlags.NONE);
|
||||||
|
|
||||||
if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)
|
if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)
|
||||||
@ -621,15 +615,17 @@ var NetworkAgent = class {
|
|||||||
this._native.connect('cancel-request', this._cancelRequest.bind(this));
|
this._native.connect('cancel-request', this._cancelRequest.bind(this));
|
||||||
|
|
||||||
this._initialized = false;
|
this._initialized = false;
|
||||||
this._native.init_async(GLib.PRIORITY_DEFAULT, null, (o, res) => {
|
this._initNative();
|
||||||
try {
|
}
|
||||||
this._native.init_finish(res);
|
|
||||||
this._initialized = true;
|
async _initNative() {
|
||||||
} catch (e) {
|
try {
|
||||||
this._native = null;
|
await this._native.init_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
logError(e, 'error initializing the NetworkManager Agent');
|
this._initialized = true;
|
||||||
}
|
} catch (e) {
|
||||||
});
|
this._native = null;
|
||||||
|
logError(e, 'error initializing the NetworkManager Agent');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
|
@ -44,7 +44,7 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
let bodyContent = new Dialog.MessageDialogContent();
|
let bodyContent = new Dialog.MessageDialogContent();
|
||||||
|
|
||||||
if (userNames.length > 1) {
|
if (userNames.length > 1) {
|
||||||
log('polkitAuthenticationAgent: Received %d'.format(userNames.length) +
|
log('polkitAuthenticationAgent: Received %d '.format(userNames.length) +
|
||||||
'identities that can be used for authentication. Only ' +
|
'identities that can be used for authentication. Only ' +
|
||||||
'considering one.');
|
'considering one.');
|
||||||
}
|
}
|
||||||
@ -327,12 +327,16 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let resetDialog = () => {
|
let resetDialog = () => {
|
||||||
|
this._sessionRequestTimeoutId = 0;
|
||||||
|
|
||||||
if (this.state != ModalDialog.State.OPENED)
|
if (this.state != ModalDialog.State.OPENED)
|
||||||
return;
|
return GLib.SOURCE_REMOVE;
|
||||||
|
|
||||||
this._passwordEntry.hide();
|
this._passwordEntry.hide();
|
||||||
this._cancelButton.grab_key_focus();
|
this._cancelButton.grab_key_focus();
|
||||||
this._okButton.reactive = false;
|
this._okButton.reactive = false;
|
||||||
|
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (delay) {
|
if (delay) {
|
||||||
|
@ -7,6 +7,14 @@ var Tpl = null;
|
|||||||
var Tp = null;
|
var Tp = null;
|
||||||
try {
|
try {
|
||||||
({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
|
({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
|
||||||
|
|
||||||
|
Gio._promisify(Tp.Channel.prototype, 'close_async', 'close_finish');
|
||||||
|
Gio._promisify(Tp.Channel.prototype,
|
||||||
|
'send_message_async', 'send_message_finish');
|
||||||
|
Gio._promisify(Tp.ChannelDispatchOperation.prototype,
|
||||||
|
'claim_with_async', 'claim_with_finish');
|
||||||
|
Gio._promisify(Tpl.LogManager.prototype,
|
||||||
|
'get_filtered_events_async', 'get_filtered_events_finish');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Telepathy is not available, chat integration will be disabled.');
|
log('Telepathy is not available, chat integration will be disabled.');
|
||||||
}
|
}
|
||||||
@ -163,7 +171,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
this.add_approver_filter(filter);
|
this.add_approver_filter(filter);
|
||||||
this.add_handler_filter(filter);
|
this.add_handler_filter(filter);
|
||||||
|
|
||||||
// Allow other clients (such as Empathy) to pre-empt our channels if
|
// Allow other clients (such as Empathy) to preempt our channels if
|
||||||
// needed
|
// needed
|
||||||
this.set_delegated_channels_callback(
|
this.set_delegated_channels_callback(
|
||||||
this._delegatedChannelsCb.bind(this));
|
this._delegatedChannelsCb.bind(this));
|
||||||
@ -215,7 +223,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
|
|
||||||
// We can only handle text channel, so close any other channel
|
// We can only handle text channel, so close any other channel
|
||||||
if (!(channel instanceof Tp.TextChannel)) {
|
if (!(channel instanceof Tp.TextChannel)) {
|
||||||
channel.close_async(null);
|
channel.close_async();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +269,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_approveTextChannel(account, conn, channel, dispatchOp, context) {
|
async _approveTextChannel(account, conn, channel, dispatchOp, context) {
|
||||||
let [targetHandle_, targetHandleType] = channel.get_handle();
|
let [targetHandle_, targetHandleType] = channel.get_handle();
|
||||||
|
|
||||||
if (targetHandleType != Tp.HandleType.CONTACT) {
|
if (targetHandleType != Tp.HandleType.CONTACT) {
|
||||||
@ -270,17 +278,15 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Approve private text channels right away as we are going to handle it
|
|
||||||
dispatchOp.claim_with_async(this, (o, result) => {
|
|
||||||
try {
|
|
||||||
dispatchOp.claim_with_finish(result);
|
|
||||||
this._handlingChannels(account, conn, [channel], false);
|
|
||||||
} catch (err) {
|
|
||||||
log('Failed to Claim channel: %s'.format(err.toString()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
context.accept();
|
context.accept();
|
||||||
|
|
||||||
|
// Approve private text channels right away as we are going to handle it
|
||||||
|
try {
|
||||||
|
await dispatchOp.claim_with_async(this);
|
||||||
|
this._handlingChannels(account, conn, [channel], false);
|
||||||
|
} catch (err) {
|
||||||
|
log('Failed to Claim channel: %s'.format(err.toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_delegatedChannelsCb(_client, _channels) {
|
_delegatedChannelsCb(_client, _channels) {
|
||||||
@ -441,17 +447,14 @@ class ChatSource extends MessageTray.Source {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_getLogMessages() {
|
async _getLogMessages() {
|
||||||
let logManager = Tpl.LogManager.dup_singleton();
|
let logManager = Tpl.LogManager.dup_singleton();
|
||||||
let entity = Tpl.Entity.new_from_tp_contact(this._contact, Tpl.EntityType.CONTACT);
|
let entity = Tpl.Entity.new_from_tp_contact(this._contact, Tpl.EntityType.CONTACT);
|
||||||
|
|
||||||
logManager.get_filtered_events_async(this._account, entity,
|
const [events] = await logManager.get_filtered_events_async(
|
||||||
Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES,
|
this._account, entity,
|
||||||
null, this._displayPendingMessages.bind(this));
|
Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES,
|
||||||
}
|
null);
|
||||||
|
|
||||||
_displayPendingMessages(logManager, result) {
|
|
||||||
let [success_, events] = logManager.get_filtered_events_finish(result);
|
|
||||||
|
|
||||||
let logMessages = events.map(e => ChatMessage.newFromTplTextEvent(e));
|
let logMessages = events.map(e => ChatMessage.newFromTplTextEvent(e));
|
||||||
this._ensureNotification();
|
this._ensureNotification();
|
||||||
@ -509,9 +512,7 @@ class ChatSource extends MessageTray.Source {
|
|||||||
this._ackMessages();
|
this._ackMessages();
|
||||||
// The chat box has been destroyed so it can't
|
// The chat box has been destroyed so it can't
|
||||||
// handle the channel any more.
|
// handle the channel any more.
|
||||||
this._channel.close_async((channel, result) => {
|
this._channel.close_async();
|
||||||
channel.close_finish(result);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// Don't indicate any unread messages when the notification
|
// Don't indicate any unread messages when the notification
|
||||||
// that represents them has been destroyed.
|
// that represents them has been destroyed.
|
||||||
@ -609,9 +610,7 @@ class ChatSource extends MessageTray.Source {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let msg = Tp.ClientMessage.new_text(type, text);
|
let msg = Tp.ClientMessage.new_text(type, text);
|
||||||
this._channel.send_message_async(msg, 0, (src, result) => {
|
this._channel.send_message_async(msg, 0);
|
||||||
this._channel.send_message_finish(result);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setChatState(state) {
|
setChatState(state) {
|
||||||
|
@ -292,11 +292,11 @@ class DashActor extends St.Widget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box) {
|
||||||
let contentBox = this.get_theme_node().get_content_box(box);
|
let contentBox = this.get_theme_node().get_content_box(box);
|
||||||
let availWidth = contentBox.x2 - contentBox.x1;
|
let availWidth = contentBox.x2 - contentBox.x1;
|
||||||
|
|
||||||
this.set_allocation(box, flags);
|
this.set_allocation(box);
|
||||||
|
|
||||||
let [appIcons, showAppsButton] = this.get_children();
|
let [appIcons, showAppsButton] = this.get_children();
|
||||||
let [, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth);
|
let [, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth);
|
||||||
@ -306,11 +306,11 @@ class DashActor extends St.Widget {
|
|||||||
childBox.y1 = contentBox.y1;
|
childBox.y1 = contentBox.y1;
|
||||||
childBox.x2 = contentBox.x2;
|
childBox.x2 = contentBox.x2;
|
||||||
childBox.y2 = contentBox.y2 - showAppsNatHeight;
|
childBox.y2 = contentBox.y2 - showAppsNatHeight;
|
||||||
appIcons.allocate(childBox, flags);
|
appIcons.allocate(childBox);
|
||||||
|
|
||||||
childBox.y1 = contentBox.y2 - showAppsNatHeight;
|
childBox.y1 = contentBox.y2 - showAppsNatHeight;
|
||||||
childBox.y2 = contentBox.y2;
|
childBox.y2 = contentBox.y2;
|
||||||
showAppsButton.allocate(childBox, flags);
|
showAppsButton.allocate(childBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_get_preferred_height(forWidth) {
|
vfunc_get_preferred_height(forWidth) {
|
||||||
@ -815,7 +815,12 @@ var Dash = GObject.registerClass({
|
|||||||
else
|
else
|
||||||
pos = 0; // always insert at the top when dash is empty
|
pos = 0; // always insert at the top when dash is empty
|
||||||
|
|
||||||
if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) {
|
// Put the placeholder after the last favorite if we are not
|
||||||
|
// in the favorites zone
|
||||||
|
if (pos > numFavorites)
|
||||||
|
pos = numFavorites;
|
||||||
|
|
||||||
|
if (pos !== this._dragPlaceholderPos && this._animatingPlaceholdersCount === 0) {
|
||||||
this._dragPlaceholderPos = pos;
|
this._dragPlaceholderPos = pos;
|
||||||
|
|
||||||
// Don't allow positioning before or after self
|
// Don't allow positioning before or after self
|
||||||
@ -843,11 +848,6 @@ var Dash = GObject.registerClass({
|
|||||||
this._dragPlaceholder.show(fadeIn);
|
this._dragPlaceholder.show(fadeIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the drag placeholder if we are not in the
|
|
||||||
// "favorites zone"
|
|
||||||
if (pos > numFavorites)
|
|
||||||
this._clearDragPlaceholder();
|
|
||||||
|
|
||||||
if (!this._dragPlaceholder)
|
if (!this._dragPlaceholder)
|
||||||
return DND.DragMotionResult.NO_DROP;
|
return DND.DragMotionResult.NO_DROP;
|
||||||
|
|
||||||
|
@ -13,7 +13,11 @@ const System = imports.system;
|
|||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
|
const NC_ = (context, str) => '%s\u0004%s'.format(context, str);
|
||||||
|
const T_ = Shell.util_translate_time_string;
|
||||||
|
|
||||||
const MAX_FORECASTS = 5;
|
const MAX_FORECASTS = 5;
|
||||||
|
const ELLIPSIS_CHAR = '\u2026';
|
||||||
|
|
||||||
const ClocksIntegrationIface = loadInterfaceXML('org.gnome.Shell.ClocksIntegration');
|
const ClocksIntegrationIface = loadInterfaceXML('org.gnome.Shell.ClocksIntegration');
|
||||||
const ClocksProxy = Gio.DBusProxy.makeProxyWrapper(ClocksIntegrationIface);
|
const ClocksProxy = Gio.DBusProxy.makeProxyWrapper(ClocksIntegrationIface);
|
||||||
@ -84,6 +88,188 @@ class TodayButton extends St.Button {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var EventsSection = GObject.registerClass(
|
||||||
|
class EventsSection extends St.Button {
|
||||||
|
_init() {
|
||||||
|
super._init({
|
||||||
|
style_class: 'events-button',
|
||||||
|
can_focus: true,
|
||||||
|
x_expand: true,
|
||||||
|
child: new St.BoxLayout({
|
||||||
|
style_class: 'events-box',
|
||||||
|
vertical: true,
|
||||||
|
x_expand: true,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
this._startDate = null;
|
||||||
|
this._endDate = null;
|
||||||
|
|
||||||
|
this._eventSource = null;
|
||||||
|
this._calendarApp = null;
|
||||||
|
|
||||||
|
this._title = new St.Label({
|
||||||
|
style_class: 'events-title',
|
||||||
|
});
|
||||||
|
this.child.add_child(this._title);
|
||||||
|
|
||||||
|
this._eventsList = new St.BoxLayout({
|
||||||
|
style_class: 'events-list',
|
||||||
|
vertical: true,
|
||||||
|
x_expand: true,
|
||||||
|
});
|
||||||
|
this.child.add_child(this._eventsList);
|
||||||
|
|
||||||
|
this._appSys = Shell.AppSystem.get_default();
|
||||||
|
this._appSys.connect('installed-changed',
|
||||||
|
this._appInstalledChanged.bind(this));
|
||||||
|
this._appInstalledChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
setDate(date) {
|
||||||
|
const day = [date.getFullYear(), date.getMonth(), date.getDate()];
|
||||||
|
this._startDate = new Date(...day);
|
||||||
|
this._endDate = new Date(...day, 23, 59, 59, 999);
|
||||||
|
|
||||||
|
this._updateTitle();
|
||||||
|
this._reloadEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
setEventSource(eventSource) {
|
||||||
|
if (!(eventSource instanceof Calendar.EventSourceBase))
|
||||||
|
throw new Error('Event source is not valid type');
|
||||||
|
|
||||||
|
this._eventSource = eventSource;
|
||||||
|
this._eventSource.connect('changed', this._reloadEvents.bind(this));
|
||||||
|
this._eventSource.connect('notify::has-calendars',
|
||||||
|
this._sync.bind(this));
|
||||||
|
this._sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
_updateTitle() {
|
||||||
|
/* Translators: Shown on calendar heading when selected day occurs on current year */
|
||||||
|
const sameYearFormat = T_(NC_('calendar heading', '%B %-d'));
|
||||||
|
|
||||||
|
/* Translators: Shown on calendar heading when selected day occurs on different year */
|
||||||
|
const otherYearFormat = T_(NC_('calendar heading', '%B %-d %Y'));
|
||||||
|
|
||||||
|
const timeSpanDay = GLib.TIME_SPAN_DAY / 1000;
|
||||||
|
const now = new Date();
|
||||||
|
|
||||||
|
if (this._startDate <= now && now <= this._endDate)
|
||||||
|
this._title.text = _('Today');
|
||||||
|
else if (this._endDate < now && now - this._endDate < timeSpanDay)
|
||||||
|
this._title.text = _('Yesterday');
|
||||||
|
else if (this._startDate > now && this._startDate - now < timeSpanDay)
|
||||||
|
this._title.text = _('Tomorrow');
|
||||||
|
else if (this._startDate.getFullYear() === now.getFullYear())
|
||||||
|
this._title.text = this._startDate.toLocaleFormat(sameYearFormat);
|
||||||
|
else
|
||||||
|
this._title.text = this._startDate.toLocaleFormat(otherYearFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
_formatEventTime(event) {
|
||||||
|
const allDay = event.allDay ||
|
||||||
|
(event.date <= this._startDate && event.end >= this._endDate);
|
||||||
|
|
||||||
|
let title;
|
||||||
|
if (allDay) {
|
||||||
|
/* Translators: Shown in calendar event list for all day events
|
||||||
|
* Keep it short, best if you can use less then 10 characters
|
||||||
|
*/
|
||||||
|
title = C_('event list time', 'All Day');
|
||||||
|
} else {
|
||||||
|
let date = event.date >= this._startDate ? event.date : event.end;
|
||||||
|
title = Util.formatTime(date, { timeOnly: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
const rtl = Clutter.get_default_text_direction() === Clutter.TextDirection.RTL;
|
||||||
|
if (event.date < this._startDate && !event.allDay) {
|
||||||
|
if (rtl)
|
||||||
|
title = '%s%s'.format(title, ELLIPSIS_CHAR);
|
||||||
|
else
|
||||||
|
title = '%s%s'.format(ELLIPSIS_CHAR, title);
|
||||||
|
}
|
||||||
|
if (event.end > this._endDate && !event.allDay) {
|
||||||
|
if (rtl)
|
||||||
|
title = '%s%s'.format(ELLIPSIS_CHAR, title);
|
||||||
|
else
|
||||||
|
title = '%s%s'.format(title, ELLIPSIS_CHAR);
|
||||||
|
}
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
_reloadEvents() {
|
||||||
|
if (this._eventSource.isLoading || this._reloading)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._reloading = true;
|
||||||
|
|
||||||
|
[...this._eventsList].forEach(c => c.destroy());
|
||||||
|
|
||||||
|
const events =
|
||||||
|
this._eventSource.getEvents(this._startDate, this._endDate);
|
||||||
|
|
||||||
|
for (let event of events) {
|
||||||
|
const box = new St.BoxLayout({
|
||||||
|
style_class: 'event-box',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
|
box.add(new St.Label({
|
||||||
|
text: event.summary,
|
||||||
|
style_class: 'event-summary',
|
||||||
|
}));
|
||||||
|
box.add(new St.Label({
|
||||||
|
text: this._formatEventTime(event),
|
||||||
|
style_class: 'event-time',
|
||||||
|
}));
|
||||||
|
this._eventsList.add_child(box);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._eventsList.get_n_children() === 0) {
|
||||||
|
const placeholder = new St.Label({
|
||||||
|
text: _('No Events'),
|
||||||
|
style_class: 'event-placeholder',
|
||||||
|
});
|
||||||
|
this._eventsList.add_child(placeholder);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._reloading = false;
|
||||||
|
this._sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_clicked() {
|
||||||
|
Main.overview.hide();
|
||||||
|
Main.panel.closeCalendar();
|
||||||
|
|
||||||
|
let appInfo = this._calendarApp;
|
||||||
|
if (appInfo.get_id() === 'org.gnome.Evolution.desktop') {
|
||||||
|
const app = this._appSys.lookup_app('evolution-calendar.desktop');
|
||||||
|
if (app)
|
||||||
|
appInfo = app.app_info;
|
||||||
|
}
|
||||||
|
appInfo.launch([], global.create_app_launch_context(0, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
_appInstalledChanged() {
|
||||||
|
const apps = Gio.AppInfo.get_recommended_for_type('text/calendar');
|
||||||
|
if (apps && (apps.length > 0)) {
|
||||||
|
const app = Gio.AppInfo.get_default_for_type('text/calendar', false);
|
||||||
|
const defaultInRecommended = apps.some(a => a.equal(app));
|
||||||
|
this._calendarApp = defaultInRecommended ? app : apps[0];
|
||||||
|
} else {
|
||||||
|
this._calendarApp = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
_sync() {
|
||||||
|
this.visible = this._eventSource && this._eventSource.hasCalendars;
|
||||||
|
this.reactive = this._calendarApp !== null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var WorldClocksSection = GObject.registerClass(
|
var WorldClocksSection = GObject.registerClass(
|
||||||
class WorldClocksSection extends St.Button {
|
class WorldClocksSection extends St.Button {
|
||||||
_init() {
|
_init() {
|
||||||
@ -94,6 +280,7 @@ class WorldClocksSection extends St.Button {
|
|||||||
});
|
});
|
||||||
this._clock = new GnomeDesktop.WallClock();
|
this._clock = new GnomeDesktop.WallClock();
|
||||||
this._clockNotifyId = 0;
|
this._clockNotifyId = 0;
|
||||||
|
this._tzNotifyId = 0;
|
||||||
|
|
||||||
this._locations = [];
|
this._locations = [];
|
||||||
|
|
||||||
@ -166,8 +353,6 @@ class WorldClocksSection extends St.Button {
|
|||||||
layout.attach(header, 0, 0, 2, 1);
|
layout.attach(header, 0, 0, 2, 1);
|
||||||
this.label_actor = header;
|
this.label_actor = header;
|
||||||
|
|
||||||
let localOffset = GLib.DateTime.new_now_local().get_utc_offset();
|
|
||||||
|
|
||||||
for (let i = 0; i < this._locations.length; i++) {
|
for (let i = 0; i < this._locations.length; i++) {
|
||||||
let l = this._locations[i].location;
|
let l = this._locations[i].location;
|
||||||
|
|
||||||
@ -180,21 +365,8 @@ class WorldClocksSection extends St.Button {
|
|||||||
|
|
||||||
let time = new St.Label({ style_class: 'world-clocks-time' });
|
let time = new St.Label({ style_class: 'world-clocks-time' });
|
||||||
|
|
||||||
const utcOffset = this._getTimeAtLocation(l).get_utc_offset();
|
|
||||||
const offsetCurrentTz = utcOffset - localOffset;
|
|
||||||
const offsetHours = Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR;
|
|
||||||
const offsetMinutes =
|
|
||||||
(Math.abs(offsetCurrentTz) % GLib.TIME_SPAN_HOUR) /
|
|
||||||
GLib.TIME_SPAN_MINUTE;
|
|
||||||
|
|
||||||
const prefix = offsetCurrentTz >= 0 ? '+' : '-';
|
|
||||||
const text = offsetMinutes === 0
|
|
||||||
? '%s%d'.format(prefix, offsetHours)
|
|
||||||
: '%s%d\u2236%d'.format(prefix, offsetHours, offsetMinutes);
|
|
||||||
|
|
||||||
const tz = new St.Label({
|
const tz = new St.Label({
|
||||||
style_class: 'world-clocks-timezone',
|
style_class: 'world-clocks-timezone',
|
||||||
text,
|
|
||||||
x_align: Clutter.ActorAlign.END,
|
x_align: Clutter.ActorAlign.END,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
});
|
});
|
||||||
@ -212,32 +384,65 @@ class WorldClocksSection extends St.Button {
|
|||||||
layout.attach(tz, 2, i + 1, 1, 1);
|
layout.attach(tz, 2, i + 1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._locations[i].actor = time;
|
this._locations[i].timeLabel = time;
|
||||||
|
this._locations[i].tzLabel = tz;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._grid.get_n_children() > 1) {
|
if (this._grid.get_n_children() > 1) {
|
||||||
if (!this._clockNotifyId) {
|
if (!this._clockNotifyId) {
|
||||||
this._clockNotifyId =
|
this._clockNotifyId =
|
||||||
this._clock.connect('notify::clock', this._updateLabels.bind(this));
|
this._clock.connect('notify::clock', this._updateTimeLabels.bind(this));
|
||||||
}
|
}
|
||||||
this._updateLabels();
|
if (!this._tzNotifyId) {
|
||||||
|
this._tzNotifyId =
|
||||||
|
this._clock.connect('notify::timezone', this._updateTimezoneLabels.bind(this));
|
||||||
|
}
|
||||||
|
this._updateTimeLabels();
|
||||||
|
this._updateTimezoneLabels();
|
||||||
} else {
|
} else {
|
||||||
if (this._clockNotifyId)
|
if (this._clockNotifyId)
|
||||||
this._clock.disconnect(this._clockNotifyId);
|
this._clock.disconnect(this._clockNotifyId);
|
||||||
this._clockNotifyId = 0;
|
this._clockNotifyId = 0;
|
||||||
|
|
||||||
|
if (this._tzNotifyId)
|
||||||
|
this._clock.disconnect(this._tzNotifyId);
|
||||||
|
this._tzNotifyId = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getTimezoneOffsetAtLocation(location) {
|
||||||
|
const localOffset = GLib.DateTime.new_now_local().get_utc_offset();
|
||||||
|
const utcOffset = this._getTimeAtLocation(location).get_utc_offset();
|
||||||
|
const offsetCurrentTz = utcOffset - localOffset;
|
||||||
|
const offsetHours = Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR;
|
||||||
|
const offsetMinutes =
|
||||||
|
(Math.abs(offsetCurrentTz) % GLib.TIME_SPAN_HOUR) /
|
||||||
|
GLib.TIME_SPAN_MINUTE;
|
||||||
|
|
||||||
|
const prefix = offsetCurrentTz >= 0 ? '+' : '-';
|
||||||
|
const text = offsetMinutes === 0
|
||||||
|
? '%s%d'.format(prefix, offsetHours)
|
||||||
|
: '%s%d\u2236%d'.format(prefix, offsetHours, offsetMinutes);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
_getTimeAtLocation(location) {
|
_getTimeAtLocation(location) {
|
||||||
let tz = GLib.TimeZone.new(location.get_timezone().get_tzid());
|
let tz = GLib.TimeZone.new(location.get_timezone().get_tzid());
|
||||||
return GLib.DateTime.new_now(tz);
|
return GLib.DateTime.new_now(tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateLabels() {
|
_updateTimeLabels() {
|
||||||
for (let i = 0; i < this._locations.length; i++) {
|
for (let i = 0; i < this._locations.length; i++) {
|
||||||
let l = this._locations[i];
|
let l = this._locations[i];
|
||||||
let now = this._getTimeAtLocation(l.location);
|
let now = this._getTimeAtLocation(l.location);
|
||||||
l.actor.text = Util.formatTime(now, { timeOnly: true });
|
l.timeLabel.text = Util.formatTime(now, { timeOnly: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_updateTimezoneLabels() {
|
||||||
|
for (let i = 0; i < this._locations.length; i++) {
|
||||||
|
let l = this._locations[i];
|
||||||
|
l.tzLabel.text = this._getTimezoneOffsetAtLocation(l.location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,13 +486,13 @@ class WeatherSection extends St.Button {
|
|||||||
this.child = box;
|
this.child = box;
|
||||||
|
|
||||||
let titleBox = new St.BoxLayout({ style_class: 'weather-header-box' });
|
let titleBox = new St.BoxLayout({ style_class: 'weather-header-box' });
|
||||||
titleBox.add_child(new St.Label({
|
this._titleLabel = new St.Label({
|
||||||
style_class: 'weather-header',
|
style_class: 'weather-header',
|
||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_align: Clutter.ActorAlign.END,
|
y_align: Clutter.ActorAlign.END,
|
||||||
text: _('Weather'),
|
});
|
||||||
}));
|
titleBox.add_child(this._titleLabel);
|
||||||
box.add_child(titleBox);
|
box.add_child(titleBox);
|
||||||
|
|
||||||
this._titleLocation = new St.Label({
|
this._titleLocation = new St.Label({
|
||||||
@ -414,10 +619,8 @@ class WeatherSection extends St.Button {
|
|||||||
_updateForecasts() {
|
_updateForecasts() {
|
||||||
this._forecastGrid.destroy_all_children();
|
this._forecastGrid.destroy_all_children();
|
||||||
|
|
||||||
if (!this._weatherClient.hasLocation) {
|
if (!this._weatherClient.hasLocation)
|
||||||
this._setStatusLabel(_("Select a location…"));
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const { info } = this._weatherClient;
|
const { info } = this._weatherClient;
|
||||||
this._titleLocation.text = this._findBestLocationName(info.location);
|
this._titleLocation.text = this._findBestLocationName(info.location);
|
||||||
@ -444,6 +647,12 @@ class WeatherSection extends St.Button {
|
|||||||
if (!this.visible)
|
if (!this.visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (this._weatherClient.hasLocation)
|
||||||
|
this._titleLabel.text = _('Weather');
|
||||||
|
else
|
||||||
|
this._titleLabel.text = _('Select weather location…');
|
||||||
|
|
||||||
|
this._forecastGrid.visible = this._weatherClient.hasLocation;
|
||||||
this._titleLocation.visible = this._weatherClient.hasLocation;
|
this._titleLocation.visible = this._weatherClient.hasLocation;
|
||||||
|
|
||||||
this._updateForecasts();
|
this._updateForecasts();
|
||||||
@ -462,7 +671,6 @@ class MessagesIndicator extends St.Icon {
|
|||||||
|
|
||||||
this._sources = [];
|
this._sources = [];
|
||||||
this._count = 0;
|
this._count = 0;
|
||||||
this._doNotDisturb = false;
|
|
||||||
|
|
||||||
this._settings = new Gio.Settings({
|
this._settings = new Gio.Settings({
|
||||||
schema_id: 'org.gnome.desktop.notifications',
|
schema_id: 'org.gnome.desktop.notifications',
|
||||||
@ -543,8 +751,8 @@ class FreezableBinLayout extends Clutter.BinLayout {
|
|||||||
return this._savedHeight;
|
return this._savedHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(container, allocation, flags) {
|
vfunc_allocate(container, allocation) {
|
||||||
super.vfunc_allocate(container, allocation, flags);
|
super.vfunc_allocate(container, allocation);
|
||||||
|
|
||||||
let [width, height] = allocation.get_size();
|
let [width, height] = allocation.get_size();
|
||||||
this._savedWidth = [width, width];
|
this._savedWidth = [width, width];
|
||||||
@ -576,6 +784,7 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
|
|
||||||
this._clockDisplay = new St.Label({ style_class: 'clock' });
|
this._clockDisplay = new St.Label({ style_class: 'clock' });
|
||||||
this._clockDisplay.clutter_text.y_align = Clutter.ActorAlign.CENTER;
|
this._clockDisplay.clutter_text.y_align = Clutter.ActorAlign.CENTER;
|
||||||
|
this._clockDisplay.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
|
||||||
this._indicator = new MessagesIndicator();
|
this._indicator = new MessagesIndicator();
|
||||||
|
|
||||||
@ -610,7 +819,7 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
this._calendar.connect('selected-date-changed', (_calendar, datetime) => {
|
this._calendar.connect('selected-date-changed', (_calendar, datetime) => {
|
||||||
let date = _gDateTimeToDate(datetime);
|
let date = _gDateTimeToDate(datetime);
|
||||||
layout.frozen = !_isToday(date);
|
layout.frozen = !_isToday(date);
|
||||||
this._messageList.setDate(date);
|
this._eventsItem.setDate(date);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.menu.connect('open-state-changed', (menu, isOpen) => {
|
this.menu.connect('open-state-changed', (menu, isOpen) => {
|
||||||
@ -619,7 +828,7 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
let now = new Date();
|
let now = new Date();
|
||||||
this._calendar.setDate(now);
|
this._calendar.setDate(now);
|
||||||
this._date.setDate(now);
|
this._date.setDate(now);
|
||||||
this._messageList.setDate(now);
|
this._eventsItem.setDate(now);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -650,6 +859,9 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
style_class: 'datemenu-displays-box' });
|
style_class: 'datemenu-displays-box' });
|
||||||
this._displaysSection.add_actor(displaysBox);
|
this._displaysSection.add_actor(displaysBox);
|
||||||
|
|
||||||
|
this._eventsItem = new EventsSection();
|
||||||
|
displaysBox.add_child(this._eventsItem);
|
||||||
|
|
||||||
this._clocksItem = new WorldClocksSection();
|
this._clocksItem = new WorldClocksSection();
|
||||||
displaysBox.add_child(this._clocksItem);
|
displaysBox.add_child(this._clocksItem);
|
||||||
|
|
||||||
@ -675,7 +887,7 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
this._eventSource.destroy();
|
this._eventSource.destroy();
|
||||||
|
|
||||||
this._calendar.setEventSource(eventSource);
|
this._calendar.setEventSource(eventSource);
|
||||||
this._messageList.setEventSource(eventSource);
|
this._eventsItem.setEventSource(eventSource);
|
||||||
|
|
||||||
this._eventSource = eventSource;
|
this._eventSource = eventSource;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported Dialog, MessageDialogContent, ListSection, ListSectionItem */
|
/* exported Dialog, MessageDialogContent, ListSection, ListSectionItem */
|
||||||
|
|
||||||
const { Clutter, GObject, Meta, Pango, St } = imports.gi;
|
const { Clutter, GLib, GObject, Meta, Pango, St } = imports.gi;
|
||||||
|
|
||||||
function _setLabel(label, value) {
|
function _setLabel(label, value) {
|
||||||
label.set({
|
label.set({
|
||||||
@ -220,23 +220,29 @@ var MessageDialogContent = GObject.registerClass({
|
|||||||
|
|
||||||
this._updateTitleStyleLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
this._updateTitleStyleLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
||||||
this._updateTitleStyleLater = 0;
|
this._updateTitleStyleLater = 0;
|
||||||
this._title.add_style_class_name('leightweight');
|
this._title.add_style_class_name('lightweight');
|
||||||
return false;
|
return GLib.SOURCE_REMOVE;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set title(title) {
|
set title(title) {
|
||||||
|
if (this._title.text === title)
|
||||||
|
return;
|
||||||
|
|
||||||
_setLabel(this._title, title);
|
_setLabel(this._title, title);
|
||||||
|
|
||||||
this._title.remove_style_class_name('leightweight');
|
this._title.remove_style_class_name('lightweight');
|
||||||
this._updateTitleStyle();
|
this._updateTitleStyle();
|
||||||
|
|
||||||
this.notify('title');
|
this.notify('title');
|
||||||
}
|
}
|
||||||
|
|
||||||
set description(description) {
|
set description(description) {
|
||||||
|
if (this._description.text === description)
|
||||||
|
return;
|
||||||
|
|
||||||
_setLabel(this._description, description);
|
_setLabel(this._description, description);
|
||||||
this.notify('description');
|
this.notify('description');
|
||||||
}
|
}
|
||||||
|
43
js/ui/dnd.js
43
js/ui/dnd.js
@ -375,19 +375,29 @@ var _Draggable = class _Draggable {
|
|||||||
|
|
||||||
this._dragActorSource = undefined;
|
this._dragActorSource = undefined;
|
||||||
this._dragOrigParent = this.actor.get_parent();
|
this._dragOrigParent = this.actor.get_parent();
|
||||||
this._dragOrigX = this._dragActor.x;
|
this._dragActorHadFixedPos = this._dragActor.fixed_position_set;
|
||||||
this._dragOrigY = this._dragActor.y;
|
this._dragOrigX = this._dragActor.allocation.x1;
|
||||||
|
this._dragOrigY = this._dragActor.allocation.y1;
|
||||||
|
this._dragOrigWidth = this._dragActor.allocation.get_width();
|
||||||
|
this._dragOrigHeight = this._dragActor.allocation.get_height();
|
||||||
this._dragOrigScale = this._dragActor.scale_x;
|
this._dragOrigScale = this._dragActor.scale_x;
|
||||||
|
|
||||||
|
// When the actor gets reparented to the uiGroup, it will be
|
||||||
|
// allocated its preferred size, so use that size instead of the
|
||||||
|
// current allocation size.
|
||||||
|
const [, newAllocatedWidth] = this._dragActor.get_preferred_width(-1);
|
||||||
|
const [, newAllocatedHeight] = this._dragActor.get_preferred_height(-1);
|
||||||
|
|
||||||
|
const transformedExtents = this._dragActor.get_transformed_extents();
|
||||||
|
|
||||||
// Set the actor's scale such that it will keep the same
|
// Set the actor's scale such that it will keep the same
|
||||||
// transformed size when it's reparented to the uiGroup
|
// transformed size when it's reparented to the uiGroup
|
||||||
let [scaledWidth, scaledHeight] = this.actor.get_transformed_size();
|
this._dragActor.set_scale(
|
||||||
this._dragActor.set_scale(scaledWidth / this.actor.width,
|
transformedExtents.get_width() / newAllocatedWidth,
|
||||||
scaledHeight / this.actor.height);
|
transformedExtents.get_height() / newAllocatedHeight);
|
||||||
|
|
||||||
let [actorStageX, actorStageY] = this.actor.get_transformed_position();
|
this._dragOffsetX = transformedExtents.origin.x - this._dragStartX;
|
||||||
this._dragOffsetX = actorStageX - this._dragStartX;
|
this._dragOffsetY = transformedExtents.origin.y - this._dragStartY;
|
||||||
this._dragOffsetY = actorStageY - this._dragStartY;
|
|
||||||
|
|
||||||
this._dragOrigParent.remove_actor(this._dragActor);
|
this._dragOrigParent.remove_actor(this._dragActor);
|
||||||
Main.uiGroup.add_child(this._dragActor);
|
Main.uiGroup.add_child(this._dragActor);
|
||||||
@ -417,6 +427,10 @@ var _Draggable = class _Draggable {
|
|||||||
this._dragOffsetX -= transX;
|
this._dragOffsetX -= transX;
|
||||||
this._dragOffsetY -= transY;
|
this._dragOffsetY -= transY;
|
||||||
|
|
||||||
|
this._dragActor.set_position(
|
||||||
|
this._dragX + this._dragOffsetX,
|
||||||
|
this._dragY + this._dragOffsetY);
|
||||||
|
|
||||||
if (this._dragActorMaxSize != undefined) {
|
if (this._dragActorMaxSize != undefined) {
|
||||||
let [scaledWidth, scaledHeight] = this._dragActor.get_transformed_size();
|
let [scaledWidth, scaledHeight] = this._dragActor.get_transformed_size();
|
||||||
let currentSize = Math.max(scaledWidth, scaledHeight);
|
let currentSize = Math.max(scaledWidth, scaledHeight);
|
||||||
@ -635,9 +649,15 @@ var _Draggable = class _Draggable {
|
|||||||
if (parentWidth != 0)
|
if (parentWidth != 0)
|
||||||
parentScale = parentScaledWidth / parentWidth;
|
parentScale = parentScaledWidth / parentWidth;
|
||||||
|
|
||||||
|
// Also adjust for the difference in the original actor width
|
||||||
|
// and the width it is now (children of uiGroup always get
|
||||||
|
// allocated their preferred size)
|
||||||
|
const childScaleX =
|
||||||
|
this._dragOrigWidth / this._dragActor.allocation.get_width();
|
||||||
|
|
||||||
x = parentX + parentScale * this._dragOrigX;
|
x = parentX + parentScale * this._dragOrigX;
|
||||||
y = parentY + parentScale * this._dragOrigY;
|
y = parentY + parentScale * this._dragOrigY;
|
||||||
scale = this._dragOrigScale * parentScale;
|
scale = this._dragOrigScale * parentScale * childScaleX;
|
||||||
} else {
|
} else {
|
||||||
// Snap back actor to its original stage position
|
// Snap back actor to its original stage position
|
||||||
x = this._snapBackX;
|
x = this._snapBackX;
|
||||||
@ -718,7 +738,10 @@ var _Draggable = class _Draggable {
|
|||||||
Main.uiGroup.remove_child(this._dragActor);
|
Main.uiGroup.remove_child(this._dragActor);
|
||||||
this._dragOrigParent.add_actor(this._dragActor);
|
this._dragOrigParent.add_actor(this._dragActor);
|
||||||
dragActor.set_scale(this._dragOrigScale, this._dragOrigScale);
|
dragActor.set_scale(this._dragOrigScale, this._dragOrigScale);
|
||||||
dragActor.set_position(this._dragOrigX, this._dragOrigY);
|
if (this._dragActorHadFixedPos)
|
||||||
|
dragActor.set_position(this._dragOrigX, this._dragOrigY);
|
||||||
|
else
|
||||||
|
dragActor.fixed_position_set = false;
|
||||||
} else {
|
} else {
|
||||||
dragActor.destroy();
|
dragActor.destroy();
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { AccountsService, Clutter, Gio,
|
const { AccountsService, Clutter, Gio,
|
||||||
GLib, GObject, Pango, Polkit, Shell, St } = imports.gi;
|
GLib, GObject, Pango, Polkit, Shell, St, UPowerGlib: UPower } = imports.gi;
|
||||||
|
|
||||||
const CheckBox = imports.ui.checkBox;
|
const CheckBox = imports.ui.checkBox;
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
@ -29,28 +29,32 @@ const UserWidget = imports.ui.userWidget;
|
|||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
|
||||||
|
|
||||||
const _ITEM_ICON_SIZE = 64;
|
const _ITEM_ICON_SIZE = 64;
|
||||||
|
|
||||||
|
const LOW_BATTERY_THRESHOLD = 30;
|
||||||
|
|
||||||
const EndSessionDialogIface = loadInterfaceXML('org.gnome.SessionManager.EndSessionDialog');
|
const EndSessionDialogIface = loadInterfaceXML('org.gnome.SessionManager.EndSessionDialog');
|
||||||
|
|
||||||
const logoutDialogContent = {
|
const logoutDialogContent = {
|
||||||
subjectWithUser: C_("title", "Log Out %s"),
|
subjectWithUser: C_("title", "Log Out %s"),
|
||||||
subject: C_("title", "Log Out"),
|
subject: C_("title", "Log Out"),
|
||||||
descriptionWithUser(user, seconds) {
|
descriptionWithUser(user, seconds) {
|
||||||
return ngettext("%s will be logged out automatically in %d second.",
|
return ngettext(
|
||||||
"%s will be logged out automatically in %d seconds.",
|
'%s will be logged out automatically in %d second.',
|
||||||
seconds).format(user, seconds);
|
'%s will be logged out automatically in %d seconds.',
|
||||||
|
seconds).format(user, seconds);
|
||||||
},
|
},
|
||||||
description(seconds) {
|
description(seconds) {
|
||||||
return ngettext("You will be logged out automatically in %d second.",
|
return ngettext(
|
||||||
"You will be logged out automatically in %d seconds.",
|
'You will be logged out automatically in %d second.',
|
||||||
seconds).format(seconds);
|
'You will be logged out automatically in %d seconds.',
|
||||||
|
seconds).format(seconds);
|
||||||
},
|
},
|
||||||
showBatteryWarning: false,
|
showBatteryWarning: false,
|
||||||
confirmButtons: [{ signal: 'ConfirmedLogout',
|
confirmButtons: [{
|
||||||
label: C_("button", "Log Out") }],
|
signal: 'ConfirmedLogout',
|
||||||
|
label: C_('button', 'Log Out'),
|
||||||
|
}],
|
||||||
showOtherSessions: false,
|
showOtherSessions: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,30 +62,36 @@ const shutdownDialogContent = {
|
|||||||
subject: C_("title", "Power Off"),
|
subject: C_("title", "Power Off"),
|
||||||
subjectWithUpdates: C_("title", "Install Updates & Power Off"),
|
subjectWithUpdates: C_("title", "Install Updates & Power Off"),
|
||||||
description(seconds) {
|
description(seconds) {
|
||||||
return ngettext("The system will power off automatically in %d second.",
|
return ngettext(
|
||||||
"The system will power off automatically in %d seconds.",
|
'The system will power off automatically in %d second.',
|
||||||
seconds).format(seconds);
|
'The system will power off automatically in %d seconds.',
|
||||||
|
seconds).format(seconds);
|
||||||
},
|
},
|
||||||
checkBoxText: C_("checkbox", "Install pending software updates"),
|
checkBoxText: C_("checkbox", "Install pending software updates"),
|
||||||
showBatteryWarning: true,
|
showBatteryWarning: true,
|
||||||
confirmButtons: [{ signal: 'ConfirmedReboot',
|
confirmButtons: [{
|
||||||
label: C_("button", "Restart") },
|
signal: 'ConfirmedShutdown',
|
||||||
{ signal: 'ConfirmedShutdown',
|
label: C_('button', 'Power Off'),
|
||||||
label: C_("button", "Power Off") }],
|
}],
|
||||||
iconName: 'system-shutdown-symbolic',
|
iconName: 'system-shutdown-symbolic',
|
||||||
showOtherSessions: true,
|
showOtherSessions: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const restartDialogContent = {
|
const restartDialogContent = {
|
||||||
subject: C_("title", "Restart"),
|
subject: C_("title", "Restart"),
|
||||||
|
subjectWithUpdates: C_('title', 'Install Updates & Restart'),
|
||||||
description(seconds) {
|
description(seconds) {
|
||||||
return ngettext("The system will restart automatically in %d second.",
|
return ngettext(
|
||||||
"The system will restart automatically in %d seconds.",
|
'The system will restart automatically in %d second.',
|
||||||
seconds).format(seconds);
|
'The system will restart automatically in %d seconds.',
|
||||||
|
seconds).format(seconds);
|
||||||
},
|
},
|
||||||
showBatteryWarning: false,
|
checkBoxText: C_('checkbox', 'Install pending software updates'),
|
||||||
confirmButtons: [{ signal: 'ConfirmedReboot',
|
showBatteryWarning: true,
|
||||||
label: C_("button", "Restart") }],
|
confirmButtons: [{
|
||||||
|
signal: 'ConfirmedReboot',
|
||||||
|
label: C_('button', 'Restart'),
|
||||||
|
}],
|
||||||
iconName: 'view-refresh-symbolic',
|
iconName: 'view-refresh-symbolic',
|
||||||
showOtherSessions: true,
|
showOtherSessions: true,
|
||||||
};
|
};
|
||||||
@ -90,13 +100,16 @@ const restartUpdateDialogContent = {
|
|||||||
|
|
||||||
subject: C_("title", "Restart & Install Updates"),
|
subject: C_("title", "Restart & Install Updates"),
|
||||||
description(seconds) {
|
description(seconds) {
|
||||||
return ngettext("The system will automatically restart and install updates in %d second.",
|
return ngettext(
|
||||||
"The system will automatically restart and install updates in %d seconds.",
|
'The system will automatically restart and install updates in %d second.',
|
||||||
seconds).format(seconds);
|
'The system will automatically restart and install updates in %d seconds.',
|
||||||
|
seconds).format(seconds);
|
||||||
},
|
},
|
||||||
showBatteryWarning: true,
|
showBatteryWarning: true,
|
||||||
confirmButtons: [{ signal: 'ConfirmedReboot',
|
confirmButtons: [{
|
||||||
label: C_("button", "Restart & Install") }],
|
signal: 'ConfirmedReboot',
|
||||||
|
label: C_('button', 'Restart & Install'),
|
||||||
|
}],
|
||||||
unusedFutureButtonForTranslation: C_("button", "Install & Power Off"),
|
unusedFutureButtonForTranslation: C_("button", "Install & Power Off"),
|
||||||
unusedFutureCheckBoxForTranslation: C_("checkbox", "Power off after updates are installed"),
|
unusedFutureCheckBoxForTranslation: C_("checkbox", "Power off after updates are installed"),
|
||||||
iconName: 'view-refresh-symbolic',
|
iconName: 'view-refresh-symbolic',
|
||||||
@ -114,8 +127,10 @@ const restartUpgradeDialogContent = {
|
|||||||
},
|
},
|
||||||
disableTimer: true,
|
disableTimer: true,
|
||||||
showBatteryWarning: false,
|
showBatteryWarning: false,
|
||||||
confirmButtons: [{ signal: 'ConfirmedReboot',
|
confirmButtons: [{
|
||||||
label: C_("button", "Restart & Install") }],
|
signal: 'ConfirmedReboot',
|
||||||
|
label: C_('button', 'Restart & Install'),
|
||||||
|
}],
|
||||||
iconName: 'view-refresh-symbolic',
|
iconName: 'view-refresh-symbolic',
|
||||||
showOtherSessions: true,
|
showOtherSessions: true,
|
||||||
};
|
};
|
||||||
@ -144,7 +159,7 @@ const LogindSession = Gio.DBusProxy.makeProxyWrapper(LogindSessionIface);
|
|||||||
const PkOfflineIface = loadInterfaceXML('org.freedesktop.PackageKit.Offline');
|
const PkOfflineIface = loadInterfaceXML('org.freedesktop.PackageKit.Offline');
|
||||||
const PkOfflineProxy = Gio.DBusProxy.makeProxyWrapper(PkOfflineIface);
|
const PkOfflineProxy = Gio.DBusProxy.makeProxyWrapper(PkOfflineIface);
|
||||||
|
|
||||||
const UPowerIface = loadInterfaceXML('org.freedesktop.UPower');
|
const UPowerIface = loadInterfaceXML('org.freedesktop.UPower.Device');
|
||||||
const UPowerProxy = Gio.DBusProxy.makeProxyWrapper(UPowerIface);
|
const UPowerProxy = Gio.DBusProxy.makeProxyWrapper(UPowerIface);
|
||||||
|
|
||||||
function findAppFromInhibitor(inhibitor) {
|
function findAppFromInhibitor(inhibitor) {
|
||||||
@ -215,6 +230,11 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
destroyOnClose: false });
|
destroyOnClose: false });
|
||||||
|
|
||||||
this._loginManager = LoginManager.getLoginManager();
|
this._loginManager = LoginManager.getLoginManager();
|
||||||
|
this._loginManager.canRebootToBootLoaderMenu(
|
||||||
|
(canRebootToBootLoaderMenu, unusedNeedsAuth) => {
|
||||||
|
this._canRebootToBootLoaderMenu = canRebootToBootLoaderMenu;
|
||||||
|
});
|
||||||
|
|
||||||
this._userManager = AccountsService.UserManager.get_default();
|
this._userManager = AccountsService.UserManager.get_default();
|
||||||
this._user = this._userManager.get_user(GLib.get_user_name());
|
this._user = this._userManager.get_user(GLib.get_user_name());
|
||||||
this._updatesPermission = null;
|
this._updatesPermission = null;
|
||||||
@ -226,7 +246,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
this._powerProxy = new UPowerProxy(Gio.DBus.system,
|
this._powerProxy = new UPowerProxy(Gio.DBus.system,
|
||||||
'org.freedesktop.UPower',
|
'org.freedesktop.UPower',
|
||||||
'/org/freedesktop/UPower',
|
'/org/freedesktop/UPower/devices/DisplayDevice',
|
||||||
(proxy, error) => {
|
(proxy, error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
log(error.message);
|
log(error.message);
|
||||||
@ -241,6 +261,9 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
this._totalSecondsToStayOpen = 0;
|
this._totalSecondsToStayOpen = 0;
|
||||||
this._applications = [];
|
this._applications = [];
|
||||||
this._sessions = [];
|
this._sessions = [];
|
||||||
|
this._capturedEventId = 0;
|
||||||
|
this._rebootButton = null;
|
||||||
|
this._rebootButtonAlt = null;
|
||||||
|
|
||||||
this.connect('destroy',
|
this.connect('destroy',
|
||||||
this._onDestroy.bind(this));
|
this._onDestroy.bind(this));
|
||||||
@ -258,7 +281,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
this._batteryWarning = new St.Label({
|
this._batteryWarning = new St.Label({
|
||||||
style_class: 'end-session-dialog-battery-warning',
|
style_class: 'end-session-dialog-battery-warning',
|
||||||
text: _('Running on battery power: Please plug in before installing updates.'),
|
text: _('Low battery power: please plug in before installing updates.'),
|
||||||
});
|
});
|
||||||
this._batteryWarning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._batteryWarning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._batteryWarning.clutter_text.line_wrap = true;
|
this._batteryWarning.clutter_text.line_wrap = true;
|
||||||
@ -280,7 +303,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
|
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPkOfflineProxyCreated(proxy, error) {
|
async _onPkOfflineProxyCreated(proxy, error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
log(error.message);
|
log(error.message);
|
||||||
return;
|
return;
|
||||||
@ -295,15 +318,12 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// It only makes sense to check for this permission if PackageKit is available.
|
// It only makes sense to check for this permission if PackageKit is available.
|
||||||
Polkit.Permission.new(
|
try {
|
||||||
'org.freedesktop.packagekit.trigger-offline-update', null, null,
|
this._updatesPermission = await Polkit.Permission.new(
|
||||||
(source, res) => {
|
'org.freedesktop.packagekit.trigger-offline-update', null, null);
|
||||||
try {
|
} catch (e) {
|
||||||
this._updatesPermission = Polkit.Permission.new_finish(res);
|
log('No permission to trigger offline updates: %s'.format(e.toString()));
|
||||||
} catch (e) {
|
}
|
||||||
log('No permission to trigger offline updates: %s'.format(e.toString()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
_onDestroy() {
|
||||||
@ -311,6 +331,32 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
this._user.disconnect(this._userChangedId);
|
this._user.disconnect(this._userChangedId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_isDischargingBattery() {
|
||||||
|
return this._powerProxy.IsPresent &&
|
||||||
|
this._powerProxy.State !== UPower.DeviceState.CHARGING &&
|
||||||
|
this._powerProxy.State !== UPower.DeviceState.FULLY_CHARGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isBatteryLow() {
|
||||||
|
return this._isDischargingBattery() && this._powerProxy.Percentage < LOW_BATTERY_THRESHOLD;
|
||||||
|
}
|
||||||
|
|
||||||
|
_shouldShowLowBatteryWarning(dialogContent) {
|
||||||
|
if (!dialogContent.showBatteryWarning)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!this._isBatteryLow())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (this._checkBox.checked)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Show the warning if updates have already been triggered, but
|
||||||
|
// the user doesn't have enough permissions to cancel them.
|
||||||
|
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
|
||||||
|
return this._updateInfo.UpdatePrepared && this._updateInfo.UpdateTriggered && !updatesAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
_sync() {
|
_sync() {
|
||||||
let open = this.state == ModalDialog.State.OPENING || this.state == ModalDialog.State.OPENED;
|
let open = this.state == ModalDialog.State.OPENING || this.state == ModalDialog.State.OPENED;
|
||||||
if (!open)
|
if (!open)
|
||||||
@ -324,10 +370,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
if (dialogContent.subjectWithUpdates && this._checkBox.checked)
|
if (dialogContent.subjectWithUpdates && this._checkBox.checked)
|
||||||
subject = dialogContent.subjectWithUpdates;
|
subject = dialogContent.subjectWithUpdates;
|
||||||
|
|
||||||
if (dialogContent.showBatteryWarning) {
|
this._batteryWarning.visible = this._shouldShowLowBatteryWarning(dialogContent);
|
||||||
this._batteryWarning.visible =
|
|
||||||
this._powerProxy.OnBattery && this._checkBox.checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
let description;
|
let description;
|
||||||
let displayTime = _roundSecondsToInterval(this._totalSecondsToStayOpen,
|
let displayTime = _roundSecondsToInterval(this._totalSecondsToStayOpen,
|
||||||
@ -368,16 +411,38 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
this._sessionSection.visible = hasSessions;
|
this._sessionSection.visible = hasSessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateButtons() {
|
_onCapturedEvent(actor, event) {
|
||||||
let dialogContent = DialogContent[this._type];
|
let altEnabled = false;
|
||||||
let buttons = [{ action: this.cancel.bind(this),
|
|
||||||
label: _("Cancel"),
|
|
||||||
key: Clutter.KEY_Escape }];
|
|
||||||
|
|
||||||
|
let type = event.type();
|
||||||
|
if (type !== Clutter.EventType.KEY_PRESS && type !== Clutter.EventType.KEY_RELEASE)
|
||||||
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
||||||
|
let key = event.get_key_symbol();
|
||||||
|
if (key !== Clutter.KEY_Alt_L && key !== Clutter.KEY_Alt_R)
|
||||||
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
||||||
|
if (type === Clutter.EventType.KEY_PRESS)
|
||||||
|
altEnabled = true;
|
||||||
|
|
||||||
|
this._rebootButton.visible = !altEnabled;
|
||||||
|
this._rebootButtonAlt.visible = altEnabled;
|
||||||
|
|
||||||
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
_updateButtons() {
|
||||||
|
this.clearButtons();
|
||||||
|
|
||||||
|
this.addButton({ action: this.cancel.bind(this),
|
||||||
|
label: _("Cancel"),
|
||||||
|
key: Clutter.KEY_Escape });
|
||||||
|
|
||||||
|
let dialogContent = DialogContent[this._type];
|
||||||
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
|
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
|
||||||
let signal = dialogContent.confirmButtons[i].signal;
|
let signal = dialogContent.confirmButtons[i].signal;
|
||||||
let label = dialogContent.confirmButtons[i].label;
|
let label = dialogContent.confirmButtons[i].label;
|
||||||
buttons.push({
|
let button = this.addButton({
|
||||||
action: () => {
|
action: () => {
|
||||||
this.close(true);
|
this.close(true);
|
||||||
let signalId = this.connect('closed', () => {
|
let signalId = this.connect('closed', () => {
|
||||||
@ -387,9 +452,34 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
},
|
},
|
||||||
label,
|
label,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
this.setButtons(buttons);
|
// Add Alt "Boot Options" option to the Reboot button
|
||||||
|
if (this._canRebootToBootLoaderMenu && signal === 'ConfirmedReboot') {
|
||||||
|
this._rebootButton = button;
|
||||||
|
this._rebootButtonAlt = this.addButton({
|
||||||
|
action: () => {
|
||||||
|
this.close(true);
|
||||||
|
let signalId = this.connect('closed', () => {
|
||||||
|
this.disconnect(signalId);
|
||||||
|
this._confirmRebootToBootLoaderMenu();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
label: C_('button', 'Boot Options'),
|
||||||
|
});
|
||||||
|
this._rebootButtonAlt.visible = false;
|
||||||
|
this._capturedEventId = global.stage.connect('captured-event',
|
||||||
|
this._onCapturedEvent.bind(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_stopAltCapture() {
|
||||||
|
if (this._capturedEventId > 0) {
|
||||||
|
global.stage.disconnect(this._capturedEventId);
|
||||||
|
this._capturedEventId = 0;
|
||||||
|
}
|
||||||
|
this._rebootButton = null;
|
||||||
|
this._rebootButtonAlt = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(skipSignal) {
|
close(skipSignal) {
|
||||||
@ -401,14 +491,21 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this._stopTimer();
|
this._stopTimer();
|
||||||
|
this._stopAltCapture();
|
||||||
this._dbusImpl.emit_signal('Canceled', null);
|
this._dbusImpl.emit_signal('Canceled', null);
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_confirmRebootToBootLoaderMenu() {
|
||||||
|
this._loginManager.setRebootToBootLoaderMenu();
|
||||||
|
this._confirm('ConfirmedReboot');
|
||||||
|
}
|
||||||
|
|
||||||
_confirm(signal) {
|
_confirm(signal) {
|
||||||
let callback = () => {
|
let callback = () => {
|
||||||
this._fadeOutDialog();
|
this._fadeOutDialog();
|
||||||
this._stopTimer();
|
this._stopTimer();
|
||||||
|
this._stopAltCapture();
|
||||||
this._dbusImpl.emit_signal(signal, null);
|
this._dbusImpl.emit_signal(signal, null);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -676,19 +773,17 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
if (dialogContent.showOtherSessions)
|
if (dialogContent.showOtherSessions)
|
||||||
this._loadSessions();
|
this._loadSessions();
|
||||||
|
|
||||||
let updateTriggered = this._updateInfo.UpdateTriggered;
|
|
||||||
let updatePrepared = this._updateInfo.UpdatePrepared;
|
|
||||||
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
|
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
|
||||||
|
|
||||||
_setCheckBoxLabel(this._checkBox, dialogContent.checkBoxText || '');
|
_setCheckBoxLabel(this._checkBox, dialogContent.checkBoxText || '');
|
||||||
this._checkBox.visible = dialogContent.checkBoxText && updatePrepared && updatesAllowed;
|
this._checkBox.visible = dialogContent.checkBoxText && this._updateInfo.UpdatePrepared && updatesAllowed;
|
||||||
this._checkBox.checked = this._checkBox.visible;
|
|
||||||
|
|
||||||
// We show the warning either together with the checkbox, or when
|
if (this._type === DialogType.UPGRADE_RESTART)
|
||||||
// updates have already been triggered, but the user doesn't have
|
this._checkBox.checked = this._checkBox.visible && this._updateInfo.UpdateTriggered && !this._isDischargingBattery();
|
||||||
// enough permissions to cancel them.
|
else
|
||||||
this._batteryWarning.visible = dialogContent.showBatteryWarning &&
|
this._checkBox.checked = this._checkBox.visible && !this._isBatteryLow();
|
||||||
(this._checkBox.visible || updatePrepared && updateTriggered && !updatesAllowed);
|
|
||||||
|
this._batteryWarning.visible = this._shouldShowLowBatteryWarning(dialogContent);
|
||||||
|
|
||||||
this._updateButtons();
|
this._updateButtons();
|
||||||
|
|
||||||
|
@ -10,10 +10,21 @@ imports.gi.versions.Gtk = '3.0';
|
|||||||
imports.gi.versions.TelepathyGLib = '0.12';
|
imports.gi.versions.TelepathyGLib = '0.12';
|
||||||
imports.gi.versions.TelepathyLogger = '0.2';
|
imports.gi.versions.TelepathyLogger = '0.2';
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Meta, Polkit, Shell, St } = imports.gi;
|
||||||
const Gettext = imports.gettext;
|
const Gettext = imports.gettext;
|
||||||
const System = imports.system;
|
const System = imports.system;
|
||||||
|
|
||||||
|
Gio._promisify(Gio.DataInputStream.prototype, 'fill_async', 'fill_finish');
|
||||||
|
Gio._promisify(Gio.DataInputStream.prototype,
|
||||||
|
'read_line_async', 'read_line_finish');
|
||||||
|
Gio._promisify(Gio.DBus, 'get', 'get_finish');
|
||||||
|
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
||||||
|
Gio._promisify(Gio.DBusProxy, 'new', 'new_finish');
|
||||||
|
Gio._promisify(Gio.DBusProxy.prototype, 'init_async', 'init_finish');
|
||||||
|
Gio._promisify(Gio.DBusProxy.prototype,
|
||||||
|
'call_with_unix_fd_list', 'call_with_unix_fd_list_finish');
|
||||||
|
Gio._promisify(Polkit.Permission, 'new', 'new_finish');
|
||||||
|
|
||||||
let _localTimeZone = null;
|
let _localTimeZone = null;
|
||||||
|
|
||||||
// We can't import shell JS modules yet, because they may have
|
// We can't import shell JS modules yet, because they may have
|
||||||
@ -123,7 +134,14 @@ function _easeActor(actor, params) {
|
|||||||
actor.set_easing_mode(params.mode);
|
actor.set_easing_mode(params.mode);
|
||||||
delete params.mode;
|
delete params.mode;
|
||||||
|
|
||||||
let cleanup = () => Meta.enable_unredirect_for_display(global.display);
|
const prepare = () => {
|
||||||
|
Meta.disable_unredirect_for_display(global.display);
|
||||||
|
global.begin_work();
|
||||||
|
};
|
||||||
|
const cleanup = () => {
|
||||||
|
Meta.enable_unredirect_for_display(global.display);
|
||||||
|
global.end_work();
|
||||||
|
};
|
||||||
let callback = _makeEaseCallback(params, cleanup);
|
let callback = _makeEaseCallback(params, cleanup);
|
||||||
|
|
||||||
// cancel overwritten transitions
|
// cancel overwritten transitions
|
||||||
@ -138,9 +156,9 @@ function _easeActor(actor, params) {
|
|||||||
.find(t => t !== null);
|
.find(t => t !== null);
|
||||||
|
|
||||||
if (transition && transition.delay)
|
if (transition && transition.delay)
|
||||||
transition.connect('started', () => Meta.disable_unredirect_for_display(global.display));
|
transition.connect('started', () => prepare());
|
||||||
else
|
else
|
||||||
Meta.disable_unredirect_for_display(global.display);
|
prepare();
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
transition.set({ repeatCount, autoReverse });
|
transition.set({ repeatCount, autoReverse });
|
||||||
@ -180,7 +198,14 @@ function _easeActorProperty(actor, propName, target, params) {
|
|||||||
if (actor instanceof Clutter.Actor && !actor.mapped)
|
if (actor instanceof Clutter.Actor && !actor.mapped)
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
|
||||||
let cleanup = () => Meta.enable_unredirect_for_display(global.display);
|
const prepare = () => {
|
||||||
|
Meta.disable_unredirect_for_display(global.display);
|
||||||
|
global.begin_work();
|
||||||
|
};
|
||||||
|
const cleanup = () => {
|
||||||
|
Meta.enable_unredirect_for_display(global.display);
|
||||||
|
global.end_work();
|
||||||
|
};
|
||||||
let callback = _makeEaseCallback(params, cleanup);
|
let callback = _makeEaseCallback(params, cleanup);
|
||||||
|
|
||||||
// cancel overwritten transition
|
// cancel overwritten transition
|
||||||
@ -192,7 +217,7 @@ function _easeActorProperty(actor, propName, target, params) {
|
|||||||
if (!isReversed)
|
if (!isReversed)
|
||||||
obj[prop] = target;
|
obj[prop] = target;
|
||||||
|
|
||||||
Meta.disable_unredirect_for_display(global.display);
|
prepare();
|
||||||
callback(true);
|
callback(true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -211,9 +236,9 @@ function _easeActorProperty(actor, propName, target, params) {
|
|||||||
transition.set_to(target);
|
transition.set_to(target);
|
||||||
|
|
||||||
if (transition.delay)
|
if (transition.delay)
|
||||||
transition.connect('started', () => Meta.disable_unredirect_for_display(global.display));
|
transition.connect('started', () => prepare());
|
||||||
else
|
else
|
||||||
Meta.disable_unredirect_for_display(global.display);
|
prepare();
|
||||||
|
|
||||||
transition.connect('stopped', (t, finished) => callback(finished));
|
transition.connect('stopped', (t, finished) => callback(finished));
|
||||||
}
|
}
|
||||||
@ -234,16 +259,15 @@ function _loggingFunc(...args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
// Add some bindings to the global JS namespace; (gjs keeps the web
|
// Add some bindings to the global JS namespace
|
||||||
// browser convention of having that namespace be called 'window'.)
|
globalThis.global = Shell.Global.get();
|
||||||
window.global = Shell.Global.get();
|
|
||||||
|
|
||||||
window.log = _loggingFunc;
|
globalThis.log = _loggingFunc;
|
||||||
|
|
||||||
window._ = Gettext.gettext;
|
globalThis._ = Gettext.gettext;
|
||||||
window.C_ = Gettext.pgettext;
|
globalThis.C_ = Gettext.pgettext;
|
||||||
window.ngettext = Gettext.ngettext;
|
globalThis.ngettext = Gettext.ngettext;
|
||||||
window.N_ = s => s;
|
globalThis.N_ = s => s;
|
||||||
|
|
||||||
GObject.gtypeNameBasedOnJSPath = true;
|
GObject.gtypeNameBasedOnJSPath = true;
|
||||||
|
|
||||||
@ -275,6 +299,11 @@ function init() {
|
|||||||
_easeActorProperty(this, 'value', target, params);
|
_easeActorProperty(this, 'value', target, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Clutter.Actor.prototype[Symbol.iterator] = function* () {
|
||||||
|
for (let c = this.get_first_child(); c; c = c.get_next_sibling())
|
||||||
|
yield c;
|
||||||
|
};
|
||||||
|
|
||||||
Clutter.Actor.prototype.toString = function () {
|
Clutter.Actor.prototype.toString = function () {
|
||||||
return St.describe_actor(this);
|
return St.describe_actor(this);
|
||||||
};
|
};
|
||||||
@ -345,10 +374,12 @@ function init() {
|
|||||||
|
|
||||||
// OK, now things are initialized enough that we can import shell JS
|
// OK, now things are initialized enough that we can import shell JS
|
||||||
const Format = imports.format;
|
const Format = imports.format;
|
||||||
const Tweener = imports.ui.tweener;
|
|
||||||
|
|
||||||
Tweener.init();
|
|
||||||
String.prototype.format = Format.format;
|
String.prototype.format = Format.format;
|
||||||
|
|
||||||
|
Math.clamp = function (x, lower, upper) {
|
||||||
|
return Math.min(Math.max(x, lower), upper);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// adjustAnimationTime:
|
// adjustAnimationTime:
|
||||||
|
@ -139,7 +139,9 @@ function checkForUpdates() {
|
|||||||
return;
|
return;
|
||||||
if (extension.hasUpdate)
|
if (extension.hasUpdate)
|
||||||
return;
|
return;
|
||||||
metadatas[uuid] = extension.metadata;
|
metadatas[uuid] = {
|
||||||
|
version: extension.metadata.version,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Object.keys(metadatas).length === 0)
|
if (Object.keys(metadatas).length === 0)
|
||||||
@ -238,7 +240,7 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
_httpSession = new Soup.SessionAsync({ ssl_use_system_ca_file: true });
|
_httpSession = new Soup.Session({ ssl_use_system_ca_file: true });
|
||||||
|
|
||||||
// See: https://bugzilla.gnome.org/show_bug.cgi?id=655189 for context.
|
// See: https://bugzilla.gnome.org/show_bug.cgi?id=655189 for context.
|
||||||
// _httpSession.add_feature(new Soup.ProxyResolverDefault());
|
// _httpSession.add_feature(new Soup.ProxyResolverDefault());
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
/* exported init connect disconnect */
|
/* exported init connect disconnect */
|
||||||
|
|
||||||
const { GLib, Gio, GObject, Shell, St } = imports.gi;
|
const { GLib, Gio, GObject, Shell, St } = imports.gi;
|
||||||
|
const ByteArray = imports.byteArray;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const ExtensionDownloader = imports.ui.extensionDownloader;
|
const ExtensionDownloader = imports.ui.extensionDownloader;
|
||||||
@ -26,6 +27,7 @@ var ExtensionManager = class {
|
|||||||
this._updateNotified = false;
|
this._updateNotified = false;
|
||||||
|
|
||||||
this._extensions = new Map();
|
this._extensions = new Map();
|
||||||
|
this._unloadedExtensions = new Map();
|
||||||
this._enabledExtensions = [];
|
this._enabledExtensions = [];
|
||||||
this._extensionOrder = [];
|
this._extensionOrder = [];
|
||||||
|
|
||||||
@ -102,18 +104,18 @@ var ExtensionManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extension.stylesheet) {
|
|
||||||
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
|
||||||
theme.unload_stylesheet(extension.stylesheet);
|
|
||||||
delete extension.stylesheet;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
extension.stateObj.disable();
|
extension.stateObj.disable();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logExtensionError(uuid, e);
|
this.logExtensionError(uuid, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (extension.stylesheet) {
|
||||||
|
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
||||||
|
theme.unload_stylesheet(extension.stylesheet);
|
||||||
|
delete extension.stylesheet;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < order.length; i++) {
|
for (let i = 0; i < order.length; i++) {
|
||||||
let otherUuid = order[i];
|
let otherUuid = order[i];
|
||||||
try {
|
try {
|
||||||
@ -215,6 +217,24 @@ var ExtensionManager = class {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openExtensionPrefs(uuid, parentWindow, options) {
|
||||||
|
const extension = this.lookup(uuid);
|
||||||
|
if (!extension || !extension.hasPrefs)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Gio.DBus.session.call(
|
||||||
|
'org.gnome.Shell.Extensions',
|
||||||
|
'/org/gnome/Shell/Extensions',
|
||||||
|
'org.gnome.Shell.Extensions',
|
||||||
|
'OpenExtensionPrefs',
|
||||||
|
new GLib.Variant('(ssa{sv})', [uuid, parentWindow, options]),
|
||||||
|
null,
|
||||||
|
Gio.DBusCallFlags.NONE,
|
||||||
|
-1,
|
||||||
|
null);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
notifyExtensionUpdate(uuid) {
|
notifyExtensionUpdate(uuid) {
|
||||||
let extension = this.lookup(uuid);
|
let extension = this.lookup(uuid);
|
||||||
if (!extension)
|
if (!extension)
|
||||||
@ -241,7 +261,8 @@ var ExtensionManager = class {
|
|||||||
if (!extension)
|
if (!extension)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let message = error.toString();
|
const message = error instanceof Error
|
||||||
|
? error.message : error.toString();
|
||||||
|
|
||||||
extension.error = message;
|
extension.error = message;
|
||||||
extension.state = ExtensionState.ERROR;
|
extension.state = ExtensionState.ERROR;
|
||||||
@ -250,6 +271,7 @@ var ExtensionManager = class {
|
|||||||
extension.errors.push(message);
|
extension.errors.push(message);
|
||||||
|
|
||||||
logError(error, 'Extension %s'.format(uuid));
|
logError(error, 'Extension %s'.format(uuid));
|
||||||
|
this._updateCanChange(extension);
|
||||||
this.emit('extension-state-changed', extension);
|
this.emit('extension-state-changed', extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,8 +283,7 @@ var ExtensionManager = class {
|
|||||||
let metadataContents, success_;
|
let metadataContents, success_;
|
||||||
try {
|
try {
|
||||||
[success_, metadataContents] = metadataFile.load_contents(null);
|
[success_, metadataContents] = metadataFile.load_contents(null);
|
||||||
if (metadataContents instanceof Uint8Array)
|
metadataContents = ByteArray.toString(metadataContents);
|
||||||
metadataContents = imports.byteArray.toString(metadataContents);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error('Failed to load metadata.json: %s'.format(e.toString()));
|
throw new Error('Failed to load metadata.json: %s'.format(e.toString()));
|
||||||
}
|
}
|
||||||
@ -299,6 +320,14 @@ var ExtensionManager = class {
|
|||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_canLoad(extension) {
|
||||||
|
if (!this._unloadedExtensions.has(extension.uuid))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
const version = this._unloadedExtensions.get(extension.uuid);
|
||||||
|
return extension.metadata.version === version;
|
||||||
|
}
|
||||||
|
|
||||||
loadExtension(extension) {
|
loadExtension(extension) {
|
||||||
// Default to error, we set success as the last step
|
// Default to error, we set success as the last step
|
||||||
extension.state = ExtensionState.ERROR;
|
extension.state = ExtensionState.ERROR;
|
||||||
@ -307,6 +336,9 @@ var ExtensionManager = class {
|
|||||||
|
|
||||||
if (checkVersion && ExtensionUtils.isOutOfDate(extension)) {
|
if (checkVersion && ExtensionUtils.isOutOfDate(extension)) {
|
||||||
extension.state = ExtensionState.OUT_OF_DATE;
|
extension.state = ExtensionState.OUT_OF_DATE;
|
||||||
|
} else if (!this._canLoad(extension)) {
|
||||||
|
this.logExtensionError(extension.uuid, new Error(
|
||||||
|
'A different version was loaded previously. You need to log out for changes to take effect.'));
|
||||||
} else {
|
} else {
|
||||||
let enabled = this._enabledExtensions.includes(extension.uuid);
|
let enabled = this._enabledExtensions.includes(extension.uuid);
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
@ -317,6 +349,8 @@ var ExtensionManager = class {
|
|||||||
} else {
|
} else {
|
||||||
extension.state = ExtensionState.INITIALIZED;
|
extension.state = ExtensionState.INITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._unloadedExtensions.delete(extension.uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._updateCanChange(extension);
|
this._updateCanChange(extension);
|
||||||
@ -324,15 +358,22 @@ var ExtensionManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unloadExtension(extension) {
|
unloadExtension(extension) {
|
||||||
|
const { uuid, type } = extension;
|
||||||
|
|
||||||
// Try to disable it -- if it's ERROR'd, we can't guarantee that,
|
// Try to disable it -- if it's ERROR'd, we can't guarantee that,
|
||||||
// but it will be removed on next reboot, and hopefully nothing
|
// but it will be removed on next reboot, and hopefully nothing
|
||||||
// broke too much.
|
// broke too much.
|
||||||
this._callExtensionDisable(extension.uuid);
|
this._callExtensionDisable(uuid);
|
||||||
|
|
||||||
extension.state = ExtensionState.UNINSTALLED;
|
extension.state = ExtensionState.UNINSTALLED;
|
||||||
this.emit('extension-state-changed', extension);
|
this.emit('extension-state-changed', extension);
|
||||||
|
|
||||||
this._extensions.delete(extension.uuid);
|
// If we did install an importer, it is now cached and it's
|
||||||
|
// impossible to load a different version
|
||||||
|
if (type === ExtensionType.PER_USER && extension.imports)
|
||||||
|
this._unloadedExtensions.set(uuid, extension.metadata.version);
|
||||||
|
|
||||||
|
this._extensions.delete(uuid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,19 +486,15 @@ var ExtensionManager = class {
|
|||||||
|
|
||||||
// Find and enable all the newly enabled extensions: UUIDs found in the
|
// Find and enable all the newly enabled extensions: UUIDs found in the
|
||||||
// new setting, but not in the old one.
|
// new setting, but not in the old one.
|
||||||
newEnabledExtensions.filter(
|
newEnabledExtensions
|
||||||
uuid => !this._enabledExtensions.includes(uuid)
|
.filter(uuid => !this._enabledExtensions.includes(uuid))
|
||||||
).forEach(uuid => {
|
.forEach(uuid => this._callExtensionEnable(uuid));
|
||||||
this._callExtensionEnable(uuid);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Find and disable all the newly disabled extensions: UUIDs found in the
|
// Find and disable all the newly disabled extensions: UUIDs found in the
|
||||||
// old setting, but not in the new one.
|
// old setting, but not in the new one.
|
||||||
this._extensionOrder.filter(
|
this._extensionOrder
|
||||||
uuid => !newEnabledExtensions.includes(uuid)
|
.filter(uuid => !newEnabledExtensions.includes(uuid))
|
||||||
).reverse().forEach(uuid => {
|
.reverse().forEach(uuid => this._callExtensionDisable(uuid));
|
||||||
this._callExtensionDisable(uuid);
|
|
||||||
});
|
|
||||||
|
|
||||||
this._enabledExtensions = newEnabledExtensions;
|
this._enabledExtensions = newEnabledExtensions;
|
||||||
}
|
}
|
||||||
|
1885
js/ui/iconGrid.js
1885
js/ui/iconGrid.js
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
/* exported InhibitShortcutsDialog */
|
/* exported InhibitShortcutsDialog */
|
||||||
const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Gtk, Meta, Pango, Shell, St } = imports.gi;
|
||||||
|
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
@ -7,7 +7,7 @@ const PermissionStore = imports.misc.permissionStore;
|
|||||||
|
|
||||||
const WAYLAND_KEYBINDINGS_SCHEMA = 'org.gnome.mutter.wayland.keybindings';
|
const WAYLAND_KEYBINDINGS_SCHEMA = 'org.gnome.mutter.wayland.keybindings';
|
||||||
|
|
||||||
const APP_WHITELIST = ['gnome-control-center.desktop'];
|
const APP_ALLOWLIST = ['gnome-control-center.desktop'];
|
||||||
const APP_PERMISSIONS_TABLE = 'gnome';
|
const APP_PERMISSIONS_TABLE = 'gnome';
|
||||||
const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
|
const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
|
||||||
const GRANTED = 'GRANTED';
|
const GRANTED = 'GRANTED';
|
||||||
@ -90,6 +90,8 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
|||||||
text: _('You can restore shortcuts by pressing %s.').format(restoreAccel),
|
text: _('You can restore shortcuts by pressing %s.').format(restoreAccel),
|
||||||
style_class: 'message-dialog-description',
|
style_class: 'message-dialog-description',
|
||||||
});
|
});
|
||||||
|
restoreLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
restoreLabel.clutter_text.line_wrap = true;
|
||||||
content.add_child(restoreLabel);
|
content.add_child(restoreLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +118,7 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
vfunc_show() {
|
vfunc_show() {
|
||||||
if (this._app && APP_WHITELIST.includes(this._app.get_id())) {
|
if (this._app && APP_ALLOWLIST.includes(this._app.get_id())) {
|
||||||
this._emitResponse(DialogResponse.ALLOW);
|
this._emitResponse(DialogResponse.ALLOW);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
/* exported KeyboardManager */
|
/* exported KeyboardManager */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
|
||||||
|
const ByteArray = imports.byteArray;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const InputSourceManager = imports.ui.status.keyboard;
|
const InputSourceManager = imports.ui.status.keyboard;
|
||||||
@ -42,7 +43,7 @@ const defaultKeysPost = [
|
|||||||
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
||||||
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
|
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
|
||||||
[{ label: '=/<', width: 3, level: 3, right: true }],
|
[{ label: '=/<', width: 3, level: 3, right: true }],
|
||||||
[{ action: 'emoji', icon: 'face-smile-symbolic' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
|
[{ action: 'emoji', icon: 'face-smile-symbolic' }, { action: 'languageMenu', extraClassName: 'layout-key', icon: 'keyboard-layout-filled-symbolic' }, { action: 'hide', extraClassName: 'hide-key', icon: 'go-down-symbolic' }]],
|
||||||
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
||||||
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
|
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
|
||||||
[{ label: '?123', width: 3, level: 2, right: true }],
|
[{ label: '?123', width: 3, level: 2, right: true }],
|
||||||
@ -61,7 +62,25 @@ class AspectContainer extends St.Widget {
|
|||||||
this.queue_relayout();
|
this.queue_relayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_get_preferred_width(forHeight) {
|
||||||
|
let [min, nat] = super.vfunc_get_preferred_width(forHeight);
|
||||||
|
|
||||||
|
if (forHeight > 0)
|
||||||
|
nat = forHeight * this._ratio;
|
||||||
|
|
||||||
|
return [min, nat];
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_get_preferred_height(forWidth) {
|
||||||
|
let [min, nat] = super.vfunc_get_preferred_height(forWidth);
|
||||||
|
|
||||||
|
if (forWidth > 0)
|
||||||
|
nat = forWidth / this._ratio;
|
||||||
|
|
||||||
|
return [min, nat];
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_allocate(box) {
|
||||||
if (box.get_width() > 0 && box.get_height() > 0) {
|
if (box.get_width() > 0 && box.get_height() > 0) {
|
||||||
let sizeRatio = box.get_width() / box.get_height();
|
let sizeRatio = box.get_width() / box.get_height();
|
||||||
|
|
||||||
@ -79,7 +98,7 @@ class AspectContainer extends St.Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.vfunc_allocate(box, flags);
|
super.vfunc_allocate(box);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -514,8 +533,7 @@ var KeyboardModel = class {
|
|||||||
_loadModel(groupName) {
|
_loadModel(groupName) {
|
||||||
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/%s.json'.format(groupName));
|
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/%s.json'.format(groupName));
|
||||||
let [success_, contents] = file.load_contents(null);
|
let [success_, contents] = file.load_contents(null);
|
||||||
if (contents instanceof Uint8Array)
|
contents = ByteArray.toString(contents);
|
||||||
contents = imports.byteArray.toString(contents);
|
|
||||||
|
|
||||||
return JSON.parse(contents);
|
return JSON.parse(contents);
|
||||||
}
|
}
|
||||||
@ -722,7 +740,7 @@ var EmojiPager = GObject.registerClass({
|
|||||||
|
|
||||||
_onPan(action) {
|
_onPan(action) {
|
||||||
let [dist_, dx, dy_] = action.get_motion_delta(0);
|
let [dist_, dx, dy_] = action.get_motion_delta(0);
|
||||||
this.delta = this.delta + dx;
|
this.delta += dx;
|
||||||
|
|
||||||
if (this._currentKey != null) {
|
if (this._currentKey != null) {
|
||||||
this._currentKey.cancel();
|
this._currentKey.cancel();
|
||||||
@ -935,8 +953,7 @@ var EmojiSelection = GObject.registerClass({
|
|||||||
this.add_child(this._emojiPager);
|
this.add_child(this._emojiPager);
|
||||||
|
|
||||||
this._pageIndicator = new PageIndicators.PageIndicators(
|
this._pageIndicator = new PageIndicators.PageIndicators(
|
||||||
Clutter.Orientation.HORIZONTAL
|
Clutter.Orientation.HORIZONTAL);
|
||||||
);
|
|
||||||
this.add_child(this._pageIndicator);
|
this.add_child(this._pageIndicator);
|
||||||
this._pageIndicator.setReactive(false);
|
this._pageIndicator.setReactive(false);
|
||||||
|
|
||||||
@ -1074,8 +1091,8 @@ var Keypad = GObject.registerClass({
|
|||||||
{ label: '8', keyval: Clutter.KEY_8, left: 1, top: 2 },
|
{ label: '8', keyval: Clutter.KEY_8, left: 1, top: 2 },
|
||||||
{ label: '9', keyval: Clutter.KEY_9, left: 2, top: 2 },
|
{ label: '9', keyval: Clutter.KEY_9, left: 2, top: 2 },
|
||||||
{ label: '0', keyval: Clutter.KEY_0, left: 1, top: 3 },
|
{ label: '0', keyval: Clutter.KEY_0, left: 1, top: 3 },
|
||||||
{ label: '⌫', keyval: Clutter.KEY_BackSpace, left: 3, top: 0 },
|
{ keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic', left: 3, top: 0 },
|
||||||
{ keyval: Clutter.KEY_Return, extraClassName: 'enter-key', left: 3, top: 1, height: 2 },
|
{ keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic', left: 3, top: 1, height: 2 },
|
||||||
];
|
];
|
||||||
|
|
||||||
super._init({
|
super._init({
|
||||||
@ -1092,7 +1109,7 @@ var Keypad = GObject.registerClass({
|
|||||||
|
|
||||||
for (let i = 0; i < keys.length; i++) {
|
for (let i = 0; i < keys.length; i++) {
|
||||||
let cur = keys[i];
|
let cur = keys[i];
|
||||||
let key = new Key(cur.label || "", []);
|
let key = new Key(cur.label || "", [], cur.icon);
|
||||||
|
|
||||||
if (keys[i].extraClassName)
|
if (keys[i].extraClassName)
|
||||||
key.keyButton.add_style_class_name(cur.extraClassName);
|
key.keyButton.add_style_class_name(cur.extraClassName);
|
||||||
@ -1119,7 +1136,7 @@ var KeyboardManager = class KeyBoardManager {
|
|||||||
this._seat.connect('notify::touch-mode', this._syncEnabled.bind(this));
|
this._seat.connect('notify::touch-mode', this._syncEnabled.bind(this));
|
||||||
|
|
||||||
this._lastDevice = null;
|
this._lastDevice = null;
|
||||||
Meta.get_backend().connect('last-device-changed', (backend, device) => {
|
global.backend.connect('last-device-changed', (backend, device) => {
|
||||||
if (device.device_type === Clutter.InputDeviceType.KEYBOARD_DEVICE)
|
if (device.device_type === Clutter.InputDeviceType.KEYBOARD_DEVICE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1257,6 +1274,10 @@ class Keyboard extends St.BoxLayout {
|
|||||||
return this._keyboardVisible && super.visible;
|
return this._keyboardVisible && super.visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set visible(visible) {
|
||||||
|
super.visible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
_onFocusPositionChanged(focusTracker) {
|
_onFocusPositionChanged(focusTracker) {
|
||||||
let rect = focusTracker.getCurrentRect();
|
let rect = focusTracker.getCurrentRect();
|
||||||
this.setCursorLocation(focusTracker.currentWindow, rect.x, rect.y, rect.width, rect.height);
|
this.setCursorLocation(focusTracker.currentWindow, rect.x, rect.y, rect.width, rect.height);
|
||||||
@ -1605,7 +1626,9 @@ class Keyboard extends St.BoxLayout {
|
|||||||
* we allow the OSK being smaller than 1/3rd of the monitor height
|
* we allow the OSK being smaller than 1/3rd of the monitor height
|
||||||
* there.
|
* there.
|
||||||
*/
|
*/
|
||||||
this.height = Math.min(maxHeight, this.get_preferred_height(monitor.width));
|
const forWidth = this.get_theme_node().adjust_for_width(monitor.width);
|
||||||
|
const [, natHeight] = this.get_preferred_height(forWidth);
|
||||||
|
this.height = Math.min(maxHeight, natHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ const Signals = imports.signals;
|
|||||||
|
|
||||||
const Background = imports.ui.background;
|
const Background = imports.ui.background;
|
||||||
const BackgroundMenu = imports.ui.backgroundMenu;
|
const BackgroundMenu = imports.ui.backgroundMenu;
|
||||||
const LoginManager = imports.misc.loginManager;
|
|
||||||
|
|
||||||
const DND = imports.ui.dnd;
|
const DND = imports.ui.dnd;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -246,7 +245,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
vertical: true });
|
vertical: true });
|
||||||
this.addChrome(this.panelBox, { affectsStruts: true,
|
this.addChrome(this.panelBox, { affectsStruts: true,
|
||||||
trackFullscreen: true });
|
trackFullscreen: true });
|
||||||
this.panelBox.connect('allocation-changed',
|
this.panelBox.connect('notify::allocation',
|
||||||
this._panelBoxChanged.bind(this));
|
this._panelBoxChanged.bind(this));
|
||||||
|
|
||||||
this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
|
this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
|
||||||
@ -295,18 +294,6 @@ var LayoutManager = GObject.registerClass({
|
|||||||
monitorManager.connect('monitors-changed',
|
monitorManager.connect('monitors-changed',
|
||||||
this._monitorsChanged.bind(this));
|
this._monitorsChanged.bind(this));
|
||||||
this._monitorsChanged();
|
this._monitorsChanged();
|
||||||
|
|
||||||
// NVIDIA drivers don't preserve FBO contents across
|
|
||||||
// suspend/resume, see
|
|
||||||
// https://bugzilla.gnome.org/show_bug.cgi?id=739178
|
|
||||||
if (Shell.util_need_background_refresh()) {
|
|
||||||
LoginManager.getLoginManager().connect('prepare-for-sleep',
|
|
||||||
(lm, suspending) => {
|
|
||||||
if (suspending)
|
|
||||||
return;
|
|
||||||
Meta.Background.refresh_all();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called by Main after everything else is constructed
|
// This is called by Main after everything else is constructed
|
||||||
@ -470,6 +457,15 @@ var LayoutManager = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_waitLoaded(bgManager) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
const id = bgManager.connect('loaded', () => {
|
||||||
|
bgManager.disconnect(id);
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_updateBackgrounds() {
|
_updateBackgrounds() {
|
||||||
for (let i = 0; i < this._bgManagers.length; i++)
|
for (let i = 0; i < this._bgManagers.length; i++)
|
||||||
this._bgManagers[i].destroy();
|
this._bgManagers[i].destroy();
|
||||||
@ -477,7 +473,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
this._bgManagers = [];
|
this._bgManagers = [];
|
||||||
|
|
||||||
if (Main.sessionMode.isGreeter)
|
if (Main.sessionMode.isGreeter)
|
||||||
return;
|
return Promise.resolve();
|
||||||
|
|
||||||
for (let i = 0; i < this.monitors.length; i++) {
|
for (let i = 0; i < this.monitors.length; i++) {
|
||||||
let bgManager = this._createBackgroundManager(i);
|
let bgManager = this._createBackgroundManager(i);
|
||||||
@ -486,6 +482,8 @@ var LayoutManager = GObject.registerClass({
|
|||||||
if (i != this.primaryIndex && this._startingUp)
|
if (i != this.primaryIndex && this._startingUp)
|
||||||
bgManager.backgroundActor.hide();
|
bgManager.backgroundActor.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Promise.all(this._bgManagers.map(this._waitLoaded));
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateKeyboardBox() {
|
_updateKeyboardBox() {
|
||||||
@ -644,7 +642,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
// When starting a normal user session, we want to grow it out of the middle
|
// When starting a normal user session, we want to grow it out of the middle
|
||||||
// of the screen.
|
// of the screen.
|
||||||
|
|
||||||
_prepareStartupAnimation() {
|
async _prepareStartupAnimation() {
|
||||||
// During the initial transition, add a simple actor to block all events,
|
// During the initial transition, add a simple actor to block all events,
|
||||||
// so they don't get delivered to X11 windows that have been transformed.
|
// so they don't get delivered to X11 windows that have been transformed.
|
||||||
this._coverPane = new Clutter.Actor({ opacity: 0,
|
this._coverPane = new Clutter.Actor({ opacity: 0,
|
||||||
@ -661,8 +659,6 @@ var LayoutManager = GObject.registerClass({
|
|||||||
} else if (Main.sessionMode.isGreeter) {
|
} else if (Main.sessionMode.isGreeter) {
|
||||||
this.panelBox.translation_y = -this.panelBox.height;
|
this.panelBox.translation_y = -this.panelBox.height;
|
||||||
} else {
|
} else {
|
||||||
this._updateBackgrounds();
|
|
||||||
|
|
||||||
// We need to force an update of the regions now before we scale
|
// We need to force an update of the regions now before we scale
|
||||||
// the UI group to get the correct allocation for the struts.
|
// the UI group to get the correct allocation for the struts.
|
||||||
this._updateRegions();
|
this._updateRegions();
|
||||||
@ -678,6 +674,8 @@ var LayoutManager = GObject.registerClass({
|
|||||||
this.uiGroup.scale_x = this.uiGroup.scale_y = 0.75;
|
this.uiGroup.scale_x = this.uiGroup.scale_y = 0.75;
|
||||||
this.uiGroup.opacity = 0;
|
this.uiGroup.opacity = 0;
|
||||||
global.window_group.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
|
global.window_group.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
|
||||||
|
|
||||||
|
await this._updateBackgrounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit('startup-prepared');
|
this.emit('startup-prepared');
|
||||||
@ -1204,7 +1202,8 @@ class HotCorner extends Clutter.Actor {
|
|||||||
|
|
||||||
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
|
||||||
this._corner.set_position(this.width - this._corner.width, 0);
|
this._corner.set_position(this.width - this._corner.width, 0);
|
||||||
this.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST);
|
this.set_pivot_point(1.0, 0.0);
|
||||||
|
this.translation_x = -this.width;
|
||||||
} else {
|
} else {
|
||||||
this._corner.set_position(0, 0);
|
this._corner.set_position(0, 0);
|
||||||
}
|
}
|
||||||
@ -1229,8 +1228,9 @@ class HotCorner extends Clutter.Actor {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (Main.overview.shouldToggleByCornerOrButton()) {
|
if (Main.overview.shouldToggleByCornerOrButton()) {
|
||||||
this._ripples.playAnimation(this._x, this._y);
|
|
||||||
Main.overview.toggle();
|
Main.overview.toggle();
|
||||||
|
if (Main.overview.animationInProgress)
|
||||||
|
this._ripples.playAnimation(this._x, this._y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,13 +27,11 @@ var RadialShaderEffect = GObject.registerClass({
|
|||||||
'brightness': GObject.ParamSpec.float(
|
'brightness': GObject.ParamSpec.float(
|
||||||
'brightness', 'brightness', 'brightness',
|
'brightness', 'brightness', 'brightness',
|
||||||
GObject.ParamFlags.READWRITE,
|
GObject.ParamFlags.READWRITE,
|
||||||
0, 1, 1
|
0, 1, 1),
|
||||||
),
|
|
||||||
'sharpness': GObject.ParamSpec.float(
|
'sharpness': GObject.ParamSpec.float(
|
||||||
'sharpness', 'sharpness', 'sharpness',
|
'sharpness', 'sharpness', 'sharpness',
|
||||||
GObject.ParamFlags.READWRITE,
|
GObject.ParamFlags.READWRITE,
|
||||||
0, 1, 0
|
0, 1, 0),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
}, class RadialShaderEffect extends Shell.GLSLEffect {
|
}, class RadialShaderEffect extends Shell.GLSLEffect {
|
||||||
_init(params) {
|
_init(params) {
|
||||||
|
@ -37,10 +37,9 @@ const LG_ANIMATION_TIME = 500;
|
|||||||
|
|
||||||
function _getAutoCompleteGlobalKeywords() {
|
function _getAutoCompleteGlobalKeywords() {
|
||||||
const keywords = ['true', 'false', 'null', 'new'];
|
const keywords = ['true', 'false', 'null', 'new'];
|
||||||
// Don't add the private properties of window (i.e., ones starting with '_')
|
// Don't add the private properties of globalThis (i.e., ones starting with '_')
|
||||||
const windowProperties = Object.getOwnPropertyNames(window).filter(
|
const windowProperties = Object.getOwnPropertyNames(globalThis).filter(
|
||||||
a => a.charAt(0) != '_'
|
a => a.charAt(0) !== '_');
|
||||||
);
|
|
||||||
const headerProperties = JsParse.getDeclaredConstants(commandHeader);
|
const headerProperties = JsParse.getDeclaredConstants(commandHeader);
|
||||||
|
|
||||||
return keywords.concat(windowProperties).concat(headerProperties);
|
return keywords.concat(windowProperties).concat(headerProperties);
|
||||||
@ -555,8 +554,8 @@ var Inspector = GObject.registerClass({
|
|||||||
this._lookingGlass = lookingGlass;
|
this._lookingGlass = lookingGlass;
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box) {
|
||||||
this.set_allocation(box, flags);
|
this.set_allocation(box);
|
||||||
|
|
||||||
if (!this._eventHandler)
|
if (!this._eventHandler)
|
||||||
return;
|
return;
|
||||||
@ -571,7 +570,7 @@ var Inspector = GObject.registerClass({
|
|||||||
childBox.x2 = childBox.x1 + natWidth;
|
childBox.x2 = childBox.x1 + natWidth;
|
||||||
childBox.y1 = primary.y + Math.floor((primary.height - natHeight) / 2);
|
childBox.y1 = primary.y + Math.floor((primary.height - natHeight) / 2);
|
||||||
childBox.y2 = childBox.y1 + natHeight;
|
childBox.y2 = childBox.y1 + natHeight;
|
||||||
this._eventHandler.allocate(childBox, flags);
|
this._eventHandler.allocate(childBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
_close() {
|
_close() {
|
||||||
@ -803,6 +802,191 @@ var Extensions = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var ActorLink = GObject.registerClass({
|
||||||
|
Signals: {
|
||||||
|
'inspect-actor': {},
|
||||||
|
},
|
||||||
|
}, class ActorLink extends St.Button {
|
||||||
|
_init(actor) {
|
||||||
|
this._arrow = new St.Icon({
|
||||||
|
icon_name: 'pan-end-symbolic',
|
||||||
|
icon_size: 8,
|
||||||
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
|
||||||
|
});
|
||||||
|
|
||||||
|
const label = new St.Label({
|
||||||
|
text: actor.toString(),
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
|
});
|
||||||
|
|
||||||
|
const inspectButton = new St.Button({
|
||||||
|
child: new St.Icon({
|
||||||
|
icon_name: 'insert-object-symbolic',
|
||||||
|
icon_size: 12,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
}),
|
||||||
|
reactive: true,
|
||||||
|
x_expand: true,
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
|
inspectButton.connect('clicked', () => this.emit('inspect-actor'));
|
||||||
|
|
||||||
|
const box = new St.BoxLayout();
|
||||||
|
box.add_child(this._arrow);
|
||||||
|
box.add_child(label);
|
||||||
|
box.add_child(inspectButton);
|
||||||
|
|
||||||
|
super._init({
|
||||||
|
reactive: true,
|
||||||
|
track_hover: true,
|
||||||
|
toggle_mode: true,
|
||||||
|
style_class: 'actor-link',
|
||||||
|
child: box,
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
|
});
|
||||||
|
|
||||||
|
this._actor = actor;
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_clicked() {
|
||||||
|
this._arrow.ease({
|
||||||
|
rotation_angle_z: this.checked ? 90 : 0,
|
||||||
|
duration: 250,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var ActorTreeViewer = GObject.registerClass(
|
||||||
|
class ActorTreeViewer extends St.BoxLayout {
|
||||||
|
_init(lookingGlass) {
|
||||||
|
super._init();
|
||||||
|
|
||||||
|
this._lookingGlass = lookingGlass;
|
||||||
|
this._actorData = new Map();
|
||||||
|
}
|
||||||
|
|
||||||
|
_showActorChildren(actor) {
|
||||||
|
const data = this._actorData.get(actor);
|
||||||
|
if (!data || data.visible)
|
||||||
|
return;
|
||||||
|
|
||||||
|
data.visible = true;
|
||||||
|
data.actorAddedId = actor.connect('actor-added', (container, child) => {
|
||||||
|
this._addActor(data.children, child);
|
||||||
|
});
|
||||||
|
data.actorRemovedId = actor.connect('actor-removed', (container, child) => {
|
||||||
|
this._removeActor(child);
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let child of actor)
|
||||||
|
this._addActor(data.children, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
_hideActorChildren(actor) {
|
||||||
|
const data = this._actorData.get(actor);
|
||||||
|
if (!data || !data.visible)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (let child of actor)
|
||||||
|
this._removeActor(child);
|
||||||
|
|
||||||
|
data.visible = false;
|
||||||
|
if (data.actorAddedId > 0) {
|
||||||
|
actor.disconnect(data.actorAddedId);
|
||||||
|
data.actorAddedId = 0;
|
||||||
|
}
|
||||||
|
if (data.actorRemovedId > 0) {
|
||||||
|
actor.disconnect(data.actorRemovedId);
|
||||||
|
data.actorRemovedId = 0;
|
||||||
|
}
|
||||||
|
data.children.remove_all_children();
|
||||||
|
}
|
||||||
|
|
||||||
|
_addActor(container, actor) {
|
||||||
|
if (this._actorData.has(actor))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (actor === this._lookingGlass)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const button = new ActorLink(actor);
|
||||||
|
button.connect('notify::checked', () => {
|
||||||
|
this._lookingGlass.setBorderPaintTarget(actor);
|
||||||
|
if (button.checked)
|
||||||
|
this._showActorChildren(actor);
|
||||||
|
else
|
||||||
|
this._hideActorChildren(actor);
|
||||||
|
});
|
||||||
|
button.connect('inspect-actor', () => {
|
||||||
|
this._lookingGlass.inspectObject(actor, button);
|
||||||
|
});
|
||||||
|
|
||||||
|
const mainContainer = new St.BoxLayout({ vertical: true });
|
||||||
|
const childrenContainer = new St.BoxLayout({
|
||||||
|
vertical: true,
|
||||||
|
style: 'padding: 0 0 0 18px',
|
||||||
|
});
|
||||||
|
|
||||||
|
mainContainer.add_child(button);
|
||||||
|
mainContainer.add_child(childrenContainer);
|
||||||
|
|
||||||
|
this._actorData.set(actor, {
|
||||||
|
button,
|
||||||
|
container: mainContainer,
|
||||||
|
children: childrenContainer,
|
||||||
|
visible: false,
|
||||||
|
actorAddedId: 0,
|
||||||
|
actorRemovedId: 0,
|
||||||
|
actorDestroyedId: actor.connect('destroy', () => this._removeActor(actor)),
|
||||||
|
});
|
||||||
|
|
||||||
|
let belowChild = null;
|
||||||
|
const nextSibling = actor.get_next_sibling();
|
||||||
|
if (nextSibling && this._actorData.has(nextSibling))
|
||||||
|
belowChild = this._actorData.get(nextSibling).container;
|
||||||
|
|
||||||
|
container.insert_child_above(mainContainer, belowChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
_removeActor(actor) {
|
||||||
|
const data = this._actorData.get(actor);
|
||||||
|
if (!data)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (let child of actor)
|
||||||
|
this._removeActor(child);
|
||||||
|
|
||||||
|
if (data.actorAddedId > 0) {
|
||||||
|
actor.disconnect(data.actorAddedId);
|
||||||
|
data.actorAddedId = 0;
|
||||||
|
}
|
||||||
|
if (data.actorRemovedId > 0) {
|
||||||
|
actor.disconnect(data.actorRemovedId);
|
||||||
|
data.actorRemovedId = 0;
|
||||||
|
}
|
||||||
|
if (data.actorDestroyedId > 0) {
|
||||||
|
actor.disconnect(data.actorDestroyedId);
|
||||||
|
data.actorDestroyedId = 0;
|
||||||
|
}
|
||||||
|
data.container.destroy();
|
||||||
|
this._actorData.delete(actor);
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_map() {
|
||||||
|
super.vfunc_map();
|
||||||
|
this._addActor(this, global.stage);
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_unmap() {
|
||||||
|
super.vfunc_unmap();
|
||||||
|
this._removeActor(global.stage);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var LookingGlass = GObject.registerClass(
|
var LookingGlass = GObject.registerClass(
|
||||||
class LookingGlass extends St.BoxLayout {
|
class LookingGlass extends St.BoxLayout {
|
||||||
_init() {
|
_init() {
|
||||||
@ -834,9 +1018,9 @@ class LookingGlass extends St.BoxLayout {
|
|||||||
Main.uiGroup.add_actor(this);
|
Main.uiGroup.add_actor(this);
|
||||||
Main.uiGroup.set_child_below_sibling(this,
|
Main.uiGroup.set_child_below_sibling(this,
|
||||||
Main.layoutManager.panelBox);
|
Main.layoutManager.panelBox);
|
||||||
Main.layoutManager.panelBox.connect('allocation-changed',
|
Main.layoutManager.panelBox.connect('notify::allocation',
|
||||||
this._queueResize.bind(this));
|
this._queueResize.bind(this));
|
||||||
Main.layoutManager.keyboardBox.connect('allocation-changed',
|
Main.layoutManager.keyboardBox.connect('notify::allocation',
|
||||||
this._queueResize.bind(this));
|
this._queueResize.bind(this));
|
||||||
|
|
||||||
this._objInspector = new ObjInspector(this);
|
this._objInspector = new ObjInspector(this);
|
||||||
@ -918,6 +1102,9 @@ class LookingGlass extends St.BoxLayout {
|
|||||||
this._extensions = new Extensions(this);
|
this._extensions = new Extensions(this);
|
||||||
notebook.appendPage('Extensions', this._extensions);
|
notebook.appendPage('Extensions', this._extensions);
|
||||||
|
|
||||||
|
this._actorTreeViewer = new ActorTreeViewer(this);
|
||||||
|
notebook.appendPage('Actors', this._actorTreeViewer);
|
||||||
|
|
||||||
this._entry.clutter_text.connect('activate', (o, _e) => {
|
this._entry.clutter_text.connect('activate', (o, _e) => {
|
||||||
// Hide any completions we are currently showing
|
// Hide any completions we are currently showing
|
||||||
this._hideCompletions();
|
this._hideCompletions();
|
||||||
|
@ -489,7 +489,10 @@ var Magnifier = class Magnifier {
|
|||||||
_updateMouseSprite() {
|
_updateMouseSprite() {
|
||||||
this._updateSpriteTexture();
|
this._updateSpriteTexture();
|
||||||
let [xHot, yHot] = this._cursorTracker.get_hot();
|
let [xHot, yHot] = this._cursorTracker.get_hot();
|
||||||
this._mouseSprite.set_anchor_point(xHot, yHot);
|
this._mouseSprite.set({
|
||||||
|
translation_x: -xHot,
|
||||||
|
translation_y: -yHot,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateSpriteTexture() {
|
_updateSpriteTexture() {
|
||||||
@ -643,8 +646,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Applies only to the first zoom region.
|
// Applies only to the first zoom region.
|
||||||
if (this._zoomRegions.length) {
|
if (this._zoomRegions.length) {
|
||||||
this._zoomRegions[0].setClampScrollingAtEdges(
|
this._zoomRegions[0].setClampScrollingAtEdges(
|
||||||
!this._settings.get_boolean(CLAMP_MODE_KEY)
|
!this._settings.get_boolean(CLAMP_MODE_KEY));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,8 +654,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Applies only to the first zoom region.
|
// Applies only to the first zoom region.
|
||||||
if (this._zoomRegions.length) {
|
if (this._zoomRegions.length) {
|
||||||
this._zoomRegions[0].setMouseTrackingMode(
|
this._zoomRegions[0].setMouseTrackingMode(
|
||||||
this._settings.get_enum(MOUSE_TRACKING_KEY)
|
this._settings.get_enum(MOUSE_TRACKING_KEY));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,8 +662,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Applies only to the first zoom region.
|
// Applies only to the first zoom region.
|
||||||
if (this._zoomRegions.length) {
|
if (this._zoomRegions.length) {
|
||||||
this._zoomRegions[0].setFocusTrackingMode(
|
this._zoomRegions[0].setFocusTrackingMode(
|
||||||
this._settings.get_enum(FOCUS_TRACKING_KEY)
|
this._settings.get_enum(FOCUS_TRACKING_KEY));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,8 +670,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Applies only to the first zoom region.
|
// Applies only to the first zoom region.
|
||||||
if (this._zoomRegions.length) {
|
if (this._zoomRegions.length) {
|
||||||
this._zoomRegions[0].setCaretTrackingMode(
|
this._zoomRegions[0].setCaretTrackingMode(
|
||||||
this._settings.get_enum(CARET_TRACKING_KEY)
|
this._settings.get_enum(CARET_TRACKING_KEY));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -679,8 +678,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Applies only to the first zoom region.
|
// Applies only to the first zoom region.
|
||||||
if (this._zoomRegions.length) {
|
if (this._zoomRegions.length) {
|
||||||
this._zoomRegions[0].setInvertLightness(
|
this._zoomRegions[0].setInvertLightness(
|
||||||
this._settings.get_boolean(INVERT_LIGHTNESS_KEY)
|
this._settings.get_boolean(INVERT_LIGHTNESS_KEY));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -688,8 +686,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Applies only to the first zoom region.
|
// Applies only to the first zoom region.
|
||||||
if (this._zoomRegions.length) {
|
if (this._zoomRegions.length) {
|
||||||
this._zoomRegions[0].setColorSaturation(
|
this._zoomRegions[0].setColorSaturation(
|
||||||
this._settings.get_double(COLOR_SATURATION_KEY)
|
this._settings.get_double(COLOR_SATURATION_KEY));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1941,9 +1938,8 @@ var MagShaderEffects = class MagShaderEffects {
|
|||||||
// it modifies the brightness and/or contrast.
|
// it modifies the brightness and/or contrast.
|
||||||
let [cRed, cGreen, cBlue] = this._brightnessContrast.get_contrast();
|
let [cRed, cGreen, cBlue] = this._brightnessContrast.get_contrast();
|
||||||
this._brightnessContrast.set_enabled(
|
this._brightnessContrast.set_enabled(
|
||||||
bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE ||
|
bRed !== NO_CHANGE || bGreen !== NO_CHANGE || bBlue !== NO_CHANGE ||
|
||||||
cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE
|
cRed !== NO_CHANGE || cGreen !== NO_CHANGE || cBlue !== NO_CHANGE);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1970,8 +1966,7 @@ var MagShaderEffects = class MagShaderEffects {
|
|||||||
// a null first argument.
|
// a null first argument.
|
||||||
let [bRed, bGreen, bBlue] = this._brightnessContrast.get_brightness();
|
let [bRed, bGreen, bBlue] = this._brightnessContrast.get_brightness();
|
||||||
this._brightnessContrast.set_enabled(
|
this._brightnessContrast.set_enabled(
|
||||||
cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE ||
|
cRed !== NO_CHANGE || cGreen !== NO_CHANGE || cBlue !== NO_CHANGE ||
|
||||||
bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE
|
bRed !== NO_CHANGE || bGreen !== NO_CHANGE || bBlue !== NO_CHANGE);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
ctrlAltTabManager, padOsdService, osdWindowManager,
|
ctrlAltTabManager, padOsdService, osdWindowManager,
|
||||||
osdMonitorLabeler, shellMountOpDBusService, shellDBusService,
|
osdMonitorLabeler, shellMountOpDBusService, shellDBusService,
|
||||||
shellAccessDialogDBusService, shellAudioSelectionDBusService,
|
shellAccessDialogDBusService, shellAudioSelectionDBusService,
|
||||||
screenSaverDBus, screencastService, uiGroup, magnifier,
|
screenSaverDBus, uiGroup, magnifier, xdndHandler, keyboard,
|
||||||
xdndHandler, keyboard, kbdA11yDialog, introspectService,
|
kbdA11yDialog, introspectService, start, pushModal, popModal,
|
||||||
start, pushModal, popModal, activateWindow, createLookingGlass,
|
activateWindow, createLookingGlass, initializeDeferredWork,
|
||||||
initializeDeferredWork, getThemeStylesheet, setThemeStylesheet */
|
getThemeStylesheet, setThemeStylesheet */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||||
|
|
||||||
@ -34,7 +34,6 @@ const LoginManager = imports.misc.loginManager;
|
|||||||
const LookingGlass = imports.ui.lookingGlass;
|
const LookingGlass = imports.ui.lookingGlass;
|
||||||
const NotificationDaemon = imports.ui.notificationDaemon;
|
const NotificationDaemon = imports.ui.notificationDaemon;
|
||||||
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
|
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
|
||||||
const Screencast = imports.ui.screencast;
|
|
||||||
const ScreenShield = imports.ui.screenShield;
|
const ScreenShield = imports.ui.screenShield;
|
||||||
const Scripting = imports.ui.scripting;
|
const Scripting = imports.ui.scripting;
|
||||||
const SessionMode = imports.ui.sessionMode;
|
const SessionMode = imports.ui.sessionMode;
|
||||||
@ -46,6 +45,7 @@ const XdndHandler = imports.ui.xdndHandler;
|
|||||||
const KbdA11yDialog = imports.ui.kbdA11yDialog;
|
const KbdA11yDialog = imports.ui.kbdA11yDialog;
|
||||||
const LocatePointer = imports.ui.locatePointer;
|
const LocatePointer = imports.ui.locatePointer;
|
||||||
const PointerA11yTimeout = imports.ui.pointerA11yTimeout;
|
const PointerA11yTimeout = imports.ui.pointerA11yTimeout;
|
||||||
|
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||||
|
|
||||||
const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
|
const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
|
||||||
const STICKY_KEYS_ENABLE = 'stickykeys-enable';
|
const STICKY_KEYS_ENABLE = 'stickykeys-enable';
|
||||||
@ -73,7 +73,6 @@ var shellAudioSelectionDBusService = null;
|
|||||||
var shellDBusService = null;
|
var shellDBusService = null;
|
||||||
var shellMountOpDBusService = null;
|
var shellMountOpDBusService = null;
|
||||||
var screenSaverDBus = null;
|
var screenSaverDBus = null;
|
||||||
var screencastService = null;
|
|
||||||
var modalCount = 0;
|
var modalCount = 0;
|
||||||
var actionMode = Shell.ActionMode.NONE;
|
var actionMode = Shell.ActionMode.NONE;
|
||||||
var modalActorFocusStack = [];
|
var modalActorFocusStack = [];
|
||||||
@ -96,6 +95,8 @@ let _oskResource = null;
|
|||||||
Gio._promisify(Gio._LocalFilePrototype, 'delete_async', 'delete_finish');
|
Gio._promisify(Gio._LocalFilePrototype, 'delete_async', 'delete_finish');
|
||||||
Gio._promisify(Gio._LocalFilePrototype, 'touch_async', 'touch_finish');
|
Gio._promisify(Gio._LocalFilePrototype, 'touch_async', 'touch_finish');
|
||||||
|
|
||||||
|
let _remoteAccessInhibited = false;
|
||||||
|
|
||||||
function _sessionUpdated() {
|
function _sessionUpdated() {
|
||||||
if (sessionMode.isPrimary)
|
if (sessionMode.isPrimary)
|
||||||
_loadDefaultStylesheet();
|
_loadDefaultStylesheet();
|
||||||
@ -120,24 +121,41 @@ function _sessionUpdated() {
|
|||||||
if (lookingGlass)
|
if (lookingGlass)
|
||||||
lookingGlass.close();
|
lookingGlass.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let remoteAccessController = global.backend.get_remote_access_controller();
|
||||||
|
if (remoteAccessController) {
|
||||||
|
if (sessionMode.allowScreencast && _remoteAccessInhibited) {
|
||||||
|
remoteAccessController.uninhibit_remote_access();
|
||||||
|
_remoteAccessInhibited = false;
|
||||||
|
} else if (!sessionMode.allowScreencast && !_remoteAccessInhibited) {
|
||||||
|
remoteAccessController.inhibit_remote_access();
|
||||||
|
_remoteAccessInhibited = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
// These are here so we don't break compatibility.
|
// These are here so we don't break compatibility.
|
||||||
global.logError = window.log;
|
global.logError = globalThis.log;
|
||||||
global.log = window.log;
|
global.log = globalThis.log;
|
||||||
|
|
||||||
// Chain up async errors reported from C
|
// Chain up async errors reported from C
|
||||||
global.connect('notify-error', (global, msg, detail) => {
|
global.connect('notify-error', (global, msg, detail) => {
|
||||||
notifyError(msg, detail);
|
notifyError(msg, detail);
|
||||||
});
|
});
|
||||||
|
|
||||||
Gio.DesktopAppInfo.set_desktop_env('GNOME');
|
let currentDesktop = GLib.getenv('XDG_CURRENT_DESKTOP');
|
||||||
|
if (!currentDesktop || !currentDesktop.split(':').includes('GNOME'))
|
||||||
|
Gio.DesktopAppInfo.set_desktop_env('GNOME');
|
||||||
|
|
||||||
sessionMode = new SessionMode.SessionMode();
|
sessionMode = new SessionMode.SessionMode();
|
||||||
sessionMode.connect('updated', _sessionUpdated);
|
sessionMode.connect('updated', _sessionUpdated);
|
||||||
|
|
||||||
St.Settings.get().connect('notify::gtk-theme', _loadDefaultStylesheet);
|
St.Settings.get().connect('notify::gtk-theme', _loadDefaultStylesheet);
|
||||||
|
|
||||||
|
// Initialize ParentalControlsManager before the UI
|
||||||
|
ParentalControlsManager.getDefault();
|
||||||
|
|
||||||
_initializeUI();
|
_initializeUI();
|
||||||
|
|
||||||
shellAccessDialogDBusService = new AccessDialog.AccessDialogDBus();
|
shellAccessDialogDBusService = new AccessDialog.AccessDialogDBus();
|
||||||
@ -180,7 +198,6 @@ function _initializeUI() {
|
|||||||
uiGroup = layoutManager.uiGroup;
|
uiGroup = layoutManager.uiGroup;
|
||||||
|
|
||||||
padOsdService = new PadOsd.PadOsdService();
|
padOsdService = new PadOsd.PadOsdService();
|
||||||
screencastService = new Screencast.ScreencastService();
|
|
||||||
xdndHandler = new XdndHandler.XdndHandler();
|
xdndHandler = new XdndHandler.XdndHandler();
|
||||||
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
|
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
|
||||||
osdWindowManager = new OsdWindow.OsdWindowManager();
|
osdWindowManager = new OsdWindow.OsdWindowManager();
|
||||||
@ -519,7 +536,9 @@ function pushModal(actor, params) {
|
|||||||
let prevFocusDestroyId;
|
let prevFocusDestroyId;
|
||||||
if (prevFocus != null) {
|
if (prevFocus != null) {
|
||||||
prevFocusDestroyId = prevFocus.connect('destroy', () => {
|
prevFocusDestroyId = prevFocus.connect('destroy', () => {
|
||||||
let index = _findModal(actor);
|
const index = modalActorFocusStack.findIndex(
|
||||||
|
record => record.prevFocus === prevFocus);
|
||||||
|
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
modalActorFocusStack[index].prevFocus = null;
|
modalActorFocusStack[index].prevFocus = null;
|
||||||
});
|
});
|
||||||
@ -795,7 +814,7 @@ function showRestartMessage(message) {
|
|||||||
|
|
||||||
var AnimationsSettings = class {
|
var AnimationsSettings = class {
|
||||||
constructor() {
|
constructor() {
|
||||||
let backend = Meta.get_backend();
|
let backend = global.backend;
|
||||||
if (!backend.is_rendering_hardware_accelerated()) {
|
if (!backend.is_rendering_hardware_accelerated()) {
|
||||||
St.Settings.get().inhibit_animations();
|
St.Settings.get().inhibit_animations();
|
||||||
return;
|
return;
|
||||||
|
@ -4,7 +4,6 @@ const { Atk, Clutter, Gio, GLib,
|
|||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
|
||||||
const Calendar = imports.ui.calendar;
|
|
||||||
const Util = imports.misc.util;
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
var MESSAGE_ANIMATION_TIME = 100;
|
var MESSAGE_ANIMATION_TIME = 100;
|
||||||
@ -285,12 +284,12 @@ var LabelExpanderLayout = GObject.registerClass({
|
|||||||
return [min, nat];
|
return [min, nat];
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(container, box, flags) {
|
vfunc_allocate(container, box) {
|
||||||
for (let i = 0; i < container.get_n_children(); i++) {
|
for (let i = 0; i < container.get_n_children(); i++) {
|
||||||
let child = container.get_child_at_index(i);
|
let child = container.get_child_at_index(i);
|
||||||
|
|
||||||
if (child.visible)
|
if (child.visible)
|
||||||
child.allocate(box, flags);
|
child.allocate(box);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -572,7 +571,6 @@ var MessageListSection = GObject.registerClass({
|
|||||||
Main.sessionMode.disconnect(id);
|
Main.sessionMode.disconnect(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
this._date = new Date();
|
|
||||||
this._empty = true;
|
this._empty = true;
|
||||||
this._canClear = false;
|
this._canClear = false;
|
||||||
this._sync();
|
this._sync();
|
||||||
@ -598,13 +596,6 @@ var MessageListSection = GObject.registerClass({
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setDate(date) {
|
|
||||||
if (Calendar.sameDay(date, this._date))
|
|
||||||
return;
|
|
||||||
this._date = date;
|
|
||||||
this._sync();
|
|
||||||
}
|
|
||||||
|
|
||||||
addMessage(message, animate) {
|
addMessage(message, animate) {
|
||||||
this.addMessageAtIndex(message, -1, animate);
|
this.addMessageAtIndex(message, -1, animate);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user