Skip to content

Commit 98002d2

Browse files
committed
v91: Support for GNOME 48
Signed-off-by: Hollow Man <hollowman@opensuse.org>
1 parent 41a1530 commit 98002d2

File tree

17 files changed

+1967
-1980
lines changed

17 files changed

+1967
-1980
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run pre-commit
1+
npm test

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ When only the light background or dark background is turned on, the extension wi
281281
- [x] V88: Have support for GNOME 45 (No support for any previous GNOME version now).
282282
- [x] V89: Have support for GNOME 46 (No support for GNOME version 45 now).
283283
- [x] V90: Have support for GNOME 47.
284+
- [x] V91: Have support for GNOME 48.
284285

285-
Tested on Fedora, OpenSUSE, Manjaro, Ubuntu and FreeBSD, GNOME-shell [3.38](../../tree/3.38)(v3, v5, v9, v11, v14, v15, v17, v19, v21, v23, v25, v27, v29, v31, v35, v37, v39, v41, v43, v45, v47, v49, v51, v53(merged into main in later version)), 40.0(v4, v8, v10, v12, v13, v16, v18, v20, v22, v24, v26, v28, v30, v32, v36, v38, v40, v42, v44, v46, v48, v50, v52, v54), 3.38 and 40(v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66), 3.34, 3.36, 3.38 and 40(v67, v68, v69, v70), 41(v72, v75, v76, v77, v78, v80), 42(v82), 43(v83, v84, v85), 44(v86), 45(v88), 46(v89), 47(v90).
286+
Tested on Fedora, OpenSUSE, Manjaro, Ubuntu and FreeBSD, GNOME-shell [3.38](../../tree/3.38)(v3, v5, v9, v11, v14, v15, v17, v19, v21, v23, v25, v27, v29, v31, v35, v37, v39, v41, v43, v45, v47, v49, v51, v53(merged into main in later version)), 40.0(v4, v8, v10, v12, v13, v16, v18, v20, v22, v24, v26, v28, v30, v32, v36, v38, v40, v42, v44, v46, v48, v50, v52, v54), 3.38 and 40(v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66), 3.34, 3.36, 3.38 and 40(v67, v68, v69, v70), 41(v72, v75, v76, v77, v78, v80), 42(v82), 43(v83, v84, v85), 44(v86), 45(v88), 46(v89), 47(v90), 48(v91).
286287

287288
## Acknowledgements
288289

README_CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ background-size: cover;
281281
- [x] V88: 支持 GNOME 45 (现无任何之前GNOME版本支持)。
282282
- [x] V89: 支持 GNOME 46 (无GNOME 45版本支持)。
283283
- [x] V90: 支持 GNOME 47。
284+
- [x] V91: 支持 GNOME 48。
284285

285-
在 Fedora,OpenSUSE,Manjaro,Ubuntu 和 FreeBSD,GNOME-shell [3.38](../../tree/3.38)(v3,v5,v9,v11,v14,v15,v17,v19,v21,v23,v25,v27,v29,v31,v35,v37,v39,v41,v43,v45,v47,v49,v51,v53(之后的合并进了主版本)),40.0(v4,v8,v10,v12,v13,v16,v18,v20,v22,v24,v26,v28,v30,v32,v36,v38,v40,v42,v44,v46,v48,v50,v52,v54),3.38 和 40(v55,v56,v57,v58,v59,v60,v61,v62,v63,v64,v65,v66),3.34,3.36,3.38 和 40(v67,v68,v69,v70),41(v72,v75,v76,v77,v78,v80),42(v82),43(v83,v84,v85),44(v86),45(v88),46(v89),47(v90)中通过了测试。
286+
在 Fedora,OpenSUSE,Manjaro,Ubuntu 和 FreeBSD,GNOME-shell [3.38](../../tree/3.38)(v3,v5,v9,v11,v14,v15,v17,v19,v21,v23,v25,v27,v29,v31,v35,v37,v39,v41,v43,v45,v47,v49,v51,v53(之后的合并进了主版本)),40.0(v4,v8,v10,v12,v13,v16,v18,v20,v22,v24,v26,v28,v30,v32,v36,v38,v40,v42,v44,v46,v48,v50,v52,v54),3.38 和 40(v55,v56,v57,v58,v59,v60,v61,v62,v63,v64,v65,v66),3.34,3.36,3.38 和 40(v67,v68,v69,v70),41(v72,v75,v76,v77,v78,v80),42(v82),43(v83,v84,v85),44(v86),45(v88),46(v89),47(v90),48(v91)中通过了测试。
286287

287288
## 致谢
288289

customize-ibus@hollowman.ml/extension.js

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,8 @@ const IBusClickSwitch = GObject.registerClass(
208208
Gio.SettingsBindFlags.GET
209209
);
210210
CandidatePopup.reactive = true;
211-
let deviceManager = null;
212-
if (Clutter.DeviceManager)
213-
deviceManager = Clutter.DeviceManager.get_default();
214-
else
215-
deviceManager =
216-
Clutter.get_default_backend().get_default_seat();
217-
this._virtualDevice = deviceManager.create_virtual_device(
211+
let seat = global.stage.context.get_backend().get_default_seat();
212+
this._virtualDevice = seat.create_virtual_device(
218213
Clutter.InputDeviceType.KEYBOARD_DEVICE
219214
);
220215

@@ -241,12 +236,12 @@ const IBusClickSwitch = GObject.registerClass(
241236
!this._mouseInCandidate || !this._clickSwitch;
242237
if (shouldPressReturn) {
243238
this._virtualDevice.notify_keyval(
244-
Clutter.get_current_event_time(),
239+
Clutter.get_current_event_time() * 1000,
245240
Clutter.KEY_Return,
246241
Clutter.KeyState.PRESSED
247242
);
248243
this._virtualDevice.notify_keyval(
249-
Clutter.get_current_event_time(),
244+
Clutter.get_current_event_time() * 1000,
250245
Clutter.KEY_Return,
251246
Clutter.KeyState.RELEASED
252247
);
@@ -299,6 +294,11 @@ const IBusClickSwitch = GObject.registerClass(
299294
GLib.source_remove(this._delayAfterPress);
300295
this._delayAfterPress = null;
301296
}
297+
if (this._virtualDevice) {
298+
// Make sure any buttons pressed by the virtual device are released
299+
// immediately instead of waiting for the next GC cycle
300+
this._virtualDevice.run_dispose();
301+
}
302302
delete this.candidateBoxesID;
303303
}
304304
}
@@ -597,6 +597,7 @@ const IBusAutoSwitch = GObject.registerClass(
597597
super();
598598
this._bindSettings();
599599
this._tmpWindow = null;
600+
this.last_null = false;
600601
this._overviewHiddenID = Main.overview.connect(
601602
'hidden',
602603
this._onWindowChanged.bind(this)
@@ -621,17 +622,23 @@ const IBusAutoSwitch = GObject.registerClass(
621622

622623
get _toggle() {
623624
let win = InputSourceManager._getCurrentWindow();
624-
if (!win) return false;
625-
625+
if (!win) {
626+
this.last_null = true;
627+
return false;
628+
}
629+
if (this.last_null) {
630+
this.last_null = false;
631+
return false;
632+
}
626633
let state = this._state;
627634
let stateConf = false;
628635
if (this._remember) {
629636
let store = this._states.get(this._tmpWindow);
630637
if (state !== store) this._states.set(this._tmpWindow, state);
631-
632638
this._tmpWindow = win.wm_class
633639
? win.wm_class.toLowerCase()
634-
: '';
640+
: 'undefined';
641+
if (this._tmpWindow === 'undefined') return false;
635642
if (!this._states.has(this._tmpWindow)) {
636643
let unknown =
637644
this.unknown === UNKNOWN.DEFAULT
@@ -841,6 +848,7 @@ const IBusFixIMEList = GObject.registerClass(
841848
InputSourceManager._switchInputSource = function (
842849
display,
843850
window,
851+
event,
844852
binding
845853
) {
846854
if (this._mruSources.length < 2) {
@@ -859,29 +867,30 @@ const IBusFixIMEList = GObject.registerClass(
859867
return;
860868
}
861869

862-
let popup = new InputSourcePopup(
870+
this._switcherPopup = new InputSourcePopup(
863871
this._mruSources,
864872
this._keybindingAction,
865873
this._keybindingActionBackward
866874
);
875+
this._switcherPopup.connect('destroy', () => {
876+
this._switcherPopup = null;
877+
});
867878
// By default InputSourcePopup starts at 0, this is ok for MRU.
868879
// But we need to set popup current index to current source.
869880
// I think it's OK to start from 0 if we don't have current source.
870881
if (this._currentSource !== null) {
871-
popup._selectedIndex = this._mruSources.indexOf(
872-
this._currentSource
873-
);
882+
this._switcherPopup._selectedIndex =
883+
this._mruSources.indexOf(this._currentSource);
874884
}
875885

876886
if (
877-
!popup.show(
887+
!this._switcherPopup.show(
878888
binding.is_reversed(),
879889
binding.get_name(),
880890
binding.get_mask()
881891
)
882-
) {
883-
popup.fadeAndDestroy();
884-
}
892+
)
893+
this._switcherPopup.fadeAndDestroy();
885894
};
886895

887896
// A dirty hack because iBus will set content type with a password entry,

customize-ibus@hollowman.ml/locale/customize-ibus.pot

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: Customize Ibus 90\n"
9+
"Project-Id-Version: Customize Ibus 91\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-09-11 00:01+0300\n"
11+
"POT-Creation-Date: 2025-03-04 22:27+0200\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,63 +17,63 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

20-
#: extension.js:1583
20+
#: extension.js:1592
2121
msgid "IBus panel service connected!"
2222
msgstr ""
2323

24-
#: extension.js:2198
24+
#: extension.js:2207
2525
msgid "loading light user theme for IBus:"
2626
msgstr ""
2727

28-
#: extension.js:2209
28+
#: extension.js:2218
2929
msgid "loading dark user theme for IBus:"
3030
msgstr ""
3131

32-
#: extension.js:2215
32+
#: extension.js:2224
3333
msgid "loading default theme for IBus"
3434
msgstr ""
3535

36-
#: extension.js:2433
36+
#: extension.js:2442
3737
msgid "loading background for IBus:"
3838
msgstr ""
3939

40-
#: extension.js:2446
40+
#: extension.js:2455
4141
msgid "remove custom background for IBus"
4242
msgstr ""
4343

44-
#: extension.js:3039
44+
#: extension.js:3048
4545
msgid "Starting / Restarting IBus..."
4646
msgstr ""
4747

48-
#: extension.js:3068
48+
#: extension.js:3077
4949
msgid "Copy Emoji"
5050
msgstr ""
5151

52-
#: extension.js:3089 prefs.js:1703 prefs.js:2158
52+
#: extension.js:3098 prefs.js:1703 prefs.js:2158
5353
msgid "Customize IBus"
5454
msgstr ""
5555

56-
#: extension.js:3110 prefs.js:302 prefs.js:545
56+
#: extension.js:3119 prefs.js:302 prefs.js:545
5757
msgid "IBus Preferences"
5858
msgstr ""
5959

60-
#: extension.js:3131 extension.js:3144 prefs.js:549
60+
#: extension.js:3140 extension.js:3153 prefs.js:549
6161
msgid "IBus Version"
6262
msgstr ""
6363

64-
#: extension.js:3170
64+
#: extension.js:3179
6565
msgid "Restart"
6666
msgstr ""
6767

68-
#: extension.js:3199
68+
#: extension.js:3208
6969
msgid "Restarting IBus..."
7070
msgstr ""
7171

72-
#: extension.js:3218
72+
#: extension.js:3227
7373
msgid "Quit"
7474
msgstr ""
7575

76-
#: extension.js:3232
76+
#: extension.js:3241
7777
msgid "Exiting IBus..."
7878
msgstr ""
7979

@@ -450,9 +450,9 @@ msgstr ""
450450

451451
#: prefs.js:1744
452452
msgid ""
453-
"<span size=\"small\">Copyright © 2021-2023 <a href=\"https://github.com/"
454-
"HollowMan6\">Hollow Man</a> &lt;<a href=\"mailto:hollowman@opensuse."
455-
"org\">hollowman@opensuse.org</a>&gt;</span>"
453+
"<span size=\"small\">Copyleft 🄯 2021-2025 <a href=\"https://github.com/"
454+
"HollowMan6\">ℍ𝕠𝕝𝕝𝕠𝕨 𝕄𝕒𝕟</a> &lt;<a "
455+
"href=\"mailto:hollowman@opensuse.org\">hollowman@opensuse.org</a>&gt;</span>"
456456
msgstr ""
457457

458458
#: prefs.js:1756
@@ -463,9 +463,10 @@ msgstr ""
463463

464464
#: prefs.js:1768
465465
msgid ""
466-
"<span size=\"small\">Sponsored by <a href=\"https://summerofcode.withgoogle."
467-
"com/archive/2021/projects/6295506795364352/\">Google Summer of Code 2021</a> "
468-
"<b><a href=\"https://github.com/openSUSE\">@openSUSE</a></b>.</span>"
466+
"<span size=\"small\">Sponsored by <a href=\"https://"
467+
"summerofcode.withgoogle.com/archive/2021/projects/6295506795364352/\">Google "
468+
"Summer of Code 2021</a> <b><a href=\"https://github.com/"
469+
"openSUSE\">@openSUSE</a></b>.</span>"
469470
msgstr ""
470471

471472
#: prefs.js:1788

customize-ibus@hollowman.ml/locale/eo/LC_MESSAGES/customize-ibus.po

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# phlostically <phlostically@mailinator.com>, 2024.
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Customize Ibus 90\n"
7+
"Project-Id-Version: Customize Ibus 91\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2024-09-11 00:01+0300\n"
9+
"POT-Creation-Date: 2025-03-04 22:27+0200\n"
1010
"PO-Revision-Date: 2024-07-09 20:16+0000\n"
1111
"Last-Translator: phlostically <phlostically@mailinator.com>\n"
1212
"Language-Team: Esperanto <https://hosted.weblate.org/projects/ibus-customize/"
@@ -18,63 +18,63 @@ msgstr ""
1818
"Plural-Forms: nplurals=2; plural=n != 1;\n"
1919
"X-Generator: Weblate 5.7-dev\n"
2020

21-
#: extension.js:1583
21+
#: extension.js:1592
2222
msgid "IBus panel service connected!"
2323
msgstr ""
2424

25-
#: extension.js:2198
25+
#: extension.js:2207
2626
msgid "loading light user theme for IBus:"
2727
msgstr "ŝargante propran helan etoson por IBus:"
2828

29-
#: extension.js:2209
29+
#: extension.js:2218
3030
msgid "loading dark user theme for IBus:"
3131
msgstr "ŝargante propran malhelan etoson por IBus:"
3232

33-
#: extension.js:2215
33+
#: extension.js:2224
3434
msgid "loading default theme for IBus"
3535
msgstr "ŝargante implicitan etoson por IBus"
3636

37-
#: extension.js:2433
37+
#: extension.js:2442
3838
msgid "loading background for IBus:"
3939
msgstr "ŝargante fonon por IBus:"
4040

41-
#: extension.js:2446
41+
#: extension.js:2455
4242
msgid "remove custom background for IBus"
4343
msgstr "forigi propran fonon por IBus"
4444

45-
#: extension.js:3039
45+
#: extension.js:3048
4646
msgid "Starting / Restarting IBus..."
4747
msgstr "Lanĉante/relanĉante IBus…"
4848

49-
#: extension.js:3068
49+
#: extension.js:3077
5050
msgid "Copy Emoji"
5151
msgstr ""
5252

53-
#: extension.js:3089 prefs.js:1703 prefs.js:2158
53+
#: extension.js:3098 prefs.js:1703 prefs.js:2158
5454
msgid "Customize IBus"
5555
msgstr "Adapti IBus"
5656

57-
#: extension.js:3110 prefs.js:302 prefs.js:545
57+
#: extension.js:3119 prefs.js:302 prefs.js:545
5858
msgid "IBus Preferences"
5959
msgstr "Agordoj pri IBus"
6060

61-
#: extension.js:3131 extension.js:3144 prefs.js:549
61+
#: extension.js:3140 extension.js:3153 prefs.js:549
6262
msgid "IBus Version"
6363
msgstr "Versio de IBus"
6464

65-
#: extension.js:3170
65+
#: extension.js:3179
6666
msgid "Restart"
6767
msgstr "Relanĉi"
6868

69-
#: extension.js:3199
69+
#: extension.js:3208
7070
msgid "Restarting IBus..."
7171
msgstr "Relanĉante IBus…"
7272

73-
#: extension.js:3218
73+
#: extension.js:3227
7474
msgid "Quit"
7575
msgstr "Forlasi"
7676

77-
#: extension.js:3232
77+
#: extension.js:3241
7878
msgid "Exiting IBus..."
7979
msgstr "Forlasante IBus…"
8080

@@ -451,13 +451,13 @@ msgstr ""
451451

452452
#: prefs.js:1744
453453
msgid ""
454-
"<span size=\"small\">Copyright © 2021-2023 <a href=\"https://github.com/"
455-
"HollowMan6\">Hollow Man</a> &lt;<a href=\"mailto:hollowman@opensuse."
456-
"org\">hollowman@opensuse.org</a>&gt;</span>"
454+
"<span size=\"small\">Copyleft 🄯 2021-2025 <a href=\"https://github.com/"
455+
"HollowMan6\">ℍ𝕠𝕝𝕝𝕠𝕨 𝕄𝕒𝕟</a> &lt;<a "
456+
"href=\"mailto:hollowman@opensuse.org\">hollowman@opensuse.org</a>&gt;</span>"
457457
msgstr ""
458-
"<span size=\"small\">Kopirajtoj © 2021-2023 <a href=\"https://github.com/"
459-
"HollowMan6\">Hollow Man</a> &lt;<a href=\"mailto:hollowman@opensuse."
460-
"org\">hollowman@opensuse.org</a>&gt;</span>"
458+
"<span size=\"small\">Kopirajtoj 🄯 2021-2025 <a href=\"https://github.com/"
459+
"HollowMan6\">ℍ𝕠𝕝𝕝𝕠𝕨 𝕄𝕒𝕟</a> &lt;<a "
460+
"href=\"mailto:hollowman@opensuse.org\">hollowman@opensuse.org</a>&gt;</span>"
461461

462462
#: prefs.js:1756
463463
msgid ""
@@ -469,9 +469,10 @@ msgstr ""
469469

470470
#: prefs.js:1768
471471
msgid ""
472-
"<span size=\"small\">Sponsored by <a href=\"https://summerofcode.withgoogle."
473-
"com/archive/2021/projects/6295506795364352/\">Google Summer of Code 2021</a> "
474-
"<b><a href=\"https://github.com/openSUSE\">@openSUSE</a></b>.</span>"
472+
"<span size=\"small\">Sponsored by <a href=\"https://"
473+
"summerofcode.withgoogle.com/archive/2021/projects/6295506795364352/\">Google "
474+
"Summer of Code 2021</a> <b><a href=\"https://github.com/"
475+
"openSUSE\">@openSUSE</a></b>.</span>"
475476
msgstr ""
476477

477478
#: prefs.js:1788

0 commit comments

Comments
 (0)