Граф коммитов

284 Коммитов

Автор SHA1 Сообщение Дата
Changwoo Ryu 5cfe838715 client/gtk2/ibusimcontext: Fix forward key keycode for GTK4
When a keycode is provided (!= 0) for a forwarded key event, convert it to a
GTK keycode before passing it to gtk_im_context_filter_key().

Also free GdkKeymapKey after gdk_display_map_keyval() is called.

BUG=https://github.com/ibus/ibus/issues/2380
BUG=https://github.com/ibus/ibus/issues/2382
2022-02-18 09:07:02 +09:00
Carlos Garnacho a076b388d8 src, client/x11: Add systemd unit file
This so far depends on GNOME targets, and is thus just usable there.
Other DEs wishing to use systemd and ibus will need to add the
necessary dependencies where applicable.

There are 2 scenarios here:
- On X11 sessions, ibus-daemon will be launched with --xim parameter,
  so ibus-x11 is started with it.
- On Wayland sessions, ibus-daemon will be started without XIM support,
  ibus-x11 will be launched and tear down together with all other
  session X11 services while Xwayland is running.

For the second part of the second situation, additionally install
a script at /etc/xdg/Xwayland-session.d, which takes care of X11
service initialization together with the Xwayland instance.

BUG=https://github.com/ibus/ibus/pull/2377
2022-02-09 23:07:56 +01:00
fujiwarat 6b979e7897 client/gtk2/ibusimcontext: Fix a key event loop with forwarding keys
_ibus_context_forward_key_event_cb() caused a key event loop in
_key_snooper_cb() with key release events.
2021-09-10 00:39:17 +09:00
fujiwarat 4957d1468d client/gtk2/ibusimcontext: Calculate keycode from keysym in GTK3 forward-key-event
IBus GTK3 mode also calculates keycode from keysym if keycode == 0
with forward-key-event signal to follow GTK4.
2021-09-06 20:25:52 +09:00
fujiwarat 5487a6baa4 client/gtk2/ibusimcontext: Implement clear preedit for GTK4
IBus IM module uses synchornized key processes for GTK4 and the timing
of the GTK reset siginal may work with focus-in/out between windows.
(I don't test GTK4 firefox and terminal yet and the verification is not
completed.)
So ibus_im_context_clear_preedit_text() is now called with the GTK4 reset
siginal.
ibus_im_context_clear_preedit_text() works with ibus-setup-anthy ->
"Conversion" tab -> "Behavior on Focus Out" pull down menu.

BUG=https://github.com/ibus/ibus/issues/2334
2021-09-06 20:23:59 +09:00
Alynx Zhou 936a0e76df client/gtk2/ibusimcontext: Fix wrong cursor location in gtk3 apps
If you apply this patch in your tarball, please also apply this to
client/gtk3/ibusimcontext.c besides client/gtk2/ibusimcontext.c .

BUG=https://github.com/ibus/ibus/issues/2337
2021-09-01 12:04:12 +09:00
Olivier Fourdan 71ca4a9859 client/x11: Add support for XFixes ClientDisconnectMode
The Xserver itself is capable of terminating itself once all X11 clients
are gone, yet in a typical full session, there are a number of X11
clients such as ibus-x11 running continuously.

Those always-running clients will prevent the Xserver from terminating,
because the actual number of X11 clients will never drop to 0.

Use XFixes ClientDisconnectMode to inform the X11 server that it can
terminate even if ibus-x11 is still running.

That will allow Xwayland from terminating automatically when regular
clients have quit.

On plain Xorg servers, the lifetime of the session is usually tied to
the session manager or window manager, and this change will have no
effect.

BUG=https://github.com/ibus/ibus/pull/2314
2021-08-18 11:54:31 +09:00
fujiwarat a823161768 client/gtk2/ibusimcontext: Enable sync process in GTK4
gtk_im_context_filter_key() does not forward control keys likes
BackSpace, Return and change the process mode to the synchronization.

BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/3465
2021-08-09 12:36:40 +09:00
fujiwarat e9e1642870 Fix code reviews 2021-06-16 18:00:31 +09:00
fujiwarat d105a3941a client/gtk2: Implement ibus_im_context_set_surrounding_with_selection()
Selection bounds need to be re-calculated when pre-edit text is
inserted and the selection position is changed.
GTK4 has a new API GtkIMContext.set_surrounding_with_selection()
to fix this issue and now IBus GTK module inherits the API.

BUG=https://github.com/ibus/ibus/issues/2013
2021-05-12 18:54:30 +09:00
fujiwarat d0a47c3c82 client/gtk2: Add XTranslateCoordinates for GTK4 X11 coordinate
GdkWindow had the absolute coordiante in the private class in GTK3
but the absolute coordiane no longer exists in GTK4 for Wayland.
Now get the toplevel window coordiante for the warkaround in GTK4
but the coordiante of the inner widgets is no longer available too.

BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/3024#note_987835
2021-01-08 18:48:13 +09:00
fujiwarat c7928b1587 Add GTK4 IM module
BUG=https://github.com/ibus/ibus/issues/2291
2021-01-08 18:45:55 +09:00
fujiwarat 0b9d936598 client/gtk2: Fix typo 2020-04-22 20:17:12 +09:00
Changwoo Ryu 5765bfd69f client/gtk2: Remove glib_check_version() in gtk immodule
In the gtk2/gtk3 immodule, glib_check_version() is being used to make sure
that the installed glib version is not older than the glib version which ibus
is built with.

But there is no reason why glib version is checked in runtime. Library
compatibility is already being checked more precisely by packaging systems and
linkers.

This version check can break the ibus gtk immodule when used with an older but
compatible version of glib, such as glib 2.62.x which is compatible with
2.64.x.

BUG=https://github.com/ibus/ibus/issues/2200
2020-04-15 17:43:14 +09:00
fujiwarat ecc3465a58 client/gtk2: Fix some format sentences 2020-01-23 16:13:05 +09:00
fujiwarat c662a02bf3 client/gtk2: Fix to connect button-press-event signal
IBus clients do not connect button-press-event in some conditions
and it will be fixed.

BUG=https://github.com/ibus/ibus/issues/1980
2019-12-25 17:30:56 +09:00
fujiwarat 25d11f5cfd client/gtk2: Fix to set use_button_press_event after signals are connected
_ibus_context_update_preedit_text_cb() can be called with reset signals
before ibus_im_context_set_client_window() is called. Then
use_button_press_event needs to be set only when the signals are connected.

BUG=https://github.com/ibus/ibus/issues/1980
2019-12-11 16:28:22 +09:00
fujiwarat ae0040c734 build: Fix build errors with '-include' directive
I forgot to test the Makefile with autoconf and also missed to
add meta.test.in to EXTRA_DIST
2019-08-23 19:47:18 +09:00
fujiwarat ab56a27376 client/wayland: Connect to "disconnected" signal
ibus-wayland could terminate with "disconnected" signal.
2019-08-21 17:25:41 +09:00
fujiwarat b758478319 client/wayland: Update Wayland input-method protocol to unstable v1
Weston uses unstable v1 for input-method protocol.
Unfortunately weston-terminal does not enable input method and tested
the protocol with weston-editor:
https://github.com/wayland-project/weston/blob/master/clients/editor.c

BUG=https://github.com/ibus/ibus/issues/2030
2019-08-20 19:23:49 +09:00
Hodong Kim 0c89a7ee33 client/x11: Update LOCALES_STRING
Update LOCALES_STRING in locales.h from /usr/share/i18n/SUPPORTED on
Debian Buster.

BUG=https://github.com/ibus/ibus/pull/2110
2019-07-25 14:37:52 +09:00
fujiwarat cebe7a9553 client/gtk2: Keep preedit cursor_pos and visible in clearing preedit text
Clear the preedit_string but keep the preedit_cursor_pos and
preedit_visible because a time lag could happen, firefox commit
the preedit text before the preedit text is cleared and it cause
a double commits of the Hangul preedit in firefox if the preedit
would be located on the URL bar and click on anywhere of firefox
out of the URL bar.
2019-05-09 15:49:21 +09:00
scootergrisen 64f4e412d0 client/x11: typo: sevrer to server
BUG=https://github.com/ibus/ibus/pull/2078
2019-02-04 16:15:28 +09:00
fujiwarat be7fb813e5 client/gtk2: Fix Atom and Slack for Flatpak
Seems Atom, slack, com.visualstudio.code does not enable
gtk_key_snooper_install() and this issue causes to call
gtk_im_context_filter_keypress instead of calling ibus APIs.

BUG=https://github.com/ibus/ibus/issues/1991
2019-01-08 12:02:37 +09:00
fujiwarat 9ae2d4658f client/gtk2: Use button-press-event only with IBUS_ENGINE_PREEDIT_COMMIT
BUG=https://github.com/ibus/ibus/issues/1980
2018-12-20 16:40:31 +09:00
fujiwarat c7d8771cb9 client/gtk2: Fix SEGV on mouse clicks when ibus-daemon not running 2018-12-11 19:16:10 +09:00
fujiwarat 4c40afba9c client/gtk2: Always reset and clear preedit on mouse click
Thinking about the reset signal again, now I think it's good to emit
the reset signal and clear the preedit on mouse click for any engines
besides Hangul because the behavior could be handled by each engine
with the reset signal.

BUG=https://github.com/ibus/ibus/issues/1980
2018-12-06 16:53:57 +09:00
fujiwarat 7b3b8c8b0c client/gtk2: Do not delete IBUS_CAP_SURROUNDING_TEXT
retrieve-surrounding signal could be failed with the first typing
on firefox. It could be a bug in firefox but now IBusIMContext does not
delete IBUS_CAP_SURROUNDING_TEXT in the capabilities as a workaround
when retrieve-surrounding signal is failed.
Also added retrieve-surrounding signal after some committing text.

BUG=https://github.com/ibus/ibus/issues/2054
2018-11-13 14:27:52 +09:00
fujiwarat a40631e166 Detect mouse click to commit Hangul preedit
If preedit text is not committed with the mouse click, preedit text
is moved to the new cursor position in Hangul typing.
Since set_cursor_location() is received before the reset() signal is
sent to ibus-daemon and commit_text() signal is received from
ibus-daemon, UpdatePreeditTextWithMode D-Bus method is newly added
and now ibus clients commit the preedit.

BUG=https://github.com/ibus/ibus/issues/1980
2018-11-09 15:11:51 +09:00
fujiwarat f328fd67f4 client/gtk2: Add IBUS_DISCARD_PASSWORD for firefox and chrome
popup window in firefox is closed in Xorg GNOME when password entry
is focus on. It's caused by gnome-shell [1].
Now IBUS_DISCARD_PASSWORD and IBUS_DISCARD_PASSWORD_APPS enviroment
variables are implemented in IBus GTK clients as a workaround.

env IBUS_DISCARD_PASSWORD=1 firefox
or
export IBUS_DISCARD_PASSWORD_APPS='firefox,.*chrome.*'

can discard typing characters on the password entries.

[1] https://gitlab.gnome.org/GNOME/gnome-shell/issues/391

BUG=https://github.com/ibus/ibus/issues/2002
2018-08-06 12:33:44 +09:00
fujiwarat 8d302c853f RHEL code reviews 2018-07-24 16:04:31 +09:00
fujiwarat d784e04c38 client/gtk2: Fix a build failure with GDK_MODIFIER_INTENT_NO_TEXT_INPUT
BUG=https://github.com/ibus/ibus/issues/1942

Review URL: https://codereview.appspot.com/327300043
2017-09-07 10:57:14 +09:00
fujiwarat bbfb3d738b client/gtk2: Do not send key events to GtkIMContextSimple
GtkIMContextSimple binds Ctrl-Shift-u but IBus clients do not now.

BUG=https://github.com/ibus/ibus/issues/1889
R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/327290043
2017-09-06 14:08:40 +09:00
Alexander Larsson 35ce62474f Support the portal in the gtk im modules
This adds a new way to create an IbusBus, ibus_bus_new_async_client().
This returns an object that is not guarantee to handle any calls
that are not needed by a client, meaning CreateInputContext and
handling the input context.

If you are running in a flatpak, or if IBUS_USE_PORTAL is set, then
instead of talking to the regular ibus bus we connect to
org.freedesktop.portal.IBus on the session bus and use the
limited org.freedesktop.IBus.Portal interface instead of the
org.freedesktop.IBus interface.

This allows flatpaks (or other sandbox systems) to safely use
dbus clients (apps).

BUG=https://github.com/flatpak/flatpak/issues/675

Review URL: https://codereview.appspot.com/328410043

Patch from Alexander Larsson <alexl@redhat.com>.
2017-08-31 12:03:37 +09:00
Xiang Fan 6a3301db85 client/gtk2: include the scaling factor
Scaling factor, which exists for HiDPI displays, needs to be included in
the calculation of cursor location. This does not affect devices without
a HiDPI display.

Candidate windows would be misplaced to smaller coordinates without this
patch.

BUG=https://github.com/ibus/ibus/issues/1806

Review URL: https://codereview.appspot.com/328250043

Patch from Xiang Fan <sfanxiang@gmail.com>.
2017-08-10 11:24:39 +09:00
fujiwarat ab6c38c192 client/x11: Add XSetIOErrorHandler() for GNOME3 desktop
When log into GNOME3 desktop immediately after the system is booted,
ibus-daemon is sometimes alive but ibus-x11 is dead after log out
the session. Because gdk_x_io_error() is called as the callback of
XSetIOErrorHandler() in gtk/gdk/x11/gdkmain-x11.c in ibus-x11.
Now I assume the callback is called in logout.

BUG=https://github.com/ibus/ibus/issues/1907

Review URL: https://codereview.appspot.com/319490043
2017-03-15 11:48:24 +09:00
fujiwarat 3ef21fef01 client/gtk2: Fix SEGV with Wayland display
Delete gdk_display_get_name() in GTK clients because ibus-daemon
does not use gdk_display_get_name().
GdkX11Dislay and GdkX11Window does not work with Wayland.

BUG=https://github.com/ibus/ibus/issues/1859
R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/301760043
2016-06-03 11:52:29 +09:00
Daiki Ueno b51c620068 Add SetCursorLocationRelative D-Bus method
We have SetCursorLocation D-Bus method which takes the absolute
coordinates of the screen, while on Wayland the coordinates are relative
to the current input window and there is no way to calculate the
absolute coordinates.  That makes it impossible for the panel to
position the lookup table correctly.

This patch adds a new D-Bus method, SetCursorLocationRelative, which
takes the relative coordinates, so that the panel
implementation (typically the same process of Wayland compositor) can
use that information.  The counterpart of this changes is at:
https://bugzilla.gnome.org/show_bug.cgi?id=753476

Unlike SetCursorLocation, SetCursorLocationRelative is not delivered to
engines, since it is not very useful for the engines without knowing the
current input window (which is also not accessible from a different
process on Wayland).

Co-authored-by: Rui Matos <tiagomatos@gmail.com>

BUG=
R=takao.fujiwara1@gmail.com

Review URL: https://codereview.appspot.com/290780043 .
2016-02-17 16:29:03 +09:00
Hodong Kim 8954a6f5ae client/x11: Remove an unused variable
BUG=https://github.com/ibus/ibus/pull/1808
R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/256010044

Patch from Hodong Kim <hodong@cogno.org>.
2015-07-21 11:39:25 +09:00
fujiwarat 845528b91b Replace code.google.com with github.com
R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/252740043
2015-06-29 11:54:17 +09:00
fujiwarat b58351ec2f Set sync process_key_event in ibus-x11
If X11 client application spend time during XNextEvent(), e.g. sleep(1),
under async process_key_event(), X11 does not keep the event order.
I don't know why the event order is broken but now set the sync mode.

BUG=https://code.google.com/p/ibus/issues/detail?id=1697
TEST=client/x11/ibus-x11

Review URL: https://codereview.appspot.com/240860043
2015-05-22 11:37:11 +09:00
fujiwarat 0f9ea3d82a Fix SEGV of ibus-x11 on wayland
In case that ibus-x11 is built with gtk3, GdkDisplay can be
GdkWaylandDisplay but not GdkX11Display so GDK_DISPLAY_XDISPLAY()
and GDK_WINDOW_XID() does not work in wayland.

TEST=client/x11/ibus-x11

Review URL: https://codereview.appspot.com/234590043
2015-05-21 11:06:02 +09:00
fujiwarat ffdcc6cd13 Fix to get X11 display name on GTK3 applications in GNOME Wayland
gdk_display_get_name() returns "Wayland" in GTK 3.16 but
ibus-daemon uses DISPLAY variable for ibus_get_address() at present.
https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkdisplay-wayland.c#n332

BUG=https://code.google.com/p/ibus/issues/detail?id=1774
TEST=client/gtk3/im-ibus.so

Review URL: https://codereview.appspot.com/229140045
2015-04-30 11:10:09 +09:00
Marc-Antoine Perennou 4d49a664b9 xim: use gtk3
TEST=client/x11/ibus-x11

Review URL: https://codereview.appspot.com/225990043
Patch from Marc-Antoine Perennou <Marc-Antoine@Perennou.com>.
2015-04-13 11:59:26 +09:00
Hodong Kim cc88075dda Fix compile error in client/x11/Makefile
BUG=https://github.com/ibus/ibus/pull/18
TEST=client/x11/Makefile

Review URL: https://codereview.appspot.com/217590043
Patch from Hodong Kim <hodong@cogno.org>.
2015-04-02 11:18:57 +09:00
fujiwarat 38d3c5ccdf gtk clients do not lose focus when chrome popup window takes the focus
Do not call gtk_im_context_focus_out() in ibus_im_context_focus_in()
for a workaround because chrome popup window does not release the focus.

BUG=rhbz#1136623
TEST=client/gtk2/im-ibus.so

Review URL: https://codereview.appspot.com/187710043
2015-01-06 13:46:14 +09:00
Eduardo Lima (Etrunko) 6488b87792 Wayland: Fix Small typo
BUG=http://code.google.com/p/ibus/issues/detail?id=1671
TEST=client/wayland/ibus-wayland

Review URL: https://codereview.appspot.com/18780044
Patch from Eduardo Lima (Etrunko) <eduardo.lima@intel.com>.
2013-11-05 18:07:33 +09:00
fujiwarat 98c7bdc5d9 Fix no output when ibus-daemon is running on another display.
Using ssh -X or another display, the hostname and display numbers
can be different between the GTK clients and ibus-daemon.
This patch fixes the output:
"Events queue growing too big, will start to drop."

BUG=RH#1004135
TEST=clients/gtk*/im-ibus.so

Review URL: https://codereview.appspot.com/13707046
2013-09-20 10:58:34 +09:00
fujiwarat b24efef988 Call _set_content_type in _create_input_context_done in im-ibus.so
TEST=password dialog in gnome-shell

Review URL: https://codereview.appspot.com/13255047
2013-08-30 18:25:42 +09:00
Daiki Ueno 3b3a7ceccb Notify engines of the content-type of input context
Add a new D-Bus method SetContentType to InputContext and Engine, to
notify engines of the content-type (primary purpose and hints) of
input context.  This is useful to implement intelligent features in
engines, such as automatic input-mode switch and text prediction.

The "purpose" and "hints" arguments are compatible with
GtkInputPurpose and GtkInputHints:
https://developer.gnome.org/gtk3/unstable/GtkEntry.html#GtkInputPurpose
https://developer.gnome.org/gtk3/unstable/GtkEntry.html#GtkInputHints

and the API is similar to the content_type event in the Wayland Input
Method Framework:
http://cgit.freedesktop.org/wayland/weston/tree/protocol/input-method.xml#n202

BUG=

Review URL: https://codereview.appspot.com/11422043
2013-08-14 13:29:45 +02:00