Compare commits
418 Commits
wip/exalm/
...
gnome-3-36
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6b20eb8eea | ||
![]() |
407abf527f | ||
![]() |
5d1c241f53 | ||
![]() |
cb9bb62a21 | ||
![]() |
bde127b893 | ||
![]() |
51537cf31c | ||
![]() |
a3d2cfa503 | ||
![]() |
f36e4b6ed5 | ||
![]() |
40a003e5ac | ||
![]() |
5fa6996210 | ||
![]() |
5dba928154 | ||
![]() |
ab9fb0f351 | ||
![]() |
c2ba11425c | ||
![]() |
98ab6ae70d | ||
![]() |
2bf544e272 | ||
![]() |
8f6c64f607 | ||
![]() |
5f509855e2 | ||
![]() |
7097796c3f | ||
![]() |
1e87315554 | ||
![]() |
6b86b6a3e2 | ||
![]() |
ab59b74124 | ||
![]() |
2f61d9e94b | ||
![]() |
b8a7291e1d | ||
![]() |
222919cfc1 | ||
![]() |
db30fbe3e9 | ||
![]() |
03062d0d9d | ||
![]() |
ac2066673f | ||
![]() |
19f6281f84 | ||
![]() |
7dce433978 | ||
![]() |
96699b996c | ||
![]() |
390431c5e0 | ||
![]() |
afb405782c | ||
![]() |
12b31e6bd0 | ||
![]() |
d76c219026 | ||
![]() |
d26b320ab7 | ||
![]() |
132a8bb53e | ||
![]() |
c79251101d | ||
![]() |
f7dc59e370 | ||
![]() |
d0d91c49b8 | ||
![]() |
6b6045578c | ||
![]() |
b5f141f596 | ||
![]() |
0790503f16 | ||
![]() |
222698954f | ||
![]() |
25a8f484e4 | ||
![]() |
fae7ba52dc | ||
![]() |
9f87ffc054 | ||
![]() |
2e8ade4da0 | ||
![]() |
235ffa29dc | ||
![]() |
8d2a87781e | ||
![]() |
d14bf9a12a | ||
![]() |
12f2053613 | ||
![]() |
0abbd52646 | ||
![]() |
96f1d1b08d | ||
![]() |
d3384d29e4 | ||
![]() |
6de2fd6324 | ||
![]() |
a9c74ed78f | ||
![]() |
c02d0f3a7d | ||
![]() |
bd84de38a3 | ||
![]() |
bda8ba5ed1 | ||
![]() |
67b9386b4b | ||
![]() |
62a34c5116 | ||
![]() |
d1ed344cef | ||
![]() |
9ccd343764 | ||
![]() |
61c7092184 | ||
![]() |
b2454bd1b2 | ||
![]() |
ff73f76527 | ||
![]() |
b642f9275e | ||
![]() |
4220cd6624 | ||
![]() |
47bcc09516 | ||
![]() |
1889a975ce | ||
![]() |
4b8e090d19 | ||
![]() |
e74e691d84 | ||
![]() |
3ad2baede0 | ||
![]() |
3c69cb5677 | ||
![]() |
bd3f8de1e3 | ||
![]() |
27455c4458 | ||
![]() |
5fca21b943 | ||
![]() |
064633f4d5 | ||
![]() |
159ac3f180 | ||
![]() |
ba435e5f2d | ||
![]() |
b0a12fee51 | ||
![]() |
b5591fef10 | ||
![]() |
04e8ebcb2d | ||
![]() |
99ebef504d | ||
![]() |
c8d91b2c30 | ||
![]() |
4099c446da | ||
![]() |
d625618d1b | ||
![]() |
a09feb4b47 | ||
![]() |
bc3c1e5a68 | ||
![]() |
b148a8bc60 | ||
![]() |
2327fc9287 | ||
![]() |
28407c95b3 | ||
![]() |
e210d3138b | ||
![]() |
3f24721c76 | ||
![]() |
1a045bb210 | ||
![]() |
db2917479a | ||
![]() |
5815f9ac0e | ||
![]() |
e84d10bf87 | ||
![]() |
40481314d2 | ||
![]() |
daf25f273d | ||
![]() |
bc6a3329b4 | ||
![]() |
d3934bd685 | ||
![]() |
504d4b7ea4 | ||
![]() |
fde8519002 | ||
![]() |
e8ae2ea432 | ||
![]() |
57e67e0f31 | ||
![]() |
894ca0dd07 | ||
![]() |
5f945294c8 | ||
![]() |
a4d0f15edb | ||
![]() |
f781bdbcc8 | ||
![]() |
e8e79173d9 | ||
![]() |
884a2623a0 | ||
![]() |
fbdb56eb6d | ||
![]() |
e2c5e471c0 | ||
![]() |
34306d7326 | ||
![]() |
c3bdaf7e41 | ||
![]() |
c9950442d9 | ||
![]() |
5cf104933e | ||
![]() |
79aeabcf76 | ||
![]() |
1974724cb1 | ||
![]() |
d159bbfd79 | ||
![]() |
881d330bc0 | ||
![]() |
6a9ce0f18c | ||
![]() |
473a666cc0 | ||
![]() |
4872d5969c | ||
![]() |
048796d145 | ||
![]() |
dfc016894e | ||
![]() |
7b19a6f9b6 | ||
![]() |
e4199c71cc | ||
![]() |
abb401eaa8 | ||
![]() |
118676bffb | ||
![]() |
dff855942e | ||
![]() |
1d3c1b1ee3 | ||
![]() |
7b75e9f5ed | ||
![]() |
4336952822 | ||
![]() |
2a2634439c | ||
![]() |
0d2d8cf623 | ||
![]() |
d64b1e6efb | ||
![]() |
bbf3a09e2a | ||
![]() |
e57a4e0937 | ||
![]() |
443d615edf | ||
![]() |
006d0e8521 | ||
![]() |
1a5a01622a | ||
![]() |
38e31b9f0d | ||
![]() |
fb7e70d562 | ||
![]() |
63a6c0d6f9 | ||
![]() |
05c1a6dce6 | ||
![]() |
4097f7943f | ||
![]() |
802c2fe532 | ||
![]() |
9497ddd68a | ||
![]() |
890f5b591f | ||
![]() |
5b0d013229 | ||
![]() |
60ee6ab4b7 | ||
![]() |
18a5c74362 | ||
![]() |
4895032054 | ||
![]() |
6b24ab572c | ||
![]() |
35a3320851 | ||
![]() |
156e05fe90 | ||
![]() |
cc0fac895c | ||
![]() |
a6783692c5 | ||
![]() |
1c27b68bcc | ||
![]() |
717c05a288 | ||
![]() |
e68604b1aa | ||
![]() |
0368ad29e9 | ||
![]() |
b982ce394e | ||
![]() |
025647f585 | ||
![]() |
7125b726ad | ||
![]() |
aebfab7207 | ||
![]() |
698bd5b3a9 | ||
![]() |
51e9f19f2f | ||
![]() |
6d38a4a7b3 | ||
![]() |
dfcc5ffb1e | ||
![]() |
8b80a4cf4d | ||
![]() |
01e894c028 | ||
![]() |
856adfd1f1 | ||
![]() |
efee3aa749 | ||
![]() |
15e72da648 | ||
![]() |
3f8bd1db25 | ||
![]() |
3a863ee341 | ||
![]() |
654a7af929 | ||
![]() |
8dd9cbac7f | ||
![]() |
331db650dd | ||
![]() |
428d38179d | ||
![]() |
fe9708ebd8 | ||
![]() |
8398769321 | ||
![]() |
768c08ba9d | ||
![]() |
69426cbfda | ||
![]() |
9f968e7378 | ||
![]() |
1ab5e6973a | ||
![]() |
1dea3341ec | ||
![]() |
8fda054dc5 | ||
![]() |
e989684602 | ||
![]() |
5c33fe4a0a | ||
![]() |
4f427f4e0d | ||
![]() |
6d3c740b37 | ||
![]() |
34c4627db9 | ||
![]() |
b08b125df6 | ||
![]() |
50301bcfd4 | ||
![]() |
c2cacc63ee | ||
![]() |
c226081a23 | ||
![]() |
16f4e4dc4c | ||
![]() |
308b58175f | ||
![]() |
454e3fd39a | ||
![]() |
e4d72fb2b0 | ||
![]() |
f3fcc4adb7 | ||
![]() |
867587ef4c | ||
![]() |
b68fb35783 | ||
![]() |
8dfed7e762 | ||
![]() |
97fe4f761a | ||
![]() |
ba8210ea98 | ||
![]() |
656168543f | ||
![]() |
8378c9c9e0 | ||
![]() |
de16fe8dff | ||
![]() |
793f053309 | ||
![]() |
bea34da289 | ||
![]() |
aafec16f49 | ||
![]() |
73df61f36d | ||
![]() |
39e6375aff | ||
![]() |
ed21a4e5c1 | ||
![]() |
73472ba6a7 | ||
![]() |
702417ce83 | ||
![]() |
766e9034e2 | ||
![]() |
91748aedb7 | ||
![]() |
4783d767d6 | ||
![]() |
dedbf0cb09 | ||
![]() |
e5b7462b94 | ||
![]() |
48b0a91385 | ||
![]() |
6170bea283 | ||
![]() |
dcceb615bf | ||
![]() |
da673639ca | ||
![]() |
dd7727e315 | ||
![]() |
f3ba1e65ba | ||
![]() |
f8b4696211 | ||
![]() |
d71d85e90c | ||
![]() |
660a2b6e62 | ||
![]() |
cc347bf6d8 | ||
![]() |
26ffeaae47 | ||
![]() |
01a57206bc | ||
![]() |
279072795f | ||
![]() |
c89d6a633a | ||
![]() |
fecc0c06ac | ||
![]() |
512862f2d7 | ||
![]() |
a90fcb7ddb | ||
![]() |
6baf490aab | ||
![]() |
f971b8426d | ||
![]() |
83c6b2ab48 | ||
![]() |
24742f3566 | ||
![]() |
03a46be5c7 | ||
![]() |
9a26b970f9 | ||
![]() |
2ef71b62df | ||
![]() |
766288eec1 | ||
![]() |
53e8285cf0 | ||
![]() |
ff844a2a81 | ||
![]() |
78997cb7eb | ||
![]() |
f52574bd28 | ||
![]() |
e6a814fac8 | ||
![]() |
ddb85c03c3 | ||
![]() |
66c4b1a8b6 | ||
![]() |
11daf14e80 | ||
![]() |
35484151ce | ||
![]() |
1bccbe7f11 | ||
![]() |
b4162afa65 | ||
![]() |
eb51942a05 | ||
![]() |
23e5cd4e10 | ||
![]() |
13f3f75303 | ||
![]() |
3dd8ffc2bb | ||
![]() |
541847d8b6 | ||
![]() |
fb9854c003 | ||
![]() |
c748b9de5c | ||
![]() |
34e85342d8 | ||
![]() |
91b7474d5a | ||
![]() |
d76162c1c0 | ||
![]() |
2b517e352d | ||
![]() |
08203c9c1e | ||
![]() |
d29e5765ba | ||
![]() |
61beccf733 | ||
![]() |
ffb8bd5fa7 | ||
![]() |
7f6e2ff36b | ||
![]() |
7d94bfa642 | ||
![]() |
eb3c857f23 | ||
![]() |
a096ed37d6 | ||
![]() |
498a743c08 | ||
![]() |
2c91b6164c | ||
![]() |
04352ae158 | ||
![]() |
5c5dc03b78 | ||
![]() |
8a89e22e8e | ||
![]() |
8f851e8adf | ||
![]() |
49e4757c0b | ||
![]() |
dc002a61eb | ||
![]() |
bea3987f3e | ||
![]() |
7cd37a4017 | ||
![]() |
3d69fa8b9c | ||
![]() |
3a52bfbc0f | ||
![]() |
38c0f3bbf2 | ||
![]() |
7b1533caf7 | ||
![]() |
afd83d929e | ||
![]() |
d9e8a525de | ||
![]() |
b25142c517 | ||
![]() |
6893fc3810 | ||
![]() |
13ef33ae0a | ||
![]() |
f8886468ce | ||
![]() |
3bf0511f1b | ||
![]() |
1b485427cf | ||
![]() |
ebf04e3a95 | ||
![]() |
2f78b8428b | ||
![]() |
00eef6cd5d | ||
![]() |
5c031200ce | ||
![]() |
4340260c49 | ||
![]() |
96e534796f | ||
![]() |
3ee878491b | ||
![]() |
b92ddc0d39 | ||
![]() |
c8a4a91681 | ||
![]() |
e572d5d08c | ||
![]() |
9829d56bfa | ||
![]() |
b30d999878 | ||
![]() |
35b62baf6e | ||
![]() |
39f61fc41c | ||
![]() |
d3939a38a3 | ||
![]() |
b97fc02e57 | ||
![]() |
ea1adea24d | ||
![]() |
eb7533bbf1 | ||
![]() |
69ea038a8f | ||
![]() |
b80115dc6e | ||
![]() |
36b8dcbe07 | ||
![]() |
07fa5ef849 | ||
![]() |
d9a75412c3 | ||
![]() |
66f9a9df81 | ||
![]() |
4bfdd677e3 | ||
![]() |
002160e524 | ||
![]() |
f2df347ddb | ||
![]() |
799bbdb503 | ||
![]() |
1aff64a38b | ||
![]() |
574c560677 | ||
![]() |
f8db5aa106 | ||
![]() |
b18469427e | ||
![]() |
72c4f148ef | ||
![]() |
94f6976ddd | ||
![]() |
be187f4149 | ||
![]() |
1b872c1195 | ||
![]() |
89f2187d72 | ||
![]() |
943df86cb0 | ||
![]() |
a5a6c699c3 | ||
![]() |
a0467bf875 | ||
![]() |
b1da3ae772 | ||
![]() |
8af466e34d | ||
![]() |
66c7616892 | ||
![]() |
c05098cd12 | ||
![]() |
4723dd1f4c | ||
![]() |
7e4c32ec1f | ||
![]() |
3d443d5b17 | ||
![]() |
3155d03d9e | ||
![]() |
989c0ee49e | ||
![]() |
69f6c43b60 | ||
![]() |
bf2d012e40 | ||
![]() |
4d773a5ce9 | ||
![]() |
711d4ba65c | ||
![]() |
4490463513 | ||
![]() |
1ec5117715 | ||
![]() |
bf367daaba | ||
![]() |
1de008f2d5 | ||
![]() |
4baa091bc5 | ||
![]() |
cb7d1925ef | ||
![]() |
3ddae9d815 | ||
![]() |
e22421a25a | ||
![]() |
09a1e61c63 | ||
![]() |
7345a6f276 | ||
![]() |
fda938175e | ||
![]() |
3a39fb5ab8 | ||
![]() |
1a0ec782b5 | ||
![]() |
a96753f085 | ||
![]() |
4ff94f80a0 | ||
![]() |
e6d4581959 | ||
![]() |
07bbcb1b48 | ||
![]() |
f4ea9074d0 | ||
![]() |
d4ee2e8bbf | ||
![]() |
cf82d5ba85 | ||
![]() |
5e04f6eb23 | ||
![]() |
0dd171a7c8 | ||
![]() |
837fbbf417 | ||
![]() |
d7b61e7281 | ||
![]() |
073da0806c | ||
![]() |
ff54b0d35e | ||
![]() |
ff2a736193 | ||
![]() |
c6cf81f28b | ||
![]() |
104d1ae151 | ||
![]() |
12e14884ef | ||
![]() |
3c4a5a67e2 | ||
![]() |
e4f9efc134 | ||
![]() |
bd665df321 | ||
![]() |
bd197789c1 | ||
![]() |
daff787a62 | ||
![]() |
ff1343611f | ||
![]() |
da05c85f3c | ||
![]() |
648179a2db | ||
![]() |
a5ad81d923 | ||
![]() |
abfa61abc5 | ||
![]() |
abdfaeb444 | ||
![]() |
06b690ff21 | ||
![]() |
d0226c7897 | ||
![]() |
19e084036a | ||
![]() |
a7d974e670 | ||
![]() |
7a0c866d97 | ||
![]() |
cc3f439323 | ||
![]() |
51b7eb7a2b | ||
![]() |
023859ee4b | ||
![]() |
09acd0a3db | ||
![]() |
bf213af362 | ||
![]() |
bfb0bc7a29 | ||
![]() |
c00f1d040b | ||
![]() |
ba7cfff90c | ||
![]() |
548c41d164 | ||
![]() |
172d21cf50 | ||
![]() |
5c8f3a65f7 | ||
![]() |
07369125b6 | ||
![]() |
59cae58f25 | ||
![]() |
e07b9a75b5 | ||
![]() |
19fc7c4d31 | ||
![]() |
d66f5ab3c6 |
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
|
||||||
|
@@ -1,9 +1,13 @@
|
|||||||
|
include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- review
|
- review
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
|
BUNDLE: "extensions-git.flatpak"
|
||||||
JS_LOG: "js-report.txt"
|
JS_LOG: "js-report.txt"
|
||||||
POT_LOG: "pot-update.txt"
|
POT_LOG: "pot-update.txt"
|
||||||
|
|
||||||
@@ -46,6 +50,20 @@ eslint:
|
|||||||
- reports
|
- reports
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
|
potfile_check:
|
||||||
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
|
||||||
|
stage: review
|
||||||
|
script:
|
||||||
|
- ./.gitlab-ci/check-potfiles.sh
|
||||||
|
<<: *only_default
|
||||||
|
|
||||||
|
no_template_check:
|
||||||
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
|
||||||
|
stage: review
|
||||||
|
script:
|
||||||
|
- ./.gitlab-ci/check-template-strings.sh
|
||||||
|
<<: *only_default
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
||||||
stage: build
|
stage: build
|
||||||
@@ -96,3 +114,24 @@ test-pot:
|
|||||||
' | tee $POT_LOG
|
' | tee $POT_LOG
|
||||||
- (! grep -q . $POT_LOG)
|
- (! grep -q . $POT_LOG)
|
||||||
<<: *only_default
|
<<: *only_default
|
||||||
|
|
||||||
|
flatpak:
|
||||||
|
stage: build
|
||||||
|
variables:
|
||||||
|
SUBPROJECT: "subprojects/extensions-app"
|
||||||
|
# Your manifest path
|
||||||
|
MANIFEST_PATH: "$SUBPROJECT/build-aux/flatpak/org.gnome.Extensions.json"
|
||||||
|
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||||
|
FLATPAK_MODULE: "gnome-extensions-app"
|
||||||
|
APP_ID: "org.gnome.Extensions"
|
||||||
|
MESON_ARGS: "$SUBPROJECT"
|
||||||
|
extends: .flatpak
|
||||||
|
before_script:
|
||||||
|
- flatpak run --command=$SUBPROJECT/generate-translations.sh
|
||||||
|
--filesystem=host org.gnome.Sdk//master
|
||||||
|
<<: *only_default
|
||||||
|
|
||||||
|
nightly:
|
||||||
|
extends: '.publish_nightly'
|
||||||
|
variables:
|
||||||
|
BUNDLES: '$BUNDLE'
|
||||||
|
26
.gitlab-ci/check-potfiles.sh
Executable file
26
.gitlab-ci/check-potfiles.sh
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
srcdirs="js src subprojects/extensions-tool"
|
||||||
|
globs=('*.js' '*.c')
|
||||||
|
|
||||||
|
# find source files that contain gettext keywords
|
||||||
|
files=$(grep -lR ${globs[@]/#/--include=} '\(gettext\|[^I_)]_\)(' $srcdirs)
|
||||||
|
|
||||||
|
# find those that aren't listed in POTFILES.in
|
||||||
|
missing=$(for f in $files; do ! grep -q ^$f po/POTFILES.in && echo $f; done)
|
||||||
|
|
||||||
|
if [ ${#missing} -eq 0 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >&2 <<EOT
|
||||||
|
|
||||||
|
The following files are missing from po/POTFILES.po:
|
||||||
|
|
||||||
|
EOT
|
||||||
|
for f in $missing; do
|
||||||
|
echo " $f" >&2
|
||||||
|
done
|
||||||
|
echo >&2
|
||||||
|
|
||||||
|
exit 1
|
23
.gitlab-ci/check-template-strings.sh
Executable file
23
.gitlab-ci/check-template-strings.sh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# find files from POTFILES.in that use js template strings
|
||||||
|
baddies=$(grep -l '${' $(grep ^js po/POTFILES.in))
|
||||||
|
|
||||||
|
if [ ${#baddies} -eq 0 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >&2 <<EOT
|
||||||
|
|
||||||
|
xgettext cannot handle template strings properly, so we ban their use
|
||||||
|
in files with translatable strings.
|
||||||
|
|
||||||
|
The following files are listed in po/POTFILES.in and use template strings:
|
||||||
|
|
||||||
|
EOT
|
||||||
|
for f in $baddies; do
|
||||||
|
echo " $f" >&2
|
||||||
|
done
|
||||||
|
echo >&2
|
||||||
|
|
||||||
|
exit 1
|
@@ -23,7 +23,7 @@ run_eslint() {
|
|||||||
mkdir -p $(dirname $output)
|
mkdir -p $(dirname $output)
|
||||||
touch $output
|
touch $output
|
||||||
|
|
||||||
eslint -f unix ${!extra_args} -o $output js
|
eslint -f unix ${!extra_args} -o $output js subprojects/extensions-app/js
|
||||||
}
|
}
|
||||||
|
|
||||||
list_commit_range_additions() {
|
list_commit_range_additions() {
|
||||||
|
233
NEWS
233
NEWS
@@ -1,3 +1,236 @@
|
|||||||
|
3.36.5
|
||||||
|
======
|
||||||
|
* 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]
|
||||||
|
* Fix app picker regressions on small displays [Sebastian; #2234, !1375, !1378]
|
||||||
|
* Fix top bar navigation when NumLock is active [Olivier; #550]
|
||||||
|
* Delay login animation until wallpaper has loaded [Michael; #734996]
|
||||||
|
* Revert changes that caused mispositioning in overview in multi-monitor setups
|
||||||
|
[Robert; #2971]
|
||||||
|
* Reset auth prompt on login screen on VT switch before fade in [Ray; #2997]
|
||||||
|
* Fix stuck grab when destroying open popup menu [Florian; #3022]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Carlos, Andre, Jonas; !1357, !1371,
|
||||||
|
!1381, #3037, #3005, !1386, !1390]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Michael Catanzaro, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||||
|
Sebastian Keller, Robert Mader, Andre Moreira Magalhaes, Florian Müllner,
|
||||||
|
Jeremias Ortega, Ray Strode, Emre Uyguroglu
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Boyuan Yang [zh_CN], Rafael Fontenelle [pt_BR]
|
||||||
|
|
||||||
|
3.36.4
|
||||||
|
======
|
||||||
|
* Hide switch-user button on lock screen if unsupported [Chingkai; #2687]
|
||||||
|
* Improve world clocks styling [PrOF-kk; #2825]
|
||||||
|
* Improve calendar-server performance [Florian, Milan; #1875]
|
||||||
|
* Fix regressions in redesigned modal dialogs [Florian, Jonas; #2491, !1336]
|
||||||
|
* Better support sandboxed apps with multiple .desktop files [Florian; #219]
|
||||||
|
* Fix on-screen keyboard size in portrait orientation [Florian; #2349]
|
||||||
|
* Support scrolling anywhere in slider menu items [Peter; #2795]
|
||||||
|
* Fixed crash [Marco; #2643]
|
||||||
|
* Plugged leaks [Sebastian, Florian; !1306, !1341]
|
||||||
|
* Misc. bug fixes and cleanups [Jonas, Daniel, Florian, Sebastian, MOZGIII,
|
||||||
|
Koki; !1119, !1289, !1331, !1192, !1340, !1327, !1279]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Chingkai, Milan Crha, Jonas Dreßler, Koki Fukuda,
|
||||||
|
Sebastian Keller, MOZGIII, Robert Mader, Florian Müllner, PrOF-kk,
|
||||||
|
Peter Simonyi, Daniel van Vugt
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Matej Urbančič [sl], sicklylife [ja], Fabio Tomat [fur],
|
||||||
|
Baurzhan Muftakhidinov [kk], Daniel Șerbănescu [ro]
|
||||||
|
|
||||||
|
3.36.3
|
||||||
|
======
|
||||||
|
* Add gnome-shell-extension-prefs wrapper for compatibility [Florian; !1220]
|
||||||
|
* Fix distorted fallback icons in top bar [Florian; #2578]
|
||||||
|
* Lower timeout for scrolling in overview [Alexander; #2602]
|
||||||
|
* 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]
|
||||||
|
* Fix "Do Not Disturb" setting getting reset on startup [Florian; #2804]
|
||||||
|
* Fix pad OSD glitches [Carlos; !1290]
|
||||||
|
* Fix matching notifications by PID [Florian; #2592]
|
||||||
|
* Only allow updates for extensions that aren't cached [Florian; !1248]
|
||||||
|
* Fixed crashes [Jonas, Florian; #2709, #2757]
|
||||||
|
* Misc. bug fixes and cleanups [Michael, Piotr, Philip, Florian, Amr,
|
||||||
|
AsciiWolf; !1233, !1205, !1229, #2751, !1232, #2796, !1249, !1263,
|
||||||
|
!1277, #2286, !1288, !1291]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
AsciiWolf, Michael Catanzaro, Philip Chimento, Jonas Dreßler, Bryan Dunsmore,
|
||||||
|
Carlos Garnacho, Amr Ibrahim, Michael Lass, Alexander Mikhaylenko,
|
||||||
|
Florian Müllner
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Fabio Tomat [fur], Cheng-Chia Tseng [zh_TW], Dušan Kazik [sk],
|
||||||
|
Piotr Drąg [pl], Daniel Mustieles [es], Nathan Follens [nl],
|
||||||
|
Bruce Cowan [en_GB], Florentina Mușat [ro], Yuri Chornoivan [uk],
|
||||||
|
Milo Casagrande [it], Anders Jonsson [sv], Charles Monzat [fr],
|
||||||
|
Daniel Șerbănescu [ro], sicklylife [ja], Kukuh Syafaat [id],
|
||||||
|
Emin Tufan Çetin [tr], Jiri Grönroos [fi], Марко Костић [sr],
|
||||||
|
Christian Kirbach [de], Changwoo Ryu [ko], Aurimas Černius [lt],
|
||||||
|
Matej Urbančič [sl]
|
||||||
|
|
||||||
|
3.36.2
|
||||||
|
======
|
||||||
|
* 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 handling of scale-factor changes [Georges; !1176]
|
||||||
|
* Fix translations of folder names [Florian; #2623]
|
||||||
|
* Fix delay on lock screen after entering wrong password [Jonas D.; #2655]
|
||||||
|
* Match ASCII alternatives of system actions [Will; #2688]
|
||||||
|
* Tone down weekend days with events in calendar [Jakub; #2588]
|
||||||
|
* Fix area screenshots on multi-monitor systems [Jonas Å; !1224]
|
||||||
|
* 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 [Jonas Å., Marco, Andre, Florian, Jonas D.;
|
||||||
|
!1155, !1156, !1169, !1168, #2551, #2563, !1172, !1179, !1160, #2562, #2578,
|
||||||
|
!1203, #2649, #2628, #2691, #1615, #2607, !1228]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Jonas Dreßler, Carlos Garnacho,
|
||||||
|
Andre Moreira Magalhaes, Florian Müllner, Georges Basile Stavracas Neto,
|
||||||
|
Jakub Steiner, Will Thompson, 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], Rafael Fontenelle [pt_BR], Petr Kovář [cs],
|
||||||
|
Daniel Rusek [cs]
|
||||||
|
|
||||||
|
3.36.1
|
||||||
|
======
|
||||||
|
* Improve app folders [Jonas D.; !1011]
|
||||||
|
* Fix launching ibus daemon [Alynx; !1080]
|
||||||
|
* Do not shutdown ibus/xsettings on X11 compositor restart [Carlos; #2329]
|
||||||
|
* Hide hint text in entries when preedit is used [Carlos; !1084]
|
||||||
|
* Do not load app infos on main thread [Christian; #2282]
|
||||||
|
* Don't expose FDO Notifications interface on main bus name [Florian; !547]
|
||||||
|
* Fix icon of mobile broadband connections [Cosimo, Reik; !1097, !1105]
|
||||||
|
* Fix high-contrast/symbolic icon mix-up [Florian; #2414]
|
||||||
|
* Don't ellipsize times in world clock [Florian; !1090]
|
||||||
|
* Only check for extension updates if there are any extensions [Florian; !1100]
|
||||||
|
* Fix crash when trying to update removed extensions [Florian; #2343]
|
||||||
|
* Make Extensions app available as flatpak [Florian; !1081, !1106, !1087, !1133]
|
||||||
|
* Display fractional timezones as hours:minutes [Jonas D.; #2438]
|
||||||
|
* Fix assigning pad keybindings [Carlos; #2451]
|
||||||
|
* Handle embedded newlines in lock screen notifications [Florian; #2463]
|
||||||
|
* Fix OSK layout fallback for unsupported variants [Florian; #2471]
|
||||||
|
* Do not apply text color to color glyphs (emojis) [Carlos; #850]
|
||||||
|
* Check "Install pending software updates" by default [Michael; #2427]
|
||||||
|
* Do not warn about missing GDM on each login [Florian; #2432]
|
||||||
|
* Fix telepathy chat notifications [Marco; !1112]
|
||||||
|
* Fix offline updates support in end session dialog [Michael; #2276]
|
||||||
|
* Fix activating notifications by keyboard [Florian; #2319]
|
||||||
|
* Remove handling of 'blacklisted' extensions [Florian; !1132]
|
||||||
|
* Only update extensions if Extensions app is installed [Florian; #2346]
|
||||||
|
* Improve Norwegian on-screen-keyboard layout [Bjørn; !1073]
|
||||||
|
* Fix IM support for deleting surrounding text [Takao; !477]
|
||||||
|
* Fix blur effect with fractional scaling [Jonas D.; !1000]
|
||||||
|
* Use better location name in weather section [Florian; #2468]
|
||||||
|
* Fix glitch in sound feedback on volume changes [Florian; !1147]
|
||||||
|
* Fix on-screen keyboard regressions [Jonas D.; !1142]
|
||||||
|
* Improve screen-reader support [Luke; #2508, #2517]
|
||||||
|
* Fix password entry resize on login/lock screen [Florian; #2423]
|
||||||
|
* Fix crash when opening app picker [Jonas Å.; !1154]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Sebastian, Jan, Daniel, Philip, Mario,
|
||||||
|
Ray, Marco, Jonas D., Carlos, Georges; #2298, #2305, !1078, !1077, #2334,
|
||||||
|
#2381, !1093, !1098, #2386, !1108, !1109, !1114, !1076, !1072, !1115, !1088,
|
||||||
|
!1101, #2467, !1121, !1122, #2476, !1123, !1117, !1129, !1113, !1102, !1127,
|
||||||
|
#2238, !1131, !1135, !1136, !849, #2504, #2371, !1146, !1141, #2510, !1150]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Michael Catanzaro, Cosimo Cecchi, Jonas Dreßler,
|
||||||
|
Takao Fujiwara, Carlos Garnacho, Christian Hergert, Sebastian Keller,
|
||||||
|
Reik Keutterling, Bjørn Lie, Florian Müllner, Jwtiyar Nariman,
|
||||||
|
Georges Basile Stavracas Neto, Mario Sanchez Prada, Ray Strode, Jan Tojnar,
|
||||||
|
Daniel van Vugt, Philip Withnall, Luke Yelavich, Alynx Zhou, Jonas Ådahl
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Марко Костић [sr], Jordi Mas [ca], sicklylife [ja], Marek Černocký [cs],
|
||||||
|
Daniel Rusek [cs], Kjartan Maraas [nb], Tim Sabsch [de], Stas Solovey [ru],
|
||||||
|
Peter Mráz [sk], Rafael Fontenelle [pt_BR], Piotr Drąg [pl],
|
||||||
|
Milo Casagrande [it], Anders Jonsson [sv], Yuri Chornoivan [uk],
|
||||||
|
Kukuh Syafaat [id], Guillaume Bernard [fr], Daniel Mustieles [es],
|
||||||
|
Danial Behzadi [fa], Goran Vidović [hr], Yosef Or Boczko [he],
|
||||||
|
Emin Tufan Çetin [tr], Wolfgang Stöggl [de], Ibai Oihanguren Sala [eu],
|
||||||
|
Jwtiyar Nariman [ckb], Aurimas Černius [lt]
|
||||||
|
|
||||||
|
3.36.0
|
||||||
|
======
|
||||||
|
* Fix off-by-1900 error in date conversions [Florian; !1061]
|
||||||
|
* Fix crash on startup with topIcons* extension enabled [Florian; #2308]
|
||||||
|
* Don't require gsd-xsettings for X11 support on wayland [Olivier; !1065]
|
||||||
|
* Fix ibus support in Xorg session [Carlos; #1690]
|
||||||
|
* Improve Extensions D-Bus API [Florian; !1074]
|
||||||
|
* Allow session modes to specify alternative resource name [Marco; !1063]
|
||||||
|
* Fix link to location settings in aggregate menu [Sebastian; #2316]
|
||||||
|
* Fix illegible app folder titles with light theme [ub; !1059]
|
||||||
|
* Really fix visual glitch in sliders [Jonas; #1569]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||||
|
Sebastian Keller, Florian Müllner, ub
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Aman Alam [pa], Goran Vidović [hr], Aurimas Černius [lt],
|
||||||
|
Milo Casagrande [it], Daniel Korostil [uk], sicklylife [ja],
|
||||||
|
Marek Černocký [cs], Nathan Follens [nl]
|
||||||
|
|
||||||
|
3.35.92
|
||||||
|
=======
|
||||||
|
* Plug a memory leak [Jonas D.; !1015]
|
||||||
|
* Fix missing "back" button on login screen [Florian; #2228]
|
||||||
|
* Fix width of window preview titles in overview [Jonas D.; #58]
|
||||||
|
* Fix looking glass text with light style variant [Feichtmeier; !1023]
|
||||||
|
* Center unlock entry [Florian; !1021]
|
||||||
|
* Hide overlay scrollbars in notification popup [Jonas D.; !1013]
|
||||||
|
* Work around add_actor() slowness in icon spring animation [Daniel; !1002]
|
||||||
|
* Add disable-animations heuristics [Jonas Å.; !757]
|
||||||
|
* Fix visual glitches in on-screen keyboard [Carlos; #2214]
|
||||||
|
* Fix clearing changed textures from cache [Florian; #2244]
|
||||||
|
* Fix visual glitch in sliders [Daniel; #1569]
|
||||||
|
* Stop using dedicated lock screen background [Florian; !1001]
|
||||||
|
* Fix entries disappearing after authentication errors [Florian; #2236]
|
||||||
|
* Fix crash when animations are disabled [Florian; #2255]
|
||||||
|
* Fix passing pointer events to clients when magnified [Jonas D.; !993]
|
||||||
|
* Fix keynav on new lock screen [Florian; #2210]
|
||||||
|
* Avoid short-lived allocations on actor removal [Christian; #2263]
|
||||||
|
* Fix super-sized default avatars in user list [Florian, Sam; #2242]
|
||||||
|
* Leave overview when locking the screen [Jonas D.; !1043]
|
||||||
|
* Hide message list on login screen [Florian; #2241]
|
||||||
|
* Avoid IO on the main thread [Christian, Florian; !1050, !1051]
|
||||||
|
* Fix window animations getting stuck when client doesn't respond [Jonas; !1055]
|
||||||
|
* Only subscribe to touchpad events for touchpad gestures [Daniel; !925]
|
||||||
|
* Start X11 session services before Xwayland clients [Carlos; !836, !1056]
|
||||||
|
* Only show switch-user button with unlock prompt [Florian; !1029]
|
||||||
|
* Misc. bug fixes and cleanups [Jonas D., Florian, Georges, Jonas Å., Daniel,
|
||||||
|
Jakub, Philippe; !1018, !1020, !1024, !1027, !1026, !1022, !1031, !1035,
|
||||||
|
!1032, !1025, !1039, #2157, !1037, !1042, !1047, !1048, #2270, !1046,
|
||||||
|
!167, !1016]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Dreßler, Feichtmeier, Carlos Garnacho, Christian Hergert, Sam Hewitt,
|
||||||
|
Florian Müllner, Georges Basile Stavracas Neto, Jakub Steiner, Philippe Troin,
|
||||||
|
Daniel van Vugt, Jonas Ådahl
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Danial Behzadi [fa], Efstathios Iosifidis [el], Daniel Mustieles [es],
|
||||||
|
Sabri Ünal [tr], sicklylife [ja], Piotr Drąg [pl], Jordi Mas [ca],
|
||||||
|
Anders Jonsson [sv], Chao-Hsiung Liao [zh_TW], Asier Sarasua Garmendia [eu],
|
||||||
|
Rafael Fontenelle [pt_BR], Марко Костић [sr], Changwoo Ryu [ko],
|
||||||
|
Charles Monzat [fr], Jiri Grönroos [fi], Jor Teron [mjw], Bruce Cowan [en_GB],
|
||||||
|
Emin Tufan Çetin [tr], Alan Mortensen [da], Balázs Úr [hu], Fran Dieguez [gl],
|
||||||
|
Kukuh Syafaat [id]
|
||||||
|
|
||||||
3.35.91
|
3.35.91
|
||||||
=======
|
=======
|
||||||
* Improve magnifier [Carlos; !984]
|
* Improve magnifier [Carlos; !984]
|
||||||
|
@@ -161,12 +161,16 @@ def convert_file(source_file, destination_path):
|
|||||||
try:
|
try:
|
||||||
xkb_name = locale_to_xkb(root["locale"], root["name"])
|
xkb_name = locale_to_xkb(root["locale"], root["name"])
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
logging.warn(e)
|
logging.warning(e)
|
||||||
return False
|
return False
|
||||||
destination_file = os.path.join(destination_path, xkb_name + ".json")
|
destination_file = os.path.join(destination_path, xkb_name + ".json")
|
||||||
|
|
||||||
with open(destination_file, 'w', encoding="utf-8") as dest_fd:
|
try:
|
||||||
json.dump(root, dest_fd, ensure_ascii=False, indent=2, sort_keys=True)
|
with open(destination_file, 'x', encoding="utf-8") as dest_fd:
|
||||||
|
json.dump(root, dest_fd, ensure_ascii=False, indent=2, sort_keys=True)
|
||||||
|
except FileExistsError as e:
|
||||||
|
logging.info("File %s exists, not updating", destination_file)
|
||||||
|
return False
|
||||||
|
|
||||||
logging.debug("written %s", destination_file)
|
logging.debug("written %s", destination_file)
|
||||||
|
|
@@ -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>
|
||||||
|
@@ -199,14 +199,37 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
LaunchExtensionPrefs:
|
LaunchExtensionPrefs:
|
||||||
@uuid: The UUID of the extension
|
Deprecated for OpenExtensionPrefs
|
||||||
|
|
||||||
Launch preferences of an extension.
|
|
||||||
-->
|
-->
|
||||||
<method name="LaunchExtensionPrefs">
|
<method name="LaunchExtensionPrefs">
|
||||||
<arg type="s" direction="in" name="uuid"/>
|
<arg type="s" direction="in" name="uuid"/>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
OpenExtensionPrefs:
|
||||||
|
@uuid: The UUID of the extension
|
||||||
|
@parent_window: Identifier for the application window
|
||||||
|
@options: Vardict with further options
|
||||||
|
|
||||||
|
Opens the prefs dialog of extension @uuid.
|
||||||
|
|
||||||
|
The following @options are recognized:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>modal b</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Whether the prefs window should be modal, default: false</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
-->
|
||||||
|
<method name="OpenExtensionPrefs">
|
||||||
|
<arg type="s" direction="in" name="uuid"/>
|
||||||
|
<arg type="s" direction="in" name="parent_window"/>
|
||||||
|
<arg type="a{sv}" direction="in" name="options"/>
|
||||||
|
</method>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
CheckForUpdates:
|
CheckForUpdates:
|
||||||
Update all extensions for which updates are available
|
Update all extensions for which updates are available
|
||||||
@@ -234,5 +257,11 @@
|
|||||||
-->
|
-->
|
||||||
<property name="ShellVersion" type="s" access="read"/>
|
<property name="ShellVersion" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
UserExtensionsEnabled:
|
||||||
|
Whether user extensions are enabled
|
||||||
|
-->
|
||||||
|
<property name="UserExtensionsEnabled" type="b" access="readwrite"/>
|
||||||
|
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
@@ -9,21 +9,21 @@
|
|||||||
<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>
|
||||||
|
@@ -19,6 +19,10 @@ Before=gnome-session-initialized.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
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
|
||||||
# On wayland we cannot restart
|
# On wayland we cannot restart
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -1,6 +1,6 @@
|
|||||||
desktop_files = [
|
desktop_files = [
|
||||||
'org.gnome.Shell.desktop',
|
'org.gnome.Shell.desktop',
|
||||||
'org.gnome.Extensions.desktop',
|
'org.gnome.Shell.Extensions.desktop',
|
||||||
]
|
]
|
||||||
service_files = []
|
service_files = []
|
||||||
|
|
||||||
|
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
|
@@ -12,7 +12,9 @@
|
|||||||
"w"
|
"w"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"e"
|
"e",
|
||||||
|
"é",
|
||||||
|
"ë"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"r"
|
"r"
|
||||||
@@ -21,30 +23,58 @@
|
|||||||
"t"
|
"t"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"y"
|
"y",
|
||||||
|
"ý",
|
||||||
|
"ÿ"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"u"
|
"u",
|
||||||
|
"ú",
|
||||||
|
"ü",
|
||||||
|
"û",
|
||||||
|
"ù",
|
||||||
|
"ū"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"i"
|
"i",
|
||||||
|
"í",
|
||||||
|
"ï"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"o"
|
"o",
|
||||||
|
"ó",
|
||||||
|
"ô",
|
||||||
|
"ò",
|
||||||
|
"õ",
|
||||||
|
"œ",
|
||||||
|
"ō"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"p"
|
"p"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"å"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
"a"
|
"a",
|
||||||
|
"á",
|
||||||
|
"ä",
|
||||||
|
"à",
|
||||||
|
"â",
|
||||||
|
"ã",
|
||||||
|
"ā"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"s"
|
"s",
|
||||||
|
"ß",
|
||||||
|
"ś",
|
||||||
|
"š"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"d"
|
"d",
|
||||||
|
"ð"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"f"
|
"f"
|
||||||
@@ -62,7 +92,16 @@
|
|||||||
"k"
|
"k"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"l"
|
"l",
|
||||||
|
"ł"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"ø",
|
||||||
|
"ö"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"æ",
|
||||||
|
"ä"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -82,7 +121,9 @@
|
|||||||
"b"
|
"b"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"n"
|
"n",
|
||||||
|
"ñ",
|
||||||
|
"ń"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"m"
|
"m"
|
||||||
@@ -121,7 +162,9 @@
|
|||||||
"W"
|
"W"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"E"
|
"E",
|
||||||
|
"É",
|
||||||
|
"Ë"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"R"
|
"R"
|
||||||
@@ -130,30 +173,58 @@
|
|||||||
"T"
|
"T"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"Y"
|
"Y",
|
||||||
|
"Ý",
|
||||||
|
"Ÿ"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"U"
|
"U",
|
||||||
|
"Ú",
|
||||||
|
"Ü",
|
||||||
|
"Û",
|
||||||
|
"Ù",
|
||||||
|
"Ū"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"I"
|
"I",
|
||||||
|
"Í",
|
||||||
|
"Ï"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"O"
|
"O",
|
||||||
|
"Ó",
|
||||||
|
"Ô",
|
||||||
|
"Ò",
|
||||||
|
"Õ",
|
||||||
|
"Œ",
|
||||||
|
"Ō"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"P"
|
"P"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Å"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
"A"
|
"A",
|
||||||
|
"Á",
|
||||||
|
"Ä",
|
||||||
|
"À",
|
||||||
|
"Â",
|
||||||
|
"Ã",
|
||||||
|
"Ā"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"S"
|
"S",
|
||||||
|
"SS",
|
||||||
|
"Ś",
|
||||||
|
"Š"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"D"
|
"D",
|
||||||
|
"Ð"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"F"
|
"F"
|
||||||
@@ -171,7 +242,16 @@
|
|||||||
"K"
|
"K"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"L"
|
"L",
|
||||||
|
"Ł"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Ø",
|
||||||
|
"Ö"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Æ",
|
||||||
|
"Ä"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -191,7 +271,9 @@
|
|||||||
"B"
|
"B"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"N"
|
"N",
|
||||||
|
"Ñ",
|
||||||
|
"Ń"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"M"
|
"M"
|
||||||
@@ -277,10 +359,10 @@
|
|||||||
"#"
|
"#"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"$",
|
"€",
|
||||||
"¢",
|
"¢",
|
||||||
"£",
|
"£",
|
||||||
"€",
|
"$",
|
||||||
"¥",
|
"¥",
|
||||||
"₱"
|
"₱"
|
||||||
],
|
],
|
||||||
@@ -419,13 +501,14 @@
|
|||||||
"£"
|
"£"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
"¥"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"$",
|
||||||
"¢"
|
"¢"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"€"
|
"¢"
|
||||||
],
|
|
||||||
[
|
|
||||||
"¥"
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"^",
|
"^",
|
||||||
@@ -504,4 +587,4 @@
|
|||||||
],
|
],
|
||||||
"locale": "nb",
|
"locale": "nb",
|
||||||
"name": "Norwegian Bokmål"
|
"name": "Norwegian Bokmål"
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ $app_icon_padding: 24px;
|
|||||||
.icon-grid {
|
.icon-grid {
|
||||||
-shell-grid-horizontal-item-size: $app_icon_size + $app_icon_padding * 2;
|
-shell-grid-horizontal-item-size: $app_icon_size + $app_icon_padding * 2;
|
||||||
-shell-grid-vertical-item-size: $app_icon_size + $app_icon_padding * 2;
|
-shell-grid-vertical-item-size: $app_icon_size + $app_icon_padding * 2;
|
||||||
spacing: $base_spacing * 6;
|
spacing: $base_spacing * 4;
|
||||||
|
|
||||||
.overview-icon {
|
.overview-icon {
|
||||||
icon-size: $app_icon_size;
|
icon-size: $app_icon_size;
|
||||||
@@ -35,9 +35,9 @@ $app_grid_fg_color: #fff;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* App Folders */
|
/* App Folders */
|
||||||
.app-folder {
|
.app-well-app.app-folder {
|
||||||
.overview-icon {
|
background-color: transparentize($osd_bg_color, 0.8);
|
||||||
}
|
border-radius: $base_border_radius + 4px; // same as %icon_tile
|
||||||
}
|
}
|
||||||
|
|
||||||
// expanded folder
|
// expanded folder
|
||||||
@@ -60,7 +60,7 @@ $app_grid_fg_color: #fff;
|
|||||||
& .folder-name-entry { width: 300px }
|
& .folder-name-entry { width: 300px }
|
||||||
|
|
||||||
/* FIXME: this is to keep the label in sync with the entry */
|
/* FIXME: this is to keep the label in sync with the entry */
|
||||||
& .folder-name-label { padding: 5px 7px }
|
& .folder-name-label { padding: 5px 7px; color: $osd_fg_color; }
|
||||||
|
|
||||||
& .edit-folder-button {
|
& .edit-folder-button {
|
||||||
@extend %button;
|
@extend %button;
|
||||||
@@ -73,10 +73,6 @@ $app_grid_fg_color: #fff;
|
|||||||
& > StIcon { icon-size: 16px }
|
& > StIcon { icon-size: 16px }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& StButton#vhandle,
|
|
||||||
& StButton#vhandle:hover,
|
|
||||||
& StButton#vhandle:active { background-color: transparent; }
|
|
||||||
}
|
}
|
||||||
.app-folder-dialog-container {
|
.app-folder-dialog-container {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
@@ -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 {
|
||||||
@@ -202,9 +204,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
|
||||||
|
@@ -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 {
|
||||||
|
@@ -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 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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
|
||||||
|
@@ -15,13 +15,11 @@
|
|||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
|
||||||
&:outlined {
|
&:outlined {
|
||||||
border: 1px solid darken($borders_color,5%);
|
background-color: transparentize($osd_fg_color, 0.7);
|
||||||
background-color: transparentize($osd_fg_color, 0.9);
|
|
||||||
box-shadow: inset 0 2px 2px 0 rgba(0,0,0,0.4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:selected {
|
&:selected {
|
||||||
background-color: transparentize($osd_fg_color, 0.9);
|
background-color: transparentize($osd_fg_color, 0.7);
|
||||||
color: $osd_fg_color;
|
color: $osd_fg_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
CLDR_LAYOUTS_TARBALL="http://www.unicode.org/Public/cldr/latest/keyboards.zip"
|
CLDR_LAYOUTS_TARBALL="http://www.unicode.org/Public/cldr/latest/keyboards.zip"
|
||||||
CLDR2JSON_GIT="git://repo.or.cz/cldr2json.git"
|
|
||||||
|
|
||||||
WORKDIR=".osk-layout-workbench"
|
WORKDIR=".osk-layout-workbench"
|
||||||
CLDR2JSON="$WORKDIR/cldr2json/cldr2json.py"
|
CLDR2JSON="cldr2json/cldr2json.py"
|
||||||
SRCDIR="$WORKDIR/keyboards/android"
|
SRCDIR="$WORKDIR/keyboards/android"
|
||||||
DESTDIR="osk-layouts"
|
DESTDIR="osk-layouts"
|
||||||
GRESOURCE_FILE="gnome-shell-osk-layouts.gresource.xml"
|
GRESOURCE_FILE="gnome-shell-osk-layouts.gresource.xml"
|
||||||
@@ -20,7 +19,6 @@ mkdir -p "osk-layouts"
|
|||||||
# Download stuff on the work dir
|
# Download stuff on the work dir
|
||||||
pushd $WORKDIR
|
pushd $WORKDIR
|
||||||
gio copy $CLDR_LAYOUTS_TARBALL .
|
gio copy $CLDR_LAYOUTS_TARBALL .
|
||||||
git clone $CLDR2JSON_GIT
|
|
||||||
unzip keyboards.zip
|
unzip keyboards.zip
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
5
js/dbusServices/dbus-service.in
Normal file
5
js/dbusServices/dbus-service.in
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
imports.package.start({
|
||||||
|
name: '@PACKAGE_NAME@',
|
||||||
|
prefix: '@prefix@',
|
||||||
|
libdir: '@libdir@',
|
||||||
|
});
|
3
js/dbusServices/dbus-service.service.in
Normal file
3
js/dbusServices/dbus-service.service.in
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[D-BUS Service]
|
||||||
|
Name=@service@
|
||||||
|
Exec=@gjs@ @pkgdatadir@/@service@
|
177
js/dbusServices/dbusService.js
Normal file
177
js/dbusServices/dbusService.js
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
/* exported DBusService, ServiceImplementation */
|
||||||
|
|
||||||
|
const { Gio, GLib } = imports.gi;
|
||||||
|
|
||||||
|
const Signals = imports.signals;
|
||||||
|
|
||||||
|
const IDLE_SHUTDOWN_TIME = 2; // s
|
||||||
|
|
||||||
|
var ServiceImplementation = class {
|
||||||
|
constructor(info, objectPath) {
|
||||||
|
this._objectPath = objectPath;
|
||||||
|
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(info, this);
|
||||||
|
|
||||||
|
this._injectTracking('return_dbus_error');
|
||||||
|
this._injectTracking('return_error_literal');
|
||||||
|
this._injectTracking('return_gerror');
|
||||||
|
this._injectTracking('return_value');
|
||||||
|
this._injectTracking('return_value_with_unix_fd_list');
|
||||||
|
|
||||||
|
this._senders = new Map();
|
||||||
|
this._holdCount = 0;
|
||||||
|
|
||||||
|
this._hasSignals = this._dbusImpl.get_info().signals.length > 0;
|
||||||
|
this._shutdownTimeoutId = 0;
|
||||||
|
|
||||||
|
// subclasses may override this to disable automatic shutdown
|
||||||
|
this._autoShutdown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// subclasses may override this to own additional names
|
||||||
|
register() {
|
||||||
|
}
|
||||||
|
|
||||||
|
export() {
|
||||||
|
this._dbusImpl.export(Gio.DBus.session, this._objectPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
unexport() {
|
||||||
|
this._dbusImpl.unexport();
|
||||||
|
}
|
||||||
|
|
||||||
|
hold() {
|
||||||
|
this._holdCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
release() {
|
||||||
|
if (this._holdCount === 0) {
|
||||||
|
logError(new Error('Unmatched call to release()'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._holdCount--;
|
||||||
|
|
||||||
|
if (this._holdCount === 0)
|
||||||
|
this._queueShutdownCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _handleError:
|
||||||
|
* @param {Gio.DBusMethodInvocation}
|
||||||
|
* @param {Error}
|
||||||
|
*
|
||||||
|
* Complete @invocation with an appropriate error if @error is set;
|
||||||
|
* useful for implementing early returns from method implementations.
|
||||||
|
*
|
||||||
|
* @returns {bool} - true if @invocation was completed
|
||||||
|
*/
|
||||||
|
|
||||||
|
_handleError(invocation, error) {
|
||||||
|
if (error === null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (error instanceof GLib.Error) {
|
||||||
|
invocation.return_gerror(error);
|
||||||
|
} else {
|
||||||
|
let name = error.name;
|
||||||
|
if (!name.includes('.')) // likely a normal JS error
|
||||||
|
name = `org.gnome.gjs.JSError.${name}`;
|
||||||
|
invocation.return_dbus_error(name, error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_maybeShutdown() {
|
||||||
|
if (!this._autoShutdown)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this._holdCount > 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.emit('shutdown');
|
||||||
|
}
|
||||||
|
|
||||||
|
_queueShutdownCheck() {
|
||||||
|
if (this._shutdownTimeoutId)
|
||||||
|
GLib.source_remove(this._shutdownTimeoutId);
|
||||||
|
|
||||||
|
this._shutdownTimeoutId = GLib.timeout_add_seconds(
|
||||||
|
GLib.PRIORITY_DEFAULT, IDLE_SHUTDOWN_TIME,
|
||||||
|
() => {
|
||||||
|
this._shutdownTimeoutId = 0;
|
||||||
|
this._maybeShutdown();
|
||||||
|
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_trackSender(sender) {
|
||||||
|
if (this._senders.has(sender))
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.hold();
|
||||||
|
this._senders.set(sender,
|
||||||
|
this._dbusImpl.get_connection().watch_name(
|
||||||
|
sender,
|
||||||
|
Gio.BusNameWatcherFlags.NONE,
|
||||||
|
null,
|
||||||
|
() => this._untrackSender(sender)));
|
||||||
|
}
|
||||||
|
|
||||||
|
_untrackSender(sender) {
|
||||||
|
const id = this._senders.get(sender);
|
||||||
|
|
||||||
|
if (id)
|
||||||
|
this._dbusImpl.get_connection().unwatch_name(id);
|
||||||
|
|
||||||
|
if (this._senders.delete(sender))
|
||||||
|
this.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
_injectTracking(methodName) {
|
||||||
|
const { prototype } = Gio.DBusMethodInvocation;
|
||||||
|
const origMethod = prototype[methodName];
|
||||||
|
const that = this;
|
||||||
|
|
||||||
|
prototype[methodName] = function (...args) {
|
||||||
|
origMethod.apply(this, args);
|
||||||
|
|
||||||
|
if (that._hasSignals)
|
||||||
|
that._trackSender(this.get_sender());
|
||||||
|
|
||||||
|
that._queueShutdownCheck();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Signals.addSignalMethods(ServiceImplementation.prototype);
|
||||||
|
|
||||||
|
var DBusService = class {
|
||||||
|
constructor(name, service) {
|
||||||
|
this._name = name;
|
||||||
|
this._service = service;
|
||||||
|
this._loop = new GLib.MainLoop(null, false);
|
||||||
|
|
||||||
|
this._service.connect('shutdown', () => this._loop.quit());
|
||||||
|
}
|
||||||
|
|
||||||
|
run() {
|
||||||
|
// Bail out when not running under gnome-shell
|
||||||
|
Gio.DBus.watch_name(Gio.BusType.SESSION,
|
||||||
|
'org.gnome.Shell',
|
||||||
|
Gio.BusNameWatcherFlags.NONE,
|
||||||
|
null,
|
||||||
|
() => this._loop.quit());
|
||||||
|
|
||||||
|
this._service.register();
|
||||||
|
|
||||||
|
Gio.DBus.own_name(Gio.BusType.SESSION,
|
||||||
|
this._name,
|
||||||
|
Gio.BusNameOwnerFlags.REPLACE,
|
||||||
|
() => this._service.export(),
|
||||||
|
null,
|
||||||
|
() => this._loop.quit());
|
||||||
|
|
||||||
|
this._loop.run();
|
||||||
|
}
|
||||||
|
};
|
2
js/dbusServices/extensions/css/application.css
Normal file
2
js/dbusServices/extensions/css/application.css
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.expander-frame > * { border-top-width: 0; }
|
||||||
|
.expander-toolbar { border: 0 solid @borders; border-top-width: 1px; }
|
274
js/dbusServices/extensions/extensionsService.js
Normal file
274
js/dbusServices/extensions/extensionsService.js
Normal file
@@ -0,0 +1,274 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
/* exported ExtensionsService */
|
||||||
|
|
||||||
|
const { Gdk, Gio, GLib, GObject, Gtk, Shew } = imports.gi;
|
||||||
|
|
||||||
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
|
|
||||||
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
const { ServiceImplementation } = imports.dbusService;
|
||||||
|
|
||||||
|
const ExtensionsIface = loadInterfaceXML('org.gnome.Shell.Extensions');
|
||||||
|
const ExtensionsProxy = Gio.DBusProxy.makeProxyWrapper(ExtensionsIface);
|
||||||
|
|
||||||
|
var ExtensionsService = class extends ServiceImplementation {
|
||||||
|
constructor() {
|
||||||
|
super(ExtensionsIface, '/org/gnome/Shell/Extensions');
|
||||||
|
|
||||||
|
this._proxy = new ExtensionsProxy(Gio.DBus.session,
|
||||||
|
'org.gnome.Shell', '/org/gnome/Shell');
|
||||||
|
|
||||||
|
this._proxy.connectSignal('ExtensionStateChanged',
|
||||||
|
(proxy, sender, params) => {
|
||||||
|
this._dbusImpl.emit_signal('ExtensionStateChanged',
|
||||||
|
new GLib.Variant('(sa{sv})', params));
|
||||||
|
});
|
||||||
|
|
||||||
|
this._proxy.connect('g-properties-changed', () => {
|
||||||
|
this._dbusImpl.emit_property_changed('UserExtensionsEnabled',
|
||||||
|
new GLib.Variant('b', this._proxy.UserExtensionsEnabled));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
get ShellVersion() {
|
||||||
|
return this._proxy.ShellVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
get UserExtensionsEnabled() {
|
||||||
|
return this._proxy.UserExtensionsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
set UserExtensionsEnabled(enable) {
|
||||||
|
this._proxy.UserExtensionsEnabled = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
ListExtensionsAsync(params, invocation) {
|
||||||
|
this._proxy.ListExtensionsRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(a{sa{sv}})', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
GetExtensionInfoAsync(params, invocation) {
|
||||||
|
this._proxy.GetExtensionInfoRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(a{sv})', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
GetExtensionErrorsAsync(params, invocation) {
|
||||||
|
this._proxy.GetExtensionErrorsRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(as)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
InstallRemoteExtensionAsync(params, invocation) {
|
||||||
|
this._proxy.InstallRemoteExtensionRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(s)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
UninstallExtensionAsync(params, invocation) {
|
||||||
|
this._proxy.UninstallExtensionRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(b)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
EnableExtensionAsync(params, invocation) {
|
||||||
|
this._proxy.EnableExtensionRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(b)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
DisableExtensionAsync(params, invocation) {
|
||||||
|
this._proxy.DisableExtensionRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(b)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
LaunchExtensionPrefsAsync([uuid], invocation) {
|
||||||
|
this.OpenExtensionPrefsAsync([uuid, '', {}], invocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
OpenExtensionPrefsAsync(params, invocation) {
|
||||||
|
const [uuid, parentWindow, options] = params;
|
||||||
|
|
||||||
|
this._proxy.GetExtensionInfoRemote(uuid, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
const [serialized] = res;
|
||||||
|
const extension = ExtensionUtils.deserializeExtension(serialized);
|
||||||
|
|
||||||
|
const window = new ExtensionPrefsDialog(extension);
|
||||||
|
window.realize();
|
||||||
|
|
||||||
|
let externalWindow = null;
|
||||||
|
|
||||||
|
if (parentWindow)
|
||||||
|
externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow);
|
||||||
|
|
||||||
|
if (externalWindow)
|
||||||
|
externalWindow.set_parent_of(window.window);
|
||||||
|
|
||||||
|
if (options.modal)
|
||||||
|
window.modal = options.modal.get_boolean();
|
||||||
|
|
||||||
|
window.connect('destroy', () => this.release());
|
||||||
|
this.hold();
|
||||||
|
|
||||||
|
window.show();
|
||||||
|
|
||||||
|
invocation.return_value(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckForUpdatesAsync(params, invocation) {
|
||||||
|
this._proxy.CheckForUpdatesRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var ExtensionPrefsDialog = GObject.registerClass({
|
||||||
|
GTypeName: 'ExtensionPrefsDialog',
|
||||||
|
Template: 'resource:///org/gnome/Shell/Extensions/ui/extension-prefs-dialog.ui',
|
||||||
|
InternalChildren: [
|
||||||
|
'headerBar',
|
||||||
|
'stack',
|
||||||
|
'expander',
|
||||||
|
'expanderArrow',
|
||||||
|
'revealer',
|
||||||
|
'errorView',
|
||||||
|
],
|
||||||
|
}, class ExtensionPrefsDialog extends Gtk.Window {
|
||||||
|
_init(extension) {
|
||||||
|
super._init();
|
||||||
|
|
||||||
|
this._uuid = extension.uuid;
|
||||||
|
this._url = extension.metadata.url || '';
|
||||||
|
|
||||||
|
this._headerBar.title = extension.metadata.name;
|
||||||
|
|
||||||
|
this._actionGroup = new Gio.SimpleActionGroup();
|
||||||
|
this.insert_action_group('win', this._actionGroup);
|
||||||
|
|
||||||
|
this._initActions();
|
||||||
|
this._addCustomStylesheet();
|
||||||
|
|
||||||
|
this._gesture = new Gtk.GestureMultiPress({
|
||||||
|
widget: this._expander,
|
||||||
|
button: 0,
|
||||||
|
exclusive: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
this._gesture.connect('released', (gesture, nPress) => {
|
||||||
|
if (nPress === 1)
|
||||||
|
this._revealer.reveal_child = !this._revealer.reveal_child;
|
||||||
|
});
|
||||||
|
|
||||||
|
this._revealer.connect('notify::reveal-child', () => {
|
||||||
|
this._expanderArrow.icon_name = this._revealer.reveal_child
|
||||||
|
? 'pan-down-symbolic'
|
||||||
|
: 'pan-end-symbolic';
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
ExtensionUtils.installImporter(extension);
|
||||||
|
|
||||||
|
// give extension prefs access to their own extension object
|
||||||
|
ExtensionUtils.getCurrentExtension = () => extension;
|
||||||
|
|
||||||
|
const prefsModule = extension.imports.prefs;
|
||||||
|
prefsModule.init(extension.metadata);
|
||||||
|
|
||||||
|
const widget = prefsModule.buildPrefsWidget();
|
||||||
|
this._stack.add(widget);
|
||||||
|
this._stack.visible_child = widget;
|
||||||
|
} catch (e) {
|
||||||
|
this._setError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_setError(exc) {
|
||||||
|
this._errorView.buffer.text = `${exc}\n\nStack trace:\n`;
|
||||||
|
// Indent stack trace.
|
||||||
|
this._errorView.buffer.text +=
|
||||||
|
exc.stack.split('\n').map(line => ` ${line}`).join('\n');
|
||||||
|
|
||||||
|
// markdown for pasting in gitlab issues
|
||||||
|
let lines = [
|
||||||
|
`The settings of extension ${this._uuid} had an error:`,
|
||||||
|
'```',
|
||||||
|
`${exc}`,
|
||||||
|
'```',
|
||||||
|
'',
|
||||||
|
'Stack trace:',
|
||||||
|
'```',
|
||||||
|
exc.stack.replace(/\n$/, ''), // stack without trailing newline
|
||||||
|
'```',
|
||||||
|
'',
|
||||||
|
];
|
||||||
|
this._errorMarkdown = lines.join('\n');
|
||||||
|
this._actionGroup.lookup('copy-error').enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_initActions() {
|
||||||
|
let action;
|
||||||
|
|
||||||
|
action = new Gio.SimpleAction({
|
||||||
|
name: 'copy-error',
|
||||||
|
enabled: false,
|
||||||
|
});
|
||||||
|
action.connect('activate', () => {
|
||||||
|
const clipboard = Gtk.Clipboard.get_default(this.get_display());
|
||||||
|
clipboard.set_text(this._errorMarkdown, -1);
|
||||||
|
});
|
||||||
|
this._actionGroup.add_action(action);
|
||||||
|
|
||||||
|
action = new Gio.SimpleAction({
|
||||||
|
name: 'show-url',
|
||||||
|
enabled: this._url !== '',
|
||||||
|
});
|
||||||
|
action.connect('activate', () => {
|
||||||
|
Gio.AppInfo.launch_default_for_uri(this._url,
|
||||||
|
this.get_display().get_app_launch_context());
|
||||||
|
});
|
||||||
|
this._actionGroup.add_action(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
_addCustomStylesheet() {
|
||||||
|
let provider = new Gtk.CssProvider();
|
||||||
|
let uri = 'resource:///org/gnome/Shell/Extensions/css/application.css';
|
||||||
|
try {
|
||||||
|
provider.load_from_file(Gio.File.new_for_uri(uri));
|
||||||
|
} catch (e) {
|
||||||
|
logError(e, 'Failed to add application style');
|
||||||
|
}
|
||||||
|
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
|
||||||
|
provider,
|
||||||
|
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
|
}
|
||||||
|
});
|
20
js/dbusServices/extensions/main.js
Normal file
20
js/dbusServices/extensions/main.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/* exported main */
|
||||||
|
|
||||||
|
imports.gi.versions.Gdk = '3.0';
|
||||||
|
imports.gi.versions.Gtk = '3.0';
|
||||||
|
|
||||||
|
const { Gtk } = imports.gi;
|
||||||
|
const pkg = imports.package;
|
||||||
|
|
||||||
|
const { DBusService } = imports.dbusService;
|
||||||
|
const { ExtensionsService } = imports.extensionsService;
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
Gtk.init(null);
|
||||||
|
pkg.initFormat();
|
||||||
|
|
||||||
|
const service = new DBusService(
|
||||||
|
'org.gnome.Shell.Extensions',
|
||||||
|
new ExtensionsService());
|
||||||
|
service.run();
|
||||||
|
}
|
197
js/dbusServices/extensions/ui/extension-prefs-dialog.ui
Normal file
197
js/dbusServices/extensions/ui/extension-prefs-dialog.ui
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.22.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.20"/>
|
||||||
|
<template class="ExtensionPrefsDialog" parent="GtkWindow">
|
||||||
|
<property name="default_width">600</property>
|
||||||
|
<property name="default_height">400</property>
|
||||||
|
<child type="titlebar">
|
||||||
|
<object class="GtkHeaderBar" id="headerBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="show_close_button">True</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkStack" id="stack">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="hscrollbar_policy">never</property>
|
||||||
|
<property name="propagate_natural_height">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="margin">100</property>
|
||||||
|
<property name="margin_bottom">60</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Something’s gone wrong</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="scale" value="1.44"/> <!-- x-large -->
|
||||||
|
</attributes>
|
||||||
|
<style>
|
||||||
|
<class name="dim-label"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">We’re very sorry, but there’s been a problem: the settings for this extension can’t be displayed. We recommend that you report the issue to the extension authors.</property>
|
||||||
|
<property name="justify">center</property>
|
||||||
|
<property name="wrap">True</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="margin_top">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame" id="expander">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="shadow_type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEventBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="margin">12</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="expanderArrow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="icon_name">pan-end-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Technical Details</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRevealer" id="revealer">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="shadow_type">in</property>
|
||||||
|
<style>
|
||||||
|
<class name="expander-frame"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkTextView" id="errorView">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="monospace">True</property>
|
||||||
|
<property name="editable">False</property>
|
||||||
|
<property name="wrap_mode">word</property>
|
||||||
|
<property name="left_margin">12</property>
|
||||||
|
<property name="right_margin">12</property>
|
||||||
|
<property name="top_margin">12</property>
|
||||||
|
<property name="bottom_margin">12</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToolbar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<style>
|
||||||
|
<class name="expander-toolbar"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToolItem">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="action_name">win.copy-error</property>
|
||||||
|
<style>
|
||||||
|
<class name="flat"/>
|
||||||
|
<class name="image-button"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="icon_name">edit-copy-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorToolItem">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="draw">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToolItem">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="homeButton">
|
||||||
|
<property name="visible"
|
||||||
|
bind-source="homeButton"
|
||||||
|
bind-property="sensitive"
|
||||||
|
bind-flags="sync-create"/>
|
||||||
|
<property name="label" translatable="yes">Homepage</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Visit extension homepage</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="no_show_all">True</property>
|
||||||
|
<property name="action_name">win.show-url</property>
|
||||||
|
<style>
|
||||||
|
<class name="flat"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</template>
|
||||||
|
</interface>
|
42
js/dbusServices/meson.build
Normal file
42
js/dbusServices/meson.build
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
launcherconf = configuration_data()
|
||||||
|
launcherconf.set('PACKAGE_NAME', meson.project_name())
|
||||||
|
launcherconf.set('prefix', prefix)
|
||||||
|
launcherconf.set('libdir', libdir)
|
||||||
|
|
||||||
|
dbus_services = {
|
||||||
|
'org.gnome.Shell.Extensions': 'extensions',
|
||||||
|
'org.gnome.Shell.Notifications': 'notifications',
|
||||||
|
}
|
||||||
|
|
||||||
|
config_dir = '@0@/..'.format(meson.current_build_dir())
|
||||||
|
|
||||||
|
foreach service, dir : dbus_services
|
||||||
|
configure_file(
|
||||||
|
input: 'dbus-service.in',
|
||||||
|
output: service,
|
||||||
|
configuration: launcherconf,
|
||||||
|
install_dir: pkgdatadir,
|
||||||
|
)
|
||||||
|
|
||||||
|
serviceconf = configuration_data()
|
||||||
|
serviceconf.set('service', service)
|
||||||
|
serviceconf.set('gjs', gjs.path())
|
||||||
|
serviceconf.set('pkgdatadir', pkgdatadir)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'dbus-service.service.in',
|
||||||
|
output: service + '.service',
|
||||||
|
configuration: serviceconf,
|
||||||
|
install_dir: servicedir
|
||||||
|
)
|
||||||
|
|
||||||
|
gnome.compile_resources(
|
||||||
|
service + '.src',
|
||||||
|
service + '.src.gresource.xml',
|
||||||
|
dependencies: [config_js],
|
||||||
|
source_dir: ['.', '..', dir, config_dir],
|
||||||
|
gresource_bundle: true,
|
||||||
|
install: true,
|
||||||
|
install_dir: pkgdatadir
|
||||||
|
)
|
||||||
|
endforeach
|
11
js/dbusServices/notifications/main.js
Normal file
11
js/dbusServices/notifications/main.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* exported main */
|
||||||
|
|
||||||
|
const { DBusService } = imports.dbusService;
|
||||||
|
const { NotificationDaemon } = imports.notificationDaemon;
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
const service = new DBusService(
|
||||||
|
'org.gnome.Shell.Notifications',
|
||||||
|
new NotificationDaemon());
|
||||||
|
service.run();
|
||||||
|
}
|
105
js/dbusServices/notifications/notificationDaemon.js
Normal file
105
js/dbusServices/notifications/notificationDaemon.js
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
/* exported NotificationDaemon */
|
||||||
|
|
||||||
|
const { Gio, GLib } = imports.gi;
|
||||||
|
|
||||||
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
const { ServiceImplementation } = imports.dbusService;
|
||||||
|
|
||||||
|
const NotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
|
||||||
|
const NotificationsProxy = Gio.DBusProxy.makeProxyWrapper(NotificationsIface);
|
||||||
|
|
||||||
|
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
||||||
|
|
||||||
|
var NotificationDaemon = class extends ServiceImplementation {
|
||||||
|
constructor() {
|
||||||
|
super(NotificationsIface, '/org/freedesktop/Notifications');
|
||||||
|
|
||||||
|
this._autoShutdown = false;
|
||||||
|
|
||||||
|
this._proxy = new NotificationsProxy(Gio.DBus.session,
|
||||||
|
'org.gnome.Shell',
|
||||||
|
'/org/freedesktop/Notifications',
|
||||||
|
(proxy, error) => {
|
||||||
|
if (error)
|
||||||
|
log(error.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
this._proxy.connectSignal('ActionInvoked',
|
||||||
|
(proxy, sender, params) => {
|
||||||
|
this._dbusImpl.emit_signal('ActionInvoked',
|
||||||
|
new GLib.Variant('(us)', params));
|
||||||
|
});
|
||||||
|
this._proxy.connectSignal('NotificationClosed',
|
||||||
|
(proxy, sender, params) => {
|
||||||
|
this._dbusImpl.emit_signal('NotificationClosed',
|
||||||
|
new GLib.Variant('(uu)', params));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
register() {
|
||||||
|
Gio.DBus.session.own_name(
|
||||||
|
'org.freedesktop.Notifications',
|
||||||
|
Gio.BusNameOwnerFlags.REPLACE,
|
||||||
|
null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(u)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseNotificationAsync(params, invocation) {
|
||||||
|
this._proxy.CloseNotificationRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
GetCapabilitiesAsync(params, invocation) {
|
||||||
|
this._proxy.GetCapabilitiesRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
invocation.return_value(new GLib.Variant('(as)', res));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
GetServerInformationAsync(params, invocation) {
|
||||||
|
this._proxy.GetServerInformationRemote(...params, (res, error) => {
|
||||||
|
if (this._handleError(invocation, error))
|
||||||
|
return;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
};
|
18
js/dbusServices/org.gnome.Shell.Extensions.src.gresource.xml
Normal file
18
js/dbusServices/org.gnome.Shell.Extensions.src.gresource.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gresources>
|
||||||
|
<gresource prefix="/org/gnome/Shell/Extensions/js">
|
||||||
|
<file>main.js</file>
|
||||||
|
<file>extensionsService.js</file>
|
||||||
|
<file>dbusService.js</file>
|
||||||
|
|
||||||
|
<file>misc/config.js</file>
|
||||||
|
<file>misc/extensionUtils.js</file>
|
||||||
|
<file>misc/fileUtils.js</file>
|
||||||
|
<file>misc/params.js</file>
|
||||||
|
</gresource>
|
||||||
|
|
||||||
|
<gresource prefix="/org/gnome/Shell/Extensions">
|
||||||
|
<file>css/application.css</file>
|
||||||
|
<file>ui/extension-prefs-dialog.ui</file>
|
||||||
|
</gresource>
|
||||||
|
</gresources>
|
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gresources>
|
||||||
|
<gresource prefix="/org/gnome/Shell/Notifications/js">
|
||||||
|
<file>main.js</file>
|
||||||
|
<file>notificationDaemon.js</file>
|
||||||
|
<file>dbusService.js</file>
|
||||||
|
|
||||||
|
<file>misc/config.js</file>
|
||||||
|
<file>misc/fileUtils.js</file>
|
||||||
|
</gresource>
|
||||||
|
</gresources>
|
@@ -120,7 +120,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
vfunc_key_press_event(keyPressEvent) {
|
vfunc_key_press_event(keyPressEvent) {
|
||||||
if (keyPressEvent.keyval == Clutter.KEY_Escape)
|
if (keyPressEvent.keyval == Clutter.KEY_Escape)
|
||||||
this.cancel();
|
this.cancel();
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return super.vfunc_key_press_event(keyPressEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
_initEntryRow() {
|
_initEntryRow() {
|
||||||
@@ -184,7 +184,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);
|
||||||
|
|
||||||
@@ -424,8 +424,13 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateSensitivity(sensitive) {
|
updateSensitivity(sensitive) {
|
||||||
|
if (this._entry.reactive === sensitive)
|
||||||
|
return;
|
||||||
|
|
||||||
this._entry.reactive = sensitive;
|
this._entry.reactive = sensitive;
|
||||||
this._entry.clutter_text.editable = sensitive;
|
|
||||||
|
if (sensitive)
|
||||||
|
this._entry.grab_key_focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_hide() {
|
vfunc_hide() {
|
||||||
|
@@ -35,7 +35,6 @@ const UserWidget = imports.ui.userWidget;
|
|||||||
const _FADE_ANIMATION_TIME = 250;
|
const _FADE_ANIMATION_TIME = 250;
|
||||||
const _SCROLL_ANIMATION_TIME = 500;
|
const _SCROLL_ANIMATION_TIME = 500;
|
||||||
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
|
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
|
||||||
const _LOGO_ICON_HEIGHT = 48;
|
|
||||||
|
|
||||||
var UserListItem = GObject.registerClass({
|
var UserListItem = GObject.registerClass({
|
||||||
Signals: { 'activate': {} },
|
Signals: { 'activate': {} },
|
||||||
@@ -178,6 +177,7 @@ var UserList = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
vfunc_key_focus_in() {
|
vfunc_key_focus_in() {
|
||||||
|
super.vfunc_key_focus_in();
|
||||||
this._moveFocusToItems();
|
this._moveFocusToItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,7 +456,6 @@ var LoginDialog = GObject.registerClass({
|
|||||||
let notListedLabel = new St.Label({
|
let notListedLabel = new St.Label({
|
||||||
text: _("Not listed?"),
|
text: _("Not listed?"),
|
||||||
style_class: 'login-dialog-not-listed-label',
|
style_class: 'login-dialog-not-listed-label',
|
||||||
x_align: Clutter.ActorAlign.START,
|
|
||||||
});
|
});
|
||||||
this._notListedButton = new St.Button({
|
this._notListedButton = new St.Button({
|
||||||
style_class: 'login-dialog-not-listed-button',
|
style_class: 'login-dialog-not-listed-button',
|
||||||
@@ -464,6 +463,7 @@ var LoginDialog = GObject.registerClass({
|
|||||||
can_focus: true,
|
can_focus: true,
|
||||||
child: notListedLabel,
|
child: notListedLabel,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._notListedButton.connect('clicked', this._hideUserListAskForUsernameAndBeginVerification.bind(this));
|
this._notListedButton.connect('clicked', this._hideUserListAskForUsernameAndBeginVerification.bind(this));
|
||||||
@@ -813,7 +813,7 @@ var LoginDialog = GObject.registerClass({
|
|||||||
if (this._logoFile && this._logoBin.resource_scale > 0) {
|
if (this._logoFile && this._logoBin.resource_scale > 0) {
|
||||||
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, _LOGO_ICON_HEIGHT,
|
-1, -1,
|
||||||
scaleFactor,
|
scaleFactor,
|
||||||
this._logoBin.resource_scale));
|
this._logoBin.resource_scale));
|
||||||
}
|
}
|
||||||
@@ -952,16 +952,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();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
subdir('misc')
|
subdir('misc')
|
||||||
|
subdir('dbusServices')
|
||||||
|
|
||||||
js_resources = gnome.compile_resources(
|
js_resources = gnome.compile_resources(
|
||||||
'js-resources', 'js-resources.gresource.xml',
|
'js-resources', 'js-resources.gresource.xml',
|
||||||
@@ -13,10 +14,3 @@ portal_resources = gnome.compile_resources(
|
|||||||
c_name: 'portal_js_resources',
|
c_name: 'portal_js_resources',
|
||||||
dependencies: [config_js]
|
dependencies: [config_js]
|
||||||
)
|
)
|
||||||
|
|
||||||
prefs_resources = gnome.compile_resources(
|
|
||||||
'prefs-resources', 'prefs-resources.gresource.xml',
|
|
||||||
source_dir: ['.', meson.current_build_dir()],
|
|
||||||
c_name: 'prefs_js_resources',
|
|
||||||
dependencies: [config_js]
|
|
||||||
)
|
|
||||||
|
@@ -15,6 +15,5 @@ var LOCALEDIR = '@datadir@/locale';
|
|||||||
/* other standard directories */
|
/* other standard directories */
|
||||||
var LIBEXECDIR = '@libexecdir@';
|
var LIBEXECDIR = '@libexecdir@';
|
||||||
var PKGDATADIR = '@datadir@/@PACKAGE_NAME@';
|
var PKGDATADIR = '@datadir@/@PACKAGE_NAME@';
|
||||||
var VPNDIR = '@vpndir@';
|
|
||||||
/* g-i package versions */
|
/* g-i package versions */
|
||||||
var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@'
|
var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@'
|
||||||
|
@@ -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
|
||||||
|
@@ -76,19 +76,15 @@ function loadInterfaceXML(iface) {
|
|||||||
_ifaceResource._register();
|
_ifaceResource._register();
|
||||||
}
|
}
|
||||||
|
|
||||||
let xml = null;
|
|
||||||
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);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let [ok_, bytes] = f.load_contents(null);
|
let [ok_, bytes] = f.load_contents(null);
|
||||||
if (bytes instanceof Uint8Array)
|
return imports.byteArray.toString(bytes);
|
||||||
xml = imports.byteArray.toString(bytes);
|
|
||||||
else
|
|
||||||
xml = bytes.toString();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(`Failed to load D-Bus interface ${iface}`);
|
log(`Failed to load D-Bus interface ${iface}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return xml;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -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 getIBusManager */
|
/* exported getIBusManager */
|
||||||
|
|
||||||
const { Gio, GLib, IBus } = imports.gi;
|
const { Gio, GLib, IBus, Meta } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const IBusCandidatePopup = imports.ui.ibusCandidatePopup;
|
const IBusCandidatePopup = imports.ui.ibusCandidatePopup;
|
||||||
@@ -55,13 +55,18 @@ var IBusManager = class {
|
|||||||
this._ibus.set_watch_ibus_signal(true);
|
this._ibus.set_watch_ibus_signal(true);
|
||||||
this._ibus.connect('global-engine-changed', this._engineChanged.bind(this));
|
this._ibus.connect('global-engine-changed', this._engineChanged.bind(this));
|
||||||
|
|
||||||
this._spawn();
|
this._spawn(Meta.is_wayland_compositor() ? [] : ['--xim']);
|
||||||
}
|
}
|
||||||
|
|
||||||
_spawn(extraArgs = []) {
|
_spawn(extraArgs = []) {
|
||||||
try {
|
try {
|
||||||
let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
|
let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
|
||||||
Gio.Subprocess.new(cmdLine, Gio.SubprocessFlags.NONE);
|
let launcher = Gio.SubprocessLauncher.new(Gio.SubprocessFlags.NONE);
|
||||||
|
// Forward the right X11 Display for ibus-x11
|
||||||
|
let display = GLib.getenv('GNOME_SETUP_DISPLAY');
|
||||||
|
if (display)
|
||||||
|
launcher.setenv('DISPLAY', display, true);
|
||||||
|
launcher.spawnv(cmdLine);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(`Failed to launch ibus-daemon: ${e.message}`);
|
log(`Failed to launch ibus-daemon: ${e.message}`);
|
||||||
}
|
}
|
||||||
@@ -122,56 +127,55 @@ var IBusManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_initPanelService(ibus, result) {
|
_initPanelService(ibus, result) {
|
||||||
let success = false;
|
|
||||||
try {
|
try {
|
||||||
success = !!this._ibus.request_name_async_finish(result);
|
this._ibus.request_name_async_finish(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
return;
|
logError(e);
|
||||||
logError(e);
|
this._clear();
|
||||||
}
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
this._panelService = new IBus.PanelService({ connection: this._ibus.get_connection(),
|
|
||||||
object_path: IBus.PATH_PANEL });
|
|
||||||
this._candidatePopup.setPanelService(this._panelService);
|
|
||||||
this._panelService.connect('update-property', this._updateProperty.bind(this));
|
|
||||||
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
|
|
||||||
let cursorLocation = { x, y, width: w, height: h };
|
|
||||||
this.emit('set-cursor-location', cursorLocation);
|
|
||||||
});
|
|
||||||
this._panelService.connect('focus-in', (panel, path) => {
|
|
||||||
if (!GLib.str_has_suffix(path, '/InputContext_1'))
|
|
||||||
this.emit('focus-in');
|
|
||||||
});
|
|
||||||
this._panelService.connect('focus-out', () => this.emit('focus-out'));
|
|
||||||
|
|
||||||
try {
|
|
||||||
// IBus versions older than 1.5.10 have a bug which
|
|
||||||
// causes spurious set-content-type emissions when
|
|
||||||
// switching input focus that temporarily lose purpose
|
|
||||||
// and hints defeating its intended semantics and
|
|
||||||
// confusing users. We thus don't use it in that case.
|
|
||||||
_checkIBusVersion(1, 5, 10);
|
|
||||||
this._panelService.connect('set-content-type', this._setContentType.bind(this));
|
|
||||||
} catch (e) {
|
|
||||||
}
|
}
|
||||||
// If an engine is already active we need to get its properties
|
return;
|
||||||
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();
|
|
||||||
} else {
|
|
||||||
this._clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._panelService = new IBus.PanelService({
|
||||||
|
connection: this._ibus.get_connection(),
|
||||||
|
object_path: IBus.PATH_PANEL,
|
||||||
|
});
|
||||||
|
this._candidatePopup.setPanelService(this._panelService);
|
||||||
|
this._panelService.connect('update-property', this._updateProperty.bind(this));
|
||||||
|
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
|
||||||
|
let cursorLocation = { x, y, width: w, height: h };
|
||||||
|
this.emit('set-cursor-location', cursorLocation);
|
||||||
|
});
|
||||||
|
this._panelService.connect('focus-in', (panel, path) => {
|
||||||
|
if (!GLib.str_has_suffix(path, '/InputContext_1'))
|
||||||
|
this.emit('focus-in');
|
||||||
|
});
|
||||||
|
this._panelService.connect('focus-out', () => this.emit('focus-out'));
|
||||||
|
|
||||||
|
try {
|
||||||
|
// IBus versions older than 1.5.10 have a bug which
|
||||||
|
// causes spurious set-content-type emissions when
|
||||||
|
// switching input focus that temporarily lose purpose
|
||||||
|
// and hints defeating its intended semantics and
|
||||||
|
// confusing users. We thus don't use it in that case.
|
||||||
|
_checkIBusVersion(1, 5, 10);
|
||||||
|
this._panelService.connect('set-content-type', this._setContentType.bind(this));
|
||||||
|
} 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateReadiness() {
|
_updateReadiness() {
|
||||||
|
@@ -97,8 +97,13 @@ class InputMethod extends Clutter.InputMethod {
|
|||||||
this.commit(text.get_text());
|
this.commit(text.get_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDeleteSurroundingText() {
|
_onDeleteSurroundingText(_context, offset, nchars) {
|
||||||
this.delete_surrounding();
|
try {
|
||||||
|
this.delete_surrounding(offset, nchars);
|
||||||
|
} catch (e) {
|
||||||
|
// We may get out of bounds for negative offset on older mutter
|
||||||
|
this.delete_surrounding(0, nchars + offset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUpdatePreeditText(_context, text, pos, visible) {
|
_onUpdatePreeditText(_context, text, pos, visible) {
|
||||||
|
@@ -7,7 +7,6 @@ jsconf.set10('HAVE_BLUETOOTH', bt_dep.found())
|
|||||||
jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager)
|
jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager)
|
||||||
jsconf.set('datadir', datadir)
|
jsconf.set('datadir', datadir)
|
||||||
jsconf.set('libexecdir', libexecdir)
|
jsconf.set('libexecdir', libexecdir)
|
||||||
jsconf.set('vpndir', vpndir)
|
|
||||||
|
|
||||||
config_js = configure_file(
|
config_js = configure_file(
|
||||||
input: 'config.js.in',
|
input: 'config.js.in',
|
||||||
|
@@ -223,7 +223,7 @@ var BroadbandModem = GObject.registerClass({
|
|||||||
}, class BroadbandModem extends ModemBase {
|
}, class BroadbandModem extends ModemBase {
|
||||||
_init(path, capabilities) {
|
_init(path, capabilities) {
|
||||||
super._init({ capabilities });
|
super._init({ capabilities });
|
||||||
this._proxy = new BroadbandModemProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
|
this._proxy = new BroadbandModemProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
|
||||||
this._proxy_3gpp = new BroadbandModem3gppProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
|
this._proxy_3gpp = new BroadbandModem3gppProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
|
||||||
this._proxy_cdma = new BroadbandModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
|
this._proxy_cdma = new BroadbandModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ var BroadbandModem = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_reloadSignalQuality() {
|
_reloadSignalQuality() {
|
||||||
let [quality, recent_] = this.SignalQuality;
|
let [quality, recent_] = this._proxy.SignalQuality;
|
||||||
this._setSignalQuality(quality);
|
this._setSignalQuality(quality);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,13 +83,17 @@ 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;reboot;restart;halt;stop')),
|
||||||
available: false,
|
available: false,
|
||||||
});
|
});
|
||||||
this._actions.set(LOCK_SCREEN_ACTION_ID, {
|
this._actions.set(LOCK_SCREEN_ACTION_ID, {
|
||||||
@@ -97,15 +101,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 +117,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 +125,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,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -277,7 +281,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 = [];
|
||||||
|
|
||||||
|
@@ -5,6 +5,5 @@
|
|||||||
|
|
||||||
<file>misc/config.js</file>
|
<file>misc/config.js</file>
|
||||||
<file>misc/fileUtils.js</file>
|
<file>misc/fileUtils.js</file>
|
||||||
<file>misc/params.js</file>
|
|
||||||
</gresource>
|
</gresource>
|
||||||
</gresources>
|
</gresources>
|
||||||
|
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<gresources>
|
|
||||||
<gresource prefix="/org/gnome/shell">
|
|
||||||
<file>extensionPrefs/main.js</file>
|
|
||||||
|
|
||||||
<file>misc/config.js</file>
|
|
||||||
<file>misc/extensionUtils.js</file>
|
|
||||||
<file>misc/fileUtils.js</file>
|
|
||||||
<file>misc/params.js</file>
|
|
||||||
|
|
||||||
<file alias="css/application.css">extensionPrefs/css/application.css</file>
|
|
||||||
|
|
||||||
<file alias="ui/extension-row.ui">extensionPrefs/ui/extension-row.ui</file>
|
|
||||||
<file alias="ui/extensions-window.ui">extensionPrefs/ui/extensions-window.ui</file>
|
|
||||||
</gresource>
|
|
||||||
</gresources>
|
|
@@ -280,12 +280,10 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
_onDestroy() {
|
||||||
super._onDestroy();
|
|
||||||
|
|
||||||
if (this._thumbnails)
|
|
||||||
this._destroyThumbnails();
|
|
||||||
if (this._thumbnailTimeoutId != 0)
|
if (this._thumbnailTimeoutId != 0)
|
||||||
GLib.source_remove(this._thumbnailTimeoutId);
|
GLib.source_remove(this._thumbnailTimeoutId);
|
||||||
|
|
||||||
|
super._onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -365,8 +363,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
this._thumbnails = null;
|
this._thumbnails = null;
|
||||||
if (this._switcherList._items[this._selectedIndex])
|
this._switcherList.removeAccessibleState(this._selectedIndex, Atk.StateType.EXPANDED);
|
||||||
this._switcherList._items[this._selectedIndex].remove_accessible_state(Atk.StateType.EXPANDED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_createThumbnails() {
|
_createThumbnails() {
|
||||||
@@ -395,7 +392,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this._switcherList._items[this._selectedIndex].add_accessible_state(Atk.StateType.EXPANDED);
|
this._switcherList.addAccessibleState(this._selectedIndex, Atk.StateType.EXPANDED);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -776,7 +773,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
|
|
||||||
// We override SwitcherList's _onItemEnter method to delay
|
// We override SwitcherList's _onItemEnter method to delay
|
||||||
// activation when the thumbnail list is open
|
// activation when the thumbnail list is open
|
||||||
_onItemEnter(index) {
|
_onItemEnter(item) {
|
||||||
|
const index = this._items.indexOf(item);
|
||||||
|
|
||||||
if (this._mouseTimeOutId != 0)
|
if (this._mouseTimeOutId != 0)
|
||||||
GLib.source_remove(this._mouseTimeOutId);
|
GLib.source_remove(this._mouseTimeOutId);
|
||||||
if (this._altTabPopup.thumbnailsVisible) {
|
if (this._altTabPopup.thumbnailsVisible) {
|
||||||
@@ -854,6 +853,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);
|
||||||
}
|
}
|
||||||
@@ -1061,25 +1063,25 @@ class WindowSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
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, flags);
|
||||||
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.
|
||||||
|
box.y2 += totalLabelHeight;
|
||||||
this.set_allocation(box, flags);
|
this.set_allocation(box, flags);
|
||||||
|
|
||||||
|
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, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
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));
|
||||||
|
@@ -36,6 +36,7 @@ var VIEWS_SWITCH_TIME = 400;
|
|||||||
var VIEWS_SWITCH_ANIMATION_DELAY = 100;
|
var VIEWS_SWITCH_ANIMATION_DELAY = 100;
|
||||||
|
|
||||||
var PAGE_SWITCH_TIME = 250;
|
var PAGE_SWITCH_TIME = 250;
|
||||||
|
var SCROLL_TIMEOUT_TIME = 150;
|
||||||
|
|
||||||
var APP_ICON_SCALE_IN_TIME = 500;
|
var APP_ICON_SCALE_IN_TIME = 500;
|
||||||
var APP_ICON_SCALE_IN_DELAY = 700;
|
var APP_ICON_SCALE_IN_DELAY = 700;
|
||||||
@@ -71,15 +72,9 @@ function _getFolderName(folder) {
|
|||||||
let name = folder.get_string('name');
|
let name = folder.get_string('name');
|
||||||
|
|
||||||
if (folder.get_boolean('translate')) {
|
if (folder.get_boolean('translate')) {
|
||||||
let keyfile = new GLib.KeyFile();
|
let translated = Shell.util_get_translated_folder_name(name);
|
||||||
let path = 'desktop-directories/%s'.format(name);
|
if (translated !== null)
|
||||||
|
return translated;
|
||||||
try {
|
|
||||||
keyfile.load_from_data_dirs(path, GLib.KeyFileFlags.NONE);
|
|
||||||
name = keyfile.get_locale_string('Desktop Entry', 'Name', null);
|
|
||||||
} catch (e) {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
@@ -120,15 +115,10 @@ function _findBestFolderName(apps) {
|
|||||||
}, commonCategories);
|
}, commonCategories);
|
||||||
|
|
||||||
for (let category of commonCategories) {
|
for (let category of commonCategories) {
|
||||||
let keyfile = new GLib.KeyFile();
|
const directory = '%s.directory'.format(category);
|
||||||
let path = 'desktop-directories/%s.directory'.format(category);
|
const translated = Shell.util_get_translated_folder_name(directory);
|
||||||
|
if (translated !== null)
|
||||||
try {
|
return translated;
|
||||||
keyfile.load_from_data_dirs(path, GLib.KeyFileFlags.NONE);
|
|
||||||
return keyfile.get_locale_string('Desktop Entry', 'Name', null);
|
|
||||||
} catch (e) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -169,6 +159,10 @@ var BaseAppView = GObject.registerClass({
|
|||||||
|
|
||||||
this._items = new Map();
|
this._items = new Map();
|
||||||
this._orderedItems = [];
|
this._orderedItems = [];
|
||||||
|
|
||||||
|
this._animateLaterId = 0;
|
||||||
|
this._viewLoadedHandlerId = 0;
|
||||||
|
this._viewIsReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_childFocused(_actor) {
|
_childFocused(_actor) {
|
||||||
@@ -204,6 +198,7 @@ var BaseAppView = GObject.registerClass({
|
|||||||
this._items.set(icon.id, icon);
|
this._items.set(icon.id, icon);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._viewIsReady = true;
|
||||||
this.emit('view-loaded');
|
this.emit('view-loaded');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +248,18 @@ var BaseAppView = GObject.registerClass({
|
|||||||
Main.overview.dash.showAppsButton);
|
Main.overview.dash.showAppsButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_clearAnimateLater() {
|
||||||
|
if (this._animateLaterId) {
|
||||||
|
Meta.later_remove(this._animateLaterId);
|
||||||
|
this._animateLaterId = 0;
|
||||||
|
}
|
||||||
|
if (this._viewLoadedHandlerId) {
|
||||||
|
this.disconnect(this._viewLoadedHandlerId);
|
||||||
|
this._viewLoadedHandlerId = 0;
|
||||||
|
}
|
||||||
|
this._grid.opacity = 255;
|
||||||
|
}
|
||||||
|
|
||||||
animate(animationDirection, onComplete) {
|
animate(animationDirection, onComplete) {
|
||||||
if (onComplete) {
|
if (onComplete) {
|
||||||
let animationDoneId = this._grid.connect('animation-done', () => {
|
let animationDoneId = this._grid.connect('animation-done', () => {
|
||||||
@@ -261,16 +268,38 @@ var BaseAppView = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._clearAnimateLater();
|
||||||
|
|
||||||
if (animationDirection == IconGrid.AnimationDirection.IN) {
|
if (animationDirection == IconGrid.AnimationDirection.IN) {
|
||||||
let id = this._grid.connect('paint', () => {
|
const doSpringAnimationLater = laterType => {
|
||||||
this._grid.disconnect(id);
|
this._animateLaterId = Meta.later_add(laterType,
|
||||||
this._doSpringAnimation(animationDirection);
|
() => {
|
||||||
});
|
this._animateLaterId = 0;
|
||||||
|
this._doSpringAnimation(animationDirection);
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this._viewIsReady) {
|
||||||
|
this._grid.opacity = 0;
|
||||||
|
doSpringAnimationLater(Meta.LaterType.IDLE);
|
||||||
|
} else {
|
||||||
|
this._viewLoadedHandlerId = this.connect('view-loaded',
|
||||||
|
() => {
|
||||||
|
this._clearAnimateLater();
|
||||||
|
doSpringAnimationLater(Meta.LaterType.BEFORE_REDRAW);
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this._doSpringAnimation(animationDirection);
|
this._doSpringAnimation(animationDirection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vfunc_unmap() {
|
||||||
|
this._clearAnimateLater();
|
||||||
|
super.vfunc_unmap();
|
||||||
|
}
|
||||||
|
|
||||||
animateSwitch(animationDirection) {
|
animateSwitch(animationDirection) {
|
||||||
this.remove_all_transitions();
|
this.remove_all_transitions();
|
||||||
this._grid.remove_all_transitions();
|
this._grid.remove_all_transitions();
|
||||||
@@ -392,10 +421,12 @@ var AllView = GObject.registerClass({
|
|||||||
this._redisplayWorkId = Main.initializeDeferredWork(this, this._redisplay.bind(this));
|
this._redisplayWorkId = Main.initializeDeferredWork(this, this._redisplay.bind(this));
|
||||||
|
|
||||||
Shell.AppSystem.get_default().connect('installed-changed', () => {
|
Shell.AppSystem.get_default().connect('installed-changed', () => {
|
||||||
|
this._viewIsReady = false;
|
||||||
Main.queueDeferredWork(this._redisplayWorkId);
|
Main.queueDeferredWork(this._redisplayWorkId);
|
||||||
});
|
});
|
||||||
this._folderSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
|
this._folderSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
|
||||||
this._folderSettings.connect('changed::folder-children', () => {
|
this._folderSettings.connect('changed::folder-children', () => {
|
||||||
|
this._viewIsReady = false;
|
||||||
Main.queueDeferredWork(this._redisplayWorkId);
|
Main.queueDeferredWork(this._redisplayWorkId);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -431,6 +462,10 @@ var AllView = GObject.registerClass({
|
|||||||
|
|
||||||
_redisplay() {
|
_redisplay() {
|
||||||
super._redisplay();
|
super._redisplay();
|
||||||
|
|
||||||
|
this._folderIcons.forEach(icon => {
|
||||||
|
icon.view._redisplay();
|
||||||
|
});
|
||||||
this._refilterApps();
|
this._refilterApps();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +653,7 @@ var AllView = GObject.registerClass({
|
|||||||
|
|
||||||
this._canScroll = false;
|
this._canScroll = false;
|
||||||
this._scrollTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
|
this._scrollTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
|
||||||
PAGE_SWITCH_TIME, () => {
|
SCROLL_TIMEOUT_TIME, () => {
|
||||||
this._canScroll = true;
|
this._canScroll = true;
|
||||||
this._scrollTimeoutId = 0;
|
this._scrollTimeoutId = 0;
|
||||||
return GLib.SOURCE_REMOVE;
|
return GLib.SOURCE_REMOVE;
|
||||||
@@ -699,8 +734,6 @@ var AllView = GObject.registerClass({
|
|||||||
|
|
||||||
// Toggle search entry
|
// Toggle search entry
|
||||||
Main.overview.searchEntry.reactive = !isOpen;
|
Main.overview.searchEntry.reactive = !isOpen;
|
||||||
Main.overview.searchEntry.clutter_text.reactive = !isOpen;
|
|
||||||
Main.overview.searchEntry.clutter_text.editable = !isOpen;
|
|
||||||
|
|
||||||
this._displayingPopup = isOpen;
|
this._displayingPopup = isOpen;
|
||||||
});
|
});
|
||||||
@@ -1259,8 +1292,8 @@ var AppSearchProvider = class AppSearchProvider {
|
|||||||
let results = [];
|
let results = [];
|
||||||
groups.forEach(group => {
|
groups.forEach(group => {
|
||||||
group = group.filter(appID => {
|
group = group.filter(appID => {
|
||||||
let app = Gio.DesktopAppInfo.new(appID);
|
const app = this._appSys.lookup_app(appID);
|
||||||
return app && app.should_show();
|
return app && app.app_info.should_show();
|
||||||
});
|
});
|
||||||
results = results.concat(group.sort(
|
results = results.concat(group.sort(
|
||||||
(a, b) => usage.compare(a, b)
|
(a, b) => usage.compare(a, b)
|
||||||
@@ -1303,12 +1336,16 @@ class FolderView extends BaseAppView {
|
|||||||
this._parentView = parentView;
|
this._parentView = parentView;
|
||||||
this._grid._delegate = this;
|
this._grid._delegate = this;
|
||||||
|
|
||||||
|
this._relayoutLaterId = 0;
|
||||||
|
this._oldWidth = null;
|
||||||
|
this._oldHeight = null;
|
||||||
|
|
||||||
this._scrollView = new St.ScrollView({
|
this._scrollView = new St.ScrollView({
|
||||||
overlay_scrollbars: true,
|
overlay_scrollbars: true,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
});
|
});
|
||||||
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL);
|
||||||
this.add_actor(this._scrollView);
|
this.add_actor(this._scrollView);
|
||||||
|
|
||||||
let scrollableContainer = new St.BoxLayout({
|
let scrollableContainer = new St.BoxLayout({
|
||||||
@@ -1324,7 +1361,8 @@ class FolderView extends BaseAppView {
|
|||||||
action.connect('pan', this._onPan.bind(this));
|
action.connect('pan', this._onPan.bind(this));
|
||||||
this._scrollView.add_action(action);
|
this._scrollView.add_action(action);
|
||||||
|
|
||||||
this._folder.connect('changed', this._redisplay.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
|
|
||||||
this._redisplay();
|
this._redisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1346,12 +1384,12 @@ class FolderView extends BaseAppView {
|
|||||||
});
|
});
|
||||||
layout.hookup_style(icon);
|
layout.hookup_style(icon);
|
||||||
let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size);
|
let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size);
|
||||||
let scale = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
|
||||||
|
|
||||||
let numItems = this._orderedItems.length;
|
let numItems = this._orderedItems.length;
|
||||||
let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
|
let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
|
||||||
for (let i = 0; i < 4; i++) {
|
for (let i = 0; i < 4; i++) {
|
||||||
let bin = new St.Bin({ width: subSize * scale, height: subSize * scale });
|
const style = 'width: %dpx; height: %dpx;'.format(subSize, subSize);
|
||||||
|
let bin = new St.Bin({ style });
|
||||||
if (i < numItems)
|
if (i < numItems)
|
||||||
bin.child = this._orderedItems[i].app.create_icon_texture(subSize);
|
bin.child = this._orderedItems[i].app.create_icon_texture(subSize);
|
||||||
layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1);
|
layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1);
|
||||||
@@ -1367,6 +1405,18 @@ class FolderView extends BaseAppView {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onDestroy() {
|
||||||
|
if (this._relayoutLaterId) {
|
||||||
|
Meta.later_remove(this._relayoutLaterId);
|
||||||
|
this._relayoutLaterId = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_relayoutLater() {
|
||||||
|
this._relayoutLaterId = 0;
|
||||||
|
this._grid.queue_relayout();
|
||||||
|
}
|
||||||
|
|
||||||
adaptToSize(width, height) {
|
adaptToSize(width, height) {
|
||||||
this._parentAvailableWidth = width;
|
this._parentAvailableWidth = width;
|
||||||
this._parentAvailableHeight = height;
|
this._parentAvailableHeight = height;
|
||||||
@@ -1386,6 +1436,16 @@ class FolderView extends BaseAppView {
|
|||||||
this._grid.bottomPadding = Math.max(this._grid.bottomPadding, 0);
|
this._grid.bottomPadding = Math.max(this._grid.bottomPadding, 0);
|
||||||
this._grid.leftPadding = Math.max(this._grid.leftPadding, 0);
|
this._grid.leftPadding = Math.max(this._grid.leftPadding, 0);
|
||||||
this._grid.rightPadding = Math.max(this._grid.rightPadding, 0);
|
this._grid.rightPadding = Math.max(this._grid.rightPadding, 0);
|
||||||
|
|
||||||
|
if (width !== this._oldWidth || height !== this._oldHeight) {
|
||||||
|
this._oldWidth = width;
|
||||||
|
this._oldHeight = height;
|
||||||
|
|
||||||
|
if (!this._relayoutLaterId) {
|
||||||
|
this._relayoutLaterId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
|
||||||
|
this._relayoutLater.bind(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_loadApps() {
|
_loadApps() {
|
||||||
@@ -1429,6 +1489,22 @@ class FolderView extends BaseAppView {
|
|||||||
return apps;
|
return apps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addApp(app) {
|
||||||
|
let folderApps = this._folder.get_strv('apps');
|
||||||
|
folderApps.push(app.id);
|
||||||
|
|
||||||
|
this._folder.set_strv('apps', folderApps);
|
||||||
|
|
||||||
|
// Also remove from 'excluded-apps' if the app id is listed
|
||||||
|
// there. This is only possible on categories-based folders.
|
||||||
|
let excludedApps = this._folder.get_strv('excluded-apps');
|
||||||
|
let index = excludedApps.indexOf(app.id);
|
||||||
|
if (index >= 0) {
|
||||||
|
excludedApps.splice(index, 1);
|
||||||
|
this._folder.set_strv('excluded-apps', excludedApps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
removeApp(app) {
|
removeApp(app) {
|
||||||
let folderApps = this._folder.get_strv('apps');
|
let folderApps = this._folder.get_strv('apps');
|
||||||
let index = folderApps.indexOf(app.id);
|
let index = folderApps.indexOf(app.id);
|
||||||
@@ -1459,8 +1535,6 @@ class FolderView extends BaseAppView {
|
|||||||
} else {
|
} else {
|
||||||
this._folder.set_strv('apps', folderApps);
|
this._folder.set_strv('apps', folderApps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1494,26 +1568,26 @@ var FolderIcon = GObject.registerClass({
|
|||||||
|
|
||||||
this.view = new FolderView(this._folder, id, parentView);
|
this.view = new FolderView(this._folder, id, parentView);
|
||||||
|
|
||||||
this._itemDragBeginId = Main.overview.connect(
|
this._iconIsHovering = false;
|
||||||
'item-drag-begin', this._onDragBegin.bind(this));
|
|
||||||
this._itemDragEndId = Main.overview.connect(
|
|
||||||
'item-drag-end', this._onDragEnd.bind(this));
|
|
||||||
|
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
|
|
||||||
this._folder.connect('changed', this._redisplay.bind(this));
|
this._folderChangedId = this._folder.connect(
|
||||||
this._redisplay();
|
'changed', this._sync.bind(this));
|
||||||
|
this._sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
_onDestroy() {
|
||||||
Main.overview.disconnect(this._itemDragBeginId);
|
if (this._dragMonitor) {
|
||||||
Main.overview.disconnect(this._itemDragEndId);
|
DND.removeDragMonitor(this._dragMonitor);
|
||||||
|
this._dragMonitor = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.view.destroy();
|
this.view.destroy();
|
||||||
|
|
||||||
if (this._spaceReadySignalId) {
|
if (this._folderChangedId) {
|
||||||
this._parentView.disconnect(this._spaceReadySignalId);
|
this._folder.disconnect(this._folderChangedId);
|
||||||
this._spaceReadySignalId = 0;
|
delete this._folderChangedId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._dialog)
|
if (this._dialog)
|
||||||
@@ -1541,29 +1615,32 @@ var FolderIcon = GObject.registerClass({
|
|||||||
return this.view.getAllItems().map(item => item.id);
|
return this.view.getAllItems().map(item => item.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDragBegin() {
|
_setHoveringByDnd(hovering) {
|
||||||
this._dragMonitor = {
|
if (this._iconIsHovering == hovering)
|
||||||
dragMotion: this._onDragMotion.bind(this),
|
return;
|
||||||
};
|
|
||||||
DND.addDragMonitor(this._dragMonitor);
|
this._iconIsHovering = hovering;
|
||||||
|
|
||||||
|
if (hovering) {
|
||||||
|
this._dragMonitor = {
|
||||||
|
dragMotion: this._onDragMotion.bind(this),
|
||||||
|
};
|
||||||
|
DND.addDragMonitor(this._dragMonitor);
|
||||||
|
this.add_style_pseudo_class('drop');
|
||||||
|
} else {
|
||||||
|
DND.removeDragMonitor(this._dragMonitor);
|
||||||
|
this.remove_style_pseudo_class('drop');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDragMotion(dragEvent) {
|
_onDragMotion(dragEvent) {
|
||||||
let target = dragEvent.targetActor;
|
if (!this.contains(dragEvent.targetActor) ||
|
||||||
|
!this._canAccept(dragEvent.source))
|
||||||
if (!this.contains(target) || !this._canAccept(dragEvent.source))
|
this._setHoveringByDnd(false);
|
||||||
this.remove_style_pseudo_class('drop');
|
|
||||||
else
|
|
||||||
this.add_style_pseudo_class('drop');
|
|
||||||
|
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDragEnd() {
|
|
||||||
this.remove_style_pseudo_class('drop');
|
|
||||||
DND.removeDragMonitor(this._dragMonitor);
|
|
||||||
}
|
|
||||||
|
|
||||||
_canAccept(source) {
|
_canAccept(source) {
|
||||||
if (!(source instanceof AppIcon))
|
if (!(source instanceof AppIcon))
|
||||||
return false;
|
return false;
|
||||||
@@ -1582,27 +1659,18 @@ var FolderIcon = GObject.registerClass({
|
|||||||
if (!this._canAccept(source))
|
if (!this._canAccept(source))
|
||||||
return DND.DragMotionResult.NO_DROP;
|
return DND.DragMotionResult.NO_DROP;
|
||||||
|
|
||||||
|
this._setHoveringByDnd(true);
|
||||||
|
|
||||||
return DND.DragMotionResult.MOVE_DROP;
|
return DND.DragMotionResult.MOVE_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptDrop(source) {
|
acceptDrop(source) {
|
||||||
|
this._setHoveringByDnd(false);
|
||||||
|
|
||||||
if (!this._canAccept(source))
|
if (!this._canAccept(source))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
let app = source.app;
|
this.view.addApp(source.app);
|
||||||
let folderApps = this._folder.get_strv('apps');
|
|
||||||
folderApps.push(app.id);
|
|
||||||
|
|
||||||
this._folder.set_strv('apps', folderApps);
|
|
||||||
|
|
||||||
// Also remove from 'excluded-apps' if the app id is listed
|
|
||||||
// there. This is only possible on categories-based folders.
|
|
||||||
let excludedApps = this._folder.get_strv('excluded-apps');
|
|
||||||
let index = excludedApps.indexOf(app.id);
|
|
||||||
if (index >= 0) {
|
|
||||||
excludedApps.splice(index, 1);
|
|
||||||
this._folder.set_strv('excluded-apps', excludedApps);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1617,11 +1685,11 @@ var FolderIcon = GObject.registerClass({
|
|||||||
this.emit('name-changed');
|
this.emit('name-changed');
|
||||||
}
|
}
|
||||||
|
|
||||||
_redisplay() {
|
_sync() {
|
||||||
|
this.emit('apps-changed');
|
||||||
this._updateName();
|
this._updateName();
|
||||||
this.visible = this.view.getAllItems().length > 0;
|
this.visible = this.view.getAllItems().length > 0;
|
||||||
this.icon.update();
|
this.icon.update();
|
||||||
this.emit('apps-changed');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_createIcon(iconSize) {
|
_createIcon(iconSize) {
|
||||||
@@ -1902,6 +1970,7 @@ var AppFolderDialog = GObject.registerClass({
|
|||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
let contentBox = this.get_theme_node().get_content_box(box);
|
let contentBox = this.get_theme_node().get_content_box(box);
|
||||||
|
contentBox = this._viewBox.get_theme_node().get_content_box(contentBox);
|
||||||
|
|
||||||
let [, entryBoxHeight] = this._entryBox.get_size();
|
let [, entryBoxHeight] = this._entryBox.get_size();
|
||||||
let spacing = this._viewBox.layout_manager.spacing;
|
let spacing = this._viewBox.layout_manager.spacing;
|
||||||
@@ -1910,6 +1979,8 @@ var AppFolderDialog = GObject.registerClass({
|
|||||||
contentBox.get_width(),
|
contentBox.get_width(),
|
||||||
contentBox.get_height() - entryBoxHeight - spacing);
|
contentBox.get_height() - entryBoxHeight - spacing);
|
||||||
|
|
||||||
|
this._view._grid.topPadding = 0;
|
||||||
|
|
||||||
super.vfunc_allocate(box, flags);
|
super.vfunc_allocate(box, flags);
|
||||||
|
|
||||||
// We can only start zooming after receiving an allocation
|
// We can only start zooming after receiving an allocation
|
||||||
@@ -2025,7 +2096,6 @@ var AppIcon = GObject.registerClass({
|
|||||||
|
|
||||||
this._delegate = this;
|
this._delegate = this;
|
||||||
|
|
||||||
this._hasDndHover = false;
|
|
||||||
this._folderPreviewId = 0;
|
this._folderPreviewId = 0;
|
||||||
|
|
||||||
// Get the isDraggable property without passing it on to the BaseIcon:
|
// Get the isDraggable property without passing it on to the BaseIcon:
|
||||||
@@ -2074,11 +2144,7 @@ var AppIcon = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this._dragMonitor = null;
|
this._otherIconIsHovering = false;
|
||||||
this._itemDragBeginId = Main.overview.connect(
|
|
||||||
'item-drag-begin', this._onDragBegin.bind(this));
|
|
||||||
this._itemDragEndId = Main.overview.connect(
|
|
||||||
'item-drag-end', this._onDragEnd.bind(this));
|
|
||||||
|
|
||||||
this._menuTimeoutId = 0;
|
this._menuTimeoutId = 0;
|
||||||
this._stateChangedId = this.app.connect('notify::state', () => {
|
this._stateChangedId = this.app.connect('notify::state', () => {
|
||||||
@@ -2090,9 +2156,6 @@ var AppIcon = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
_onDestroy() {
|
||||||
Main.overview.disconnect(this._itemDragBeginId);
|
|
||||||
Main.overview.disconnect(this._itemDragEndId);
|
|
||||||
|
|
||||||
if (this._folderPreviewId > 0) {
|
if (this._folderPreviewId > 0) {
|
||||||
GLib.source_remove(this._folderPreviewId);
|
GLib.source_remove(this._folderPreviewId);
|
||||||
this._folderPreviewId = 0;
|
this._folderPreviewId = 0;
|
||||||
@@ -2339,7 +2402,17 @@ var AppIcon = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setHoveringByDnd(hovering) {
|
_setHoveringByDnd(hovering) {
|
||||||
|
if (this._otherIconIsHovering == hovering)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._otherIconIsHovering = hovering;
|
||||||
|
|
||||||
if (hovering) {
|
if (hovering) {
|
||||||
|
this._dragMonitor = {
|
||||||
|
dragMotion: this._onDragMotion.bind(this),
|
||||||
|
};
|
||||||
|
DND.addDragMonitor(this._dragMonitor);
|
||||||
|
|
||||||
if (this._folderPreviewId > 0)
|
if (this._folderPreviewId > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2351,6 +2424,8 @@ var AppIcon = GObject.registerClass({
|
|||||||
return GLib.SOURCE_REMOVE;
|
return GLib.SOURCE_REMOVE;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
DND.removeDragMonitor(this._dragMonitor);
|
||||||
|
|
||||||
if (this._folderPreviewId > 0) {
|
if (this._folderPreviewId > 0) {
|
||||||
GLib.source_remove(this._folderPreviewId);
|
GLib.source_remove(this._folderPreviewId);
|
||||||
this._folderPreviewId = 0;
|
this._folderPreviewId = 0;
|
||||||
@@ -2360,32 +2435,13 @@ var AppIcon = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDragBegin() {
|
|
||||||
this._dragMonitor = {
|
|
||||||
dragMotion: this._onDragMotion.bind(this),
|
|
||||||
};
|
|
||||||
DND.addDragMonitor(this._dragMonitor);
|
|
||||||
}
|
|
||||||
|
|
||||||
_onDragMotion(dragEvent) {
|
_onDragMotion(dragEvent) {
|
||||||
let target = dragEvent.targetActor;
|
if (!this.contains(dragEvent.targetActor))
|
||||||
let isHovering = target == this || this.contains(target);
|
this._setHoveringByDnd(false);
|
||||||
let canDrop = this._canAccept(dragEvent.source);
|
|
||||||
let hasDndHover = isHovering && canDrop;
|
|
||||||
|
|
||||||
if (this._hasDndHover != hasDndHover) {
|
|
||||||
this._setHoveringByDnd(hasDndHover);
|
|
||||||
this._hasDndHover = hasDndHover;
|
|
||||||
}
|
|
||||||
|
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDragEnd() {
|
|
||||||
this.remove_style_pseudo_class('drop');
|
|
||||||
DND.removeDragMonitor(this._dragMonitor);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleDragOver(source) {
|
handleDragOver(source) {
|
||||||
if (source == this)
|
if (source == this)
|
||||||
return DND.DragMotionResult.NO_DROP;
|
return DND.DragMotionResult.NO_DROP;
|
||||||
@@ -2393,6 +2449,8 @@ var AppIcon = GObject.registerClass({
|
|||||||
if (!this._canAccept(source))
|
if (!this._canAccept(source))
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
|
|
||||||
|
this._setHoveringByDnd(true);
|
||||||
|
|
||||||
return DND.DragMotionResult.MOVE_DROP;
|
return DND.DragMotionResult.MOVE_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2437,7 +2495,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
|||||||
Main.uiGroup.add_actor(this.actor);
|
Main.uiGroup.add_actor(this.actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
_redisplay() {
|
_rebuildMenu() {
|
||||||
this.removeAll();
|
this.removeAll();
|
||||||
|
|
||||||
let windows = this._source.app.get_windows().filter(
|
let windows = this._source.app.get_windows().filter(
|
||||||
@@ -2533,7 +2591,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
|||||||
'org.gtk.Actions', 'Activate',
|
'org.gtk.Actions', 'Activate',
|
||||||
GLib.Variant.new('(sava{sv})',
|
GLib.Variant.new('(sava{sv})',
|
||||||
['details', [args], null]),
|
['details', [args], null]),
|
||||||
null, 0, -1, null, null);
|
null, 0, -1, null);
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -2554,7 +2612,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
popup(_activatingButton) {
|
popup(_activatingButton) {
|
||||||
this._redisplay();
|
this._rebuildMenu();
|
||||||
this.open();
|
this.open();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -12,6 +12,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',
|
||||||
|
@@ -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) {
|
||||||
@@ -758,10 +760,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);
|
||||||
});
|
});
|
||||||
|
@@ -197,6 +197,11 @@ var BoxPointer = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
|
if (this._sourceActor && this._sourceActor.mapped) {
|
||||||
|
this._reposition(box);
|
||||||
|
this._updateFlip(box);
|
||||||
|
}
|
||||||
|
|
||||||
this.set_allocation(box, flags);
|
this.set_allocation(box, flags);
|
||||||
|
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
@@ -230,12 +235,6 @@ var BoxPointer = GObject.registerClass({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.bin.allocate(childBox, flags);
|
this.bin.allocate(childBox, flags);
|
||||||
|
|
||||||
if (this._sourceActor && this._sourceActor.mapped) {
|
|
||||||
this._reposition(box);
|
|
||||||
this._updateFlip(box);
|
|
||||||
this.set_allocation(box, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_drawBorder(area) {
|
_drawBorder(area) {
|
||||||
|
@@ -220,7 +220,12 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
@@ -257,7 +262,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 +278,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 +327,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 +372,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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -700,12 +725,11 @@ var Calendar = GObject.registerClass({
|
|||||||
var EventMessage = GObject.registerClass(
|
var EventMessage = GObject.registerClass(
|
||||||
class EventMessage extends MessageList.Message {
|
class EventMessage extends MessageList.Message {
|
||||||
_init(event, date) {
|
_init(event, date) {
|
||||||
super._init('', event.summary);
|
super._init('', '');
|
||||||
|
|
||||||
this._event = event;
|
|
||||||
this._date = date;
|
this._date = date;
|
||||||
|
|
||||||
this.setTitle(this._formatEventTime());
|
this.update(event);
|
||||||
|
|
||||||
this._icon = new St.Icon({ icon_name: 'x-office-calendar-symbolic' });
|
this._icon = new St.Icon({ icon_name: 'x-office-calendar-symbolic' });
|
||||||
this.setIcon(this._icon);
|
this.setIcon(this._icon);
|
||||||
@@ -717,6 +741,13 @@ class EventMessage extends MessageList.Message {
|
|||||||
super.vfunc_style_changed();
|
super.vfunc_style_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update(event) {
|
||||||
|
this._event = event;
|
||||||
|
|
||||||
|
this.setTitle(this._formatEventTime());
|
||||||
|
this.setBody(event.summary);
|
||||||
|
}
|
||||||
|
|
||||||
_formatEventTime() {
|
_formatEventTime() {
|
||||||
let periodBegin = _getBeginningOfDay(this._date);
|
let periodBegin = _getBeginningOfDay(this._date);
|
||||||
let periodEnd = _getEndOfDay(this._date);
|
let periodEnd = _getEndOfDay(this._date);
|
||||||
@@ -837,8 +868,9 @@ class EventsSection extends MessageList.MessageListSection {
|
|||||||
this._title.connect('clicked', this._onTitleClicked.bind(this));
|
this._title.connect('clicked', this._onTitleClicked.bind(this));
|
||||||
this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
|
this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
|
||||||
|
|
||||||
Shell.AppSystem.get_default().connect('installed-changed',
|
this._appSys = Shell.AppSystem.get_default();
|
||||||
this._appInstalledChanged.bind(this));
|
this._appSys.connect('installed-changed',
|
||||||
|
this._appInstalledChanged.bind(this));
|
||||||
this._appInstalledChanged();
|
this._appInstalledChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -873,7 +905,7 @@ class EventsSection extends MessageList.MessageListSection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_reloadEvents() {
|
_reloadEvents() {
|
||||||
if (this._eventSource.isLoading)
|
if (this._eventSource.isLoading || this._reloading)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._reloading = true;
|
this._reloading = true;
|
||||||
@@ -899,6 +931,7 @@ class EventsSection extends MessageList.MessageListSection {
|
|||||||
this._messageById.set(event.id, message);
|
this._messageById.set(event.id, message);
|
||||||
this.addMessage(message, false);
|
this.addMessage(message, false);
|
||||||
} else {
|
} else {
|
||||||
|
message.update(event);
|
||||||
this.moveMessage(message, i, false);
|
this.moveMessage(message, i, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -931,10 +964,13 @@ class EventsSection extends MessageList.MessageListSection {
|
|||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
Main.panel.closeCalendar();
|
Main.panel.closeCalendar();
|
||||||
|
|
||||||
let app = this._getCalendarApp();
|
let appInfo = this._getCalendarApp();
|
||||||
if (app.get_id() == 'evolution.desktop')
|
if (appInfo.get_id() === 'org.gnome.Evolution.desktop') {
|
||||||
app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
|
let app = this._appSys.lookup_app('evolution-calendar.desktop');
|
||||||
app.launch([], global.create_app_launch_context(0, -1));
|
if (app)
|
||||||
|
appInfo = app.app_info;
|
||||||
|
}
|
||||||
|
appInfo.launch([], global.create_app_launch_context(0, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
setDate(date) {
|
setDate(date) {
|
||||||
@@ -1149,17 +1185,22 @@ class CalendarMessageList extends St.Widget {
|
|||||||
let hbox = new St.BoxLayout({ style_class: 'message-list-controls' });
|
let hbox = new St.BoxLayout({ style_class: 'message-list-controls' });
|
||||||
box.add_child(hbox);
|
box.add_child(hbox);
|
||||||
|
|
||||||
hbox.add_child(new St.Label({
|
const dndLabel = new St.Label({
|
||||||
text: _('Do Not Disturb'),
|
text: _('Do Not Disturb'),
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
}));
|
});
|
||||||
|
hbox.add_child(dndLabel);
|
||||||
|
|
||||||
this._dndSwitch = new DoNotDisturbSwitch();
|
this._dndSwitch = new DoNotDisturbSwitch();
|
||||||
this._dndButton = new St.Button({
|
this._dndButton = new St.Button({
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
|
toggle_mode: true,
|
||||||
child: this._dndSwitch,
|
child: this._dndSwitch,
|
||||||
|
label_actor: dndLabel,
|
||||||
});
|
});
|
||||||
this._dndButton.connect('clicked', () => this._dndSwitch.toggle());
|
this._dndSwitch.bind_property('state',
|
||||||
|
this._dndButton, 'checked',
|
||||||
|
GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE);
|
||||||
hbox.add_child(this._dndButton);
|
hbox.add_child(this._dndButton);
|
||||||
|
|
||||||
this._clearButton = new St.Button({
|
this._clearButton = new St.Button({
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/* exported CheckBox */
|
/* exported CheckBox */
|
||||||
const { Clutter, GObject, Pango, St } = imports.gi;
|
const { Atk, Clutter, GObject, Pango, St } = imports.gi;
|
||||||
|
|
||||||
var CheckBox = GObject.registerClass(
|
var CheckBox = GObject.registerClass(
|
||||||
class CheckBox extends St.Button {
|
class CheckBox extends St.Button {
|
||||||
@@ -15,6 +15,7 @@ class CheckBox extends St.Button {
|
|||||||
toggle_mode: true,
|
toggle_mode: true,
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
});
|
});
|
||||||
|
this.set_accessible_role(Atk.Role.CHECK_BOX);
|
||||||
|
|
||||||
this._box = new St.Bin({ y_align: Clutter.ActorAlign.START });
|
this._box = new St.Bin({ y_align: Clutter.ActorAlign.START });
|
||||||
container.add_actor(this._box);
|
container.add_actor(this._box);
|
||||||
@@ -22,6 +23,7 @@ class CheckBox extends St.Button {
|
|||||||
this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
|
this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
|
||||||
this._label.clutter_text.set_line_wrap(true);
|
this._label.clutter_text.set_line_wrap(true);
|
||||||
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
|
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
|
||||||
|
this.set_label_actor(this._label);
|
||||||
container.add_actor(this._label);
|
container.add_actor(this._label);
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
|
@@ -188,6 +188,8 @@ var CloseDialog = GObject.registerClass({
|
|||||||
global.stage.disconnect(this._keyFocusChangedId);
|
global.stage.disconnect(this._keyFocusChangedId);
|
||||||
this._keyFocusChangedId = 0;
|
this._keyFocusChangedId = 0;
|
||||||
|
|
||||||
|
this._dialog._dialog.remove_all_transitions();
|
||||||
|
|
||||||
let dialog = this._dialog;
|
let dialog = this._dialog;
|
||||||
this._dialog = null;
|
this._dialog = null;
|
||||||
this._removeWindowEffect();
|
this._removeWindowEffect();
|
||||||
|
@@ -111,15 +111,11 @@ class KeyringDialog extends ModalDialog.ModalDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateSensitivity(sensitive) {
|
_updateSensitivity(sensitive) {
|
||||||
if (this._passwordEntry) {
|
if (this._passwordEntry)
|
||||||
this._passwordEntry.reactive = sensitive;
|
this._passwordEntry.reactive = sensitive;
|
||||||
this._passwordEntry.clutter_text.editable = sensitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._confirmEntry) {
|
if (this._confirmEntry)
|
||||||
this._confirmEntry.reactive = sensitive;
|
this._confirmEntry.reactive = sensitive;
|
||||||
this._confirmEntry.clutter_text.editable = sensitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._continueButton.can_focus = sensitive;
|
this._continueButton.can_focus = sensitive;
|
||||||
this._continueButton.reactive = sensitive;
|
this._continueButton.reactive = sensitive;
|
||||||
|
@@ -4,13 +4,15 @@
|
|||||||
const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Config = imports.misc.config;
|
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const MessageTray = imports.ui.messageTray;
|
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,
|
||||||
|
'search_vpn_plugin', 'search_vpn_plugin_finish');
|
||||||
|
|
||||||
const VPN_UI_GROUP = 'VPN Plugin UI';
|
const VPN_UI_GROUP = 'VPN Plugin UI';
|
||||||
|
|
||||||
var NetworkSecretDialog = GObject.registerClass(
|
var NetworkSecretDialog = GObject.registerClass(
|
||||||
@@ -615,14 +617,6 @@ var NetworkAgent = class {
|
|||||||
this._vpnRequests = { };
|
this._vpnRequests = { };
|
||||||
this._notifications = { };
|
this._notifications = { };
|
||||||
|
|
||||||
this._pluginDir = Gio.file_new_for_path(Config.VPNDIR);
|
|
||||||
try {
|
|
||||||
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
|
|
||||||
monitor.connect('changed', () => (this._vpnCacheBuilt = false));
|
|
||||||
} catch (e) {
|
|
||||||
log('Failed to create monitor for VPN plugin dir: %s'.format(e.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
this._native.connect('new-request', this._newRequest.bind(this));
|
this._native.connect('new-request', this._newRequest.bind(this));
|
||||||
this._native.connect('cancel-request', this._cancelRequest.bind(this));
|
this._native.connect('cancel-request', this._cancelRequest.bind(this));
|
||||||
|
|
||||||
@@ -766,13 +760,11 @@ var NetworkAgent = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_vpnRequest(requestId, connection, hints, flags) {
|
async _vpnRequest(requestId, connection, hints, flags) {
|
||||||
let vpnSetting = connection.get_setting_vpn();
|
let vpnSetting = connection.get_setting_vpn();
|
||||||
let serviceType = vpnSetting.service_type;
|
let serviceType = vpnSetting.service_type;
|
||||||
|
|
||||||
this._buildVPNServiceCache();
|
let binary = await this._findAuthBinary(serviceType);
|
||||||
|
|
||||||
let binary = this._vpnBinaries[serviceType];
|
|
||||||
if (!binary) {
|
if (!binary) {
|
||||||
log('Invalid VPN service type (cannot find authentication binary)');
|
log('Invalid VPN service type (cannot find authentication binary)');
|
||||||
|
|
||||||
@@ -788,36 +780,30 @@ var NetworkAgent = class {
|
|||||||
this._vpnRequests[requestId] = vpnRequest;
|
this._vpnRequests[requestId] = vpnRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
_buildVPNServiceCache() {
|
async _findAuthBinary(serviceType) {
|
||||||
if (this._vpnCacheBuilt)
|
let plugin;
|
||||||
return;
|
|
||||||
|
|
||||||
this._vpnCacheBuilt = true;
|
try {
|
||||||
this._vpnBinaries = { };
|
plugin = await this._native.search_vpn_plugin(serviceType);
|
||||||
|
} catch (e) {
|
||||||
|
logError(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
NM.VpnPluginInfo.list_load().forEach(plugin => {
|
const fileName = plugin.get_auth_dialog();
|
||||||
let service = plugin.get_service();
|
if (!GLib.file_test(fileName, GLib.FileTest.IS_EXECUTABLE)) {
|
||||||
let fileName = plugin.get_auth_dialog();
|
log('VPN plugin at %s is not executable'.format(fileName));
|
||||||
let supportsHints = plugin.supports_hints();
|
return null;
|
||||||
let externalUIMode = false;
|
}
|
||||||
|
|
||||||
let prop = plugin.lookup_property('GNOME', 'supports-external-ui-mode');
|
const prop = plugin.lookup_property('GNOME', 'supports-external-ui-mode');
|
||||||
if (prop) {
|
const trimmedProp = prop ? prop.trim().toLowerCase() : '';
|
||||||
prop = prop.trim().toLowerCase();
|
|
||||||
externalUIMode = ['true', 'yes', 'on', '1'].includes(prop);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GLib.file_test(fileName, GLib.FileTest.IS_EXECUTABLE)) {
|
return {
|
||||||
let binary = { fileName, externalUIMode, supportsHints };
|
fileName,
|
||||||
this._vpnBinaries[service] = binary;
|
supportsHints: plugin.supports_hints(),
|
||||||
|
externalUIMode: ['true', 'yes', 'on', '1'].includes(trimmedProp),
|
||||||
plugin.get_aliases().forEach(alias => {
|
};
|
||||||
this._vpnBinaries[alias] = binary;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
log('VPN plugin at %s is not executable'.format(fileName));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var Component = NetworkAgent;
|
var Component = NetworkAgent;
|
||||||
|
@@ -327,6 +327,8 @@ 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;
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
/* exported Component */
|
/* exported Component */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, St } = imports.gi;
|
||||||
const Lang = imports.lang;
|
|
||||||
|
|
||||||
var Tpl = null;
|
var Tpl = null;
|
||||||
var Tp = null;
|
var Tp = null;
|
||||||
@@ -40,36 +39,59 @@ var NotificationDirection = {
|
|||||||
RECEIVED: 'chat-received',
|
RECEIVED: 'chat-received',
|
||||||
};
|
};
|
||||||
|
|
||||||
function makeMessageFromTpMessage(tpMessage, direction) {
|
const ChatMessage = HAVE_TP ? GObject.registerClass({
|
||||||
let [text, flags_] = tpMessage.to_text();
|
Properties: {
|
||||||
|
'message-type': GObject.ParamSpec.int(
|
||||||
|
'message-type', 'message-type', 'message-type',
|
||||||
|
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||||
|
Math.min(...Object.values(Tp.ChannelTextMessageType)),
|
||||||
|
Math.max(...Object.values(Tp.ChannelTextMessageType)),
|
||||||
|
Tp.ChannelTextMessageType.NORMAL),
|
||||||
|
'text': GObject.ParamSpec.string(
|
||||||
|
'text', 'text', 'text',
|
||||||
|
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||||
|
null),
|
||||||
|
'sender': GObject.ParamSpec.string(
|
||||||
|
'sender', 'sender', 'sender',
|
||||||
|
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||||
|
null),
|
||||||
|
'timestamp': GObject.ParamSpec.int64(
|
||||||
|
'timestamp', 'timestamp', 'timestamp',
|
||||||
|
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||||
|
0, Number.MAX_SAFE_INTEGER, 0),
|
||||||
|
'direction': GObject.ParamSpec.string(
|
||||||
|
'direction', 'direction', 'direction',
|
||||||
|
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||||
|
null),
|
||||||
|
},
|
||||||
|
}, class ChatMessageClass extends GObject.Object {
|
||||||
|
static newFromTpMessage(tpMessage, direction) {
|
||||||
|
return new ChatMessage({
|
||||||
|
'message-type': tpMessage.get_message_type(),
|
||||||
|
'text': tpMessage.to_text()[0],
|
||||||
|
'sender': tpMessage.sender.alias,
|
||||||
|
'timestamp': direction === NotificationDirection.RECEIVED
|
||||||
|
? tpMessage.get_received_timestamp() : tpMessage.get_sent_timestamp(),
|
||||||
|
direction,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let timestamp = tpMessage.get_sent_timestamp();
|
static newFromTplTextEvent(tplTextEvent) {
|
||||||
if (timestamp == 0)
|
let direction =
|
||||||
timestamp = tpMessage.get_received_timestamp();
|
tplTextEvent.get_sender().get_entity_type() === Tpl.EntityType.SELF
|
||||||
|
? NotificationDirection.SENT : NotificationDirection.RECEIVED;
|
||||||
|
|
||||||
return {
|
return new ChatMessage({
|
||||||
messageType: tpMessage.get_message_type(),
|
'message-type': tplTextEvent.get_message_type(),
|
||||||
text,
|
'text': tplTextEvent.get_message(),
|
||||||
sender: tpMessage.sender.alias,
|
'sender': tplTextEvent.get_sender().get_alias(),
|
||||||
timestamp,
|
'timestamp': tplTextEvent.get_timestamp(),
|
||||||
direction,
|
direction,
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
}) : null;
|
||||||
|
|
||||||
|
|
||||||
function makeMessageFromTplEvent(event) {
|
|
||||||
let sent = event.get_sender().get_entity_type() == Tpl.EntityType.SELF;
|
|
||||||
let direction = sent ? NotificationDirection.SENT : NotificationDirection.RECEIVED;
|
|
||||||
|
|
||||||
return {
|
|
||||||
messageType: event.get_message_type(),
|
|
||||||
text: event.get_message(),
|
|
||||||
sender: event.get_sender().get_alias(),
|
|
||||||
timestamp: event.get_timestamp(),
|
|
||||||
direction,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
var TelepathyComponent = class {
|
var TelepathyComponent = class {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._client = null;
|
this._client = null;
|
||||||
@@ -270,12 +292,12 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
var ChatSource = HAVE_TP ? GObject.registerClass(
|
var ChatSource = HAVE_TP ? GObject.registerClass(
|
||||||
class ChatSource extends MessageTray.Source {
|
class ChatSource extends MessageTray.Source {
|
||||||
_init(account, conn, channel, contact, client) {
|
_init(account, conn, channel, contact, client) {
|
||||||
super._init(contact.get_alias());
|
|
||||||
|
|
||||||
this._account = account;
|
this._account = account;
|
||||||
this._contact = contact;
|
this._contact = contact;
|
||||||
this._client = client;
|
this._client = client;
|
||||||
|
|
||||||
|
super._init(contact.get_alias());
|
||||||
|
|
||||||
this.isChat = true;
|
this.isChat = true;
|
||||||
this._pendingMessages = [];
|
this._pendingMessages = [];
|
||||||
|
|
||||||
@@ -431,7 +453,7 @@ class ChatSource extends MessageTray.Source {
|
|||||||
_displayPendingMessages(logManager, result) {
|
_displayPendingMessages(logManager, result) {
|
||||||
let [success_, events] = logManager.get_filtered_events_finish(result);
|
let [success_, events] = logManager.get_filtered_events_finish(result);
|
||||||
|
|
||||||
let logMessages = events.map(makeMessageFromTplEvent);
|
let logMessages = events.map(e => ChatMessage.newFromTplTextEvent(e));
|
||||||
this._ensureNotification();
|
this._ensureNotification();
|
||||||
|
|
||||||
let pendingTpMessages = this._channel.get_pending_messages();
|
let pendingTpMessages = this._channel.get_pending_messages();
|
||||||
@@ -443,7 +465,8 @@ class ChatSource extends MessageTray.Source {
|
|||||||
if (message.get_message_type() == Tp.ChannelTextMessageType.DELIVERY_REPORT)
|
if (message.get_message_type() == Tp.ChannelTextMessageType.DELIVERY_REPORT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pendingMessages.push(makeMessageFromTpMessage(message, NotificationDirection.RECEIVED));
|
pendingMessages.push(ChatMessage.newFromTpMessage(message,
|
||||||
|
NotificationDirection.RECEIVED));
|
||||||
|
|
||||||
this._pendingMessages.push(message);
|
this._pendingMessages.push(message);
|
||||||
}
|
}
|
||||||
@@ -541,7 +564,8 @@ class ChatSource extends MessageTray.Source {
|
|||||||
this._pendingMessages.push(message);
|
this._pendingMessages.push(message);
|
||||||
this.countUpdated();
|
this.countUpdated();
|
||||||
|
|
||||||
message = makeMessageFromTpMessage(message, NotificationDirection.RECEIVED);
|
message = ChatMessage.newFromTpMessage(message,
|
||||||
|
NotificationDirection.RECEIVED);
|
||||||
this._notification.appendMessage(message);
|
this._notification.appendMessage(message);
|
||||||
|
|
||||||
// Wait a bit before notifying for the received message, a handler
|
// Wait a bit before notifying for the received message, a handler
|
||||||
@@ -566,7 +590,8 @@ class ChatSource extends MessageTray.Source {
|
|||||||
// our client and other clients as well.
|
// our client and other clients as well.
|
||||||
_messageSent(channel, message, _flags, _token) {
|
_messageSent(channel, message, _flags, _token) {
|
||||||
this._ensureNotification();
|
this._ensureNotification();
|
||||||
message = makeMessageFromTpMessage(message, NotificationDirection.SENT);
|
message = ChatMessage.newFromTpMessage(message,
|
||||||
|
NotificationDirection.SENT);
|
||||||
this._notification.appendMessage(message);
|
this._notification.appendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,11 +655,19 @@ class ChatSource extends MessageTray.Source {
|
|||||||
}
|
}
|
||||||
}) : null;
|
}) : null;
|
||||||
|
|
||||||
|
const ChatNotificationMessage = HAVE_TP ? GObject.registerClass(
|
||||||
|
class ChatNotificationMessage extends GObject.Object {
|
||||||
|
_init(props = {}) {
|
||||||
|
super._init();
|
||||||
|
this.set(props);
|
||||||
|
}
|
||||||
|
}) : null;
|
||||||
|
|
||||||
var ChatNotification = HAVE_TP ? GObject.registerClass({
|
var ChatNotification = HAVE_TP ? GObject.registerClass({
|
||||||
Signals: {
|
Signals: {
|
||||||
'message-removed': { param_types: [Tp.Message.$gtype] },
|
'message-removed': { param_types: [ChatNotificationMessage.$gtype] },
|
||||||
'message-added': { param_types: [Tp.Message.$gtype] },
|
'message-added': { param_types: [ChatNotificationMessage.$gtype] },
|
||||||
'timestamp-changed': { param_types: [Tp.Message.$gtype] },
|
'timestamp-changed': { param_types: [ChatNotificationMessage.$gtype] },
|
||||||
},
|
},
|
||||||
}, class ChatNotification extends MessageTray.Notification {
|
}, class ChatNotification extends MessageTray.Notification {
|
||||||
_init(source) {
|
_init(source) {
|
||||||
@@ -735,21 +768,24 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
|||||||
styles: [],
|
styles: [],
|
||||||
timestamp: currentTime,
|
timestamp: currentTime,
|
||||||
noTimestamp: false });
|
noTimestamp: false });
|
||||||
|
const { noTimestamp } = props;
|
||||||
|
delete props.noTimestamp;
|
||||||
|
|
||||||
// Reset the old message timeout
|
// Reset the old message timeout
|
||||||
if (this._timestampTimeoutId)
|
if (this._timestampTimeoutId)
|
||||||
GLib.source_remove(this._timestampTimeoutId);
|
GLib.source_remove(this._timestampTimeoutId);
|
||||||
this._timestampTimeoutId = 0;
|
this._timestampTimeoutId = 0;
|
||||||
|
|
||||||
let message = { realMessage: props.group != 'meta',
|
let message = new ChatNotificationMessage({
|
||||||
showTimestamp: false };
|
realMessage: props.group !== 'meta',
|
||||||
Lang.copyProperties(props, message);
|
showTimestamp: false,
|
||||||
delete message.noTimestamp;
|
...props,
|
||||||
|
});
|
||||||
|
|
||||||
this.messages.unshift(message);
|
this.messages.unshift(message);
|
||||||
this.emit('message-added', message);
|
this.emit('message-added', message);
|
||||||
|
|
||||||
if (!props.noTimestamp) {
|
if (!noTimestamp) {
|
||||||
let timestamp = props.timestamp;
|
let timestamp = props.timestamp;
|
||||||
if (timestamp < currentTime - SCROLLBACK_IMMEDIATE_TIME) {
|
if (timestamp < currentTime - SCROLLBACK_IMMEDIATE_TIME) {
|
||||||
this.appendTimestamp();
|
this.appendTimestamp();
|
||||||
|
@@ -94,6 +94,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 +167,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,14 +179,14 @@ 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' });
|
||||||
|
|
||||||
let otherOffset = this._getTimeAtLocation(l).get_utc_offset();
|
const tz = new St.Label({
|
||||||
let offset = (otherOffset - localOffset) / GLib.TIME_SPAN_HOUR;
|
style_class: 'world-clocks-timezone',
|
||||||
let fmt = Math.trunc(offset) == offset ? '%s%.0f' : '%s%.1f';
|
x_align: Clutter.ActorAlign.END,
|
||||||
let prefix = offset >= 0 ? '+' : '-';
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
let tz = new St.Label({ style_class: 'world-clocks-timezone',
|
});
|
||||||
text: fmt.format(prefix, Math.abs(offset)),
|
|
||||||
x_align: Clutter.ActorAlign.END,
|
time.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
tz.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
|
||||||
if (this._grid.text_direction == Clutter.TextDirection.RTL) {
|
if (this._grid.text_direction == Clutter.TextDirection.RTL) {
|
||||||
layout.attach(tz, 0, i + 1, 1, 1);
|
layout.attach(tz, 0, i + 1, 1, 1);
|
||||||
@@ -199,32 +198,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,6 +416,20 @@ class WeatherSection extends St.Button {
|
|||||||
layout.attach(label, 0, 0, 1, 1);
|
layout.attach(label, 0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_findBestLocationName(loc) {
|
||||||
|
const locName = loc.get_name();
|
||||||
|
|
||||||
|
if (loc.get_level() === GWeather.LocationLevel.CITY ||
|
||||||
|
!loc.has_coords())
|
||||||
|
return locName;
|
||||||
|
|
||||||
|
const world = GWeather.Location.get_world();
|
||||||
|
const city = world.find_nearest_city(...loc.get_coords());
|
||||||
|
const cityName = city.get_name();
|
||||||
|
|
||||||
|
return locName.includes(cityName) ? cityName : locName;
|
||||||
|
}
|
||||||
|
|
||||||
_updateForecasts() {
|
_updateForecasts() {
|
||||||
this._forecastGrid.destroy_all_children();
|
this._forecastGrid.destroy_all_children();
|
||||||
|
|
||||||
@@ -392,13 +438,8 @@ class WeatherSection extends St.Button {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let info = this._weatherClient.info;
|
const { info } = this._weatherClient;
|
||||||
let loc = info.get_location();
|
this._titleLocation.text = this._findBestLocationName(info.location);
|
||||||
if (loc.get_level() !== GWeather.LocationLevel.CITY && loc.has_coords()) {
|
|
||||||
let world = GWeather.Location.get_world();
|
|
||||||
loc = world.find_nearest_city(...loc.get_coords());
|
|
||||||
}
|
|
||||||
this._titleLocation.text = loc.get_name();
|
|
||||||
|
|
||||||
if (this._weatherClient.loading) {
|
if (this._weatherClient.loading) {
|
||||||
this._setStatusLabel(_("Loading…"));
|
this._setStatusLabel(_("Loading…"));
|
||||||
@@ -440,7 +481,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',
|
||||||
@@ -554,6 +594,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();
|
||||||
|
|
||||||
|
@@ -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({
|
||||||
@@ -221,13 +221,16 @@ 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('leightweight');
|
||||||
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('leightweight');
|
||||||
@@ -237,6 +240,9 @@ var MessageDialogContent = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
|
@@ -346,10 +346,8 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
// Use a different description when we are installing a system upgrade
|
// Use a different description when we are installing a system upgrade
|
||||||
// if the PackageKit proxy is available (i.e. PackageKit is available).
|
// if the PackageKit proxy is available (i.e. PackageKit is available).
|
||||||
if (this._pkOfflineProxy && dialogContent.upgradeDescription) {
|
if (dialogContent.upgradeDescription) {
|
||||||
let name = this._pkOfflineProxy.PreparedUpgrade['name'].deep_unpack();
|
const { name, version } = this._updateInfo.PreparedUpgrade;
|
||||||
let version = this._pkOfflineProxy.PreparedUpgrade['version'].deep_unpack();
|
|
||||||
|
|
||||||
if (name != null && version != null)
|
if (name != null && version != null)
|
||||||
description = dialogContent.upgradeDescription(name, version);
|
description = dialogContent.upgradeDescription(name, version);
|
||||||
}
|
}
|
||||||
@@ -608,16 +606,46 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenAsync(parameters, invocation) {
|
async _getUpdateInfo() {
|
||||||
|
const connection = this._pkOfflineProxy.get_connection();
|
||||||
|
const reply = await connection.call(
|
||||||
|
this._pkOfflineProxy.g_name,
|
||||||
|
this._pkOfflineProxy.g_object_path,
|
||||||
|
'org.freedesktop.DBus.Properties',
|
||||||
|
'GetAll',
|
||||||
|
new GLib.Variant('(s)', [this._pkOfflineProxy.g_interface_name]),
|
||||||
|
null,
|
||||||
|
Gio.DBusCallFlags.NONE,
|
||||||
|
-1,
|
||||||
|
null);
|
||||||
|
const [info] = reply.recursiveUnpack();
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
async OpenAsync(parameters, invocation) {
|
||||||
let [type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths] = parameters;
|
let [type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths] = parameters;
|
||||||
this._totalSecondsToStayOpen = totalSecondsToStayOpen;
|
this._totalSecondsToStayOpen = totalSecondsToStayOpen;
|
||||||
this._type = type;
|
this._type = type;
|
||||||
|
|
||||||
|
try {
|
||||||
|
this._updateInfo = await this._getUpdateInfo();
|
||||||
|
} catch (e) {
|
||||||
|
if (this._pkOfflineProxy !== null)
|
||||||
|
log('Failed to get update info from PackageKit: %s'.format(e.message));
|
||||||
|
|
||||||
|
this._updateInfo = {
|
||||||
|
UpdateTriggered: false,
|
||||||
|
UpdatePrepared: false,
|
||||||
|
UpgradeTriggered: false,
|
||||||
|
PreparedUpgrade: {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Only consider updates and upgrades if PackageKit is available.
|
// Only consider updates and upgrades if PackageKit is available.
|
||||||
if (this._pkOfflineProxy && this._type == DialogType.RESTART) {
|
if (this._pkOfflineProxy && this._type == DialogType.RESTART) {
|
||||||
if (this._pkOfflineProxy.UpdateTriggered)
|
if (this._updateInfo.UpdateTriggered)
|
||||||
this._type = DialogType.UPDATE_RESTART;
|
this._type = DialogType.UPDATE_RESTART;
|
||||||
else if (this._pkOfflineProxy.UpgradeTriggered)
|
else if (this._updateInfo.UpgradeTriggered)
|
||||||
this._type = DialogType.UPGRADE_RESTART;
|
this._type = DialogType.UPGRADE_RESTART;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,9 +674,8 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
if (dialogContent.showOtherSessions)
|
if (dialogContent.showOtherSessions)
|
||||||
this._loadSessions();
|
this._loadSessions();
|
||||||
|
|
||||||
// Only consider updates and upgrades if PackageKit is available.
|
let updateTriggered = this._updateInfo.UpdateTriggered;
|
||||||
let updateTriggered = this._pkOfflineProxy ? this._pkOfflineProxy.UpdateTriggered : false;
|
let updatePrepared = this._updateInfo.UpdatePrepared;
|
||||||
let updatePrepared = this._pkOfflineProxy ? this._pkOfflineProxy.UpdatePrepared : false;
|
|
||||||
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
|
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
|
||||||
|
|
||||||
_setCheckBoxLabel(this._checkBox, dialogContent.checkBoxText || '');
|
_setCheckBoxLabel(this._checkBox, dialogContent.checkBoxText || '');
|
||||||
|
@@ -10,8 +10,13 @@ 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, GLib, GObject, Meta, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||||
const Gettext = imports.gettext;
|
const Gettext = imports.gettext;
|
||||||
|
const System = imports.system;
|
||||||
|
|
||||||
|
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
||||||
|
|
||||||
|
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
|
||||||
// variable initializations, etc, that depend on init() already having
|
// variable initializations, etc, that depend on init() already having
|
||||||
@@ -285,6 +290,13 @@ function init() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Gio._LocalFilePrototype.touch_async = function (callback) {
|
||||||
|
Shell.util_touch_file_async(this, callback);
|
||||||
|
};
|
||||||
|
Gio._LocalFilePrototype.touch_finish = function (result) {
|
||||||
|
return Shell.util_touch_file_finish(this, result);
|
||||||
|
};
|
||||||
|
|
||||||
St.set_slow_down_factor = function (factor) {
|
St.set_slow_down_factor = function (factor) {
|
||||||
let { stack } = new Error();
|
let { stack } = new Error();
|
||||||
log(`St.set_slow_down_factor() is deprecated, use St.Settings.slow_down_factor\n${stack}`);
|
log(`St.set_slow_down_factor() is deprecated, use St.Settings.slow_down_factor\n${stack}`);
|
||||||
@@ -304,9 +316,25 @@ function init() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Override to clear our own timezone cache as well
|
||||||
|
const origClearDateCaches = System.clearDateCaches;
|
||||||
|
System.clearDateCaches = function () {
|
||||||
|
_localTimeZone = null;
|
||||||
|
origClearDateCaches();
|
||||||
|
};
|
||||||
|
|
||||||
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783
|
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783
|
||||||
Date.prototype.toLocaleFormat = function (format) {
|
Date.prototype.toLocaleFormat = function (format) {
|
||||||
let dt = GLib.DateTime.new_from_unix_local(this.getTime() / 1000);
|
if (_localTimeZone === null)
|
||||||
|
_localTimeZone = GLib.TimeZone.new_local();
|
||||||
|
|
||||||
|
let dt = GLib.DateTime.new(_localTimeZone,
|
||||||
|
this.getFullYear(),
|
||||||
|
this.getMonth() + 1,
|
||||||
|
this.getDate(),
|
||||||
|
this.getHours(),
|
||||||
|
this.getMinutes(),
|
||||||
|
this.getSeconds());
|
||||||
return dt ? dt.format(format) : '';
|
return dt ? dt.format(format) : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -56,6 +56,15 @@ function uninstallExtension(uuid) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
FileUtils.recursivelyDeleteDir(extension.dir, true);
|
FileUtils.recursivelyDeleteDir(extension.dir, true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const updatesDir = Gio.File.new_for_path(GLib.build_filenamev(
|
||||||
|
[global.userdatadir, 'extension-updates', extension.uuid]));
|
||||||
|
FileUtils.recursivelyDeleteDir(updatesDir, true);
|
||||||
|
} catch (e) {
|
||||||
|
// not an error
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +108,9 @@ function gotExtensionZipFile(session, message, uuid, dir, callback, errback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function downloadExtensionUpdate(uuid) {
|
function downloadExtensionUpdate(uuid) {
|
||||||
|
if (!Main.extensionManager.updatesSupported)
|
||||||
|
return;
|
||||||
|
|
||||||
let dir = Gio.File.new_for_path(
|
let dir = Gio.File.new_for_path(
|
||||||
GLib.build_filenamev([global.userdatadir, 'extension-updates', uuid]));
|
GLib.build_filenamev([global.userdatadir, 'extension-updates', uuid]));
|
||||||
|
|
||||||
@@ -117,6 +129,9 @@ function downloadExtensionUpdate(uuid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkForUpdates() {
|
function checkForUpdates() {
|
||||||
|
if (!Main.extensionManager.updatesSupported)
|
||||||
|
return;
|
||||||
|
|
||||||
let metadatas = {};
|
let metadatas = {};
|
||||||
Main.extensionManager.getUuids().forEach(uuid => {
|
Main.extensionManager.getUuids().forEach(uuid => {
|
||||||
let extension = Main.extensionManager.lookup(uuid);
|
let extension = Main.extensionManager.lookup(uuid);
|
||||||
@@ -124,9 +139,14 @@ 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)
|
||||||
|
return; // nothing to update
|
||||||
|
|
||||||
let versionCheck = global.settings.get_boolean(
|
let versionCheck = global.settings.get_boolean(
|
||||||
'disable-extension-version-validation');
|
'disable-extension-version-validation');
|
||||||
let params = {
|
let params = {
|
||||||
@@ -144,9 +164,7 @@ function checkForUpdates() {
|
|||||||
let operations = JSON.parse(message.response_body.data);
|
let operations = JSON.parse(message.response_body.data);
|
||||||
for (let uuid in operations) {
|
for (let uuid in operations) {
|
||||||
let operation = operations[uuid];
|
let operation = operations[uuid];
|
||||||
if (operation == 'blacklist')
|
if (operation === 'upgrade' || operation === 'downgrade')
|
||||||
uninstallExtension(uuid);
|
|
||||||
else if (operation == 'upgrade' || operation == 'downgrade')
|
|
||||||
downloadExtensionUpdate(uuid);
|
downloadExtensionUpdate(uuid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -222,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());
|
||||||
|
@@ -26,6 +26,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 = [];
|
||||||
|
|
||||||
@@ -60,6 +61,11 @@ var ExtensionManager = class {
|
|||||||
ExtensionDownloader.checkForUpdates();
|
ExtensionDownloader.checkForUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get updatesSupported() {
|
||||||
|
const appSys = Shell.AppSystem.get_default();
|
||||||
|
return appSys.lookup_app('org.gnome.Extensions.desktop') !== null;
|
||||||
|
}
|
||||||
|
|
||||||
lookup(uuid) {
|
lookup(uuid) {
|
||||||
return this._extensions.get(uuid);
|
return this._extensions.get(uuid);
|
||||||
}
|
}
|
||||||
@@ -97,18 +103,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 {
|
||||||
@@ -210,6 +216,25 @@ 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,
|
||||||
|
(conn, res) => conn.call_finish(res));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
notifyExtensionUpdate(uuid) {
|
notifyExtensionUpdate(uuid) {
|
||||||
let extension = this.lookup(uuid);
|
let extension = this.lookup(uuid);
|
||||||
if (!extension)
|
if (!extension)
|
||||||
@@ -245,6 +270,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,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;
|
||||||
@@ -302,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) {
|
||||||
@@ -312,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);
|
||||||
@@ -319,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,6 +527,9 @@ var ExtensionManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_installExtensionUpdates() {
|
_installExtensionUpdates() {
|
||||||
|
if (!this.updatesSupported)
|
||||||
|
return;
|
||||||
|
|
||||||
FileUtils.collectFromDatadirs('extension-updates', true, (dir, info) => {
|
FileUtils.collectFromDatadirs('extension-updates', true, (dir, info) => {
|
||||||
let fileType = info.get_file_type();
|
let fileType = info.get_file_type();
|
||||||
if (fileType !== Gio.FileType.DIRECTORY)
|
if (fileType !== Gio.FileType.DIRECTORY)
|
||||||
@@ -489,9 +538,14 @@ var ExtensionManager = class {
|
|||||||
let extensionDir = Gio.File.new_for_path(
|
let extensionDir = Gio.File.new_for_path(
|
||||||
GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
|
GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
|
||||||
|
|
||||||
FileUtils.recursivelyDeleteDir(extensionDir, false);
|
try {
|
||||||
FileUtils.recursivelyMoveDir(dir, extensionDir);
|
FileUtils.recursivelyDeleteDir(extensionDir, false);
|
||||||
FileUtils.recursivelyDeleteDir(dir, true);
|
FileUtils.recursivelyMoveDir(dir, extensionDir);
|
||||||
|
} catch (e) {
|
||||||
|
log('Failed to install extension updates for %s'.format(uuid));
|
||||||
|
} finally {
|
||||||
|
FileUtils.recursivelyDeleteDir(dir, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -845,8 +845,10 @@ var IconGrid = GObject.registerClass({
|
|||||||
// Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up
|
// Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up
|
||||||
_updateIconSizes() {
|
_updateIconSizes() {
|
||||||
this._updateIconSizesLaterId = 0;
|
this._updateIconSizesLaterId = 0;
|
||||||
let scale = Math.min(this._fixedHItemSize, this._fixedVItemSize) / Math.max(this._hItemSize, this._vItemSize);
|
let extraWidth = Math.max(0, this._hItemSize - ICON_SIZE);
|
||||||
let newIconSize = Math.floor(ICON_SIZE * scale);
|
let extraHeight = Math.max(0, this._vItemSize - ICON_SIZE);
|
||||||
|
let newIconSize = Math.min(this._fixedHItemSize - extraWidth,
|
||||||
|
this._fixedVItemSize - extraHeight);
|
||||||
for (let i in this._items)
|
for (let i in this._items)
|
||||||
this._items[i].icon.setIconSize(newIconSize);
|
this._items[i].icon.setIconSize(newIconSize);
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,7 +42,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,6 +61,24 @@ class AspectContainer extends St.Widget {
|
|||||||
this.queue_relayout();
|
this.queue_relayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
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();
|
||||||
@@ -498,7 +516,7 @@ var Key = GObject.registerClass({
|
|||||||
var KeyboardModel = class {
|
var KeyboardModel = class {
|
||||||
constructor(groupName) {
|
constructor(groupName) {
|
||||||
let names = [groupName];
|
let names = [groupName];
|
||||||
if (names.includes('+'))
|
if (groupName.includes('+'))
|
||||||
names.push(groupName.replace(/\+.*/, ''));
|
names.push(groupName.replace(/\+.*/, ''));
|
||||||
names.push('us');
|
names.push('us');
|
||||||
|
|
||||||
@@ -1074,8 +1092,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 +1110,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);
|
||||||
@@ -1120,10 +1138,11 @@ var KeyboardManager = class KeyBoardManager {
|
|||||||
|
|
||||||
this._lastDevice = null;
|
this._lastDevice = null;
|
||||||
Meta.get_backend().connect('last-device-changed', (backend, device) => {
|
Meta.get_backend().connect('last-device-changed', (backend, device) => {
|
||||||
if (device.get_device_name().indexOf('XTEST') < 0) {
|
if (device.device_type === Clutter.InputDeviceType.KEYBOARD_DEVICE)
|
||||||
this._lastDevice = device;
|
return;
|
||||||
this._syncEnabled();
|
|
||||||
}
|
this._lastDevice = device;
|
||||||
|
this._syncEnabled();
|
||||||
});
|
});
|
||||||
this._syncEnabled();
|
this._syncEnabled();
|
||||||
}
|
}
|
||||||
@@ -1148,9 +1167,9 @@ var KeyboardManager = class KeyBoardManager {
|
|||||||
this._keyboard = new Keyboard();
|
this._keyboard = new Keyboard();
|
||||||
} else if (!enabled && this._keyboard) {
|
} else if (!enabled && this._keyboard) {
|
||||||
this._keyboard.setCursorLocation(null);
|
this._keyboard.setCursorLocation(null);
|
||||||
Main.layoutManager.hideKeyboard(true);
|
|
||||||
this._keyboard.destroy();
|
this._keyboard.destroy();
|
||||||
this._keyboard = null;
|
this._keyboard = null;
|
||||||
|
Main.layoutManager.hideKeyboard(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1256,6 +1275,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);
|
||||||
@@ -1604,7 +1627,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1868,6 +1893,10 @@ var KeyboardController = class {
|
|||||||
Main.inputMethod.disconnect(this._notifyContentPurposeId);
|
Main.inputMethod.disconnect(this._notifyContentPurposeId);
|
||||||
Main.inputMethod.disconnect(this._notifyContentHintsId);
|
Main.inputMethod.disconnect(this._notifyContentHintsId);
|
||||||
Main.inputMethod.disconnect(this._notifyInputPanelStateId);
|
Main.inputMethod.disconnect(this._notifyInputPanelStateId);
|
||||||
|
|
||||||
|
// Make sure any buttons pressed by the virtual device are released
|
||||||
|
// immediately instead of waiting for the next GC cycle
|
||||||
|
this._virtualDevice.run_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onSourcesModified() {
|
_onSourcesModified() {
|
||||||
|
@@ -470,6 +470,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 +486,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 +495,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() {
|
||||||
@@ -612,10 +623,20 @@ var LayoutManager = GObject.registerClass({
|
|||||||
|
|
||||||
let signalId = this._systemBackground.connect('loaded', () => {
|
let signalId = this._systemBackground.connect('loaded', () => {
|
||||||
this._systemBackground.disconnect(signalId);
|
this._systemBackground.disconnect(signalId);
|
||||||
this._systemBackground.show();
|
|
||||||
global.stage.show();
|
|
||||||
|
|
||||||
this._prepareStartupAnimation();
|
// We're mostly prepared for the startup animation
|
||||||
|
// now, but since a lot is going on asynchronously
|
||||||
|
// during startup, let's defer the startup animation
|
||||||
|
// until the event loop is uncontended and idle.
|
||||||
|
// This helps to prevent us from running the animation
|
||||||
|
// when the system is bogged down
|
||||||
|
const id = GLib.idle_add(GLib.PRIORITY_LOW, () => {
|
||||||
|
this._systemBackground.show();
|
||||||
|
global.stage.show();
|
||||||
|
this._prepareStartupAnimation();
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
});
|
||||||
|
GLib.Source.set_name_by_id(id, '[gnome-shell] Startup Animation');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -634,7 +655,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,
|
||||||
@@ -651,8 +672,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();
|
||||||
@@ -668,21 +687,13 @@ 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');
|
||||||
|
|
||||||
// We're mostly prepared for the startup animation
|
this._startupAnimation();
|
||||||
// now, but since a lot is going on asynchronously
|
|
||||||
// during startup, let's defer the startup animation
|
|
||||||
// until the event loop is uncontended and idle.
|
|
||||||
// This helps to prevent us from running the animation
|
|
||||||
// when the system is bogged down
|
|
||||||
let id = GLib.idle_add(GLib.PRIORITY_LOW, () => {
|
|
||||||
this._startupAnimation();
|
|
||||||
return GLib.SOURCE_REMOVE;
|
|
||||||
});
|
|
||||||
GLib.Source.set_name_by_id(id, '[gnome-shell] this._startupAnimation');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_startupAnimation() {
|
_startupAnimation() {
|
||||||
@@ -765,7 +776,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
this._keyboardHeightNotifyId = 0;
|
this._keyboardHeightNotifyId = 0;
|
||||||
}
|
}
|
||||||
this.keyboardBox.ease({
|
this.keyboardBox.ease({
|
||||||
translation_y: this.keyboardBox.height,
|
translation_y: 0,
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
duration: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
|
duration: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
|
||||||
mode: Clutter.AnimationMode.EASE_IN_QUAD,
|
mode: Clutter.AnimationMode.EASE_IN_QUAD,
|
||||||
@@ -1229,8 +1240,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1127,7 +1127,7 @@ class LookingGlass extends St.BoxLayout {
|
|||||||
else if (symbol == Clutter.KEY_Page_Down)
|
else if (symbol == Clutter.KEY_Page_Down)
|
||||||
this._notebook.nextTab();
|
this._notebook.nextTab();
|
||||||
}
|
}
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return super.vfunc_key_press_event(keyPressEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
|
@@ -93,6 +93,9 @@ let _a11ySettings = null;
|
|||||||
let _themeResource = null;
|
let _themeResource = null;
|
||||||
let _oskResource = null;
|
let _oskResource = null;
|
||||||
|
|
||||||
|
Gio._promisify(Gio._LocalFilePrototype, 'delete_async', 'delete_finish');
|
||||||
|
Gio._promisify(Gio._LocalFilePrototype, 'touch_async', 'touch_finish');
|
||||||
|
|
||||||
function _sessionUpdated() {
|
function _sessionUpdated() {
|
||||||
if (sessionMode.isPrimary)
|
if (sessionMode.isPrimary)
|
||||||
_loadDefaultStylesheet();
|
_loadDefaultStylesheet();
|
||||||
@@ -129,7 +132,9 @@ function start() {
|
|||||||
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);
|
||||||
@@ -142,6 +147,11 @@ function start() {
|
|||||||
shellDBusService = new ShellDBus.GnomeShell();
|
shellDBusService = new ShellDBus.GnomeShell();
|
||||||
shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
|
shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
|
||||||
|
|
||||||
|
const watchId = Gio.DBus.session.watch_name('org.gnome.Shell.Notifications',
|
||||||
|
Gio.BusNameWatcherFlags.AUTO_START,
|
||||||
|
bus => bus.unwatch_name(watchId),
|
||||||
|
bus => bus.unwatch_name(watchId));
|
||||||
|
|
||||||
_sessionUpdated();
|
_sessionUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,11 +281,8 @@ function _initializeUI() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sessionMode.currentMode !== 'gdm' &&
|
if (sessionMode.currentMode !== 'gdm' &&
|
||||||
sessionMode.currentMode !== 'initial-setup' &&
|
sessionMode.currentMode !== 'initial-setup')
|
||||||
screenShield === null) {
|
_handleLockScreenWarning();
|
||||||
notify(_('Screen Lock disabled'),
|
|
||||||
_('Screen Locking requires the GNOME display manager.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
LoginManager.registerSessionWithGDM();
|
LoginManager.registerSessionWithGDM();
|
||||||
|
|
||||||
@@ -288,6 +295,32 @@ function _initializeUI() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function _handleLockScreenWarning() {
|
||||||
|
const path = '%s/lock-warning-shown'.format(global.userdatadir);
|
||||||
|
const file = Gio.File.new_for_path(path);
|
||||||
|
|
||||||
|
const hasLockScreen = screenShield !== null;
|
||||||
|
if (hasLockScreen) {
|
||||||
|
try {
|
||||||
|
await file.delete_async(0, null);
|
||||||
|
} catch (e) {
|
||||||
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND))
|
||||||
|
logError(e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
if (!await file.touch_async())
|
||||||
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
logError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
notify(
|
||||||
|
_('Screen Lock disabled'),
|
||||||
|
_('Screen Locking requires the GNOME display manager.'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function _getStylesheet(name) {
|
function _getStylesheet(name) {
|
||||||
let stylesheet;
|
let stylesheet;
|
||||||
|
|
||||||
@@ -361,7 +394,8 @@ function reloadThemeResource() {
|
|||||||
if (_themeResource)
|
if (_themeResource)
|
||||||
_themeResource._unregister();
|
_themeResource._unregister();
|
||||||
|
|
||||||
_themeResource = Gio.Resource.load('%s/gnome-shell-theme.gresource'.format(global.datadir));
|
_themeResource = Gio.Resource.load('%s/%s'.format(global.datadir,
|
||||||
|
sessionMode.themeResourceName));
|
||||||
_themeResource._register();
|
_themeResource._register();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,7 +521,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;
|
||||||
});
|
});
|
||||||
|
@@ -530,7 +530,7 @@ var Message = GObject.registerClass({
|
|||||||
this.close();
|
this.close();
|
||||||
return Clutter.EVENT_STOP;
|
return Clutter.EVENT_STOP;
|
||||||
}
|
}
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return super.vfunc_key_press_event(keyEvent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -136,29 +136,22 @@ var FocusGrabber = class FocusGrabber {
|
|||||||
var NotificationPolicy = GObject.registerClass({
|
var NotificationPolicy = GObject.registerClass({
|
||||||
Properties: {
|
Properties: {
|
||||||
'enable': GObject.ParamSpec.boolean(
|
'enable': GObject.ParamSpec.boolean(
|
||||||
'enable', 'enable', 'enable',
|
'enable', 'enable', 'enable', GObject.ParamFlags.READABLE, true),
|
||||||
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
|
||||||
true),
|
|
||||||
'enable-sound': GObject.ParamSpec.boolean(
|
'enable-sound': GObject.ParamSpec.boolean(
|
||||||
'enable-sound', 'enable-sound', 'enable-sound',
|
'enable-sound', 'enable-sound', 'enable-sound',
|
||||||
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
GObject.ParamFlags.READABLE, true),
|
||||||
true),
|
|
||||||
'show-banners': GObject.ParamSpec.boolean(
|
'show-banners': GObject.ParamSpec.boolean(
|
||||||
'show-banners', 'show-banners', 'show-banners',
|
'show-banners', 'show-banners', 'show-banners',
|
||||||
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
GObject.ParamFlags.READABLE, true),
|
||||||
true),
|
|
||||||
'force-expanded': GObject.ParamSpec.boolean(
|
'force-expanded': GObject.ParamSpec.boolean(
|
||||||
'force-expanded', 'force-expanded', 'force-expanded',
|
'force-expanded', 'force-expanded', 'force-expanded',
|
||||||
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
GObject.ParamFlags.READABLE, false),
|
||||||
false),
|
|
||||||
'show-in-lock-screen': GObject.ParamSpec.boolean(
|
'show-in-lock-screen': GObject.ParamSpec.boolean(
|
||||||
'show-in-lock-screen', 'show-in-lock-screen', 'show-in-lock-screen',
|
'show-in-lock-screen', 'show-in-lock-screen', 'show-in-lock-screen',
|
||||||
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
GObject.ParamFlags.READABLE, false),
|
||||||
false),
|
|
||||||
'details-in-lock-screen': GObject.ParamSpec.boolean(
|
'details-in-lock-screen': GObject.ParamSpec.boolean(
|
||||||
'details-in-lock-screen', 'details-in-lock-screen', 'details-in-lock-screen',
|
'details-in-lock-screen', 'details-in-lock-screen', 'details-in-lock-screen',
|
||||||
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
GObject.ParamFlags.READABLE, false),
|
||||||
false),
|
|
||||||
},
|
},
|
||||||
}, class NotificationPolicy extends GObject.Object {
|
}, class NotificationPolicy extends GObject.Object {
|
||||||
// Do nothing for the default policy. These methods are only useful for the
|
// Do nothing for the default policy. These methods are only useful for the
|
||||||
@@ -169,24 +162,28 @@ var NotificationPolicy = GObject.registerClass({
|
|||||||
this.run_dispose();
|
this.run_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get enable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
get enableSound() {
|
get enableSound() {
|
||||||
return this.enable_sound;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
get showBanners() {
|
get showBanners() {
|
||||||
return this.show_banners;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
get forceExpanded() {
|
get forceExpanded() {
|
||||||
return this.force_expanded;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
get showInLockScreen() {
|
get showInLockScreen() {
|
||||||
return this.show_in_lock_screen;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
get detailsInLockScreen() {
|
get detailsInLockScreen() {
|
||||||
return this.details_in_lock_screen;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -762,12 +759,10 @@ var Source = GObject.registerClass({
|
|||||||
|
|
||||||
this.notifications = [];
|
this.notifications = [];
|
||||||
|
|
||||||
this._policy = null;
|
this._policy = this._createPolicy();
|
||||||
}
|
}
|
||||||
|
|
||||||
get policy() {
|
get policy() {
|
||||||
if (!this._policy)
|
|
||||||
this._policy = this._createPolicy();
|
|
||||||
return this._policy;
|
return this._policy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -880,8 +875,6 @@ var Source = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy(reason) {
|
destroy(reason) {
|
||||||
this.policy.destroy();
|
|
||||||
|
|
||||||
let notifications = this.notifications;
|
let notifications = this.notifications;
|
||||||
this.notifications = [];
|
this.notifications = [];
|
||||||
|
|
||||||
@@ -890,6 +883,7 @@ var Source = GObject.registerClass({
|
|||||||
|
|
||||||
this.emit('destroy', reason);
|
this.emit('destroy', reason);
|
||||||
|
|
||||||
|
this.policy.destroy();
|
||||||
this.run_dispose();
|
this.run_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -173,6 +173,11 @@ var MprisPlayer = class MprisPlayer {
|
|||||||
if (!this._mprisProxy.g_name_owner)
|
if (!this._mprisProxy.g_name_owner)
|
||||||
this._close();
|
this._close();
|
||||||
});
|
});
|
||||||
|
// It is possible for the bus to disappear before the previous signal
|
||||||
|
// is connected, so we must ensure that the bus still exists at this
|
||||||
|
// point.
|
||||||
|
if (!this._mprisProxy.g_name_owner)
|
||||||
|
this._close();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPlayerProxyReady() {
|
_onPlayerProxyReady() {
|
||||||
@@ -251,6 +256,10 @@ class MediaSection extends MessageList.MessageListSection {
|
|||||||
return !this.empty && Calendar.isToday(this._date);
|
return !this.empty && Calendar.isToday(this._date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get allowed() {
|
||||||
|
return !Main.sessionMode.isGreeter;
|
||||||
|
}
|
||||||
|
|
||||||
_addPlayer(busName) {
|
_addPlayer(busName) {
|
||||||
if (this._players.get(busName))
|
if (this._players.get(busName))
|
||||||
return;
|
return;
|
||||||
|
@@ -10,13 +10,6 @@ const Params = imports.misc.params;
|
|||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
// Should really be defined in Gio.js
|
|
||||||
const BusIface = loadInterfaceXML('org.freedesktop.DBus');
|
|
||||||
var BusProxy = Gio.DBusProxy.makeProxyWrapper(BusIface);
|
|
||||||
function Bus() {
|
|
||||||
return new BusProxy(Gio.DBus.session, 'org.freedesktop.DBus', '/org/freedesktop/DBus');
|
|
||||||
}
|
|
||||||
|
|
||||||
const FdoNotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
|
const FdoNotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
|
||||||
|
|
||||||
var NotificationClosedReason = {
|
var NotificationClosedReason = {
|
||||||
@@ -49,9 +42,7 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
|
this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
|
||||||
|
|
||||||
this._sources = [];
|
this._sources = [];
|
||||||
this._senderToPid = {};
|
|
||||||
this._notifications = {};
|
this._notifications = {};
|
||||||
this._busProxy = new Bus();
|
|
||||||
|
|
||||||
this._nextNotificationId = 1;
|
this._nextNotificationId = 1;
|
||||||
|
|
||||||
@@ -116,12 +107,9 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
//
|
//
|
||||||
// If no existing source is found, a new source is created as long as
|
// If no existing source is found, a new source is created as long as
|
||||||
// pid is provided.
|
// pid is provided.
|
||||||
//
|
|
||||||
// Either a pid or ndata.notification is needed to retrieve or
|
|
||||||
// create a source.
|
|
||||||
_getSource(title, pid, ndata, sender) {
|
_getSource(title, pid, ndata, sender) {
|
||||||
if (!pid && !(ndata && ndata.notification))
|
if (!pid && !(ndata && ndata.notification))
|
||||||
return null;
|
throw new Error('Either a pid or ndata.notification is needed');
|
||||||
|
|
||||||
// We use notification's source for the notifications we still have
|
// We use notification's source for the notifications we still have
|
||||||
// around that are getting replaced because we don't keep sources
|
// around that are getting replaced because we don't keep sources
|
||||||
@@ -218,42 +206,10 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
this._notifications[id] = ndata;
|
this._notifications[id] = ndata;
|
||||||
|
|
||||||
let sender = invocation.get_sender();
|
let sender = invocation.get_sender();
|
||||||
let pid = this._senderToPid[sender];
|
let pid = hints['sender-pid'];
|
||||||
|
|
||||||
let source = this._getSource(appName, pid, ndata, sender, null);
|
let source = this._getSource(appName, pid, ndata, sender, null);
|
||||||
|
this._notifyForSource(source, ndata);
|
||||||
if (source) {
|
|
||||||
this._notifyForSource(source, ndata);
|
|
||||||
return invocation.return_value(GLib.Variant.new('(u)', [id]));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (replacesId) {
|
|
||||||
// There's already a pending call to GetConnectionUnixProcessID,
|
|
||||||
// which will see the new notification data when it finishes,
|
|
||||||
// so we don't have to do anything.
|
|
||||||
return invocation.return_value(GLib.Variant.new('(u)', [id]));
|
|
||||||
}
|
|
||||||
|
|
||||||
this._busProxy.GetConnectionUnixProcessIDRemote(sender, (result, excp) => {
|
|
||||||
// The app may have updated or removed the notification
|
|
||||||
ndata = this._notifications[id];
|
|
||||||
if (!ndata)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (excp) {
|
|
||||||
logError(excp, 'Call to GetConnectionUnixProcessID failed');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
[pid] = result;
|
|
||||||
source = this._getSource(appName, pid, ndata, sender, null);
|
|
||||||
|
|
||||||
this._senderToPid[sender] = pid;
|
|
||||||
source.connect('destroy', () => {
|
|
||||||
delete this._senderToPid[sender];
|
|
||||||
});
|
|
||||||
this._notifyForSource(source, ndata);
|
|
||||||
});
|
|
||||||
|
|
||||||
return invocation.return_value(GLib.Variant.new('(u)', [id]));
|
return invocation.return_value(GLib.Variant.new('(u)', [id]));
|
||||||
}
|
}
|
||||||
@@ -416,12 +372,11 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
var FdoNotificationDaemonSource = GObject.registerClass(
|
var FdoNotificationDaemonSource = GObject.registerClass(
|
||||||
class FdoNotificationDaemonSource extends MessageTray.Source {
|
class FdoNotificationDaemonSource extends MessageTray.Source {
|
||||||
_init(title, pid, sender, appId) {
|
_init(title, pid, sender, appId) {
|
||||||
super._init(title);
|
|
||||||
|
|
||||||
this.pid = pid;
|
this.pid = pid;
|
||||||
|
this.initialTitle = title;
|
||||||
this.app = this._getApp(appId);
|
this.app = this._getApp(appId);
|
||||||
|
|
||||||
this.initialTitle = title;
|
super._init(title);
|
||||||
|
|
||||||
if (this.app)
|
if (this.app)
|
||||||
this.title = this.app.get_name();
|
this.title = this.app.get_name();
|
||||||
@@ -470,19 +425,20 @@ class FdoNotificationDaemonSource extends MessageTray.Source {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getApp(appId) {
|
_getApp(appId) {
|
||||||
|
const appSys = Shell.AppSystem.get_default();
|
||||||
let app;
|
let app;
|
||||||
|
|
||||||
app = Shell.WindowTracker.get_default().get_app_from_pid(this.pid);
|
app = Shell.WindowTracker.get_default().get_app_from_pid(this.pid);
|
||||||
if (app != null)
|
if (app != null)
|
||||||
return app;
|
return app;
|
||||||
|
|
||||||
if (appId) {
|
if (appId)
|
||||||
app = Shell.AppSystem.get_default().lookup_app('%s.desktop'.format(appId));
|
app = appSys.lookup_app('%s.desktop'.format(appId));
|
||||||
if (app != null)
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
if (!app)
|
||||||
|
app = appSys.lookup_app('%s.desktop'.format(this.initialTitle));
|
||||||
|
|
||||||
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTitle(title) {
|
setTitle(title) {
|
||||||
@@ -631,12 +587,12 @@ class GtkNotificationDaemonAppSource extends MessageTray.Source {
|
|||||||
if (!app)
|
if (!app)
|
||||||
throw new InvalidAppError();
|
throw new InvalidAppError();
|
||||||
|
|
||||||
super._init(app.get_name());
|
|
||||||
|
|
||||||
this._appId = appId;
|
this._appId = appId;
|
||||||
this._app = app;
|
this._app = app;
|
||||||
this._objectPath = objectPath;
|
this._objectPath = objectPath;
|
||||||
|
|
||||||
|
super._init(app.get_name());
|
||||||
|
|
||||||
this._notifications = {};
|
this._notifications = {};
|
||||||
this._notificationPending = false;
|
this._notificationPending = false;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,10 @@
|
|||||||
const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
|
const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
|
// Time for initial animation going into Overview mode;
|
||||||
|
// this is defined here to make it available in imports.
|
||||||
|
var ANIMATION_TIME = 250;
|
||||||
|
|
||||||
const Background = imports.ui.background;
|
const Background = imports.ui.background;
|
||||||
const DND = imports.ui.dnd;
|
const DND = imports.ui.dnd;
|
||||||
const LayoutManager = imports.ui.layout;
|
const LayoutManager = imports.ui.layout;
|
||||||
@@ -14,9 +18,6 @@ const OverviewControls = imports.ui.overviewControls;
|
|||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
||||||
|
|
||||||
// Time for initial animation going into Overview mode
|
|
||||||
var ANIMATION_TIME = 250;
|
|
||||||
|
|
||||||
// Must be less than ANIMATION_TIME, since we switch to
|
// Must be less than ANIMATION_TIME, since we switch to
|
||||||
// or from the overview completely after ANIMATION_TIME,
|
// or from the overview completely after ANIMATION_TIME,
|
||||||
// and don't want the shading animation to get cut off
|
// and don't want the shading animation to get cut off
|
||||||
|
@@ -8,8 +8,9 @@ const Main = imports.ui.main;
|
|||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const ViewSelector = imports.ui.viewSelector;
|
const ViewSelector = imports.ui.viewSelector;
|
||||||
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
||||||
|
const Overview = imports.ui.overview;
|
||||||
|
|
||||||
var SIDE_CONTROLS_ANIMATION_TIME = 160;
|
var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME;
|
||||||
|
|
||||||
function getRtlSlideDirection(direction, actor) {
|
function getRtlSlideDirection(direction, actor) {
|
||||||
let rtl = actor.text_direction == Clutter.TextDirection.RTL;
|
let rtl = actor.text_direction == Clutter.TextDirection.RTL;
|
||||||
@@ -473,6 +474,7 @@ class ControlsManager extends St.Widget {
|
|||||||
|
|
||||||
// A workspace might have been inserted or removed before the active
|
// A workspace might have been inserted or removed before the active
|
||||||
// one, causing the adjustment to go out of sync, so update the value
|
// one, causing the adjustment to go out of sync, so update the value
|
||||||
|
this._workspaceAdjustment.remove_transition('value');
|
||||||
this._workspaceAdjustment.value = activeIndex;
|
this._workspaceAdjustment.value = activeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
157
js/ui/padOsd.js
157
js/ui/padOsd.js
@@ -2,7 +2,7 @@
|
|||||||
/* exported PadOsd, PadOsdService */
|
/* exported PadOsd, PadOsdService */
|
||||||
|
|
||||||
const { Atk, Clutter, GDesktopEnums, Gio,
|
const { Atk, Clutter, GDesktopEnums, Gio,
|
||||||
GLib, GObject, Gtk, Meta, Rsvg, St } = imports.gi;
|
GLib, GObject, Gtk, Meta, Pango, Rsvg, St } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@@ -89,7 +89,7 @@ var PadChooser = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var KeybindingEntry = GObject.registerClass({
|
var KeybindingEntry = GObject.registerClass({
|
||||||
Signals: { 'keybinding-edited': {} },
|
Signals: { 'keybinding-edited': { param_types: [GObject.TYPE_STRING] } },
|
||||||
}, class KeybindingEntry extends St.Entry {
|
}, class KeybindingEntry extends St.Entry {
|
||||||
_init() {
|
_init() {
|
||||||
super._init({ hint_text: _("New shortcut…"), style: 'width: 10em' });
|
super._init({ hint_text: _("New shortcut…"), style: 'width: 10em' });
|
||||||
@@ -329,6 +329,7 @@ var PadDiagram = GObject.registerClass({
|
|||||||
|
|
||||||
this._imagePath = imagePath;
|
this._imagePath = imagePath;
|
||||||
this._handle = this._composeStyledDiagram();
|
this._handle = this._composeStyledDiagram();
|
||||||
|
this._initLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
@@ -343,6 +344,26 @@ var PadDiagram = GObject.registerClass({
|
|||||||
this.add_actor(actor);
|
this.add_actor(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_initLabels() {
|
||||||
|
let i = 0;
|
||||||
|
for (i = 0; ; i++) {
|
||||||
|
if (!this._addLabel(Meta.PadActionType.BUTTON, i))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; ; i++) {
|
||||||
|
if (!this._addLabel(Meta.PadActionType.RING, i, CW) ||
|
||||||
|
!this._addLabel(Meta.PadActionType.RING, i, CCW))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; ; i++) {
|
||||||
|
if (!this._addLabel(Meta.PadActionType.STRIP, i, UP) ||
|
||||||
|
!this._addLabel(Meta.PadActionType.STRIP, i, DOWN))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_wrappingSvgHeader() {
|
_wrappingSvgHeader() {
|
||||||
return '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +
|
return '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +
|
||||||
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" ' +
|
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" ' +
|
||||||
@@ -362,10 +383,8 @@ var PadDiagram = GObject.registerClass({
|
|||||||
|
|
||||||
for (let i = 0; i < this._activeButtons.length; i++) {
|
for (let i = 0; i < this._activeButtons.length; i++) {
|
||||||
let ch = String.fromCharCode('A'.charCodeAt() + this._activeButtons[i]);
|
let ch = String.fromCharCode('A'.charCodeAt() + this._activeButtons[i]);
|
||||||
css += '.%s {'.format(ch);
|
css += '.%s.Leader { stroke: %s !important; }'.format(ch, ACTIVE_COLOR);
|
||||||
css += ' stroke: %s !important;'.format(ACTIVE_COLOR);
|
css += '.%s.Button { stroke: %s !important; fill: %s !important; }'.format(ch, ACTIVE_COLOR, ACTIVE_COLOR);
|
||||||
css += ' fill: %s !important;'.format(ACTIVE_COLOR);
|
|
||||||
css += '}';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return css;
|
return css;
|
||||||
@@ -390,9 +409,6 @@ var PadDiagram = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateDiagramScale() {
|
_updateDiagramScale() {
|
||||||
if (this._handle == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
[this._actorWidth, this._actorHeight] = this.get_size();
|
[this._actorWidth, this._actorHeight] = this.get_size();
|
||||||
let dimensions = this._handle.get_dimensions();
|
let dimensions = this._handle.get_dimensions();
|
||||||
let scaleX = this._actorWidth / dimensions.width;
|
let scaleX = this._actorWidth / dimensions.width;
|
||||||
@@ -405,6 +421,11 @@ var PadDiagram = GObject.registerClass({
|
|||||||
let [, natWidth] = child.get_preferred_width(natHeight);
|
let [, natWidth] = child.get_preferred_width(natHeight);
|
||||||
let childBox = new Clutter.ActorBox();
|
let childBox = new Clutter.ActorBox();
|
||||||
|
|
||||||
|
// I miss Cairo.Matrix
|
||||||
|
let dimensions = this._handle.get_dimensions();
|
||||||
|
x = x * this._scale + this._actorWidth / 2 - dimensions.width / 2 * this._scale;
|
||||||
|
y = y * this._scale + this._actorHeight / 2 - dimensions.height / 2 * this._scale;
|
||||||
|
|
||||||
if (direction == LTR) {
|
if (direction == LTR) {
|
||||||
childBox.x1 = x;
|
childBox.x1 = x;
|
||||||
childBox.x2 = x + natWidth;
|
childBox.x2 = x + natWidth;
|
||||||
@@ -420,17 +441,18 @@ var PadDiagram = GObject.registerClass({
|
|||||||
|
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
super.vfunc_allocate(box, flags);
|
super.vfunc_allocate(box, flags);
|
||||||
|
if (this._handle === null)
|
||||||
|
return;
|
||||||
|
|
||||||
this._updateDiagramScale();
|
this._updateDiagramScale();
|
||||||
|
|
||||||
for (let i = 0; i < this._labels.length; i++) {
|
for (let i = 0; i < this._labels.length; i++) {
|
||||||
let [label, action, idx, dir] = this._labels[i];
|
const { label, x, y, arrangement } = this._labels[i];
|
||||||
let [found_, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
|
|
||||||
this._allocateChild(label, x, y, arrangement);
|
this._allocateChild(label, x, y, arrangement);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._editorActor && this._curEdited) {
|
if (this._editorActor && this._curEdited) {
|
||||||
let [label_, action, idx, dir] = this._curEdited;
|
const { x, y, arrangement } = this._curEdited;
|
||||||
let [found_, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
|
|
||||||
this._allocateChild(this._editorActor, x, y, arrangement);
|
this._allocateChild(this._editorActor, x, y, arrangement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,17 +479,6 @@ var PadDiagram = GObject.registerClass({
|
|||||||
cr.$dispose();
|
cr.$dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
_transformPoint(x, y) {
|
|
||||||
if (this._handle == null || this._scale == null)
|
|
||||||
return [x, y];
|
|
||||||
|
|
||||||
// I miss Cairo.Matrix
|
|
||||||
let dimensions = this._handle.get_dimensions();
|
|
||||||
x = x * this._scale + this._actorWidth / 2 - dimensions.width / 2 * this._scale;
|
|
||||||
y = y * this._scale + this._actorHeight / 2 - dimensions.height / 2 * this._scale;
|
|
||||||
return [Math.round(x), Math.round(y)];
|
|
||||||
}
|
|
||||||
|
|
||||||
_getItemLabelCoords(labelName, leaderName) {
|
_getItemLabelCoords(labelName, leaderName) {
|
||||||
if (this._handle == null)
|
if (this._handle == null)
|
||||||
return [false];
|
return [false];
|
||||||
@@ -495,44 +506,39 @@ var PadDiagram = GObject.registerClass({
|
|||||||
pos.y = this._imageHeight - pos.y;
|
pos.y = this._imageHeight - pos.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
let [x, y] = this._transformPoint(pos.x, pos.y);
|
return [true, pos.x, pos.y, direction];
|
||||||
|
|
||||||
return [true, x, y, direction];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getButtonLabelCoords(button) {
|
_getButtonLabels(button) {
|
||||||
let ch = String.fromCharCode('A'.charCodeAt() + button);
|
let ch = String.fromCharCode('A'.charCodeAt() + button);
|
||||||
let labelName = 'Label%s'.format(ch);
|
let labelName = 'Label%s'.format(ch);
|
||||||
let leaderName = 'Leader%s'.format(ch);
|
let leaderName = 'Leader%s'.format(ch);
|
||||||
|
return [labelName, leaderName];
|
||||||
return this._getItemLabelCoords(labelName, leaderName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getRingLabelCoords(number, dir) {
|
_getRingLabels(number, dir) {
|
||||||
let numStr = number > 0 ? (number + 1).toString() : '';
|
let numStr = number > 0 ? (number + 1).toString() : '';
|
||||||
let dirStr = dir == CW ? 'CW' : 'CCW';
|
let dirStr = dir == CW ? 'CW' : 'CCW';
|
||||||
let labelName = 'LabelRing%s%s'.format(numStr, dirStr);
|
let labelName = 'LabelRing%s%s'.format(numStr, dirStr);
|
||||||
let leaderName = 'LeaderRing%s%s'.format(numStr, dirStr);
|
let leaderName = 'LeaderRing%s%s'.format(numStr, dirStr);
|
||||||
|
return [labelName, leaderName];
|
||||||
return this._getItemLabelCoords(labelName, leaderName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getStripLabelCoords(number, dir) {
|
_getStripLabels(number, dir) {
|
||||||
let numStr = number > 0 ? (number + 1).toString() : '';
|
let numStr = number > 0 ? (number + 1).toString() : '';
|
||||||
let dirStr = dir == UP ? 'Up' : 'Down';
|
let dirStr = dir == UP ? 'Up' : 'Down';
|
||||||
let labelName = 'LabelStrip%s%s'.format(numStr, dirStr);
|
let labelName = 'LabelStrip%s%s'.format(numStr, dirStr);
|
||||||
let leaderName = 'LeaderStrip%s%s'.format(numStr, dirStr);
|
let leaderName = 'LeaderStrip%s%s'.format(numStr, dirStr);
|
||||||
|
return [labelName, leaderName];
|
||||||
return this._getItemLabelCoords(labelName, leaderName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getLabelCoords(action, idx, dir) {
|
_getLabelCoords(action, idx, dir) {
|
||||||
if (action == Meta.PadActionType.BUTTON)
|
if (action == Meta.PadActionType.BUTTON)
|
||||||
return this.getButtonLabelCoords(idx);
|
return this._getItemLabelCoords(...this._getButtonLabels(idx));
|
||||||
else if (action == Meta.PadActionType.RING)
|
else if (action == Meta.PadActionType.RING)
|
||||||
return this.getRingLabelCoords(idx, dir);
|
return this._getItemLabelCoords(...this._getRingLabels(idx, dir));
|
||||||
else if (action == Meta.PadActionType.STRIP)
|
else if (action == Meta.PadActionType.STRIP)
|
||||||
return this.getStripLabelCoords(idx, dir);
|
return this._getItemLabelCoords(...this._getStripLabels(idx, dir));
|
||||||
|
|
||||||
return [false];
|
return [false];
|
||||||
}
|
}
|
||||||
@@ -557,26 +563,30 @@ var PadDiagram = GObject.registerClass({
|
|||||||
this._invalidateSvg();
|
this._invalidateSvg();
|
||||||
}
|
}
|
||||||
|
|
||||||
addLabel(label, type, idx, dir) {
|
_addLabel(action, idx, dir) {
|
||||||
this._labels.push([label, type, idx, dir]);
|
let [found, x, y, arrangement] = this._getLabelCoords(action, idx, dir);
|
||||||
|
if (!found)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
let label = new St.Label();
|
||||||
|
this._labels.push({ label, action, idx, dir, x, y, arrangement });
|
||||||
this.add_actor(label);
|
this.add_actor(label);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLabels(getText) {
|
updateLabels(getText) {
|
||||||
for (let i = 0; i < this._labels.length; i++) {
|
for (let i = 0; i < this._labels.length; i++) {
|
||||||
let [label, action, idx, dir] = this._labels[i];
|
const { label, action, idx, dir } = this._labels[i];
|
||||||
let str = getText(action, idx, dir);
|
let str = getText(action, idx, dir);
|
||||||
label.set_text(str);
|
label.set_text(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.queue_relayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
_applyLabel(label, action, idx, dir, str) {
|
_applyLabel(label, action, idx, dir, str) {
|
||||||
if (str != null) {
|
if (str !== null)
|
||||||
label.set_text(str);
|
label.set_text(str);
|
||||||
|
|
||||||
let [found_, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
|
|
||||||
this._allocateChild(label, x, y, arrangement);
|
|
||||||
}
|
|
||||||
label.show();
|
label.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,18 +594,20 @@ var PadDiagram = GObject.registerClass({
|
|||||||
this._editorActor.hide();
|
this._editorActor.hide();
|
||||||
|
|
||||||
if (this._prevEdited) {
|
if (this._prevEdited) {
|
||||||
let [label, action, idx, dir] = this._prevEdited;
|
const { label, action, idx, dir } = this._prevEdited;
|
||||||
this._applyLabel(label, action, idx, dir, str);
|
this._applyLabel(label, action, idx, dir, str);
|
||||||
this._prevEdited = null;
|
this._prevEdited = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._curEdited) {
|
if (this._curEdited) {
|
||||||
let [label, action, idx, dir] = this._curEdited;
|
const { label, action, idx, dir } = this._curEdited;
|
||||||
this._applyLabel(label, action, idx, dir, str);
|
this._applyLabel(label, action, idx, dir, str);
|
||||||
if (continues)
|
if (continues)
|
||||||
this._prevEdited = this._curEdited;
|
this._prevEdited = this._curEdited;
|
||||||
this._curEdited = null;
|
this._curEdited = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.queue_relayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
startEdition(action, idx, dir) {
|
startEdition(action, idx, dir) {
|
||||||
@@ -605,21 +617,19 @@ var PadDiagram = GObject.registerClass({
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (let i = 0; i < this._labels.length; i++) {
|
for (let i = 0; i < this._labels.length; i++) {
|
||||||
let [label, itemAction, itemIdx, itemDir] = this._labels[i];
|
if (action == this._labels[i].action &&
|
||||||
if (action == itemAction && idx == itemIdx && dir == itemDir) {
|
idx == this._labels[i].idx && dir == this._labels[i].dir) {
|
||||||
this._curEdited = this._labels[i];
|
this._curEdited = this._labels[i];
|
||||||
editedLabel = label;
|
editedLabel = this._curEdited.label;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._curEdited == null)
|
if (this._curEdited == null)
|
||||||
return;
|
return;
|
||||||
let [found] = this.getLabelCoords(action, idx, dir);
|
|
||||||
if (!found)
|
|
||||||
return;
|
|
||||||
this._editorActor.show();
|
this._editorActor.show();
|
||||||
editedLabel.hide();
|
editedLabel.hide();
|
||||||
|
this.queue_relayout();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -693,6 +703,7 @@ var PadOsd = GObject.registerClass({
|
|||||||
|
|
||||||
this._titleLabel = new St.Label({ style: 'font-side: larger; font-weight: bold;',
|
this._titleLabel = new St.Label({ style: 'font-side: larger; font-weight: bold;',
|
||||||
x_align: Clutter.ActorAlign.CENTER });
|
x_align: Clutter.ActorAlign.CENTER });
|
||||||
|
this._titleLabel.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
|
||||||
this._titleLabel.clutter_text.set_text(padDevice.get_device_name());
|
this._titleLabel.clutter_text.set_text(padDevice.get_device_name());
|
||||||
labelBox.add_actor(this._titleLabel);
|
labelBox.add_actor(this._titleLabel);
|
||||||
|
|
||||||
@@ -710,31 +721,7 @@ var PadOsd = GObject.registerClass({
|
|||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true });
|
y_expand: true });
|
||||||
this.add_actor(this._padDiagram);
|
this.add_actor(this._padDiagram);
|
||||||
|
this._updateActionLabels();
|
||||||
// FIXME: Fix num buttons.
|
|
||||||
let i = 0;
|
|
||||||
for (i = 0; i < 50; i++) {
|
|
||||||
let [found] = this._padDiagram.getButtonLabelCoords(i);
|
|
||||||
if (!found)
|
|
||||||
break;
|
|
||||||
this._createLabel(Meta.PadActionType.BUTTON, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < padDevice.get_n_rings(); i++) {
|
|
||||||
let [found] = this._padDiagram.getRingLabelCoords(i, CW);
|
|
||||||
if (!found)
|
|
||||||
break;
|
|
||||||
this._createLabel(Meta.PadActionType.RING, i, CW);
|
|
||||||
this._createLabel(Meta.PadActionType.RING, i, CCW);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < padDevice.get_n_strips(); i++) {
|
|
||||||
let [found] = this._padDiagram.getStripLabelCoords(i, UP);
|
|
||||||
if (!found)
|
|
||||||
break;
|
|
||||||
this._createLabel(Meta.PadActionType.STRIP, i, UP);
|
|
||||||
this._createLabel(Meta.PadActionType.STRIP, i, DOWN);
|
|
||||||
}
|
|
||||||
|
|
||||||
let buttonBox = new St.Widget({ layout_manager: new Clutter.BinLayout(),
|
let buttonBox = new St.Widget({ layout_manager: new Clutter.BinLayout(),
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
@@ -787,11 +774,6 @@ var PadOsd = GObject.registerClass({
|
|||||||
return str ? str : _("None");
|
return str ? str : _("None");
|
||||||
}
|
}
|
||||||
|
|
||||||
_createLabel(type, number, dir) {
|
|
||||||
let label = new St.Label({ text: this._getActionText(type, number) });
|
|
||||||
this._padDiagram.addLabel(label, type, number, dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
_updateActionLabels() {
|
_updateActionLabels() {
|
||||||
this._padDiagram.updateLabels(this._getActionText.bind(this));
|
this._padDiagram.updateLabels(this._getActionText.bind(this));
|
||||||
}
|
}
|
||||||
@@ -867,8 +849,7 @@ var PadOsd = GObject.registerClass({
|
|||||||
this._tipLabel.set_text(_("Press any key to exit"));
|
this._tipLabel.set_text(_("Press any key to exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
this._titleLabel.clutter_text.set_markup(
|
this._titleLabel.set_text(title);
|
||||||
'<span size="larger"><b>%s</b></span>'.format(title));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_isEditedAction(type, number, dir) {
|
_isEditedAction(type, number, dir) {
|
||||||
|
@@ -100,7 +100,7 @@ class AppMenu extends PopupMenu.PopupMenu {
|
|||||||
'org.gtk.Actions', 'Activate',
|
'org.gtk.Actions', 'Activate',
|
||||||
GLib.Variant.new('(sava{sv})',
|
GLib.Variant.new('(sava{sv})',
|
||||||
['details', [args], null]),
|
['details', [args], null]),
|
||||||
null, 0, -1, null, null);
|
null, 0, -1, null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -216,7 +216,10 @@ var AppMenuButton = GObject.registerClass({
|
|||||||
this._onIconThemeChanged.bind(this));
|
this._onIconThemeChanged.bind(this));
|
||||||
|
|
||||||
let iconEffect = new Clutter.DesaturateEffect();
|
let iconEffect = new Clutter.DesaturateEffect();
|
||||||
this._iconBox = new St.Bin({ style_class: 'app-menu-icon' });
|
this._iconBox = new St.Bin({
|
||||||
|
style_class: 'app-menu-icon',
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this._iconBox.add_effect(iconEffect);
|
this._iconBox.add_effect(iconEffect);
|
||||||
this._container.add_actor(this._iconBox);
|
this._container.add_actor(this._iconBox);
|
||||||
|
|
||||||
@@ -964,7 +967,7 @@ class Panel extends St.Widget {
|
|||||||
return Clutter.EVENT_STOP;
|
return Clutter.EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return super.vfunc_key_press_event(keyEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
_toggleMenu(indicator) {
|
_toggleMenu(indicator) {
|
||||||
|
@@ -183,10 +183,9 @@ var Button = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
_onDestroy() {
|
||||||
super._onDestroy();
|
|
||||||
|
|
||||||
if (this.menu)
|
if (this.menu)
|
||||||
this.menu.destroy();
|
this.menu.destroy();
|
||||||
|
super._onDestroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -881,9 +881,10 @@ var PopupMenu = class extends PopupMenuBase {
|
|||||||
|
|
||||||
let state = event.get_state();
|
let state = event.get_state();
|
||||||
|
|
||||||
// if user has a modifier down (except capslock)
|
// if user has a modifier down (except capslock and numlock)
|
||||||
// then don't handle the key press here
|
// then don't handle the key press here
|
||||||
state &= ~Clutter.ModifierType.LOCK_MASK;
|
state &= ~Clutter.ModifierType.LOCK_MASK;
|
||||||
|
state &= ~Clutter.ModifierType.MOD2_MASK;
|
||||||
state &= Clutter.ModifierType.MODIFIER_MASK;
|
state &= Clutter.ModifierType.MODIFIER_MASK;
|
||||||
|
|
||||||
if (state)
|
if (state)
|
||||||
@@ -1324,7 +1325,7 @@ var PopupMenuManager = class {
|
|||||||
|
|
||||||
removeMenu(menu) {
|
removeMenu(menu) {
|
||||||
if (menu == this.activeMenu)
|
if (menu == this.activeMenu)
|
||||||
this._closeMenu(false, menu);
|
this._grabHelper.ungrab({ actor: menu.actor });
|
||||||
|
|
||||||
let position = this._findMenu(menu);
|
let position = this._findMenu(menu);
|
||||||
if (position == -1) // not a menu we manage
|
if (position == -1) // not a menu we manage
|
||||||
|
@@ -247,7 +247,7 @@ var RemoteSearchProvider = class {
|
|||||||
if (error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
log('Received error from DBus search provider %s: %s'.format(this.id, String(error)));
|
log('Received error from D-Bus search provider %s: %s'.format(this.id, String(error)));
|
||||||
callback([]);
|
callback([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -274,7 +274,7 @@ var RemoteSearchProvider = class {
|
|||||||
_getResultMetasFinished(results, error, callback) {
|
_getResultMetasFinished(results, error, callback) {
|
||||||
if (error) {
|
if (error) {
|
||||||
if (!error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (!error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
log('Received error from DBus search provider %s during GetResultMetas: %s'.format(this.id, String(error)));
|
log('Received error from D-Bus search provider %s during GetResultMetas: %s'.format(this.id, String(error)));
|
||||||
callback([]);
|
callback([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -498,6 +498,8 @@ var ScreenShield = class {
|
|||||||
if (Main.sessionMode.currentMode == 'unlock-dialog')
|
if (Main.sessionMode.currentMode == 'unlock-dialog')
|
||||||
Main.sessionMode.popMode('unlock-dialog');
|
Main.sessionMode.popMode('unlock-dialog');
|
||||||
|
|
||||||
|
this.emit('wake-up-screen');
|
||||||
|
|
||||||
if (this._isGreeter) {
|
if (this._isGreeter) {
|
||||||
// We don't want to "deactivate" any more than
|
// We don't want to "deactivate" any more than
|
||||||
// this. In particular, we don't want to drop
|
// this. In particular, we don't want to drop
|
||||||
@@ -519,6 +521,9 @@ var ScreenShield = class {
|
|||||||
this._isModal = false;
|
this._isModal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._longLightbox.lightOff();
|
||||||
|
this._shortLightbox.lightOff();
|
||||||
|
|
||||||
this._lockDialogGroup.ease({
|
this._lockDialogGroup.ease({
|
||||||
translation_y: -global.screen_height,
|
translation_y: -global.screen_height,
|
||||||
duration: Overview.ANIMATION_TIME,
|
duration: Overview.ANIMATION_TIME,
|
||||||
@@ -533,8 +538,6 @@ var ScreenShield = class {
|
|||||||
this._dialog = null;
|
this._dialog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._longLightbox.lightOff();
|
|
||||||
this._shortLightbox.lightOff();
|
|
||||||
this.actor.hide();
|
this.actor.hide();
|
||||||
|
|
||||||
if (this._becameActiveId != 0) {
|
if (this._becameActiveId != 0) {
|
||||||
|
@@ -30,7 +30,9 @@ var ScreenshotService = class {
|
|||||||
|
|
||||||
let sender = invocation.get_sender();
|
let sender = invocation.get_sender();
|
||||||
if (this._screenShooter.has(sender) || lockedDown) {
|
if (this._screenShooter.has(sender) || lockedDown) {
|
||||||
invocation.return_value(GLib.Variant.new('(bs)', [false, '']));
|
invocation.return_error_literal(
|
||||||
|
Gio.IOErrorEnum, Gio.IOErrorEnum.BUSY,
|
||||||
|
'There is an ongoing operation for this sender');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +86,7 @@ var ScreenshotService = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_createStream(filename) {
|
_createStream(filename, invocation) {
|
||||||
if (filename == '')
|
if (filename == '')
|
||||||
return [Gio.MemoryOutputStream.new_resizable(), null];
|
return [Gio.MemoryOutputStream.new_resizable(), null];
|
||||||
|
|
||||||
@@ -94,6 +96,7 @@ var ScreenshotService = class {
|
|||||||
let stream = file.replace(null, false, Gio.FileCreateFlags.NONE, null);
|
let stream = file.replace(null, false, Gio.FileCreateFlags.NONE, null);
|
||||||
return [stream, file];
|
return [stream, file];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', [false, '']));
|
||||||
return [null, null];
|
return [null, null];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,23 +107,22 @@ var ScreenshotService = class {
|
|||||||
return [stream, file];
|
return [stream, file];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.EXISTS))
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.EXISTS))
|
||||||
return [null, null];
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
invocation.return_value(GLib.Variant.new('(bs)', [false, '']));
|
||||||
return [null, null];
|
return [null, null];
|
||||||
}
|
}
|
||||||
|
|
||||||
_onScreenshotComplete(result, area, stream, file, flash, invocation) {
|
_onScreenshotComplete(area, stream, file, flash, invocation) {
|
||||||
if (result) {
|
if (flash) {
|
||||||
if (flash) {
|
let flashspot = new Flashspot(area);
|
||||||
let flashspot = new Flashspot(area);
|
flashspot.fire(() => {
|
||||||
flashspot.fire(() => {
|
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
}
|
});
|
||||||
|
} else {
|
||||||
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.close(null);
|
stream.close(null);
|
||||||
@@ -134,7 +136,7 @@ var ScreenshotService = class {
|
|||||||
clipboard.set_content(St.ClipboardType.CLIPBOARD, 'image/png', bytes);
|
clipboard.set_content(St.ClipboardType.CLIPBOARD, 'image/png', bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
let retval = GLib.Variant.new('(bs)', [result, filenameUsed]);
|
let retval = GLib.Variant.new('(bs)', [true, filenameUsed]);
|
||||||
invocation.return_value(retval);
|
invocation.return_value(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,17 +171,20 @@ var ScreenshotService = class {
|
|||||||
if (!screenshot)
|
if (!screenshot)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let [stream, file] = this._createStream(filename);
|
let [stream, file] = this._createStream(filename, invocation);
|
||||||
|
if (!stream)
|
||||||
|
return;
|
||||||
|
|
||||||
screenshot.screenshot_area(x, y, width, height, stream,
|
screenshot.screenshot_area(x, y, width, height, stream,
|
||||||
(o, res) => {
|
(o, res) => {
|
||||||
try {
|
try {
|
||||||
let [result, area] =
|
let [success_, area] =
|
||||||
screenshot.screenshot_area_finish(res);
|
screenshot.screenshot_area_finish(res);
|
||||||
this._onScreenshotComplete(
|
this._onScreenshotComplete(
|
||||||
result, area, stream, file, flash, invocation);
|
area, stream, file, flash, invocation);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
invocation.return_gerror(e);
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
|
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -190,17 +195,20 @@ var ScreenshotService = class {
|
|||||||
if (!screenshot)
|
if (!screenshot)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let [stream, file] = this._createStream(filename);
|
let [stream, file] = this._createStream(filename, invocation);
|
||||||
|
if (!stream)
|
||||||
|
return;
|
||||||
|
|
||||||
screenshot.screenshot_window(includeFrame, includeCursor, stream,
|
screenshot.screenshot_window(includeFrame, includeCursor, stream,
|
||||||
(o, res) => {
|
(o, res) => {
|
||||||
try {
|
try {
|
||||||
let [result, area] =
|
let [success_, area] =
|
||||||
screenshot.screenshot_window_finish(res);
|
screenshot.screenshot_window_finish(res);
|
||||||
this._onScreenshotComplete(
|
this._onScreenshotComplete(
|
||||||
result, area, stream, file, flash, invocation);
|
area, stream, file, flash, invocation);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
invocation.return_gerror(e);
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
|
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -211,17 +219,20 @@ var ScreenshotService = class {
|
|||||||
if (!screenshot)
|
if (!screenshot)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let [stream, file] = this._createStream(filename);
|
let [stream, file] = this._createStream(filename, invocation);
|
||||||
|
if (!stream)
|
||||||
|
return;
|
||||||
|
|
||||||
screenshot.screenshot(includeCursor, stream,
|
screenshot.screenshot(includeCursor, stream,
|
||||||
(o, res) => {
|
(o, res) => {
|
||||||
try {
|
try {
|
||||||
let [result, area] =
|
let [success_, area] =
|
||||||
screenshot.screenshot_finish(res);
|
screenshot.screenshot_finish(res);
|
||||||
this._onScreenshotComplete(
|
this._onScreenshotComplete(
|
||||||
result, area, stream, file, flash, invocation);
|
area, stream, file, flash, invocation);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
invocation.return_gerror(e);
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
|
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -281,6 +292,8 @@ var ScreenshotService = class {
|
|||||||
invocation.return_error_literal(
|
invocation.return_error_literal(
|
||||||
Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
|
Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
|
||||||
'Operation was cancelled');
|
'Operation was cancelled');
|
||||||
|
} finally {
|
||||||
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -15,6 +15,7 @@ const _modes = {
|
|||||||
'restrictive': {
|
'restrictive': {
|
||||||
parentMode: null,
|
parentMode: null,
|
||||||
stylesheetName: 'gnome-shell.css',
|
stylesheetName: 'gnome-shell.css',
|
||||||
|
themeResourceName: 'gnome-shell-theme.gresource',
|
||||||
hasOverview: false,
|
hasOverview: false,
|
||||||
showCalendarEvents: false,
|
showCalendarEvents: false,
|
||||||
allowSettings: false,
|
allowSettings: false,
|
||||||
|
@@ -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 GnomeShell, ScreenSaverDBus */
|
/* exported GnomeShell, ScreenSaverDBus */
|
||||||
|
|
||||||
const { Gio, GLib, Meta, Shell } = imports.gi;
|
const { Gio, GLib, Meta } = imports.gi;
|
||||||
|
|
||||||
const Config = imports.misc.config;
|
const Config = imports.misc.config;
|
||||||
const ExtensionDownloader = imports.ui.extensionDownloader;
|
const ExtensionDownloader = imports.ui.extensionDownloader;
|
||||||
@@ -255,6 +255,17 @@ var GnomeShellExtensions = class {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellExtensionsIface, this);
|
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellExtensionsIface, this);
|
||||||
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
|
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
|
||||||
|
|
||||||
|
this._userExtensionsEnabled = this.UserExtensionsEnabled;
|
||||||
|
global.settings.connect('changed::disable-user-extensions', () => {
|
||||||
|
if (this._userExtensionsEnabled === this.UserExtensionsEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._userExtensionsEnabled = this.UserExtensionsEnabled;
|
||||||
|
this._dbusImpl.emit_property_changed('UserExtensionsEnabled',
|
||||||
|
new GLib.Variant('b', this._userExtensionsEnabled));
|
||||||
|
});
|
||||||
|
|
||||||
Main.extensionManager.connect('extension-state-changed',
|
Main.extensionManager.connect('extension-state-changed',
|
||||||
this._extensionStateChanged.bind(this));
|
this._extensionStateChanged.bind(this));
|
||||||
}
|
}
|
||||||
@@ -301,20 +312,18 @@ var GnomeShellExtensions = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LaunchExtensionPrefs(uuid) {
|
LaunchExtensionPrefs(uuid) {
|
||||||
let appSys = Shell.AppSystem.get_default();
|
this.OpenExtensionPrefs(uuid, '', {});
|
||||||
let app = appSys.lookup_app('org.gnome.Extensions.desktop');
|
|
||||||
let info = app.get_app_info();
|
|
||||||
let timestamp = global.display.get_current_time_roundtrip();
|
|
||||||
info.launch_uris([`extension:///${uuid}`],
|
|
||||||
global.create_app_launch_context(timestamp, -1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReloadExtension(uuid) {
|
OpenExtensionPrefs(uuid, parentWindow, options) {
|
||||||
let extension = Main.extensionManager.lookup(uuid);
|
Main.extensionManager.openExtensionPrefs(uuid, parentWindow, options);
|
||||||
if (!extension)
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
Main.extensionManager.reloadExtension(extension);
|
ReloadExtensionAsync(params, invocation) {
|
||||||
|
invocation.return_error_literal(
|
||||||
|
Gio.DBusError,
|
||||||
|
Gio.DBusError.NOT_SUPPORTED,
|
||||||
|
'ReloadExtension is deprecated and does not work');
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckForUpdates() {
|
CheckForUpdates() {
|
||||||
@@ -325,6 +334,14 @@ var GnomeShellExtensions = class {
|
|||||||
return Config.PACKAGE_VERSION;
|
return Config.PACKAGE_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get UserExtensionsEnabled() {
|
||||||
|
return !global.settings.get_boolean('disable-user-extensions');
|
||||||
|
}
|
||||||
|
|
||||||
|
set UserExtensionsEnabled(enable) {
|
||||||
|
global.settings.set_boolean('disable-user-extensions', !enable);
|
||||||
|
}
|
||||||
|
|
||||||
_extensionStateChanged(_, newState) {
|
_extensionStateChanged(_, newState) {
|
||||||
let state = ExtensionUtils.serializeExtension(newState);
|
let state = ExtensionUtils.serializeExtension(newState);
|
||||||
this._dbusImpl.emit_signal('ExtensionStateChanged',
|
this._dbusImpl.emit_signal('ExtensionStateChanged',
|
||||||
|
@@ -447,12 +447,8 @@ var ShellMountPasswordDialog = GObject.registerClass({
|
|||||||
let useKeyfiles = this._keyfilesCheckbox.checked;
|
let useKeyfiles = this._keyfilesCheckbox.checked;
|
||||||
this._passwordEntry.reactive = !useKeyfiles;
|
this._passwordEntry.reactive = !useKeyfiles;
|
||||||
this._passwordEntry.can_focus = !useKeyfiles;
|
this._passwordEntry.can_focus = !useKeyfiles;
|
||||||
this._passwordEntry.clutter_text.editable = !useKeyfiles;
|
|
||||||
this._passwordEntry.clutter_text.selectable = !useKeyfiles;
|
|
||||||
this._pimEntry.reactive = !useKeyfiles;
|
this._pimEntry.reactive = !useKeyfiles;
|
||||||
this._pimEntry.can_focus = !useKeyfiles;
|
this._pimEntry.can_focus = !useKeyfiles;
|
||||||
this._pimEntry.clutter_text.editable = !useKeyfiles;
|
|
||||||
this._pimEntry.clutter_text.selectable = !useKeyfiles;
|
|
||||||
this._rememberChoice.reactive = !useKeyfiles;
|
this._rememberChoice.reactive = !useKeyfiles;
|
||||||
this._rememberChoice.can_focus = !useKeyfiles;
|
this._rememberChoice.can_focus = !useKeyfiles;
|
||||||
this._keyfilesLabel.visible = useKeyfiles;
|
this._keyfilesLabel.visible = useKeyfiles;
|
||||||
|
@@ -43,10 +43,10 @@ var Slider = GObject.registerClass({
|
|||||||
let [hasHandleColor, handleBorderColor] =
|
let [hasHandleColor, handleBorderColor] =
|
||||||
themeNode.lookup_color('-slider-handle-border-color', false);
|
themeNode.lookup_color('-slider-handle-border-color', false);
|
||||||
|
|
||||||
let wholeHandleRadius = Math.ceil(handleRadius);
|
const ceiledHandleRadius = Math.ceil(handleRadius + handleBorderWidth);
|
||||||
let handleX = wholeHandleRadius +
|
const handleX = ceiledHandleRadius +
|
||||||
(width - 2 * wholeHandleRadius) * this._value / this._maxValue;
|
(width - 2 * ceiledHandleRadius) * this._value / this._maxValue;
|
||||||
let handleY = height / 2;
|
const handleY = height / 2;
|
||||||
|
|
||||||
let color = themeNode.get_foreground_color();
|
let color = themeNode.get_foreground_color();
|
||||||
Clutter.cairo_set_source_color(cr, color);
|
Clutter.cairo_set_source_color(cr, color);
|
||||||
@@ -186,7 +186,7 @@ var Slider = GObject.registerClass({
|
|||||||
this.value = Math.max(0, Math.min(this._value + delta, this._maxValue));
|
this.value = Math.max(0, Math.min(this._value + delta, this._maxValue));
|
||||||
return Clutter.EVENT_STOP;
|
return Clutter.EVENT_STOP;
|
||||||
}
|
}
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return super.vfunc_key_press_event(keyPressEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
_moveHandle(absX, _absY) {
|
_moveHandle(absX, _absY) {
|
||||||
|
@@ -139,14 +139,14 @@ class ATIndicator extends PanelMenu.Button {
|
|||||||
interfaceSettings.is_writable(KEY_ICON_THEME),
|
interfaceSettings.is_writable(KEY_ICON_THEME),
|
||||||
enabled => {
|
enabled => {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
interfaceSettings.set_string(KEY_GTK_THEME, HIGH_CONTRAST_THEME);
|
|
||||||
interfaceSettings.set_string(KEY_ICON_THEME, HIGH_CONTRAST_THEME);
|
interfaceSettings.set_string(KEY_ICON_THEME, HIGH_CONTRAST_THEME);
|
||||||
|
interfaceSettings.set_string(KEY_GTK_THEME, HIGH_CONTRAST_THEME);
|
||||||
} else if (!hasHC) {
|
} else if (!hasHC) {
|
||||||
interfaceSettings.set_string(KEY_GTK_THEME, gtkTheme);
|
|
||||||
interfaceSettings.set_string(KEY_ICON_THEME, iconTheme);
|
interfaceSettings.set_string(KEY_ICON_THEME, iconTheme);
|
||||||
|
interfaceSettings.set_string(KEY_GTK_THEME, gtkTheme);
|
||||||
} else {
|
} else {
|
||||||
interfaceSettings.reset(KEY_GTK_THEME);
|
|
||||||
interfaceSettings.reset(KEY_ICON_THEME);
|
interfaceSettings.reset(KEY_ICON_THEME);
|
||||||
|
interfaceSettings.reset(KEY_GTK_THEME);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -48,7 +48,9 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
this._item.connect('key-press-event', (actor, event) => {
|
this._item.connect('key-press-event', (actor, event) => {
|
||||||
return this._slider.emit('key-press-event', event);
|
return this._slider.emit('key-press-event', event);
|
||||||
});
|
});
|
||||||
|
this._item.connect('scroll-event', (actor, event) => {
|
||||||
|
return this._slider.emit('scroll-event', event);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_sliderChanged() {
|
_sliderChanged() {
|
||||||
|
@@ -64,7 +64,7 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
|
|
||||||
this._item.label.text = _("Location Enabled");
|
this._item.label.text = _("Location Enabled");
|
||||||
this._onOffAction = this._item.menu.addAction(_("Disable"), this._onOnOffAction.bind(this));
|
this._onOffAction = this._item.menu.addAction(_("Disable"), this._onOnOffAction.bind(this));
|
||||||
this._item.menu.addSettingsAction(_("Privacy Settings"), 'gnome-privacy-panel.desktop');
|
this._item.menu.addSettingsAction(_('Privacy Settings'), 'gnome-location-panel.desktop');
|
||||||
|
|
||||||
this.menu.addMenuItem(this._item);
|
this.menu.addMenuItem(this._item);
|
||||||
|
|
||||||
|
@@ -112,12 +112,12 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
let chargingState = this._proxy.State == UPower.DeviceState.CHARGING
|
let chargingState = this._proxy.State == UPower.DeviceState.CHARGING
|
||||||
? '-charging' : '';
|
? '-charging' : '';
|
||||||
let fillLevel = 10 * Math.floor(this._proxy.Percentage / 10);
|
let fillLevel = 10 * Math.floor(this._proxy.Percentage / 10);
|
||||||
let icon;
|
const charged =
|
||||||
if (this._proxy.State == UPower.DeviceState.FULLY_CHARGED ||
|
this._proxy.State === UPower.DeviceState.FULLY_CHARGED ||
|
||||||
fillLevel === 100)
|
(this._proxy.State === UPower.DeviceState.CHARGING && fillLevel === 100);
|
||||||
icon = 'battery-level-100-charged-symbolic';
|
const icon = charged
|
||||||
else
|
? 'battery-level-100-charged-symbolic'
|
||||||
icon = 'battery-level-%d%s-symbolic'.format(fillLevel, chargingState);
|
: 'battery-level-%d%s-symbolic'.format(fillLevel, chargingState);
|
||||||
|
|
||||||
// Make sure we fall back to fallback-icon-name and not GThemedIcon's
|
// Make sure we fall back to fallback-icon-name and not GThemedIcon's
|
||||||
// default fallbacks
|
// default fallbacks
|
||||||
|
@@ -86,6 +86,8 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
|
|
||||||
Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
|
Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
|
||||||
this._sessionUpdated();
|
this._sessionUpdated();
|
||||||
|
|
||||||
|
this._sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
_sessionUpdated() {
|
_sessionUpdated() {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user