Skip to content

Commit

Permalink
emscripten 3.1.71; sync (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Nov 10, 2024
1 parent 2ae2a5c commit 3399a14
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-24.04
env:
EMSCRIPTEN_VERSION: '3.1.66'
EMSCRIPTEN_VERSION: '3.1.71'
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion fcitx5-rime
2 changes: 1 addition & 1 deletion fcitx5-rime-data/rime-luna-pinyin
2 changes: 1 addition & 1 deletion fcitx5-thai
4 changes: 2 additions & 2 deletions patches/hallelujah.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02daeea..17cf5c9 100644
index 7ffcf34..8fa5fa8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.6.0)

project(fcitx5-hallelujah VERSION 5.0.0)
project(fcitx5-hallelujah VERSION 5.0.1)

+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-sSIDE_MODULE")
Expand Down
95 changes: 8 additions & 87 deletions patches/rime.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e96508c..46e9923 100644
index 1a1637a..a09f008 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,10 @@ include(GNUInstallDirs)
Expand All @@ -24,8 +24,8 @@ index e96508c..46e9923 100644
+ include_directories("${PROJECT_SOURCE_DIR}/../build/sysroot/usr/include")
endif()

if ("${Rime_VERSION}" VERSION_LESS "1.8.0")
@@ -42,7 +47,7 @@ add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-rime\")
if ("${Rime_VERSION}" VERSION_LESS "1.10.0")
@@ -45,7 +50,7 @@ add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-rime\")
add_definitions(-DFCITX_RIME_VERSION=\"${PROJECT_VERSION}\")
fcitx5_add_i18n_definition()

Expand All @@ -34,95 +34,16 @@ index e96508c..46e9923 100644

add_subdirectory(po)
add_subdirectory(src)
diff --git a/src/rimecandidate.cpp b/src/rimecandidate.cpp
index fc84a03..79c461d 100644
--- a/src/rimecandidate.cpp
+++ b/src/rimecandidate.cpp
@@ -75,6 +75,9 @@ RimeCandidateList::RimeCandidateList(RimeEngine *engine, InputContext *ic,
setPageable(this);
setBulk(this);
setActionable(this);
+#ifndef FCITX_RIME_NO_HIGHLIGHT_CANDIDATE
+ setBulkCursor(this);
+#endif

const auto &menu = context.menu;

@@ -187,4 +190,19 @@ void RimeCandidateList::triggerAction(const CandidateWord &candidate, int id) {
}
}
}
+
+#ifndef FCITX_RIME_NO_HIGHLIGHT_CANDIDATE
+int RimeCandidateList::globalCursorIndex() const {
+ return -1; // No API available.
+}
+
+void RimeCandidateList::setGlobalCursorIndex(int index) {
+ auto session = engine_->state(ic_)->session(false);
+ if (!session) {
+ throw std::invalid_argument("Invalid session");
+ }
+ auto *api = engine_->api();
+ api->highlight_candidate(session, index);
+}
+#endif
} // namespace fcitx
diff --git a/src/rimecandidate.h b/src/rimecandidate.h
index 6c96898..a52b87a 100644
--- a/src/rimecandidate.h
+++ b/src/rimecandidate.h
@@ -52,6 +52,10 @@ class RimeCandidateList final : public CandidateList,
,
public BulkCandidateList
#endif
+#ifndef FCITX_RIME_NO_HIGHLIGHT_CANDIDATE
+ ,
+ public BulkCursorCandidateList
+#endif
{
public:
RimeCandidateList(RimeEngine *engine, InputContext *ic,
@@ -94,6 +98,11 @@ public:
int totalSize() const override;
#endif

+#ifndef FCITX_RIME_NO_HIGHLIGHT_CANDIDATE
+ int globalCursorIndex() const override;
+ void setGlobalCursorIndex(int index) override;
+#endif
+
bool hasAction(const CandidateWord &candidate) const override;
std::vector<CandidateAction>
candidateActions(const CandidateWord &candidate) const override;
diff --git a/src/rimeengine.h b/src/rimeengine.h
index 3ecc012..1fe3384 100644
index 6bec003..05d7a82 100644
--- a/src/rimeengine.h
+++ b/src/rimeengine.h
@@ -77,7 +77,7 @@ FCITX_CONFIGURATION(
@@ -89,7 +89,7 @@ FCITX_CONFIGURATION(
Option<bool> preeditCursorPositionAtBeginning{
this, "PreeditCursorPositionAtBeginning",
_("Fix embedded preedit cursor at the beginning of the preedit"),
- !isAndroid() && !isApple()};
+ false};
Option<bool> commitWhenDeactivate{
this, "Commit when deactivate",
_("Commit current text when deactivating"), true};
diff --git a/src/rimestate.cpp b/src/rimestate.cpp
index a8fe4b9..c54100c 100644
--- a/src/rimestate.cpp
+++ b/src/rimestate.cpp
@@ -79,7 +79,12 @@ void RimeState::clear() {
}
}

-void RimeState::activate() { maybeSyncProgramNameToSession(); }
+void RimeState::activate() {
+ maybeSyncProgramNameToSession();
+ if (session_) {
+ engine_->api()->set_option(session_->id(), "_linear", true);
+ }
+}

std::string RimeState::subMode() {
std::string result;
OptionWithAnnotation<SwitchInputMethodBehavior,
SwitchInputMethodBehaviorI18NAnnotation>
switchInputMethodBehavior{

0 comments on commit 3399a14

Please sign in to comment.