Compare commits
338 Commits
3.35.91
...
gbsneto/ea
Author | SHA1 | Date | |
---|---|---|---|
![]() |
966d4b164c | ||
![]() |
a3cf41734a | ||
![]() |
76811b4ebc | ||
![]() |
2721c306af | ||
![]() |
402fd8ec29 | ||
![]() |
fbe2e30f38 | ||
![]() |
fb6ead2881 | ||
![]() |
7ff7fb5d3b | ||
![]() |
8030d9ad32 | ||
![]() |
45bc850715 | ||
![]() |
51a913730e | ||
![]() |
0a4974ac8c | ||
![]() |
1666fa195d | ||
![]() |
a9df4e7516 | ||
![]() |
343b3351f1 | ||
![]() |
407b12c3cb | ||
![]() |
455a8f3076 | ||
![]() |
5067bda61a | ||
![]() |
e138b6e3af | ||
![]() |
9bc9d5165f | ||
![]() |
26c2cb9f65 | ||
![]() |
da44649e6f | ||
![]() |
a0def23940 | ||
![]() |
f49b58cf97 | ||
![]() |
cadd9a99c0 | ||
![]() |
7061889a29 | ||
![]() |
764527c8c9 | ||
![]() |
18742fcc32 | ||
![]() |
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 | ||
![]() |
c773c8c162 | ||
![]() |
9a3ed0056e | ||
![]() |
b3999e4078 | ||
![]() |
d0a587d42f | ||
![]() |
2bb8e1be9b | ||
![]() |
967a6ae44d | ||
![]() |
89ca5e71d4 | ||
![]() |
4c4d23ed83 | ||
![]() |
7173ec1df7 | ||
![]() |
bc465ab006 | ||
![]() |
fe4973b585 | ||
![]() |
0d0384ebb1 | ||
![]() |
27ef8eb9a0 | ||
![]() |
24a3fd4c4d | ||
![]() |
d9f8e04478 | ||
![]() |
b9f6032ddd | ||
![]() |
d62391c8f1 | ||
![]() |
ab24ee7a7e | ||
![]() |
c52fd9373c | ||
![]() |
1249655d0a | ||
![]() |
120b907c33 | ||
![]() |
3848513cf4 | ||
![]() |
725c72e020 | ||
![]() |
0b113094b4 | ||
![]() |
3633e1feca | ||
![]() |
4759197200 | ||
![]() |
1d39afabdc | ||
![]() |
483607311c | ||
![]() |
d90a79fe7a | ||
![]() |
87ed0118d1 | ||
![]() |
1f5eccbc70 | ||
![]() |
dac2274993 | ||
![]() |
39db86e755 | ||
![]() |
255627bd69 | ||
![]() |
0afac36713 | ||
![]() |
c0c027c608 | ||
![]() |
e938986a74 | ||
![]() |
32fa060a62 | ||
![]() |
38da479ee8 | ||
![]() |
574ab04e9f | ||
![]() |
ee6635282c | ||
![]() |
ff39b3274b | ||
![]() |
2c1d654035 | ||
![]() |
1bdb065ffa | ||
![]() |
57669bca1b | ||
![]() |
e647ceb4d1 | ||
![]() |
4d9e84f6f7 | ||
![]() |
5171bdd45f | ||
![]() |
9ab0071aa5 | ||
![]() |
cf39b2db87 | ||
![]() |
8a1c0f3a42 | ||
![]() |
4b42879a2c | ||
![]() |
394121f77d | ||
![]() |
f4f8982825 | ||
![]() |
7220f6d25b | ||
![]() |
059fb5c7cb | ||
![]() |
0057c19bfc | ||
![]() |
05409b949f | ||
![]() |
affbec73ef | ||
![]() |
e781e1fdba | ||
![]() |
12de4e67f8 | ||
![]() |
9201701c95 | ||
![]() |
6e7344b837 | ||
![]() |
b8f8e1710b | ||
![]() |
8b0a67fe64 | ||
![]() |
1eb1b1be4e | ||
![]() |
de5a4a98c9 | ||
![]() |
26a49168ba | ||
![]() |
ff4623454f | ||
![]() |
cf5204760d | ||
![]() |
46c13349fc | ||
![]() |
2a3875775d | ||
![]() |
38b38732d3 | ||
![]() |
24c8f5bb70 | ||
![]() |
c02296a9b9 | ||
![]() |
4eb122ea8d | ||
![]() |
90d5d16343 | ||
![]() |
45c8f0b76c | ||
![]() |
236ee9e483 | ||
![]() |
459b200cc0 | ||
![]() |
45bc8ae292 | ||
![]() |
fbfe5a1988 | ||
![]() |
87a6dc1b95 | ||
![]() |
1b11f0673e |
@@ -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'
|
||||||
|
@@ -19,7 +19,7 @@ fi
|
|||||||
function commit_message_has_url() {
|
function commit_message_has_url() {
|
||||||
commit=$1
|
commit=$1
|
||||||
commit_message=$(git show -s --format='format:%b' $commit)
|
commit_message=$(git show -s --format='format:%b' $commit)
|
||||||
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
|
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(-/\)\?\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
@@ -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() {
|
||||||
|
67
NEWS
@@ -1,3 +1,70 @@
|
|||||||
|
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)
|
||||||
|
|
@@ -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>
|
||||||
|
@@ -57,5 +57,19 @@
|
|||||||
<method name="GetWindows">
|
<method name="GetWindows">
|
||||||
<arg name="windows" direction="out" type="a{ta{sv}}" />
|
<arg name="windows" direction="out" type="a{ta{sv}}" />
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
AnimationsEnabled:
|
||||||
|
@short_description: Whether the shell animations are enabled
|
||||||
|
|
||||||
|
By default determined by the org.gnome.desktop.interface enable-animations
|
||||||
|
gsetting, but may be overridden, e.g. if there is an active screen cast or
|
||||||
|
remote desktop session that asked for animations to be disabled.
|
||||||
|
|
||||||
|
Since: 2
|
||||||
|
-->
|
||||||
|
<property name="AnimationsEnabled" type="b" access="read"/>
|
||||||
|
|
||||||
|
<property name="version" type="u" access="read"/>
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
@@ -9,12 +9,6 @@
|
|||||||
<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>key-enter.svg</file>
|
|
||||||
<file>key-hide.svg</file>
|
|
||||||
<file>key-layout.svg</file>
|
|
||||||
<file>key-shift.svg</file>
|
|
||||||
<file>key-shift-uppercase.svg</file>
|
|
||||||
<file>key-shift-latched-uppercase.svg</file>
|
|
||||||
<file alias="icons/message-indicator-symbolic.svg">message-indicator-symbolic.svg</file>
|
<file alias="icons/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>
|
||||||
@@ -25,6 +19,11 @@
|
|||||||
<file alias="icons/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
|
<file alias="icons/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/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/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/keyboard-enter-symbolic.svg">keyboard-enter-symbolic.svg</file>
|
||||||
|
<file alias="icons/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/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
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
desktop_files = [
|
desktop_files = [
|
||||||
'org.gnome.Shell.desktop',
|
'org.gnome.Shell.desktop',
|
||||||
'org.gnome.Extensions.desktop',
|
|
||||||
]
|
]
|
||||||
service_files = []
|
service_files = []
|
||||||
|
|
||||||
@@ -43,7 +42,6 @@ endforeach
|
|||||||
|
|
||||||
|
|
||||||
subdir('dbus-interfaces')
|
subdir('dbus-interfaces')
|
||||||
subdir('icons')
|
|
||||||
subdir('theme')
|
subdir('theme')
|
||||||
|
|
||||||
data_resources = [
|
data_resources = [
|
||||||
|
@@ -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"
|
||||||
}
|
}
|
||||||
|
@@ -150,7 +150,7 @@
|
|||||||
color: $tc;
|
color: $tc;
|
||||||
text-shadow: 0 1px $text_shadow_color;
|
text-shadow: 0 1px $text_shadow_color;
|
||||||
icon-shadow: 0 1px $text_shadow_color;
|
icon-shadow: 0 1px $text_shadow_color;
|
||||||
box-shadow: inset 0 0 0 2px transparentize($selected_bg_color, 0.7);
|
box-shadow: inset 0 0 0 2px transparentize($selected_bg_color, 0.4);
|
||||||
//border-color: $selected_bg_color;
|
//border-color: $selected_bg_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
|
@@ -1,6 +1,13 @@
|
|||||||
/* Date/Time Menu */
|
/* Date/Time Menu */
|
||||||
|
|
||||||
.clock-display-box { spacing: $base_spacing; }
|
.clock-display-box {
|
||||||
|
spacing: $base_spacing / 2;
|
||||||
|
|
||||||
|
.clock {
|
||||||
|
padding-left: $base_padding;
|
||||||
|
padding-right: $base_padding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// overall menu
|
// overall menu
|
||||||
#calendarArea {
|
#calendarArea {
|
||||||
|
@@ -52,10 +52,6 @@ $default_key_bg_color: if($variant=='light', darken($osd_bg_color, 11%), lighten
|
|||||||
|
|
||||||
// non-character keys
|
// non-character keys
|
||||||
&.default-key {
|
&.default-key {
|
||||||
|
|
||||||
// size of the icon asset
|
|
||||||
background-size: 24px;
|
|
||||||
|
|
||||||
@include button(normal, $c:$default_key_bg_color);
|
@include button(normal, $c:$default_key_bg_color);
|
||||||
&:hover, &:checked {@include button(hover, $c: $default_key_bg_color);}
|
&:hover, &:checked {@include button(hover, $c: $default_key_bg_color);}
|
||||||
&:active { @include button(active, $c: $default_key_bg_color);}
|
&:active { @include button(active, $c: $default_key_bg_color);}
|
||||||
@@ -63,19 +59,14 @@ $default_key_bg_color: if($variant=='light', darken($osd_bg_color, 11%), lighten
|
|||||||
|
|
||||||
// enter key is suggested-action
|
// enter key is suggested-action
|
||||||
&.enter-key {
|
&.enter-key {
|
||||||
background-image: url("resource:///org/gnome/shell/theme/key-enter.svg");
|
|
||||||
|
|
||||||
@include button(normal, $c:$selected_bg_color, $tc:$selected_fg_color);
|
@include button(normal, $c:$selected_bg_color, $tc:$selected_fg_color);
|
||||||
&:hover, &:checked { @include button(hover, $c: lighten($selected_bg_color, 3%));}
|
&:hover, &:checked { @include button(hover, $c: lighten($selected_bg_color, 3%));}
|
||||||
&:active {@include button(active, $c: darken($selected_bg_color, 2%));}
|
&:active {@include button(active, $c: darken($selected_bg_color, 2%));}
|
||||||
}
|
}
|
||||||
|
|
||||||
// key assets
|
&.shift-key-uppercase { color: $selected_bg_color }
|
||||||
&.shift-key-lowercase {background-image: url("resource:///org/gnome/shell/theme/key-shift.svg");}
|
|
||||||
&.shift-key-uppercase {background-image: url("resource:///org/gnome/shell/theme/key-shift-uppercase.svg");}
|
StIcon { icon-size: 1.125em; }
|
||||||
&.shift-key-uppercase:latched {background-image: url("resource:///org/gnome/shell/theme/key-shift-latched-uppercase.svg");}
|
|
||||||
&.hide-key {background-image: url("resource:///org/gnome/shell/theme/key-hide.svg");}
|
|
||||||
&.layout-key {background-image: url("resource:///org/gnome/shell/theme/key-layout.svg");}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// long press on a key popup
|
// long press on a key popup
|
||||||
|
@@ -160,7 +160,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-dialog-prompt-entry {
|
.login-dialog-prompt-entry {
|
||||||
width: 17.89em;
|
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,14 +5,14 @@
|
|||||||
background-color: $osd_bg_color;
|
background-color: $osd_bg_color;
|
||||||
spacing: $base_spacing;
|
spacing: $base_spacing;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border: 2px solid transparentize($osd_fg_color, 0.8);
|
border: 1px solid transparentize($osd_fg_color, 0.8);
|
||||||
border-top-width:0;
|
border-radius: $base_border_radius;
|
||||||
border-radius: 0 0 $base_border_radius $base_border_radius;
|
color: $osd_fg_color;
|
||||||
|
|
||||||
& > #Toolbar {
|
& > #Toolbar {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: $base_border_radius;
|
border-radius: $base_border_radius;
|
||||||
background-color: darken($osd_bg_color, 10%);
|
background-color: $osd_bg_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.labels { spacing: $base_spacing; }
|
.labels { spacing: $base_spacing; }
|
||||||
@@ -20,19 +20,18 @@
|
|||||||
-natural-hpadding: $base_padding * 2;
|
-natural-hpadding: $base_padding * 2;
|
||||||
-minimum-hpadding: 6px;
|
-minimum-hpadding: 6px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $fg_color;
|
color: darken($osd_fg_color, 15%);
|
||||||
transition-duration: 100ms;
|
transition-duration: 100ms;
|
||||||
padding-left: .3em;
|
padding-left: .3em;
|
||||||
padding-right: .3em;
|
padding-right: .3em;
|
||||||
|
border-bottom-width: 2px;
|
||||||
&:hover {
|
&:hover {
|
||||||
color: white;
|
color: $osd_fg_color;
|
||||||
text-shadow: black 0px 2px 2px;
|
|
||||||
}
|
}
|
||||||
&:selected {
|
&:selected {
|
||||||
border-bottom-width: 2px;
|
border-bottom-width: 2px;
|
||||||
border-color: lighten($selected_bg_color,5%);
|
box-shadow: inset 0 -2px 0 0 lighten($selected_bg_color, 5%);
|
||||||
color: white;
|
color: $osd_fg_color;
|
||||||
text-shadow: black 0px 2px 2px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StBoxLayout#EvalBox { padding: 4px; spacing: $base_spacing; }
|
StBoxLayout#EvalBox { padding: 4px; spacing: $base_spacing; }
|
||||||
@@ -41,12 +40,17 @@
|
|||||||
|
|
||||||
.lg-dialog {
|
.lg-dialog {
|
||||||
StEntry {
|
StEntry {
|
||||||
selection-background-color: #bbbbbb;
|
background-color: transparentize(lighten($osd_bg_color, 5%), 0.4);
|
||||||
selected-color: $osd_bg_color;
|
color: $osd_fg_color;
|
||||||
|
border-color: transparentize($osd_fg_color, 0.8);
|
||||||
|
min-height: 22px;
|
||||||
|
selection-background-color: $selected_bg_color;
|
||||||
|
selected-color: $selected_fg_color;
|
||||||
}
|
}
|
||||||
.shell-link {
|
.shell-link {
|
||||||
color: #999999;
|
color: $link_color;
|
||||||
&:hover { color: #dddddd; }
|
&:hover { color: lighten($link_color, 10%); }
|
||||||
|
&:active { color: darken($link_color, 10%); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lg-obj-inspector-button {
|
.lg-obj-inspector-button {
|
||||||
border: 1px solid gray;
|
border: 1px solid $osd_borders_color;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-radius: $base_border_radius;
|
border-radius: $base_border_radius;
|
||||||
&:hover { border: 1px solid #ffffff; }
|
&:hover { border: 1px solid #ffffff; }
|
||||||
@@ -75,7 +79,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lg-extension {
|
.lg-extension {
|
||||||
border: 1px solid $osd_borders_color;
|
border: 1px solid lighten($osd_borders_color, 5%);
|
||||||
|
background-color: lighten($osd_bg_color, 5%);
|
||||||
border-radius: $base_border_radius;
|
border-radius: $base_border_radius;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
margin: ($base_margin * 2) ($base_margin * 4) 0;
|
margin: ($base_margin * 2) ($base_margin * 4) 0;
|
||||||
// NOTE: remove the padding if notification_bubble could remove margin for drop shadow
|
// NOTE: remove the padding if notification_bubble could remove margin for drop shadow
|
||||||
padding: $base_margin;
|
padding: $base_margin;
|
||||||
spacing: $base_spacing;
|
spacing: $base_spacing * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// message bubbles
|
// message bubbles
|
||||||
|
@@ -15,18 +15,28 @@
|
|||||||
|
|
||||||
& StIcon {
|
& StIcon {
|
||||||
background-color: transparentize($osd_fg_color,0.95);
|
background-color: transparentize($osd_fg_color,0.95);
|
||||||
padding: 18px 20px 22px 20px;
|
|
||||||
width: 88px; height: 88px;
|
|
||||||
border-radius: 99px;
|
border-radius: 99px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-widget.vertical .user-icon {
|
.user-widget.vertical .user-icon {
|
||||||
icon-size: 128px;
|
icon-size: $base_icon_size * 6; // 128px
|
||||||
|
|
||||||
|
& StIcon {
|
||||||
|
padding: $base_padding * 3 + 2px; // 20px
|
||||||
|
padding-top: $base_padding * 3; // 18 px
|
||||||
|
padding-bottom: $base_padding * 3 + 4px; // 22px
|
||||||
|
width: $base_icon_size * 5.5; height: $base_icon_size * 5.5; // 88px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-widget.horizontal .user-icon {
|
.user-widget.horizontal .user-icon {
|
||||||
icon-size: 64px;
|
icon-size: $base_icon_size * 4; // 64px
|
||||||
|
|
||||||
|
& StIcon {
|
||||||
|
padding: $base_padding * 2 ; // 12px
|
||||||
|
width: $base_icon_size * 2.5; height: $base_icon_size * 2.5; // 40px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.lightbox { background-color: black; }
|
.lightbox { background-color: black; }
|
||||||
|
@@ -54,9 +54,6 @@ $panel_height: 1.86em;
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:active, &:overview, &:focus, &:checked {
|
&:active, &:overview, &:focus, &:checked {
|
||||||
// Trick due to St limitations. It needs a background to draw a box-shadow
|
|
||||||
background-color: rgba(0, 0, 0, 0.01);
|
|
||||||
box-shadow: inset 0 -2px 0 0 lighten($selected_bg_color,5%);
|
|
||||||
color: lighten($panel_fg_color, 20%);
|
color: lighten($panel_fg_color, 20%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +79,26 @@ $panel_height: 1.86em;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.panel-button {
|
||||||
|
&:active, &:overview, &:focus, &:checked {
|
||||||
|
// Trick due to St limitations. It needs a background to draw a box-shadow
|
||||||
|
background-color: rgba(0, 0, 0, 0.01);
|
||||||
|
box-shadow: inset 0 -2px 0 0 lighten($selected_bg_color,5%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-button.clock-display {
|
||||||
|
// Move highlight from .panel-button to .clock
|
||||||
|
&:active, &:overview, &:focus, &:checked {
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
.clock {
|
||||||
|
background-color: rgba(0, 0, 0, 0.01);
|
||||||
|
box-shadow: inset 0 -2px 0 0 lighten($selected_bg_color,5%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.panel-status-indicators-box,
|
.panel-status-indicators-box,
|
||||||
.panel-status-menu-box {
|
.panel-status-menu-box {
|
||||||
spacing: 2px;
|
spacing: 2px;
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ws-switcher-box {
|
.ws-switcher-box {
|
||||||
// background: transparent;
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background-size: 32px;
|
background-size: 32px;
|
||||||
@@ -29,6 +28,7 @@
|
|||||||
.ws-switcher-active-down,
|
.ws-switcher-active-down,
|
||||||
.ws-switcher-active-left,
|
.ws-switcher-active-left,
|
||||||
.ws-switcher-active-right {
|
.ws-switcher-active-right {
|
||||||
|
height: 52px;
|
||||||
background-color: $selected_bg_color;
|
background-color: $selected_bg_color;
|
||||||
border: 1px solid if($variant=='light', darken($selected_bg_color, 8%), lighten($selected_bg_color, 5%));
|
border: 1px solid if($variant=='light', darken($selected_bg_color, 8%), lighten($selected_bg_color, 5%));
|
||||||
border-radius: $base_border_radius + 3px;
|
border-radius: $base_border_radius + 3px;
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" class="keyboard-key" width="24" height="24">
|
|
||||||
<path overflow="visible" font-weight="400" style="line-height:normal;-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-decoration-line:none;text-transform:none;marker:none" d="M10 23H8.5c-.398 0-.796-.14-1.079-.422L.345 15.5l7.078-7.078C7.704 8.14 8.102 8 8.5 8H10v1.5c0 .398-.14.796-.422 1.079L4.657 15.5l4.921 4.922c.282.282.422.68.422 1.078z" color="#000" font-family="Bitstream Vera Sans" fill="#fff"/>
|
|
||||||
<path overflow="visible" d="M22 1.5v9a5 5 0 01-5 5H4" style="marker:none" color="#000" fill="none" stroke="#fff" stroke-width="3"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 676 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
||||||
<path d="M12 20.875L.562 9.438C.171 9.046 0 8.51 0 8V6h2c.511 0 1.046.17 1.438.563L12 15.125l8.563-8.562C20.953 6.17 21.488 6 22 6h2v2c0 .511-.17 1.046-.563 1.438z" fill="#e5e5e5"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 278 B |
@@ -1,5 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" class="keyboard-key" width="24" height="24">
|
|
||||||
<path d="M4.5 2v21" fill="#e5e5e5" fill-rule="evenodd" stroke="#e5e5e5" stroke-width="3"/>
|
|
||||||
<path d="M4 12h6l2 4h8V6h-6l-2-4H4z" fill="none" stroke="#e5e5e5" stroke-width="2" stroke-linejoin="round"/>
|
|
||||||
<path d="M4 12h6l2 4h8V6h-6l-2-4H4z" fill="#e5e5e5" fill-rule="evenodd"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 378 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
||||||
<path style="marker:none" d="M12 0L2 12h6v6h8v-6h6zM8 21v3h8v-3z" color="#000" overflow="visible" fill="#3584e4"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 211 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
||||||
<path d="M8 22v-8H2L12 2l10 12h-6v8z" style="marker:none" color="#000" overflow="visible" fill="#3584e4"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 203 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
||||||
<path d="M8 22v-8H2L12 2l10 12h-6v8z" style="marker:none" color="#000" overflow="visible" fill="#bebebe"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 203 B |
6
data/theme/keyboard-caps-lock-filled-symbolic.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||||
|
<g fill="#2e3436">
|
||||||
|
<path d="M6 8H2.937l5.126-5.781L13.186 8H10v2H6z" style="marker:none" color="#000" overflow="visible"/>
|
||||||
|
<path d="M6 11h4v2H6z" style="marker:none"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 268 B |
6
data/theme/keyboard-enter-symbolic.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||||
|
<g font-weight="400" fill="#2e3436">
|
||||||
|
<path d="M11.994 3v4.004c.002.666-.183.72-.445.852-.262.13-.555.144-.555.144H4v2h6.994s.71.014 1.45-.355c.738-.37 1.552-1.313 1.55-2.645V3z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1;marker:none" color="#000" font-family="sans-serif" overflow="visible"/>
|
||||||
|
<path d="M6 12v-1c0-.257-.13-.528-.313-.719l-1.28-1.303 1.28-1.26C5.87 7.529 6 7.258 6 7V6H5c-.31 0-.552.09-.75.281L1.594 8.978l2.656 2.74c.198.192.44.282.75.282z" style="line-height:normal;-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-decoration-line:none;text-transform:none;marker:none" color="#bebebe" font-family="Bitstream Vera Sans" overflow="visible"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
7
data/theme/keyboard-hide-symbolic.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||||
|
<g color="#000" fill="#2e3436">
|
||||||
|
<path d="M4.707 5.293L3.293 6.707 8 11.414l4.707-4.707-1.414-1.414L8 8.586z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1;marker:none" font-weight="400" font-family="sans-serif" overflow="visible"/>
|
||||||
|
<path d="M12 6V5h1v1zM3 6V5h1v1z" style="marker:none" overflow="visible"/>
|
||||||
|
<path d="M3 6c0-.554.446-1 1-1s1 .446 1 1-.446 1-1 1-1-.446-1-1zM11 6c0-.554.446-1 1-1s1 .446 1 1-.446 1-1 1-1-.446-1-1z" style="marker:none" overflow="visible"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 990 B |
7
data/theme/keyboard-layout-filled-symbolic.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||||
|
<g fill="#2e3436" fill-rule="evenodd">
|
||||||
|
<path d="M2 1v14h2V1z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1" color="#000" font-weight="400" font-family="sans-serif" overflow="visible"/>
|
||||||
|
<path d="M3 1a1 1 0 00-1 1v6a1 1 0 001 1h3.383l.722 1.447A1 1 0 008 11h5a1 1 0 001-1V4a1 1 0 00-1-1H9.617l-.722-1.447A1 1 0 008 1zm1 2h3.383l.722 1.447A1 1 0 009 5h3v4H8.617l-.722-1.447A1 1 0 007 7H4z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1" color="#000" font-weight="400" font-family="sans-serif" overflow="visible"/>
|
||||||
|
<path d="M3 8h4l1 2h5V4H9L8 2H3z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
3
data/theme/keyboard-shift-filled-symbolic.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||||
|
<path d="M6 13V9H2.937l5.126-5.781L13.186 9H10v4z" style="marker:none" color="#000" overflow="visible" fill="#2e3436"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 195 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="46" height="22"><defs><linearGradient id="a"><stop offset="0" stop-color="#39393a"/><stop offset="1" stop-color="#302f30"/></linearGradient><linearGradient xlink:href="#a" id="b" x1="53" y1="294.429" x2="53" y2="309.804" gradientUnits="userSpaceOnUse" gradientTransform="translate(-42.76)"/></defs><g transform="translate(0 -291.18)" stroke-width="1.085"><rect style="marker:none" width="44.446" height="20.911" x=".625" y="291.715" rx="10.455" ry="10.073" fill="#323233" stroke="#272728"/><rect ry="10.455" rx="10.455" y="291.715" x=".543" height="20.911" width="21.143" style="marker:none" fill="url(#b)" stroke="#151515"/></g></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="46" height="22"><defs><linearGradient id="a"><stop offset="0" stop-color="#39393a"/><stop offset="1" stop-color="#302f30"/></linearGradient><linearGradient xlink:href="#a" id="b" x1="53" y1="294.429" x2="53" y2="309.804" gradientUnits="userSpaceOnUse" gradientTransform="translate(-42.76)"/></defs><g transform="translate(0 -291.18)" stroke-width="1.085" stroke="#151515"><rect style="marker:none" width="44.446" height="20.911" x=".625" y="291.715" rx="10.455" ry="10.073" fill="#282828"/><rect ry="10.455" rx="10.455" y="291.715" x=".543" height="20.911" width="21.143" style="marker:none" fill="url(#b)"/></g></svg>
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 708 B |
@@ -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
@@ -0,0 +1,5 @@
|
|||||||
|
imports.package.start({
|
||||||
|
name: '@PACKAGE_NAME@',
|
||||||
|
prefix: '@prefix@',
|
||||||
|
libdir: '@libdir@',
|
||||||
|
});
|
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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();
|
||||||
|
}
|
80
js/dbusServices/notifications/notificationDaemon.js
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// -*- 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);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
NotifyAsync(params, invocation) {
|
||||||
|
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));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
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>
|
@@ -55,6 +55,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
|
|
||||||
this._gdmClient = gdmClient;
|
this._gdmClient = gdmClient;
|
||||||
this._mode = mode;
|
this._mode = mode;
|
||||||
|
this._defaultButtonWellActor = null;
|
||||||
|
|
||||||
let reauthenticationOnly;
|
let reauthenticationOnly;
|
||||||
if (this._mode == AuthPromptMode.UNLOCK_ONLY)
|
if (this._mode == AuthPromptMode.UNLOCK_ONLY)
|
||||||
@@ -81,7 +82,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
this.add_child(this._userWell);
|
this.add_child(this._userWell);
|
||||||
|
|
||||||
this._hasCancelButton = this._mode === AuthPromptStatus.UNLOCK_OR_LOG_IN;
|
this._hasCancelButton = this._mode === AuthPromptMode.UNLOCK_OR_LOG_IN;
|
||||||
|
|
||||||
this._initEntryRow();
|
this._initEntryRow();
|
||||||
|
|
||||||
@@ -119,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() {
|
||||||
@@ -131,9 +132,10 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
|
|
||||||
this.cancelButton = new St.Button({
|
this.cancelButton = new St.Button({
|
||||||
style_class: 'modal-dialog-button button cancel-button',
|
style_class: 'modal-dialog-button button cancel-button',
|
||||||
|
accessible_name: _('Cancel'),
|
||||||
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
|
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
|
||||||
reactive: this._hasCancelButton,
|
reactive: this._hasCancelButton,
|
||||||
can_focus: true,
|
can_focus: this._hasCancelButton,
|
||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
child: new St.Icon({ icon_name: 'go-previous-symbolic' }),
|
child: new St.Icon({ icon_name: 'go-previous-symbolic' }),
|
||||||
@@ -284,6 +286,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
this.setActorInDefaultButtonWell(null);
|
this.setActorInDefaultButtonWell(null);
|
||||||
this.verificationStatus = AuthPromptStatus.VERIFICATION_SUCCEEDED;
|
this.verificationStatus = AuthPromptStatus.VERIFICATION_SUCCEEDED;
|
||||||
this.cancelButton.reactive = false;
|
this.cancelButton.reactive = false;
|
||||||
|
this.cancelButton.can_focus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onReset() {
|
_onReset() {
|
||||||
@@ -422,7 +425,6 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
|
|
||||||
updateSensitivity(sensitive) {
|
updateSensitivity(sensitive) {
|
||||||
this._entry.reactive = sensitive;
|
this._entry.reactive = sensitive;
|
||||||
this._entry.clutter_text.editable = sensitive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_hide() {
|
vfunc_hide() {
|
||||||
@@ -452,6 +454,7 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
let oldStatus = this.verificationStatus;
|
let oldStatus = this.verificationStatus;
|
||||||
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
|
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
|
||||||
this.cancelButton.reactive = this._hasCancelButton;
|
this.cancelButton.reactive = this._hasCancelButton;
|
||||||
|
this.cancelButton.can_focus = this._hasCancelButton;
|
||||||
this._preemptiveAnswer = null;
|
this._preemptiveAnswer = null;
|
||||||
|
|
||||||
if (this._userVerifier)
|
if (this._userVerifier)
|
||||||
|
@@ -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));
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
/* exported BANNER_MESSAGE_KEY, BANNER_MESSAGE_TEXT_KEY, LOGO_KEY,
|
/* exported BANNER_MESSAGE_KEY, BANNER_MESSAGE_TEXT_KEY, LOGO_KEY,
|
||||||
DISABLE_USER_LIST_KEY, fadeInActor, fadeOutActor, cloneAndFadeOutActor */
|
DISABLE_USER_LIST_KEY, fadeInActor, fadeOutActor, cloneAndFadeOutActor */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib } = imports.gi;
|
const { Clutter, Gdm, Gio, GLib } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Batch = imports.gdm.batch;
|
const Batch = imports.gdm.batch;
|
||||||
@@ -12,6 +12,15 @@ const Main = imports.ui.main;
|
|||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const SmartcardManager = imports.misc.smartcardManager;
|
const SmartcardManager = imports.misc.smartcardManager;
|
||||||
|
|
||||||
|
Gio._promisify(Gdm.Client.prototype,
|
||||||
|
'open_reauthentication_channel', 'open_reauthentication_channel_finish');
|
||||||
|
Gio._promisify(Gdm.Client.prototype,
|
||||||
|
'get_user_verifier', 'get_user_verifier_finish');
|
||||||
|
Gio._promisify(Gdm.UserVerifierProxy.prototype,
|
||||||
|
'call_begin_verification_for_user', 'call_begin_verification_for_user_finish');
|
||||||
|
Gio._promisify(Gdm.UserVerifierProxy.prototype,
|
||||||
|
'call_begin_verification', 'call_begin_verification_finish');
|
||||||
|
|
||||||
var PASSWORD_SERVICE_NAME = 'gdm-password';
|
var PASSWORD_SERVICE_NAME = 'gdm-password';
|
||||||
var FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
|
var FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
|
||||||
var SMARTCARD_SERVICE_NAME = 'gdm-smartcard';
|
var SMARTCARD_SERVICE_NAME = 'gdm-smartcard';
|
||||||
@@ -168,14 +177,12 @@ var ShellUserVerifier = class {
|
|||||||
|
|
||||||
this._checkForFingerprintReader();
|
this._checkForFingerprintReader();
|
||||||
|
|
||||||
if (userName) {
|
// If possible, reauthenticate an already running session,
|
||||||
// If possible, reauthenticate an already running session,
|
// so any session specific credentials get updated appropriately
|
||||||
// so any session specific credentials get updated appropriately
|
if (userName)
|
||||||
this._client.open_reauthentication_channel(userName, this._cancellable,
|
this._openReauthenticationChannel(userName);
|
||||||
this._reauthenticationChannelOpened.bind(this));
|
else
|
||||||
} else {
|
this._getUserVerifier();
|
||||||
this._client.get_user_verifier(this._cancellable, this._userVerifierGot.bind(this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
@@ -339,10 +346,11 @@ var ShellUserVerifier = class {
|
|||||||
this._verificationFailed(false);
|
this._verificationFailed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_reauthenticationChannelOpened(client, result) {
|
async _openReauthenticationChannel(userName) {
|
||||||
try {
|
try {
|
||||||
this._clearUserVerifier();
|
this._clearUserVerifier();
|
||||||
this._userVerifier = client.open_reauthentication_channel_finish(result);
|
this._userVerifier = await this._client.open_reauthentication_channel(
|
||||||
|
userName, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
return;
|
return;
|
||||||
@@ -351,8 +359,7 @@ var ShellUserVerifier = class {
|
|||||||
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there
|
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there
|
||||||
// is no session to reauthenticate. Fall back to performing
|
// is no session to reauthenticate. Fall back to performing
|
||||||
// verification from this login session
|
// verification from this login session
|
||||||
client.get_user_verifier(this._cancellable,
|
this._getUserVerifier();
|
||||||
this._userVerifierGot.bind(this));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,10 +373,11 @@ var ShellUserVerifier = class {
|
|||||||
this._hold.release();
|
this._hold.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
_userVerifierGot(client, result) {
|
async _getUserVerifier() {
|
||||||
try {
|
try {
|
||||||
this._clearUserVerifier();
|
this._clearUserVerifier();
|
||||||
this._userVerifier = client.get_user_verifier_finish(result);
|
this._userVerifier =
|
||||||
|
await this._client.get_user_verifier(this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
return;
|
return;
|
||||||
@@ -421,35 +429,25 @@ var ShellUserVerifier = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_startService(serviceName) {
|
async _startService(serviceName) {
|
||||||
this._hold.acquire();
|
this._hold.acquire();
|
||||||
if (this._userName) {
|
try {
|
||||||
this._userVerifier.call_begin_verification_for_user(serviceName, this._userName, this._cancellable, (obj, result) => {
|
if (this._userName) {
|
||||||
try {
|
await this._userVerifier.call_begin_verification_for_user(
|
||||||
obj.call_begin_verification_for_user_finish(result);
|
serviceName, this._userName, this._cancellable);
|
||||||
} catch (e) {
|
} else {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
await this._userVerifier.call_begin_verification(
|
||||||
return;
|
serviceName, this._cancellable);
|
||||||
this._reportInitError('Failed to start verification for user', e);
|
}
|
||||||
return;
|
} catch (e) {
|
||||||
}
|
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
|
return;
|
||||||
this._hold.release();
|
this._reportInitError(this._userName
|
||||||
});
|
? 'Failed to start verification for user'
|
||||||
} else {
|
: 'Failed to start verification', e);
|
||||||
this._userVerifier.call_begin_verification(serviceName, this._cancellable, (obj, result) => {
|
return;
|
||||||
try {
|
|
||||||
obj.call_begin_verification_finish(result);
|
|
||||||
} catch (e) {
|
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
|
||||||
return;
|
|
||||||
this._reportInitError('Failed to start verification', e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._hold.release();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
this._hold.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
_beginVerification() {
|
_beginVerification() {
|
||||||
|
@@ -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,11 +1,20 @@
|
|||||||
// -*- 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;
|
||||||
|
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'list_engines_async', 'list_engines_async_finish');
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'request_name_async', 'request_name_async_finish');
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'get_global_engine_async', 'get_global_engine_async_finish');
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'set_global_engine_async', 'set_global_engine_async_finish');
|
||||||
|
|
||||||
// Ensure runtime version matches
|
// Ensure runtime version matches
|
||||||
_checkIBusVersion(1, 5, 2);
|
_checkIBusVersion(1, 5, 2);
|
||||||
|
|
||||||
@@ -55,13 +64,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}`);
|
||||||
}
|
}
|
||||||
@@ -97,16 +111,14 @@ var IBusManager = class {
|
|||||||
|
|
||||||
_onConnected() {
|
_onConnected() {
|
||||||
this._cancellable = new Gio.Cancellable();
|
this._cancellable = new Gio.Cancellable();
|
||||||
this._ibus.list_engines_async(-1, this._cancellable,
|
this._initEngines();
|
||||||
this._initEngines.bind(this));
|
this._initPanelService();
|
||||||
this._ibus.request_name_async(IBus.SERVICE_PANEL,
|
|
||||||
IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable,
|
|
||||||
this._initPanelService.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_initEngines(ibus, result) {
|
async _initEngines() {
|
||||||
try {
|
try {
|
||||||
let enginesList = this._ibus.list_engines_async_finish(result);
|
const enginesList =
|
||||||
|
await this._ibus.list_engines_async(-1, this._cancellable);
|
||||||
for (let i = 0; i < enginesList.length; ++i) {
|
for (let i = 0; i < enginesList.length; ++i) {
|
||||||
let name = enginesList[i].get_name();
|
let name = enginesList[i].get_name();
|
||||||
this._engines.set(name, enginesList[i]);
|
this._engines.set(name, enginesList[i]);
|
||||||
@@ -121,56 +133,52 @@ var IBusManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_initPanelService(ibus, result) {
|
async _initPanelService() {
|
||||||
let success = false;
|
|
||||||
try {
|
try {
|
||||||
success = !!this._ibus.request_name_async_finish(result);
|
await this._ibus.request_name_async(IBus.SERVICE_PANEL,
|
||||||
|
IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
return;
|
logError(e);
|
||||||
logError(e);
|
this._clear();
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
this._panelService = new IBus.PanelService({
|
||||||
this._panelService = new IBus.PanelService({ connection: this._ibus.get_connection(),
|
connection: this._ibus.get_connection(),
|
||||||
object_path: IBus.PATH_PANEL });
|
object_path: IBus.PATH_PANEL,
|
||||||
this._candidatePopup.setPanelService(this._panelService);
|
});
|
||||||
this._panelService.connect('update-property', this._updateProperty.bind(this));
|
this._candidatePopup.setPanelService(this._panelService);
|
||||||
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
|
this._panelService.connect('update-property', this._updateProperty.bind(this));
|
||||||
let cursorLocation = { x, y, width: w, height: h };
|
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
|
||||||
this.emit('set-cursor-location', cursorLocation);
|
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._panelService.connect('focus-in', (panel, path) => {
|
||||||
this.emit('focus-in');
|
if (!GLib.str_has_suffix(path, '/InputContext_1'))
|
||||||
});
|
this.emit('focus-in');
|
||||||
this._panelService.connect('focus-out', () => this.emit('focus-out'));
|
});
|
||||||
|
this._panelService.connect('focus-out', () => this.emit('focus-out'));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// IBus versions older than 1.5.10 have a bug which
|
// IBus versions older than 1.5.10 have a bug which
|
||||||
// causes spurious set-content-type emissions when
|
// causes spurious set-content-type emissions when
|
||||||
// switching input focus that temporarily lose purpose
|
// switching input focus that temporarily lose purpose
|
||||||
// and hints defeating its intended semantics and
|
// and hints defeating its intended semantics and
|
||||||
// confusing users. We thus don't use it in that case.
|
// confusing users. We thus don't use it in that case.
|
||||||
_checkIBusVersion(1, 5, 10);
|
_checkIBusVersion(1, 5, 10);
|
||||||
this._panelService.connect('set-content-type', this._setContentType.bind(this));
|
this._panelService.connect('set-content-type', this._setContentType.bind(this));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// If an engine is already active we need to get its properties
|
// If an engine is already active we need to get its properties
|
||||||
this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, res) => {
|
const engine =
|
||||||
let engine;
|
await this._ibus.get_global_engine_async(-1, this._cancellable);
|
||||||
try {
|
this._engineChanged(this._ibus, engine.get_name());
|
||||||
engine = this._ibus.get_global_engine_async_finish(res);
|
|
||||||
if (!engine)
|
|
||||||
return;
|
|
||||||
} catch (e) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._engineChanged(this._ibus, engine.get_name());
|
|
||||||
});
|
|
||||||
this._updateReadiness();
|
this._updateReadiness();
|
||||||
} else {
|
} catch (e) {
|
||||||
this._clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +227,7 @@ var IBusManager = class {
|
|||||||
return this._engines.get(id);
|
return this._engines.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEngine(id, callback) {
|
async setEngine(id, callback) {
|
||||||
// Send id even if id == this._currentEngineName
|
// Send id even if id == this._currentEngineName
|
||||||
// because 'properties-registered' signal can be emitted
|
// because 'properties-registered' signal can be emitted
|
||||||
// while this._ibusSources == null on a lock screen.
|
// while this._ibusSources == null on a lock screen.
|
||||||
@@ -229,18 +237,16 @@ var IBusManager = class {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._ibus.set_global_engine_async(id,
|
try {
|
||||||
this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
|
await this._ibus.set_global_engine_async(id,
|
||||||
this._cancellable, (_bus, res) => {
|
this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
|
||||||
try {
|
this._cancellable);
|
||||||
this._ibus.set_global_engine_async_finish(res);
|
} catch (e) {
|
||||||
} catch (e) {
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
|
logError(e);
|
||||||
logError(e);
|
}
|
||||||
}
|
if (callback)
|
||||||
if (callback)
|
callback();
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preloadEngines(ids) {
|
preloadEngines(ids) {
|
||||||
|
@@ -4,6 +4,9 @@ const { Clutter, GLib, Gio, GObject, IBus } = imports.gi;
|
|||||||
|
|
||||||
const Keyboard = imports.ui.status.keyboard;
|
const Keyboard = imports.ui.status.keyboard;
|
||||||
|
|
||||||
|
Gio._promisify(IBus.Bus.prototype,
|
||||||
|
'create_input_context_async', 'create_input_context_async_finish');
|
||||||
|
|
||||||
var HIDE_PANEL_TIME = 50;
|
var HIDE_PANEL_TIME = 50;
|
||||||
|
|
||||||
var InputMethod = GObject.registerClass(
|
var InputMethod = GObject.registerClass(
|
||||||
@@ -46,15 +49,11 @@ class InputMethod extends Clutter.InputMethod {
|
|||||||
this._currentSource = this._inputSourceManager.currentSource;
|
this._currentSource = this._inputSourceManager.currentSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onConnected() {
|
async _onConnected() {
|
||||||
this._cancellable = new Gio.Cancellable();
|
this._cancellable = new Gio.Cancellable();
|
||||||
this._ibus.create_input_context_async('gnome-shell', -1,
|
|
||||||
this._cancellable, this._setContext.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
_setContext(bus, res) {
|
|
||||||
try {
|
try {
|
||||||
this._context = this._ibus.create_input_context_async_finish(res);
|
this._context = await this._ibus.create_input_context_async(
|
||||||
|
'gnome-shell', -1, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
logError(e);
|
logError(e);
|
||||||
@@ -97,8 +96,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) {
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
/* exported IntrospectService */
|
/* exported IntrospectService */
|
||||||
const { Gio, GLib, Meta, Shell } = imports.gi;
|
const { Gio, GLib, Meta, Shell, St } = imports.gi;
|
||||||
|
|
||||||
const INTROSPECT_SCHEMA = 'org.gnome.shell';
|
const INTROSPECT_SCHEMA = 'org.gnome.shell';
|
||||||
const INTROSPECT_KEY = 'introspect';
|
const INTROSPECT_KEY = 'introspect';
|
||||||
const APP_WHITELIST = ['org.freedesktop.impl.portal.desktop.gtk'];
|
const APP_WHITELIST = ['org.freedesktop.impl.portal.desktop.gtk'];
|
||||||
|
|
||||||
|
const INTROSPECT_DBUS_API_VERSION = 2;
|
||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
const IntrospectDBusIface = loadInterfaceXML('org.gnome.Shell.Introspect');
|
const IntrospectDBusIface = loadInterfaceXML('org.gnome.Shell.Introspect');
|
||||||
@@ -22,6 +24,7 @@ var IntrospectService = class {
|
|||||||
this._runningApplicationsDirty = true;
|
this._runningApplicationsDirty = true;
|
||||||
this._activeApplication = null;
|
this._activeApplication = null;
|
||||||
this._activeApplicationDirty = true;
|
this._activeApplicationDirty = true;
|
||||||
|
this._animationsEnabled = true;
|
||||||
|
|
||||||
this._appSystem = Shell.AppSystem.get_default();
|
this._appSystem = Shell.AppSystem.get_default();
|
||||||
this._appSystem.connect('app-state-changed',
|
this._appSystem.connect('app-state-changed',
|
||||||
@@ -30,7 +33,9 @@ var IntrospectService = class {
|
|||||||
this._syncRunningApplications();
|
this._syncRunningApplications();
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings = new Gio.Settings({ schema_id: INTROSPECT_SCHEMA });
|
this._introspectSettings = new Gio.Settings({
|
||||||
|
schema_id: INTROSPECT_SCHEMA,
|
||||||
|
});
|
||||||
|
|
||||||
let tracker = Shell.WindowTracker.get_default();
|
let tracker = Shell.WindowTracker.get_default();
|
||||||
tracker.connect('notify::focus-app',
|
tracker.connect('notify::focus-app',
|
||||||
@@ -49,6 +54,11 @@ var IntrospectService = class {
|
|||||||
(conn, name, owner) => this._whitelistMap.set(name, owner),
|
(conn, name, owner) => this._whitelistMap.set(name, owner),
|
||||||
(conn, name) => this._whitelistMap.delete(name));
|
(conn, name) => this._whitelistMap.delete(name));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._settings = St.Settings.get();
|
||||||
|
this._settings.connect('notify::enable-animations',
|
||||||
|
this._syncAnimationsEnabled.bind(this));
|
||||||
|
this._syncAnimationsEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
_isStandaloneApp(app) {
|
_isStandaloneApp(app) {
|
||||||
@@ -56,7 +66,7 @@ var IntrospectService = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_isIntrospectEnabled() {
|
_isIntrospectEnabled() {
|
||||||
return this._settings.get_boolean(INTROSPECT_KEY);
|
return this._introspectSettings.get_boolean(INTROSPECT_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
_isSenderWhitelisted(sender) {
|
_isSenderWhitelisted(sender) {
|
||||||
@@ -119,9 +129,18 @@ var IntrospectService = class {
|
|||||||
type == Meta.WindowType.UTILITY;
|
type == Meta.WindowType.UTILITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_isInvocationAllowed(invocation) {
|
||||||
|
if (this._isIntrospectEnabled())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (this._isSenderWhitelisted(invocation.get_sender()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
GetRunningApplicationsAsync(params, invocation) {
|
GetRunningApplicationsAsync(params, invocation) {
|
||||||
if (!this._isIntrospectEnabled() &&
|
if (!this._isInvocationAllowed(invocation)) {
|
||||||
!this._isSenderWhitelisted(invocation.get_sender())) {
|
|
||||||
invocation.return_error_literal(Gio.DBusError,
|
invocation.return_error_literal(Gio.DBusError,
|
||||||
Gio.DBusError.ACCESS_DENIED,
|
Gio.DBusError.ACCESS_DENIED,
|
||||||
'App introspection not allowed');
|
'App introspection not allowed');
|
||||||
@@ -136,8 +155,7 @@ var IntrospectService = class {
|
|||||||
let apps = this._appSystem.get_running();
|
let apps = this._appSystem.get_running();
|
||||||
let windowsList = {};
|
let windowsList = {};
|
||||||
|
|
||||||
if (!this._isIntrospectEnabled() &&
|
if (!this._isInvocationAllowed(invocation)) {
|
||||||
!this._isSenderWhitelisted(invocation.get_sender())) {
|
|
||||||
invocation.return_error_literal(Gio.DBusError,
|
invocation.return_error_literal(Gio.DBusError,
|
||||||
Gio.DBusError.ACCESS_DENIED,
|
Gio.DBusError.ACCESS_DENIED,
|
||||||
'App introspection not allowed');
|
'App introspection not allowed');
|
||||||
@@ -181,4 +199,21 @@ var IntrospectService = class {
|
|||||||
}
|
}
|
||||||
invocation.return_value(new GLib.Variant('(a{ta{sv}})', [windowsList]));
|
invocation.return_value(new GLib.Variant('(a{ta{sv}})', [windowsList]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_syncAnimationsEnabled() {
|
||||||
|
let wasAnimationsEnabled = this._animationsEnabled;
|
||||||
|
this._animationsEnabled = this._settings.enable_animations;
|
||||||
|
if (wasAnimationsEnabled !== this._animationsEnabled) {
|
||||||
|
let variant = new GLib.Variant('b', this._animationsEnabled);
|
||||||
|
this._dbusImpl.emit_property_changed('AnimationsEnabled', variant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get AnimationsEnabled() {
|
||||||
|
return this._animationsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
get version() {
|
||||||
|
return INTROSPECT_DBUS_API_VERSION;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@@ -50,25 +50,22 @@ function canLock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function registerSessionWithGDM() {
|
async function registerSessionWithGDM() {
|
||||||
log("Registering session with GDM");
|
log("Registering session with GDM");
|
||||||
Gio.DBus.system.call('org.gnome.DisplayManager',
|
try {
|
||||||
'/org/gnome/DisplayManager/Manager',
|
await Gio.DBus.system.call(
|
||||||
'org.gnome.DisplayManager.Manager',
|
'org.gnome.DisplayManager',
|
||||||
'RegisterSession',
|
'/org/gnome/DisplayManager/Manager',
|
||||||
GLib.Variant.new('(a{sv})', [{}]), null,
|
'org.gnome.DisplayManager.Manager',
|
||||||
Gio.DBusCallFlags.NONE, -1, null,
|
'RegisterSession',
|
||||||
(source, result) => {
|
GLib.Variant.new('(a{sv})', [{}]), null,
|
||||||
try {
|
Gio.DBusCallFlags.NONE, -1, null);
|
||||||
source.call_finish(result);
|
} catch (e) {
|
||||||
} catch (e) {
|
if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
|
||||||
if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
|
log(`Error registering session with GDM: ${e.message}`);
|
||||||
log(`Error registering session with GDM: ${e.message}`);
|
else
|
||||||
else
|
log('Not calling RegisterSession(): method not exported, GDM too old?');
|
||||||
log("Not calling RegisterSession(): method not exported, GDM too old?");
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let _loginManager = null;
|
let _loginManager = null;
|
||||||
@@ -174,24 +171,19 @@ var LoginManagerSystemd = class {
|
|||||||
this._proxy.SuspendRemote(true);
|
this._proxy.SuspendRemote(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
inhibit(reason, callback) {
|
async inhibit(reason, callback) {
|
||||||
let inVariant = GLib.Variant.new('(ssss)',
|
try {
|
||||||
['sleep',
|
const inVariant = new GLib.Variant('(ssss)',
|
||||||
'GNOME Shell',
|
['sleep', 'GNOME Shell', reason, 'delay']);
|
||||||
reason,
|
const [outVariant_, fdList] =
|
||||||
'delay']);
|
await this._proxy.call_with_unix_fd_list('Inhibit',
|
||||||
this._proxy.call_with_unix_fd_list('Inhibit', inVariant, 0, -1, null, null,
|
inVariant, 0, -1, null, null);
|
||||||
(proxy, result) => {
|
const [fd] = fdList.steal_fds();
|
||||||
let fd = -1;
|
callback(new Gio.UnixInputStream({ fd }));
|
||||||
try {
|
} catch (e) {
|
||||||
let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
|
logError(e, 'Error getting systemd inhibitor');
|
||||||
fd = fdList.steal_fds()[0];
|
callback(null);
|
||||||
callback(new Gio.UnixInputStream({ fd }));
|
}
|
||||||
} catch (e) {
|
|
||||||
logError(e, "Error getting systemd inhibitor");
|
|
||||||
callback(null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_prepareForSleep(proxy, sender, [aboutToSuspend]) {
|
_prepareForSleep(proxy, sender, [aboutToSuspend]) {
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,9 +57,7 @@ var ObjectManager = class {
|
|||||||
// Start out inhibiting load until at least the proxy
|
// Start out inhibiting load until at least the proxy
|
||||||
// manager is loaded and the remote objects are fetched
|
// manager is loaded and the remote objects are fetched
|
||||||
this._numLoadInhibitors = 1;
|
this._numLoadInhibitors = 1;
|
||||||
this._managerProxy.init_async(GLib.PRIORITY_DEFAULT,
|
this._initManagerProxy();
|
||||||
this._cancellable,
|
|
||||||
this._onManagerProxyLoaded.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_tryToCompleteLoad() {
|
_tryToCompleteLoad() {
|
||||||
@@ -73,7 +71,7 @@ var ObjectManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_addInterface(objectPath, interfaceName, onFinished) {
|
async _addInterface(objectPath, interfaceName, onFinished) {
|
||||||
let info = this._interfaceInfos[interfaceName];
|
let info = this._interfaceInfos[interfaceName];
|
||||||
|
|
||||||
if (!info) {
|
if (!info) {
|
||||||
@@ -89,40 +87,38 @@ var ObjectManager = class {
|
|||||||
g_interface_info: info,
|
g_interface_info: info,
|
||||||
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
|
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
|
||||||
|
|
||||||
proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable, (initable, result) => {
|
try {
|
||||||
try {
|
await proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable);
|
||||||
initable.init_finish(result);
|
} catch (e) {
|
||||||
} catch (e) {
|
logError(e, `could not initialize proxy for interface ${interfaceName}`);
|
||||||
logError(e, `could not initialize proxy for interface ${interfaceName}`);
|
|
||||||
|
|
||||||
if (onFinished)
|
|
||||||
onFinished();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let isNewObject;
|
|
||||||
if (!this._objects[objectPath]) {
|
|
||||||
this._objects[objectPath] = {};
|
|
||||||
isNewObject = true;
|
|
||||||
} else {
|
|
||||||
isNewObject = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._objects[objectPath][interfaceName] = proxy;
|
|
||||||
|
|
||||||
if (!this._interfaces[interfaceName])
|
|
||||||
this._interfaces[interfaceName] = [];
|
|
||||||
|
|
||||||
this._interfaces[interfaceName].push(proxy);
|
|
||||||
|
|
||||||
if (isNewObject)
|
|
||||||
this.emit('object-added', objectPath);
|
|
||||||
|
|
||||||
this.emit('interface-added', interfaceName, proxy);
|
|
||||||
|
|
||||||
if (onFinished)
|
if (onFinished)
|
||||||
onFinished();
|
onFinished();
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let isNewObject;
|
||||||
|
if (!this._objects[objectPath]) {
|
||||||
|
this._objects[objectPath] = {};
|
||||||
|
isNewObject = true;
|
||||||
|
} else {
|
||||||
|
isNewObject = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._objects[objectPath][interfaceName] = proxy;
|
||||||
|
|
||||||
|
if (!this._interfaces[interfaceName])
|
||||||
|
this._interfaces[interfaceName] = [];
|
||||||
|
|
||||||
|
this._interfaces[interfaceName].push(proxy);
|
||||||
|
|
||||||
|
if (isNewObject)
|
||||||
|
this.emit('object-added', objectPath);
|
||||||
|
|
||||||
|
this.emit('interface-added', interfaceName, proxy);
|
||||||
|
|
||||||
|
if (onFinished)
|
||||||
|
onFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeInterface(objectPath, interfaceName) {
|
_removeInterface(objectPath, interfaceName) {
|
||||||
@@ -151,9 +147,10 @@ var ObjectManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onManagerProxyLoaded(initable, result) {
|
async _initManagerProxy() {
|
||||||
try {
|
try {
|
||||||
initable.init_finish(result);
|
await this._managerProxy.init_async(
|
||||||
|
GLib.PRIORITY_DEFAULT, this._cancellable);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e, `could not initialize object manager for object ${this._serviceName}`);
|
logError(e, `could not initialize object manager for object ${this._serviceName}`);
|
||||||
|
|
||||||
|
@@ -445,6 +445,9 @@ function ensureActorVisibleInScrollView(scrollView, actor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wiggle(actor, params) {
|
function wiggle(actor, params) {
|
||||||
|
if (!St.Settings.get().enable_animations)
|
||||||
|
return;
|
||||||
|
|
||||||
params = Params.parse(params, {
|
params = Params.parse(params, {
|
||||||
offset: WIGGLE_OFFSET,
|
offset: WIGGLE_OFFSET,
|
||||||
duration: WIGGLE_DURATION,
|
duration: WIGGLE_DURATION,
|
||||||
|
@@ -7,6 +7,8 @@ const PermissionStore = imports.misc.permissionStore;
|
|||||||
|
|
||||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||||
|
|
||||||
|
Gio._promisify(Geoclue.Simple, 'new', 'new_finish');
|
||||||
|
|
||||||
const WeatherIntegrationIface = loadInterfaceXML('org.gnome.Shell.WeatherIntegration');
|
const WeatherIntegrationIface = loadInterfaceXML('org.gnome.Shell.WeatherIntegration');
|
||||||
|
|
||||||
const WEATHER_BUS_NAME = 'org.gnome.Weather';
|
const WEATHER_BUS_NAME = 'org.gnome.Weather';
|
||||||
@@ -79,16 +81,7 @@ var WeatherClient = class {
|
|||||||
this._weatherApp = null;
|
this._weatherApp = null;
|
||||||
this._weatherProxy = null;
|
this._weatherProxy = null;
|
||||||
|
|
||||||
let nodeInfo = Gio.DBusNodeInfo.new_for_xml(WeatherIntegrationIface);
|
this._createWeatherProxy();
|
||||||
Gio.DBusProxy.new(
|
|
||||||
Gio.DBus.session,
|
|
||||||
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
|
|
||||||
nodeInfo.lookup_interface(WEATHER_INTEGRATION_IFACE),
|
|
||||||
WEATHER_BUS_NAME,
|
|
||||||
WEATHER_OBJECT_PATH,
|
|
||||||
WEATHER_INTEGRATION_IFACE,
|
|
||||||
null,
|
|
||||||
this._onWeatherProxyReady.bind(this));
|
|
||||||
|
|
||||||
this._settings = new Gio.Settings({
|
this._settings = new Gio.Settings({
|
||||||
schema_id: 'org.gnome.shell.weather',
|
schema_id: 'org.gnome.shell.weather',
|
||||||
@@ -146,9 +139,17 @@ var WeatherClient = class {
|
|||||||
(!this._needsAuth || this._weatherAuthorized);
|
(!this._needsAuth || this._weatherAuthorized);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onWeatherProxyReady(o, res) {
|
async _createWeatherProxy() {
|
||||||
|
const nodeInfo = Gio.DBusNodeInfo.new_for_xml(WeatherIntegrationIface);
|
||||||
try {
|
try {
|
||||||
this._weatherProxy = Gio.DBusProxy.new_finish(res);
|
this._weatherProxy = await Gio.DBusProxy.new(
|
||||||
|
Gio.DBus.session,
|
||||||
|
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
|
||||||
|
nodeInfo.lookup_interface(WEATHER_INTEGRATION_IFACE),
|
||||||
|
WEATHER_BUS_NAME,
|
||||||
|
WEATHER_OBJECT_PATH,
|
||||||
|
WEATHER_INTEGRATION_IFACE,
|
||||||
|
null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(`Failed to create GNOME Weather proxy: ${e}`);
|
log(`Failed to create GNOME Weather proxy: ${e}`);
|
||||||
return;
|
return;
|
||||||
@@ -239,25 +240,23 @@ var WeatherClient = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_startGClueService() {
|
async _startGClueService() {
|
||||||
if (this._gclueStarting)
|
if (this._gclueStarting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._gclueStarting = true;
|
this._gclueStarting = true;
|
||||||
|
|
||||||
Geoclue.Simple.new('org.gnome.Shell', Geoclue.AccuracyLevel.CITY, null,
|
try {
|
||||||
(o, res) => {
|
this._gclueService = await Geoclue.Simple.new(
|
||||||
try {
|
'org.gnome.Shell', Geoclue.AccuracyLevel.CITY, null);
|
||||||
this._gclueService = Geoclue.Simple.new_finish(res);
|
} catch (e) {
|
||||||
} catch (e) {
|
log(`Failed to connect to Geoclue2 service: ${e.message}`);
|
||||||
log(`Failed to connect to Geoclue2 service: ${e.message}`);
|
this._setLocation(this._mostRecentLocation);
|
||||||
this._setLocation(this._mostRecentLocation);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
this._gclueStarted = true;
|
||||||
this._gclueStarted = true;
|
this._gclueService.get_client().distance_threshold = 100;
|
||||||
this._gclueService.get_client().distance_threshold = 100;
|
this._updateLocationMonitoring();
|
||||||
this._updateLocationMonitoring();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onGClueLocationChanged() {
|
_onGClueLocationChanged() {
|
||||||
|
@@ -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) {
|
||||||
|
@@ -71,15 +71,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 +114,9 @@ function _findBestFolderName(apps) {
|
|||||||
}, commonCategories);
|
}, commonCategories);
|
||||||
|
|
||||||
for (let category of commonCategories) {
|
for (let category of commonCategories) {
|
||||||
let keyfile = new GLib.KeyFile();
|
let translated = Shell.util_get_translated_folder_name(category);
|
||||||
let path = 'desktop-directories/%s.directory'.format(category);
|
if (translated !== null)
|
||||||
|
return translated;
|
||||||
try {
|
|
||||||
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 +157,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 +196,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 +246,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 +266,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 +419,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 +460,10 @@ var AllView = GObject.registerClass({
|
|||||||
|
|
||||||
_redisplay() {
|
_redisplay() {
|
||||||
super._redisplay();
|
super._redisplay();
|
||||||
|
|
||||||
|
this._folderIcons.forEach(icon => {
|
||||||
|
icon.view._redisplay();
|
||||||
|
});
|
||||||
this._refilterApps();
|
this._refilterApps();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,8 +732,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 +1290,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)
|
||||||
@@ -1308,7 +1339,7 @@ class FolderView extends BaseAppView {
|
|||||||
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 +1355,6 @@ 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._redisplay();
|
this._redisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1346,12 +1376,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);
|
||||||
@@ -1429,6 +1459,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 +1505,6 @@ class FolderView extends BaseAppView {
|
|||||||
} else {
|
} else {
|
||||||
this._folder.set_strv('apps', folderApps);
|
this._folder.set_strv('apps', folderApps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1494,26 +1538,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 +1585,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 +1629,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 +1655,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) {
|
||||||
@@ -1657,10 +1695,6 @@ var AppFolderDialog = GObject.registerClass({
|
|||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
});
|
});
|
||||||
this.add_constraint(new Clutter.BindConstraint({
|
|
||||||
source: Main.overview.viewSelector,
|
|
||||||
coordinate: Clutter.BindCoordinate.ALL,
|
|
||||||
}));
|
|
||||||
|
|
||||||
this._source = source;
|
this._source = source;
|
||||||
this._folder = folder;
|
this._folder = folder;
|
||||||
@@ -1906,6 +1940,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;
|
||||||
@@ -1914,6 +1949,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
|
||||||
@@ -2029,7 +2066,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:
|
||||||
@@ -2078,11 +2114,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', () => {
|
||||||
@@ -2094,9 +2126,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;
|
||||||
@@ -2343,7 +2372,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;
|
||||||
|
|
||||||
@@ -2355,6 +2394,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;
|
||||||
@@ -2364,32 +2405,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;
|
||||||
@@ -2397,6 +2419,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2441,7 +2465,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(
|
||||||
@@ -2527,19 +2551,18 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
|||||||
if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop')) {
|
if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop')) {
|
||||||
this._appendSeparator();
|
this._appendSeparator();
|
||||||
let item = this._appendMenuItem(_("Show Details"));
|
let item = this._appendMenuItem(_("Show Details"));
|
||||||
item.connect('activate', () => {
|
item.connect('activate', async () => {
|
||||||
let id = this._source.app.get_id();
|
let id = this._source.app.get_id();
|
||||||
let args = GLib.Variant.new('(ss)', [id, '']);
|
let args = GLib.Variant.new('(ss)', [id, '']);
|
||||||
Gio.DBus.get(Gio.BusType.SESSION, null, (o, res) => {
|
const bus = await Gio.DBus.get(Gio.BusType.SESSION, null);
|
||||||
let bus = Gio.DBus.get_finish(res);
|
bus.call(
|
||||||
bus.call('org.gnome.Software',
|
'org.gnome.Software',
|
||||||
'/org/gnome/Software',
|
'/org/gnome/Software',
|
||||||
'org.gtk.Actions', 'Activate',
|
'org.gtk.Actions', 'Activate',
|
||||||
GLib.Variant.new('(sava{sv})',
|
new GLib.Variant.new(
|
||||||
['details', [args], null]),
|
'(sava{sv})', ['details', [args], null]),
|
||||||
null, 0, -1, null, null);
|
null, 0, -1, null);
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2558,7 +2581,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
popup(_activatingButton) {
|
popup(_activatingButton) {
|
||||||
this._redisplay();
|
this._rebuildMenu();
|
||||||
this.open();
|
this.open();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -199,46 +199,47 @@ class DBusEventSource extends EventSourceBase {
|
|||||||
|
|
||||||
this._initialized = false;
|
this._initialized = false;
|
||||||
this._dbusProxy = new CalendarServer();
|
this._dbusProxy = new CalendarServer();
|
||||||
this._dbusProxy.init_async(GLib.PRIORITY_DEFAULT, null, (object, result) => {
|
this._initProxy();
|
||||||
let loaded = false;
|
}
|
||||||
|
|
||||||
try {
|
async _initProxy() {
|
||||||
this._dbusProxy.init_finish(result);
|
let loaded = false;
|
||||||
loaded = true;
|
|
||||||
} catch (e) {
|
try {
|
||||||
if (e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) {
|
await this._dbusProxy.init_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
// Ignore timeouts and install signals as normal, because with high
|
loaded = true;
|
||||||
// probability the service will appear later on, and we will get a
|
} catch (e) {
|
||||||
// NameOwnerChanged which will finish loading
|
// Ignore timeouts and install signals as normal, because with high
|
||||||
//
|
// probability the service will appear later on, and we will get a
|
||||||
// (But still _initialized to false, because the proxy does not know
|
// NameOwnerChanged which will finish loading
|
||||||
// about the HasCalendars property and would cause an exception trying
|
//
|
||||||
// to read it)
|
// (But still _initialized to false, because the proxy does not know
|
||||||
} else {
|
// about the HasCalendars property and would cause an exception trying
|
||||||
log('Error loading calendars: %s'.format(e.message));
|
// to read it)
|
||||||
return;
|
if (!e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) {
|
||||||
}
|
log('Error loading calendars: %s'.format(e.message));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this._dbusProxy.connectSignal('Changed', this._onChanged.bind(this));
|
this._dbusProxy.connectSignal('Changed', this._onChanged.bind(this));
|
||||||
|
|
||||||
this._dbusProxy.connect('notify::g-name-owner', () => {
|
this._dbusProxy.connect('notify::g-name-owner', () => {
|
||||||
if (this._dbusProxy.g_name_owner)
|
if (this._dbusProxy.g_name_owner)
|
||||||
this._onNameAppeared();
|
|
||||||
else
|
|
||||||
this._onNameVanished();
|
|
||||||
});
|
|
||||||
|
|
||||||
this._dbusProxy.connect('g-properties-changed', () => {
|
|
||||||
this.notify('has-calendars');
|
|
||||||
});
|
|
||||||
|
|
||||||
this._initialized = loaded;
|
|
||||||
if (loaded) {
|
|
||||||
this.notify('has-calendars');
|
|
||||||
this._onNameAppeared();
|
this._onNameAppeared();
|
||||||
}
|
else
|
||||||
|
this._onNameVanished();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._dbusProxy.connect('g-properties-changed', () => {
|
||||||
|
this.notify('has-calendars');
|
||||||
|
});
|
||||||
|
|
||||||
|
this._initialized = loaded;
|
||||||
|
if (loaded) {
|
||||||
|
this.notify('has-calendars');
|
||||||
|
this._onNameAppeared();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
@@ -837,8 +838,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,10 +933,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 +1154,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._dndButton.bind_property('checked',
|
||||||
|
this._dndSwitch, 'state',
|
||||||
|
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,10 +188,13 @@ 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();
|
||||||
|
|
||||||
|
dialog.makeInactive();
|
||||||
dialog._dialog.ease({
|
dialog._dialog.ease({
|
||||||
scale_y: 0,
|
scale_y: 0,
|
||||||
mode: Clutter.AnimationMode.LINEAR,
|
mode: Clutter.AnimationMode.LINEAR,
|
||||||
|
@@ -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,16 @@
|
|||||||
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, 'init_async', 'init_finish');
|
||||||
|
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(
|
||||||
@@ -480,39 +483,37 @@ var VPNRequestHandler = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_readStdoutOldStyle() {
|
async _readStdoutOldStyle() {
|
||||||
this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null, (stream, result) => {
|
const [line, len_] =
|
||||||
let [line, len_] = this._dataStdout.read_line_finish_utf8(result);
|
await this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
|
|
||||||
if (line == null) {
|
if (line === null) {
|
||||||
// end of file
|
// end of file
|
||||||
this._stdout.close(null);
|
this._stdout.close(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._vpnChildProcessLineOldStyle(line);
|
this._vpnChildProcessLineOldStyle(line);
|
||||||
|
|
||||||
// try to read more!
|
// try to read more!
|
||||||
this._readStdoutOldStyle();
|
this._readStdoutOldStyle();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_readStdoutNewStyle() {
|
async _readStdoutNewStyle() {
|
||||||
this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null, (stream, result) => {
|
const cnt =
|
||||||
let cnt = this._dataStdout.fill_finish(result);
|
await this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null);
|
||||||
|
|
||||||
if (cnt == 0) {
|
if (cnt === 0) {
|
||||||
// end of file
|
// end of file
|
||||||
this._showNewStyleDialog();
|
this._showNewStyleDialog();
|
||||||
|
|
||||||
this._stdout.close(null);
|
this._stdout.close(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to read more
|
// Try to read more
|
||||||
this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size());
|
this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size());
|
||||||
this._readStdoutNewStyle();
|
this._readStdoutNewStyle();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_showNewStyleDialog() {
|
_showNewStyleDialog() {
|
||||||
@@ -615,27 +616,21 @@ 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));
|
||||||
|
|
||||||
this._initialized = false;
|
this._initialized = false;
|
||||||
this._native.init_async(GLib.PRIORITY_DEFAULT, null, (o, res) => {
|
this._initNative();
|
||||||
try {
|
}
|
||||||
this._native.init_finish(res);
|
|
||||||
this._initialized = true;
|
async _initNative() {
|
||||||
} catch (e) {
|
try {
|
||||||
this._native = null;
|
await this._native.init_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
logError(e, 'error initializing the NetworkManager Agent');
|
this._initialized = true;
|
||||||
}
|
} catch (e) {
|
||||||
});
|
this._native = null;
|
||||||
|
logError(e, 'error initializing the NetworkManager Agent');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
@@ -766,13 +761,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 +781,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;
|
||||||
|
@@ -2,12 +2,19 @@
|
|||||||
/* 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;
|
||||||
try {
|
try {
|
||||||
({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
|
({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
|
||||||
|
|
||||||
|
Gio._promisify(Tp.Channel.prototype, 'close_async', 'close_finish');
|
||||||
|
Gio._promisify(Tp.Channel.prototype,
|
||||||
|
'send_message_async', 'send_message_finish');
|
||||||
|
Gio._promisify(Tp.ChannelDispatchOperation.prototype,
|
||||||
|
'claim_with_async', 'claim_with_finish');
|
||||||
|
Gio._promisify(Tpl.LogManager.prototype,
|
||||||
|
'get_filtered_events_async', 'get_filtered_events_finish');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Telepathy is not available, chat integration will be disabled.');
|
log('Telepathy is not available, chat integration will be disabled.');
|
||||||
}
|
}
|
||||||
@@ -40,36 +47,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;
|
||||||
@@ -193,7 +223,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
|
|
||||||
// We can only handle text channel, so close any other channel
|
// We can only handle text channel, so close any other channel
|
||||||
if (!(channel instanceof Tp.TextChannel)) {
|
if (!(channel instanceof Tp.TextChannel)) {
|
||||||
channel.close_async(null);
|
channel.close_async();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,7 +269,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_approveTextChannel(account, conn, channel, dispatchOp, context) {
|
async _approveTextChannel(account, conn, channel, dispatchOp, context) {
|
||||||
let [targetHandle_, targetHandleType] = channel.get_handle();
|
let [targetHandle_, targetHandleType] = channel.get_handle();
|
||||||
|
|
||||||
if (targetHandleType != Tp.HandleType.CONTACT) {
|
if (targetHandleType != Tp.HandleType.CONTACT) {
|
||||||
@@ -248,17 +278,15 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Approve private text channels right away as we are going to handle it
|
|
||||||
dispatchOp.claim_with_async(this, (o, result) => {
|
|
||||||
try {
|
|
||||||
dispatchOp.claim_with_finish(result);
|
|
||||||
this._handlingChannels(account, conn, [channel], false);
|
|
||||||
} catch (err) {
|
|
||||||
log('Failed to Claim channel: %s'.format(err.toString()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
context.accept();
|
context.accept();
|
||||||
|
|
||||||
|
// Approve private text channels right away as we are going to handle it
|
||||||
|
try {
|
||||||
|
await dispatchOp.claim_with_async(this);
|
||||||
|
this._handlingChannels(account, conn, [channel], false);
|
||||||
|
} catch (err) {
|
||||||
|
log('Failed to Claim channel: %s'.format(err.toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_delegatedChannelsCb(_client, _channels) {
|
_delegatedChannelsCb(_client, _channels) {
|
||||||
@@ -270,12 +298,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 = [];
|
||||||
|
|
||||||
@@ -419,19 +447,16 @@ class ChatSource extends MessageTray.Source {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_getLogMessages() {
|
async _getLogMessages() {
|
||||||
let logManager = Tpl.LogManager.dup_singleton();
|
let logManager = Tpl.LogManager.dup_singleton();
|
||||||
let entity = Tpl.Entity.new_from_tp_contact(this._contact, Tpl.EntityType.CONTACT);
|
let entity = Tpl.Entity.new_from_tp_contact(this._contact, Tpl.EntityType.CONTACT);
|
||||||
|
|
||||||
logManager.get_filtered_events_async(this._account, entity,
|
const [events] = await logManager.get_filtered_events_async(
|
||||||
Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES,
|
this._account, entity,
|
||||||
null, this._displayPendingMessages.bind(this));
|
Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES,
|
||||||
}
|
null);
|
||||||
|
|
||||||
_displayPendingMessages(logManager, result) {
|
let logMessages = events.map(e => ChatMessage.newFromTplTextEvent(e));
|
||||||
let [success_, events] = logManager.get_filtered_events_finish(result);
|
|
||||||
|
|
||||||
let logMessages = events.map(makeMessageFromTplEvent);
|
|
||||||
this._ensureNotification();
|
this._ensureNotification();
|
||||||
|
|
||||||
let pendingTpMessages = this._channel.get_pending_messages();
|
let pendingTpMessages = this._channel.get_pending_messages();
|
||||||
@@ -443,7 +468,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);
|
||||||
}
|
}
|
||||||
@@ -486,9 +512,7 @@ class ChatSource extends MessageTray.Source {
|
|||||||
this._ackMessages();
|
this._ackMessages();
|
||||||
// The chat box has been destroyed so it can't
|
// The chat box has been destroyed so it can't
|
||||||
// handle the channel any more.
|
// handle the channel any more.
|
||||||
this._channel.close_async((channel, result) => {
|
this._channel.close_async();
|
||||||
channel.close_finish(result);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// Don't indicate any unread messages when the notification
|
// Don't indicate any unread messages when the notification
|
||||||
// that represents them has been destroyed.
|
// that represents them has been destroyed.
|
||||||
@@ -541,7 +565,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 +591,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,9 +610,7 @@ class ChatSource extends MessageTray.Source {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let msg = Tp.ClientMessage.new_text(type, text);
|
let msg = Tp.ClientMessage.new_text(type, text);
|
||||||
this._channel.send_message_async(msg, 0, (src, result) => {
|
this._channel.send_message_async(msg, 0);
|
||||||
this._channel.send_message_finish(result);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setChatState(state) {
|
setChatState(state) {
|
||||||
@@ -630,11 +654,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 +767,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();
|
||||||
|
@@ -180,14 +180,27 @@ 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 utcOffset = this._getTimeAtLocation(l).get_utc_offset();
|
||||||
let offset = (otherOffset - localOffset) / GLib.TIME_SPAN_HOUR;
|
const offsetCurrentTz = utcOffset - localOffset;
|
||||||
let fmt = Math.trunc(offset) == offset ? '%s%.0f' : '%s%.1f';
|
const offsetHours = Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR;
|
||||||
let prefix = offset >= 0 ? '+' : '-';
|
const offsetMinutes =
|
||||||
let tz = new St.Label({ style_class: 'world-clocks-timezone',
|
(Math.abs(offsetCurrentTz) % GLib.TIME_SPAN_HOUR) /
|
||||||
text: fmt.format(prefix, Math.abs(offset)),
|
GLib.TIME_SPAN_MINUTE;
|
||||||
x_align: Clutter.ActorAlign.END,
|
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
const prefix = offsetCurrentTz >= 0 ? '+' : '-';
|
||||||
|
const text = offsetMinutes === 0
|
||||||
|
? '%s%d'.format(prefix, offsetHours)
|
||||||
|
: '%s%d\u2236%d'.format(prefix, offsetHours, offsetMinutes);
|
||||||
|
|
||||||
|
const tz = new St.Label({
|
||||||
|
style_class: 'world-clocks-timezone',
|
||||||
|
text,
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
|
|
||||||
|
time.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
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);
|
||||||
@@ -384,6 +397,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 +419,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…"));
|
||||||
@@ -454,6 +476,8 @@ class MessagesIndicator extends St.Icon {
|
|||||||
let sources = Main.messageTray.getSources();
|
let sources = Main.messageTray.getSources();
|
||||||
sources.forEach(source => this._onSourceAdded(null, source));
|
sources.forEach(source => this._onSourceAdded(null, source));
|
||||||
|
|
||||||
|
this._sync();
|
||||||
|
|
||||||
this.connect('destroy', () => {
|
this.connect('destroy', () => {
|
||||||
this._settings.run_dispose();
|
this._settings.run_dispose();
|
||||||
this._settings = null;
|
this._settings = null;
|
||||||
@@ -488,26 +512,6 @@ class MessagesIndicator extends St.Icon {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var IndicatorPad = GObject.registerClass(
|
|
||||||
class IndicatorPad extends St.Widget {
|
|
||||||
_init(actor) {
|
|
||||||
this._source = actor;
|
|
||||||
this._source.connect('notify::size', () => this.queue_relayout());
|
|
||||||
super._init();
|
|
||||||
this._source.bind_property('visible',
|
|
||||||
this, 'visible',
|
|
||||||
GObject.BindingFlags.SYNC_CREATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
vfunc_get_preferred_width(forHeight) {
|
|
||||||
return this._source.get_preferred_width(forHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
vfunc_get_preferred_height(forWidth) {
|
|
||||||
return this._source.get_preferred_height(forWidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var FreezableBinLayout = GObject.registerClass(
|
var FreezableBinLayout = GObject.registerClass(
|
||||||
class FreezableBinLayout extends Clutter.BinLayout {
|
class FreezableBinLayout extends Clutter.BinLayout {
|
||||||
_init() {
|
_init() {
|
||||||
@@ -568,16 +572,24 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
let hbox;
|
let hbox;
|
||||||
let vbox;
|
let vbox;
|
||||||
|
|
||||||
let menuAlignment = 0.5;
|
super._init(0.5);
|
||||||
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
|
||||||
menuAlignment = 1.0 - menuAlignment;
|
this._clockDisplay = new St.Label({ style_class: 'clock' });
|
||||||
super._init(menuAlignment);
|
this._clockDisplay.clutter_text.y_align = Clutter.ActorAlign.CENTER;
|
||||||
|
|
||||||
this._clockDisplay = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
|
|
||||||
this._indicator = new MessagesIndicator();
|
this._indicator = new MessagesIndicator();
|
||||||
|
|
||||||
|
const indicatorPad = new St.Widget();
|
||||||
|
this._indicator.bind_property('visible',
|
||||||
|
indicatorPad, 'visible',
|
||||||
|
GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
indicatorPad.add_constraint(new Clutter.BindConstraint({
|
||||||
|
source: this._indicator,
|
||||||
|
coordinate: Clutter.BindCoordinate.SIZE,
|
||||||
|
}));
|
||||||
|
|
||||||
let box = new St.BoxLayout({ style_class: 'clock-display-box' });
|
let box = new St.BoxLayout({ style_class: 'clock-display-box' });
|
||||||
box.add_actor(new IndicatorPad(this._indicator));
|
box.add_actor(indicatorPad);
|
||||||
box.add_actor(this._clockDisplay);
|
box.add_actor(this._clockDisplay);
|
||||||
box.add_actor(this._indicator);
|
box.add_actor(this._indicator);
|
||||||
|
|
||||||
@@ -630,7 +642,7 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade',
|
this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
overlay_scrollbars: true });
|
overlay_scrollbars: true });
|
||||||
this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL);
|
||||||
vbox.add_actor(this._displaysSection);
|
vbox.add_actor(this._displaysSection);
|
||||||
|
|
||||||
let displaysBox = new St.BoxLayout({ vertical: true,
|
let displaysBox = new St.BoxLayout({ vertical: true,
|
||||||
|
@@ -58,10 +58,16 @@ class Dialog extends St.Widget {
|
|||||||
this._dialog.add_child(this.buttonLayout);
|
this._dialog.add_child(this.buttonLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
makeInactive() {
|
||||||
if (this._eventId != 0)
|
if (this._eventId != 0)
|
||||||
this._parentActor.disconnect(this._eventId);
|
this._parentActor.disconnect(this._eventId);
|
||||||
this._eventId = 0;
|
this._eventId = 0;
|
||||||
|
|
||||||
|
this.buttonLayout.get_children().forEach(c => c.set_reactive(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
_onDestroy() {
|
||||||
|
this.makeInactive();
|
||||||
}
|
}
|
||||||
|
|
||||||
_modalEventHandler(actor, event) {
|
_modalEventHandler(actor, event) {
|
||||||
|
@@ -278,7 +278,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
|
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPkOfflineProxyCreated(proxy, error) {
|
async _onPkOfflineProxyCreated(proxy, error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
log(error.message);
|
log(error.message);
|
||||||
return;
|
return;
|
||||||
@@ -293,15 +293,12 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// It only makes sense to check for this permission if PackageKit is available.
|
// It only makes sense to check for this permission if PackageKit is available.
|
||||||
Polkit.Permission.new(
|
try {
|
||||||
'org.freedesktop.packagekit.trigger-offline-update', null, null,
|
this._updatesPermission = await Polkit.Permission.new(
|
||||||
(source, res) => {
|
'org.freedesktop.packagekit.trigger-offline-update', null, null);
|
||||||
try {
|
} catch (e) {
|
||||||
this._updatesPermission = Polkit.Permission.new_finish(res);
|
log('No permission to trigger offline updates: %s'.format(e.toString()));
|
||||||
} catch (e) {
|
}
|
||||||
log('No permission to trigger offline updates: %s'.format(e.toString()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDestroy() {
|
_onDestroy() {
|
||||||
@@ -346,10 +343,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 +603,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,14 +671,13 @@ 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 || '');
|
||||||
this._checkBox.visible = dialogContent.checkBoxText && updatePrepared && updatesAllowed;
|
this._checkBox.visible = dialogContent.checkBoxText && updatePrepared && updatesAllowed;
|
||||||
this._checkBox.checked = updatePrepared && updateTriggered;
|
this._checkBox.checked = this._checkBox.visible;
|
||||||
|
|
||||||
// We show the warning either together with the checkbox, or when
|
// We show the warning either together with the checkbox, or when
|
||||||
// updates have already been triggered, but the user doesn't have
|
// updates have already been triggered, but the user doesn't have
|
||||||
|
@@ -10,8 +10,22 @@ 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, Polkit, Shell, St } = imports.gi;
|
||||||
const Gettext = imports.gettext;
|
const Gettext = imports.gettext;
|
||||||
|
const System = imports.system;
|
||||||
|
|
||||||
|
Gio._promisify(Gio.DataInputStream.prototype, 'fill_async', 'fill_finish');
|
||||||
|
Gio._promisify(Gio.DataInputStream.prototype,
|
||||||
|
'read_line_async', 'read_line_finish');
|
||||||
|
Gio._promisify(Gio.DBus, 'get', 'get_finish');
|
||||||
|
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
||||||
|
Gio._promisify(Gio.DBusProxy, 'new', 'new_finish');
|
||||||
|
Gio._promisify(Gio.DBusProxy.prototype, 'init_async', 'init_finish');
|
||||||
|
Gio._promisify(Gio.DBusProxy.prototype,
|
||||||
|
'call_with_unix_fd_list', 'call_with_unix_fd_list_finish');
|
||||||
|
Gio._promisify(Polkit.Permission, 'new', 'new_finish');
|
||||||
|
|
||||||
|
let _localTimeZone = null;
|
||||||
|
|
||||||
// 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
|
||||||
@@ -111,6 +125,11 @@ function _easeActor(actor, params) {
|
|||||||
autoReverse = params.autoReverse;
|
autoReverse = params.autoReverse;
|
||||||
delete params.autoReverse;
|
delete params.autoReverse;
|
||||||
|
|
||||||
|
// repeatCount doesn't include the initial iteration
|
||||||
|
const numIterations = repeatCount + 1;
|
||||||
|
// whether the transition should finish where it started
|
||||||
|
const isReversed = autoReverse && numIterations % 2 === 0;
|
||||||
|
|
||||||
if (params.mode != undefined)
|
if (params.mode != undefined)
|
||||||
actor.set_easing_mode(params.mode);
|
actor.set_easing_mode(params.mode);
|
||||||
delete params.mode;
|
delete params.mode;
|
||||||
@@ -122,7 +141,8 @@ function _easeActor(actor, params) {
|
|||||||
let animatedProps = Object.keys(params).map(p => p.replace('_', '-', 'g'));
|
let animatedProps = Object.keys(params).map(p => p.replace('_', '-', 'g'));
|
||||||
animatedProps.forEach(p => actor.remove_transition(p));
|
animatedProps.forEach(p => actor.remove_transition(p));
|
||||||
|
|
||||||
actor.set(params);
|
if (actor.get_easing_duration() > 0 || !isReversed)
|
||||||
|
actor.set(params);
|
||||||
actor.restore_easing_state();
|
actor.restore_easing_state();
|
||||||
|
|
||||||
let transition = animatedProps.map(p => actor.get_transition(p))
|
let transition = animatedProps.map(p => actor.get_transition(p))
|
||||||
@@ -161,6 +181,11 @@ function _easeActorProperty(actor, propName, target, params) {
|
|||||||
autoReverse = params.autoReverse;
|
autoReverse = params.autoReverse;
|
||||||
delete params.autoReverse;
|
delete params.autoReverse;
|
||||||
|
|
||||||
|
// repeatCount doesn't include the initial iteration
|
||||||
|
const numIterations = repeatCount + 1;
|
||||||
|
// whether the transition should finish where it started
|
||||||
|
const isReversed = autoReverse && numIterations % 2 === 0;
|
||||||
|
|
||||||
// Copy Clutter's behavior for implicit animations, see
|
// Copy Clutter's behavior for implicit animations, see
|
||||||
// should_skip_implicit_transition()
|
// should_skip_implicit_transition()
|
||||||
if (actor instanceof Clutter.Actor && !actor.mapped)
|
if (actor instanceof Clutter.Actor && !actor.mapped)
|
||||||
@@ -174,7 +199,9 @@ function _easeActorProperty(actor, propName, target, params) {
|
|||||||
|
|
||||||
if (duration == 0) {
|
if (duration == 0) {
|
||||||
let [obj, prop] = _getPropertyTarget(actor, propName);
|
let [obj, prop] = _getPropertyTarget(actor, propName);
|
||||||
obj[prop] = target;
|
|
||||||
|
if (!isReversed)
|
||||||
|
obj[prop] = target;
|
||||||
|
|
||||||
Meta.disable_unredirect_for_display(global.display);
|
Meta.disable_unredirect_for_display(global.display);
|
||||||
callback(true);
|
callback(true);
|
||||||
@@ -272,6 +299,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}`);
|
||||||
@@ -291,9 +325,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);
|
||||||
@@ -127,6 +142,9 @@ function checkForUpdates() {
|
|||||||
metadatas[uuid] = extension.metadata;
|
metadatas[uuid] = extension.metadata;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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 +162,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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -60,6 +60,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);
|
||||||
}
|
}
|
||||||
@@ -210,6 +215,24 @@ var ExtensionManager = class {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openExtensionPrefs(uuid, parentWindow, options) {
|
||||||
|
const extension = this.lookup(uuid);
|
||||||
|
if (!extension || !extension.hasPrefs)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Gio.DBus.session.call(
|
||||||
|
'org.gnome.Shell.Extensions',
|
||||||
|
'/org/gnome/Shell/Extensions',
|
||||||
|
'org.gnome.Shell.Extensions',
|
||||||
|
'OpenExtensionPrefs',
|
||||||
|
new GLib.Variant('(ssa{sv})', [uuid, parentWindow, options]),
|
||||||
|
null,
|
||||||
|
Gio.DBusCallFlags.NONE,
|
||||||
|
-1,
|
||||||
|
null);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
notifyExtensionUpdate(uuid) {
|
notifyExtensionUpdate(uuid) {
|
||||||
let extension = this.lookup(uuid);
|
let extension = this.lookup(uuid);
|
||||||
if (!extension)
|
if (!extension)
|
||||||
@@ -481,6 +504,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 +515,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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -114,8 +114,11 @@ class BaseIcon extends St.Bin {
|
|||||||
if (this._setSizeManually) {
|
if (this._setSizeManually) {
|
||||||
size = this.iconSize;
|
size = this.iconSize;
|
||||||
} else {
|
} else {
|
||||||
|
const { scaleFactor } =
|
||||||
|
St.ThemeContext.get_for_stage(global.stage);
|
||||||
|
|
||||||
let [found, len] = node.lookup_length('icon-size', false);
|
let [found, len] = node.lookup_length('icon-size', false);
|
||||||
size = found ? len : ICON_SIZE;
|
size = found ? len / scaleFactor : ICON_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.iconSize == size && this._iconBin.child)
|
if (this.iconSize == size && this._iconBin.child)
|
||||||
@@ -556,15 +559,25 @@ var IconGrid = GObject.registerClass({
|
|||||||
}, Infinity);
|
}, Infinity);
|
||||||
let normalization = maxDist - minDist;
|
let normalization = maxDist - minDist;
|
||||||
|
|
||||||
for (let index = 0; index < actors.length; index++) {
|
actors.forEach(actor => {
|
||||||
let actor = actors[index];
|
let clone = new Clutter.Clone({ source: actor });
|
||||||
|
this._clonesAnimating.push(clone);
|
||||||
|
Main.uiGroup.add_actor(clone);
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ^
|
||||||
|
* | These need to be separate loops because Main.uiGroup.add_actor
|
||||||
|
* | is excessively slow if done inside the below loop and we want the
|
||||||
|
* | below loop to complete within one frame interval (#2065, !1002).
|
||||||
|
* v
|
||||||
|
*/
|
||||||
|
|
||||||
|
this._clonesAnimating.forEach(actorClone => {
|
||||||
|
let actor = actorClone.source;
|
||||||
actor.opacity = 0;
|
actor.opacity = 0;
|
||||||
actor.reactive = false;
|
actor.reactive = false;
|
||||||
|
|
||||||
let actorClone = new Clutter.Clone({ source: actor });
|
|
||||||
this._clonesAnimating.push(actorClone);
|
|
||||||
Main.uiGroup.add_actor(actorClone);
|
|
||||||
|
|
||||||
let [width, height] = this._getAllocatedChildSizeAndSpacing(actor);
|
let [width, height] = this._getAllocatedChildSizeAndSpacing(actor);
|
||||||
actorClone.set_size(width, height);
|
actorClone.set_size(width, height);
|
||||||
let scaleX = sourceScaledWidth / width;
|
let scaleX = sourceScaledWidth / width;
|
||||||
@@ -631,7 +644,7 @@ var IconGrid = GObject.registerClass({
|
|||||||
|
|
||||||
actorClone.ease(movementParams);
|
actorClone.ease(movementParams);
|
||||||
actorClone.ease(fadeParams);
|
actorClone.ease(fadeParams);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_getAllocatedChildSizeAndSpacing(child) {
|
_getAllocatedChildSizeAndSpacing(child) {
|
||||||
|
@@ -24,29 +24,29 @@ const SHOW_KEYBOARD = 'screen-keyboard-enabled';
|
|||||||
const KEY_SIZE = 2;
|
const KEY_SIZE = 2;
|
||||||
|
|
||||||
const defaultKeysPre = [
|
const defaultKeysPre = [
|
||||||
[[], [], [{ width: 1.5, level: 1, extraClassName: 'shift-key-lowercase' }], [{ label: '?123', width: 1.5, level: 2 }]],
|
[[], [], [{ width: 1.5, level: 1, extraClassName: 'shift-key-lowercase', icon: 'keyboard-shift-filled-symbolic' }], [{ label: '?123', width: 1.5, level: 2 }]],
|
||||||
[[], [], [{ width: 1.5, level: 0, extraClassName: 'shift-key-uppercase' }], [{ label: '?123', width: 1.5, level: 2 }]],
|
[[], [], [{ width: 1.5, level: 0, extraClassName: 'shift-key-uppercase', icon: 'keyboard-shift-filled-symbolic' }], [{ label: '?123', width: 1.5, level: 2 }]],
|
||||||
[[], [], [{ label: '=/<', width: 1.5, level: 3 }], [{ label: 'ABC', width: 1.5, level: 0 }]],
|
[[], [], [{ label: '=/<', width: 1.5, level: 3 }], [{ label: 'ABC', width: 1.5, level: 0 }]],
|
||||||
[[], [], [{ label: '?123', width: 1.5, level: 2 }], [{ label: 'ABC', width: 1.5, level: 0 }]],
|
[[], [], [{ label: '?123', width: 1.5, level: 2 }], [{ label: 'ABC', width: 1.5, level: 0 }]],
|
||||||
];
|
];
|
||||||
|
|
||||||
const defaultKeysPost = [
|
const defaultKeysPost = [
|
||||||
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
|
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
||||||
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
|
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
|
||||||
[{ width: 3, level: 1, right: true, extraClassName: 'shift-key-lowercase' }],
|
[{ width: 3, level: 1, right: true, extraClassName: 'shift-key-lowercase', icon: 'keyboard-shift-filled-symbolic' }],
|
||||||
[{ label: '☻', action: 'emoji' }, { 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' }]],
|
||||||
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
|
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
||||||
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
|
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
|
||||||
[{ width: 3, level: 0, right: true, extraClassName: 'shift-key-uppercase' }],
|
[{ width: 3, level: 0, right: true, extraClassName: 'shift-key-uppercase', icon: 'keyboard-shift-filled-symbolic' }],
|
||||||
[{ label: '☻', action: 'emoji' }, { 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' }]],
|
||||||
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
|
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
||||||
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
|
[{ 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 }],
|
||||||
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
|
[{ action: 'emoji', icon: 'face-smile-symbolic' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
|
||||||
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
|
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
|
||||||
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
|
[{ 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 }],
|
||||||
[{ label: '☻', action: 'emoji' }, { 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' }]],
|
||||||
];
|
];
|
||||||
|
|
||||||
var AspectContainer = GObject.registerClass(
|
var AspectContainer = GObject.registerClass(
|
||||||
@@ -257,11 +257,11 @@ var Key = GObject.registerClass({
|
|||||||
'released': { param_types: [GObject.TYPE_UINT, GObject.TYPE_STRING] },
|
'released': { param_types: [GObject.TYPE_UINT, GObject.TYPE_STRING] },
|
||||||
},
|
},
|
||||||
}, class Key extends St.BoxLayout {
|
}, class Key extends St.BoxLayout {
|
||||||
_init(key, extendedKeys) {
|
_init(key, extendedKeys, icon = null) {
|
||||||
super._init({ style_class: 'key-container' });
|
super._init({ style_class: 'key-container' });
|
||||||
|
|
||||||
this.key = key || "";
|
this.key = key || "";
|
||||||
this.keyButton = this._makeKey(this.key);
|
this.keyButton = this._makeKey(this.key, icon);
|
||||||
|
|
||||||
/* Add the key in a container, so keys can be padded without losing
|
/* Add the key in a container, so keys can be padded without losing
|
||||||
* logical proportions between those.
|
* logical proportions between those.
|
||||||
@@ -404,14 +404,21 @@ var Key = GObject.registerClass({
|
|||||||
this._capturedPress = false;
|
this._capturedPress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_makeKey(key) {
|
_makeKey(key, icon) {
|
||||||
let label = GLib.markup_escape_text(key, -1);
|
|
||||||
let button = new St.Button({
|
let button = new St.Button({
|
||||||
label,
|
|
||||||
style_class: 'keyboard-key',
|
style_class: 'keyboard-key',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (icon) {
|
||||||
|
let child = new St.Icon({ icon_name: icon });
|
||||||
|
button.set_child(child);
|
||||||
|
this._icon = child;
|
||||||
|
} else {
|
||||||
|
let label = GLib.markup_escape_text(key, -1);
|
||||||
|
button.set_label(label);
|
||||||
|
}
|
||||||
|
|
||||||
button.keyWidth = 1;
|
button.keyWidth = 1;
|
||||||
button.connect('button-press-event', () => {
|
button.connect('button-press-event', () => {
|
||||||
this._press(key);
|
this._press(key);
|
||||||
@@ -475,17 +482,23 @@ var Key = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
setLatched(latched) {
|
setLatched(latched) {
|
||||||
if (latched)
|
if (!this._icon)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (latched) {
|
||||||
this.keyButton.add_style_pseudo_class('latched');
|
this.keyButton.add_style_pseudo_class('latched');
|
||||||
else
|
this._icon.icon_name = 'keyboard-caps-lock-filled-symbolic';
|
||||||
|
} else {
|
||||||
this.keyButton.remove_style_pseudo_class('latched');
|
this.keyButton.remove_style_pseudo_class('latched');
|
||||||
|
this._icon.icon_name = 'keyboard-shift-filled-symbolic';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
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');
|
||||||
|
|
||||||
@@ -1022,7 +1035,7 @@ var EmojiSelection = GObject.registerClass({
|
|||||||
section.button = key;
|
section.button = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
key = new Key(null, []);
|
key = new Key(null, [], 'go-down-symbolic');
|
||||||
key.keyButton.add_style_class_name('default-key');
|
key.keyButton.add_style_class_name('default-key');
|
||||||
key.keyButton.add_style_class_name('hide-key');
|
key.keyButton.add_style_class_name('hide-key');
|
||||||
key.connect('released', () => {
|
key.connect('released', () => {
|
||||||
@@ -1107,10 +1120,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();
|
||||||
}
|
}
|
||||||
@@ -1135,9 +1149,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1255,11 +1269,7 @@ class Keyboard extends St.BoxLayout {
|
|||||||
|
|
||||||
this._clearShowIdle();
|
this._clearShowIdle();
|
||||||
|
|
||||||
this._keyboardController = null;
|
this._keyboardController.destroy();
|
||||||
this._suggestions = null;
|
|
||||||
this._aspectContainer = null;
|
|
||||||
this._emojiSelection = null;
|
|
||||||
this._keypad = null;
|
|
||||||
|
|
||||||
Main.layoutManager.untrackChrome(this);
|
Main.layoutManager.untrackChrome(this);
|
||||||
Main.layoutManager.keyboardBox.remove_actor(this);
|
Main.layoutManager.keyboardBox.remove_actor(this);
|
||||||
@@ -1439,12 +1449,13 @@ class Keyboard extends St.BoxLayout {
|
|||||||
let keyval = key.keyval;
|
let keyval = key.keyval;
|
||||||
let switchToLevel = key.level;
|
let switchToLevel = key.level;
|
||||||
let action = key.action;
|
let action = key.action;
|
||||||
|
let icon = key.icon;
|
||||||
|
|
||||||
/* Skip emoji button if necessary */
|
/* Skip emoji button if necessary */
|
||||||
if (!this._emojiKeyVisible && action == 'emoji')
|
if (!this._emojiKeyVisible && action == 'emoji')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
extraButton = new Key(key.label || '', []);
|
extraButton = new Key(key.label || '', [], icon);
|
||||||
|
|
||||||
extraButton.keyButton.add_style_class_name('default-key');
|
extraButton.keyButton.add_style_class_name('default-key');
|
||||||
if (key.extraClassName != null)
|
if (key.extraClassName != null)
|
||||||
@@ -1844,13 +1855,24 @@ var KeyboardController = class {
|
|||||||
this._onSourcesModified.bind(this));
|
this._onSourcesModified.bind(this));
|
||||||
this._currentSource = this._inputSourceManager.currentSource;
|
this._currentSource = this._inputSourceManager.currentSource;
|
||||||
|
|
||||||
Main.inputMethod.connect('notify::content-purpose',
|
this._notifyContentPurposeId = Main.inputMethod.connect(
|
||||||
this._onContentPurposeHintsChanged.bind(this));
|
'notify::content-purpose', this._onContentPurposeHintsChanged.bind(this));
|
||||||
Main.inputMethod.connect('notify::content-hints',
|
this._notifyContentHintsId = Main.inputMethod.connect(
|
||||||
this._onContentPurposeHintsChanged.bind(this));
|
'notify::content-hints', this._onContentPurposeHintsChanged.bind(this));
|
||||||
Main.inputMethod.connect('input-panel-state', (o, state) => {
|
this._notifyInputPanelStateId = Main.inputMethod.connect(
|
||||||
this.emit('panel-state', state);
|
'input-panel-state', (o, state) => this.emit('panel-state', state));
|
||||||
});
|
}
|
||||||
|
|
||||||
|
destroy() {
|
||||||
|
this._inputSourceManager.disconnect(this._sourceChangedId);
|
||||||
|
this._inputSourceManager.disconnect(this._sourcesModifiedId);
|
||||||
|
Main.inputMethod.disconnect(this._notifyContentPurposeId);
|
||||||
|
Main.inputMethod.disconnect(this._notifyContentHintsId);
|
||||||
|
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() {
|
||||||
|
@@ -612,10 +612,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');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -672,17 +682,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
|
|
||||||
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() {
|
||||||
@@ -738,7 +738,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
showKeyboard() {
|
showKeyboard() {
|
||||||
this.keyboardBox.show();
|
this.keyboardBox.show();
|
||||||
this.keyboardBox.ease({
|
this.keyboardBox.ease({
|
||||||
anchor_y: this.keyboardBox.height,
|
translation_y: -this.keyboardBox.height,
|
||||||
opacity: 255,
|
opacity: 255,
|
||||||
duration: KEYBOARD_ANIMATION_TIME,
|
duration: KEYBOARD_ANIMATION_TIME,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
@@ -755,7 +755,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
this._updateRegions();
|
this._updateRegions();
|
||||||
|
|
||||||
this._keyboardHeightNotifyId = this.keyboardBox.connect('notify::height', () => {
|
this._keyboardHeightNotifyId = this.keyboardBox.connect('notify::height', () => {
|
||||||
this.keyboardBox.anchor_y = this.keyboardBox.height;
|
this.keyboardBox.translation_y = -this.keyboardBox.height;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -765,7 +765,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
this._keyboardHeightNotifyId = 0;
|
this._keyboardHeightNotifyId = 0;
|
||||||
}
|
}
|
||||||
this.keyboardBox.ease({
|
this.keyboardBox.ease({
|
||||||
anchor_y: 0,
|
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,
|
||||||
|
@@ -244,6 +244,12 @@ function objectToString(o) {
|
|||||||
// special case this since the default is way, way too verbose
|
// special case this since the default is way, way too verbose
|
||||||
return '<js function>';
|
return '<js function>';
|
||||||
} else {
|
} else {
|
||||||
|
if (o === undefined)
|
||||||
|
return 'undefined';
|
||||||
|
|
||||||
|
if (o === null)
|
||||||
|
return 'null';
|
||||||
|
|
||||||
return o.toString();
|
return o.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1121,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() {
|
||||||
|
@@ -127,6 +127,10 @@ var Magnifier = class Magnifier {
|
|||||||
* Show the system mouse pointer.
|
* Show the system mouse pointer.
|
||||||
*/
|
*/
|
||||||
showSystemCursor() {
|
showSystemCursor() {
|
||||||
|
const seat = Clutter.get_default_backend().get_default_seat();
|
||||||
|
|
||||||
|
if (seat.is_unfocus_inhibited())
|
||||||
|
seat.uninhibit_unfocus();
|
||||||
this._cursorTracker.set_pointer_visible(true);
|
this._cursorTracker.set_pointer_visible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,6 +139,10 @@ var Magnifier = class Magnifier {
|
|||||||
* Hide the system mouse pointer.
|
* Hide the system mouse pointer.
|
||||||
*/
|
*/
|
||||||
hideSystemCursor() {
|
hideSystemCursor() {
|
||||||
|
const seat = Clutter.get_default_backend().get_default_seat();
|
||||||
|
|
||||||
|
if (!seat.is_unfocus_inhibited())
|
||||||
|
seat.inhibit_unfocus();
|
||||||
this._cursorTracker.set_pointer_visible(false);
|
this._cursorTracker.set_pointer_visible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +177,7 @@ var Magnifier = class Magnifier {
|
|||||||
// Make sure system mouse pointer is shown when all zoom regions are
|
// Make sure system mouse pointer is shown when all zoom regions are
|
||||||
// invisible.
|
// invisible.
|
||||||
if (!activate)
|
if (!activate)
|
||||||
this._cursorTracker.set_pointer_visible(true);
|
this.showSystemCursor();
|
||||||
|
|
||||||
// Notify interested parties of this change
|
// Notify interested parties of this change
|
||||||
this.emit('active-changed', activate);
|
this.emit('active-changed', activate);
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +171,8 @@ function _initializeUI() {
|
|||||||
_loadOskLayouts();
|
_loadOskLayouts();
|
||||||
_loadDefaultStylesheet();
|
_loadDefaultStylesheet();
|
||||||
|
|
||||||
|
new AnimationsSettings();
|
||||||
|
|
||||||
// Setup the stage hierarchy early
|
// Setup the stage hierarchy early
|
||||||
layoutManager = new Layout.LayoutManager();
|
layoutManager = new Layout.LayoutManager();
|
||||||
|
|
||||||
@@ -269,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();
|
||||||
|
|
||||||
@@ -286,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;
|
||||||
|
|
||||||
@@ -359,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -758,3 +794,46 @@ function showRestartMessage(message) {
|
|||||||
let restartMessage = new RestartMessage(message);
|
let restartMessage = new RestartMessage(message);
|
||||||
restartMessage.open();
|
restartMessage.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var AnimationsSettings = class {
|
||||||
|
constructor() {
|
||||||
|
let backend = Meta.get_backend();
|
||||||
|
if (!backend.is_rendering_hardware_accelerated()) {
|
||||||
|
St.Settings.get().inhibit_animations();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let isXvnc = Shell.util_has_x11_display_extension(
|
||||||
|
global.display, 'VNC-EXTENSION');
|
||||||
|
if (isXvnc) {
|
||||||
|
St.Settings.get().inhibit_animations();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let remoteAccessController = backend.get_remote_access_controller();
|
||||||
|
if (!remoteAccessController)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._handles = new Set();
|
||||||
|
remoteAccessController.connect('new-handle',
|
||||||
|
(_, handle) => this._onNewRemoteAccessHandle(handle));
|
||||||
|
}
|
||||||
|
|
||||||
|
_onRemoteAccessHandleStopped(handle) {
|
||||||
|
let settings = St.Settings.get();
|
||||||
|
|
||||||
|
settings.uninhibit_animations();
|
||||||
|
this._handles.delete(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onNewRemoteAccessHandle(handle) {
|
||||||
|
if (!handle.get_disable_animations())
|
||||||
|
return;
|
||||||
|
|
||||||
|
let settings = St.Settings.get();
|
||||||
|
|
||||||
|
settings.inhibit_animations();
|
||||||
|
this._handles.add(handle);
|
||||||
|
handle.connect('stopped', this._onRemoteAccessHandleStopped.bind(this));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -762,12 +762,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 +878,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 +886,7 @@ var Source = GObject.registerClass({
|
|||||||
|
|
||||||
this.emit('destroy', reason);
|
this.emit('destroy', reason);
|
||||||
|
|
||||||
|
this.policy.destroy();
|
||||||
this.run_dispose();
|
this.run_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -251,6 +251,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;
|
||||||
|
@@ -416,11 +416,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.app = this._getApp(appId);
|
this.app = this._getApp(appId);
|
||||||
|
|
||||||
|
super._init(title);
|
||||||
|
|
||||||
this.initialTitle = title;
|
this.initialTitle = title;
|
||||||
|
|
||||||
if (this.app)
|
if (this.app)
|
||||||
@@ -631,12 +631,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;
|
||||||
}
|
}
|
||||||
|
@@ -270,7 +270,11 @@ var Overview = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_sessionUpdated() {
|
_sessionUpdated() {
|
||||||
this.isDummy = !Main.sessionMode.hasOverview;
|
const { hasOverview } = Main.sessionMode;
|
||||||
|
if (!hasOverview)
|
||||||
|
this.hide();
|
||||||
|
|
||||||
|
this.isDummy = !hasOverview;
|
||||||
this._createOverview();
|
this._createOverview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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' });
|
||||||
|
@@ -90,18 +90,16 @@ class AppMenu extends PopupMenu.PopupMenu {
|
|||||||
|
|
||||||
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
|
|
||||||
this._detailsItem = this.addAction(_("Show Details"), () => {
|
this._detailsItem = this.addAction(_('Show Details'), async () => {
|
||||||
let id = this._app.get_id();
|
let id = this._app.get_id();
|
||||||
let args = GLib.Variant.new('(ss)', [id, '']);
|
let args = GLib.Variant.new('(ss)', [id, '']);
|
||||||
Gio.DBus.get(Gio.BusType.SESSION, null, (o, res) => {
|
const bus = await Gio.DBus.get(Gio.BusType.SESSION, null);
|
||||||
let bus = Gio.DBus.get_finish(res);
|
bus.call(
|
||||||
bus.call('org.gnome.Software',
|
'org.gnome.Software',
|
||||||
'/org/gnome/Software',
|
'/org/gnome/Software',
|
||||||
'org.gtk.Actions', 'Activate',
|
'org.gtk.Actions', 'Activate',
|
||||||
GLib.Variant.new('(sava{sv})',
|
new GLib.Variant('(sava{sv})', ['details', [args], null]),
|
||||||
['details', [args], null]),
|
null, 0, -1, null);
|
||||||
null, 0, -1, null, null);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
@@ -533,6 +531,9 @@ class PanelCorner extends St.DrawingArea {
|
|||||||
if (index < 0)
|
if (index < 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if (!(children[index] instanceof St.Widget))
|
||||||
|
return null;
|
||||||
|
|
||||||
if (!children[index].has_style_class_name('panel-menu') &&
|
if (!children[index].has_style_class_name('panel-menu') &&
|
||||||
!children[index].has_style_class_name('panel-button'))
|
!children[index].has_style_class_name('panel-button'))
|
||||||
return this._findRightmostButton(children[index]);
|
return this._findRightmostButton(children[index]);
|
||||||
@@ -558,6 +559,9 @@ class PanelCorner extends St.DrawingArea {
|
|||||||
if (index == children.length)
|
if (index == children.length)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if (!(children[index] instanceof St.Widget))
|
||||||
|
return null;
|
||||||
|
|
||||||
if (!children[index].has_style_class_name('panel-menu') &&
|
if (!children[index].has_style_class_name('panel-menu') &&
|
||||||
!children[index].has_style_class_name('panel-button'))
|
!children[index].has_style_class_name('panel-button'))
|
||||||
return this._findLeftmostButton(children[index]);
|
return this._findLeftmostButton(children[index]);
|
||||||
@@ -958,7 +962,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) {
|
||||||
|
@@ -204,7 +204,7 @@ var RemoteSearchProvider = class {
|
|||||||
g_interface_info: proxyInfo,
|
g_interface_info: proxyInfo,
|
||||||
g_interface_name: proxyInfo.name,
|
g_interface_name: proxyInfo.name,
|
||||||
gFlags });
|
gFlags });
|
||||||
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null, null);
|
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
|
|
||||||
this.appInfo = appInfo;
|
this.appInfo = appInfo;
|
||||||
this.id = appInfo.get_id();
|
this.id = appInfo.get_id();
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|