Skip to content

Commit

Permalink
Refactor GTK (#241)
Browse files Browse the repository at this point in the history
* Set visibility=hidden

* Remove unused bypass function
  • Loading branch information
Riey committed Feb 11, 2021
1 parent 3a6c231 commit 781c369
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* Implement engine hotkeys [#223](https://github.com/Riey/kime/issues/223)
* Implement sebeolsik-sin1995 [#235](https://github.com/Riey/kime/issues/235)
* Implement layout_addons [#239](https://github.com/Riey/kime/issues/239)
* Fix gtk reset doesn't commit preedit char
* Fix gtk reset doesn't commit preedit char [#240](https://github.com/Riey/kime/issues/240)]
* Compile C/C++ with `-fvisibility=hidden`

## 1.0.0-pre3

Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ option(ENABLE_QT5 "Enable Qt5 immodule" OFF)
option(ENABLE_QT6 "Enable Qt6 immodule" OFF)

set(CMAKE_SKIP_RPATH TRUE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand Down
14 changes: 0 additions & 14 deletions src/frontends/gtk2/src/immodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,6 @@ gboolean commit_event(KimeImContext *ctx, GdkModifierType state, guint keyval) {
return FALSE;
}

gboolean bypass(KimeImContext *ctx, EventType *key) {
uint32_t c = kime_engine_reset(ctx->engine);

if (!c) {
update_preedit(ctx, FALSE);
commit(ctx, c);
put_event(ctx, key);
return TRUE;
} else {
return FALSE;
}
}

gboolean filter_keypress(GtkIMContext *im, EventType *key) {
KIME_IM_CONTEXT(im);
#if GTK_CHECK_VERSION(3, 98, 4)
Expand All @@ -156,7 +143,6 @@ gboolean filter_keypress(GtkIMContext *im, EventType *key) {
debug("code %u, state %u", code, state);

if (state & FORWARDED_MASK) {
debug("Forwarded: %u", keyval);
return commit_event(ctx, state, keyval);
} else {
KimeModifierState kime_state = 0;
Expand Down

0 comments on commit 781c369

Please sign in to comment.