Commit graph

266 commits

Author SHA1 Message Date
Darcy Wong
7a7ba2f70c chore(linux): Set test-helper script executable 2023-02-07 10:38:08 +07:00
Eberhard Beilharz
e937e1395c
chore(linux): Address code review comments
- make use of new meson features
- some refactoring
2023-02-03 10:11:11 +01:00
Eberhard Beilharz
0367df8652
chore(linux): Fix a few bugs in meson scripts 2023-02-02 19:06:55 +01:00
Eberhard Beilharz
c176ebc6af
chore(linux): Address code review comments 2023-01-31 17:38:29 +01:00
Eberhard Beilharz
eb076c08c8
chore(linux): Build with meson instead of autotools
This change introduces meson for building ibus-keyman instead of
autotools.

Closes #5981.
2023-01-30 16:32:38 +01:00
Eberhard Beilharz
ffc59553e2
Merge pull request #8102 from keymanapp/chore/linux/legacy
chore(linux): Remove legacy projects
2023-01-27 15:56:42 +01:00
Eberhard Beilharz
f2cfccb572
chore(linux): Fix warnings
This warnings showed up when building with Meson.
2023-01-26 16:58:27 +01:00
Eberhard Beilharz
ea059df541
chore(linux): Remove legacy projects
This change removes the KMFL legacy projects. They are still
available in the stable-16 branch if we need them.

Also removed some shellcheck warnings.
2023-01-26 11:51:13 +01:00
Eberhard Beilharz
d20812d043
Merge pull request #8036 from TheSchlunz/TheSchlunz/issue7540
chore(linux): log failures to `km_kbp_context_clear(context)`
2023-01-19 11:46:49 +01:00
Eberhard Beilharz
4f19ea690f
Merge pull request #8037 from TheSchlunz/TheSchlunz/issue7541
chore(linux): use faster zero-length string check
2023-01-19 11:41:24 +01:00
Kevin Schluensen
28baf30135 Add status output 2023-01-18 18:27:37 +01:00
Kevin Schluensen
c7dedf6643 chore(linux): use faster zero-length string check
Fixes #7541
2023-01-18 13:06:16 +01:00
Kevin Schluensen
b7c27886c0 chore(linux): log failures to km_kbp_context_clear(context)
Fixes #7540
2023-01-18 12:57:13 +01:00
Eberhard Beilharz
3afc6961d7
fix(linux): Properly set context after changing IP
This change fixes a bug where we the context was wrong after
putting the IP in a new location by mouse-click.

Fixes #8024.

(cherry picked from commit a085fa244b)
2023-01-16 17:19:05 +01:00
Steven R. Loomis
fdb2f6bf08 fix(linux): add IBUS_HAS_PREFILTER ifdef to linux/ibus-keyman/tests/ibusimcontext.c 2022-12-30 15:52:45 -06:00
Marc Durdin
e1ce5d9f40
Merge branch 'master' into chore/beta-to-master 2022-12-14 06:50:32 +11:00
Eberhard Beilharz
7b3de475da
Merge pull request #7813 from keymanapp/chore/linux/updateTests
refactor(linux): Update ibusimcontext.c
2022-12-10 19:57:15 +01:00
Marc Durdin
25abcbc10a
Merge branch 'master' into chore/beta-to-master 2022-12-09 20:47:31 +11:00
Eberhard Beilharz
a43a6d47df
chore(linux): Fix failing tests 2022-12-09 10:16:59 +01:00
Eberhard Beilharz
8a14372e0a
chore(linux): Improve package build
During package builds on Debian servers the build often failed
with an error related to X11 when running the tests. This change
skips the tests in `linux/ibus-keyman/src/test` when building
packages, similar to the way we already do it for the tests in
`linux/ibus-keyman/tests`.
2022-12-07 09:00:52 +01:00
Eberhard Beilharz
5cf88878da docs(linux): Move Linux documentation
This change moves the Linux developer documentation to the new location
`docs/linux` as discussed in our planning meeting.
2022-12-05 18:07:10 +01:00
Eberhard Beilharz
c06e32186a
chore(linux): Cleanup previous commit
- fix debug output in case surrounding-text is not supported
- conditionally set prefilter flag if ibus supports it. We can now
  uncomment the check because beta branch got merged which added the
  variable to autotools.
2022-11-30 19:14:01 +01:00
Eberhard Beilharz
e1305a7f5d
refactor(linux): Update ibusimcontext.c
This change adds the upstream changes to ibusimcontext.c to our
test ibusimcontext.c file up to commit
506ac9993d5166196b7c4e9bfa9fb0f9d3792ffa plus our two prefilter
commits.
2022-11-30 19:14:01 +01:00
Eberhard Beilharz
f54ea7a7f2
Merge pull request #7804 from keymanapp/refactor/linux/kbdOptions
refactor(linux): Refactor setting keyboard options ⚙️
2022-11-29 10:48:02 +01:00
Eberhard Beilharz
0f2c9972c6
refactor(linux): Fix more memory leaks
Turns out there are more things we need to clean out if we run
into an error condition in the c'tor. Easiest is to call the
destroy method.
2022-11-28 16:46:55 +01:00
Eberhard Beilharz
8b4d3e09ed
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-11-28 16:40:02 +01:00
Eberhard Beilharz
61d5d69a12
refactor(linux): Address code review comments 2022-11-25 17:31:32 +01:00
Eberhard Beilharz
35b678a931
refactor(linux): Fix failing tests 2022-11-24 19:16:14 +01:00
Eberhard Beilharz
ddd8e5b08c
refactor(linux): Address code review comments 2022-11-24 17:00:11 +01:00
Eberhard Beilharz
afd5fc86f1
refactor(linux): Refactor setting keyboard options
- set keyboard options in a call to `km_kbp_state_options_update`
  separate from setting the environment options
- output status value if method fails
- if any of the methods fails we now return NULL
- split setting the options in multiple methods

Fixes #7717.
2022-11-23 19:05:54 +01:00
Eberhard Beilharz
5da4f17dd1
refactor(linux): Don't free consts
(cherry picked from commit b0b605709a)
2022-11-23 18:21:01 +01:00
Eberhard Beilharz
0f0ab06f53
refactor(linux): Use consts instead of strings
This refactoring makes use of the already defined strings.
It also simplifies setting the values by directly specifying an
UTF-16 string.

Motivated by the changes in PR #7667.

(cherry picked from commit 31340b5b51)
2022-11-23 18:20:52 +01:00
Eberhard Beilharz
1f7d6682a8
chore(linux): Update autotools configuration
This fixes some deprecation warnings:
- "The macro `AC_GNU_SOURCE' is obsolete"
- "The macro `AM_DISABLE_STATIC' is obsolete"
- "The macro `AC_ISC_POSIX' is obsolete"
- "The macro `AC_HEADER_STDC' is obsolete"
- "The macro `AM_PROG_LIBTOOL' is obsolete"
2022-11-23 08:46:41 +01:00
Eberhard Beilharz
a958f1a369
Merge pull request #7792 from keymanapp/fix/linux/7774_buildWithOldIbus
fix(linux): Allow to build without patched ibus version
2022-11-23 08:42:36 +01:00
Eberhard Beilharz
c1871fdd70
fix(linux): Improve compiler warning if ibus not patched
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-11-23 08:42:25 +01:00
Eberhard Beilharz
bb54946a8a
fix(linux): Fix warning
Commit acab920de8 didn't really fix
the warning. https://stackoverflow.com/a/2524675/1836776 suggests
to use `%zu` which is what this change does now.
2022-11-22 18:47:11 +01:00
Eberhard Beilharz
da765f1625
fix(linux): Allow to build without patched ibus version
This change makes it possible to compile even when the updated
ibus version is not installed. Of course ordered output won't work
in that case, but at least it will compile and the rest of Keyman
will work.

Fixes #7774.
2022-11-22 18:05:46 +01:00
Eberhard Beilharz
812c7c33b9
fix(linux): Revert "fix(linux): Fix a warning"
This reverts commit acab920de8.

I'm confused - now we're getting the same warning again - claiming
that `size_t` is defined as `long unsigned int` and so we have to
use `%lu`!? Is this related to the platform we're compiling on?
This time, the warning we get is when compiling for x86_64:

```
engine.c: In function ‘get_current_context_text’:
engine.c:224:15: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  224 |     g_message("%s: current context is:%u:%lu:%s:", __FUNCTION__, km_kbp_context_length(context), buf_size, current_context_utf8);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                  |
      |                                                                  size_t {aka long unsigned int}
engine.c:224:40: note: format string is defined here
  224 |     g_message("%s: current context is:%u:%lu:%s:", __FUNCTION__, km_kbp_context_length(context), buf_size, current_context_utf8);
      |                                       ~^
      |                                        |
      |                                        unsigned int
      |                                       %lu

```

Reverting the previous fix for now.
2022-11-21 16:12:00 +01:00
Eberhard Beilharz
acab920de8
fix(linux): Fix a warning
`size_t` is defined as `unsigned int`, not as a long.
2022-11-17 19:26:28 +01:00
Eberhard Beilharz
417dcc6bcd
Merge pull request #7686 from keymanapp/refactor/linux/consts
refactor(linux): Use consts instead of strings
2022-11-14 17:20:37 +01:00
Eberhard Beilharz
b0b605709a
refactor(linux): Don't free consts 2022-11-11 18:44:28 +01:00
Eberhard Beilharz
31340b5b51
refactor(linux): Use consts instead of strings
This refactoring makes use of the already defined strings.
It also simplifies setting the values by directly specifying an
UTF-16 string.

Motivated by the changes in PR #7667.
2022-11-10 19:56:35 +01:00
Eberhard Beilharz
053ee52281
fix(linux): Fix keyboard icon in system tray
Show the keyboard specific icon in the system tray on Wasta instead
of the generic keyman one.

Fixes #7547.
2022-11-10 09:11:44 +01:00
Marc Durdin
deeb246783
Merge pull request #7084 from keymanapp/fix/linux/improvecontext
fix(linux): Improve setting context
2022-10-26 12:34:24 +11:00
Marc Durdin
5321538d1d
Merge pull request #7503 from keymanapp/chore/linux/clearify
chore(linux): call `reset_context` instead of `...focus_in`
2022-10-25 06:23:42 +11:00
Eberhard Beilharz
7b3f891eb9
chore(linux): Rename internal method to commit_string
The previous method name `ibus_keyman_engine_commit_string`
suggests that this method is overridden from ibus-engine class.
However, while it is true that ibus-engine has a
`ibus_engine_commit_string` method it can't be overridden. This
change renames the method to make it clearer that this is an internal
method that won't be called by ibus.
2022-10-20 09:34:28 +02:00
Eberhard Beilharz
e529052dc5
chore(linux): call reset_context instead of ...focus_in
Both `ibus_keyman_engine_reset` and `ibus_keyman_engine_focus_in`
are methods that get called by ibus. Having `ibus_keyman_engine_reset`
call `ibus_keyman_engine_focus_in` makes it much harder to see in
log files which methods get really called by ibus.

This change replaces the call of `...focus_in` with `reset_context`,
which is what `...focus_in` does as well. The only other thing that
`ibus_keyman_engine_focus_in` does in addition to that is calling
`ibus_engine_register_properties` - which shouldn't be necessary on
a reset (besides that we don't seem to do anything with the one
status property we register).
2022-10-20 09:22:11 +02:00
Eberhard Beilharz
cfe0998b2e
refactor(linux): Comment unused methods
Closes #7297.
2022-10-20 09:06:27 +02:00
Eberhard Beilharz
448baad79d
refactor(linux): Replace tabs with spaces 2022-10-20 09:02:48 +02:00
Eberhard Beilharz
d4283754df
refactor(linux): Refactor alignment of params 2022-10-20 09:02:48 +02:00