#1008481 Add SDL_IM_MODULE to fcitx4 and fcitx5

#1008481#5
Date:
2022-03-27 07:06:22 UTC
From:
To:
Origin from https://salsa.debian.org/input-method-team/im-config/-/merge_requests/14

I asked the author to submit a bug first. But we haven't received so far.

sdl2 supports reading SDL_IM_MODULE, but the supported value is only fcitx,
otherwise it uses ibus.

Fcitx support in sdl2 package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881042
Upstream code: https://github.com/libsdl-org/SDL/blob/120c76c8/src/core/linux/SDL_ime.c#L46-L49

So adding SDL_IM_MODULE=fcitx to fcitx4 and fcitx5 is reasonable.

#1008481#10
Date:
2022-03-28 03:37:51 UTC
From:
To:
Hi,

These bugs seem somewhat similar:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990316
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008481

Please check these.

So question is "Does sdl upstream recommend turning on IM_MODULE as default?

Also, I am a bit concerned to add features for external program fearng some
regressions.  Please explain this has no negative side effects.

Can we resolve this by adding README for some special case situation.

Osamu

#1008481#15
Date:
2022-03-28 06:28:55 UTC
From:
To:
I can't find GLFW_IM_MODULE in glfw code, it only appears in kitty's glfw fork.
But SDL_IM_MODULE can be found in sdl2 code.

Ref: https://github.com/libsdl-org/SDL/blob/120c76c8/src/core/linux/SDL_ime.c#L46-L49

#1008481#20
Date:
2022-03-28 19:04:52 UTC
From:
To:
longer think that's the case. As regards Kitty, upstream intentionally
disables the IM support by default. This seems to be something else, and
AFAICT adding that variable would not contradict to anyone's intention.

But with that said, I don't think it makes sense to spam the users'
environment with duplicate variables. Upstream already makes use of the
well established XMODIFIERS variable, and by parsing its value they
would know whether fcitx(5) is used or not. So we may want to propose
that to upstream rather than adding a new application specific variable.

#1008481#25
Date:
2022-03-28 19:27:36 UTC
From:
To:
1. I thought XMODIFIERS is for XIM (X Input Method). Not sure why sdl2
checks XMODIFIERS as well.
2. Changing sdl2 upstream takes too long to propagate. SDL_IM_MODULE
appeared in sdl2 since 2016
https://github.com/libsdl-org/SDL/commit/808c75d1
    User asks for this for Dota2 game, which seems hard to get sdl2 updated...

#1008481#30
Date:
2022-03-28 19:47:14 UTC
From:
To:
Ok, I rest my case. :)

As far as I'm concerned, please feel free to push the change to the repo.

#1008481#35
Date:
2022-03-29 07:13:09 UTC
From:
To:
Hi,

Let me assess situation more verbosely.

Yes, I understand these are not the same problem.

With your explanation, I think I am clear about issues.

The upstream of glfw doesn't support GLFW_IM_MODULE.

The vendored copy of glfw in the popular kitty supports GLFW_IM_MODULE and kitty
upstream still advises not to enable this input method support as the default
setting.

So we decided not to enable it from im-config

Since fcitx5 uses the same protocol as ibus, documented proposed workaround was to
set GLFW_IM_MODULE=ibus for both ibus case and fcitx5 case.   fcitx4 isn't supported
and no proposed setting.

The upstream of sdl in Debian has been supporting fcitx via SDL_IM_MODULE for some
time.

No popular programs in Debian used modern sdl2 so the support of fcitx via
SDL_IM_MODULE was never raised nor addressed in im-config.  It should have been and
is a valid feature addition case for im-config.

The vendored copy of sdl2 in the popular non-Debian DOTA finally got updated and now
support of fcitx (fcitx4?) via SDL_IM_MODULE is a desirable feature.  So there is
significant desire to set up fcitx for sdl2 from the user.

We know from glfw discussion, fcitx4 and fcitx5 uses different protocol.
(fcitx5==ibus)

My question is what is the correct value for SDL_IM_MODULE which works with Debian's
sdl2 and DOTA's sdl2?.

ibus --> no setting for SDL_IM_MODULE
fcitx (fcitx4) --> SDL_IM_MODULE=fcitx
fcitx5 --> SDL_IM_MODULE=fcitx5 or SDL_IM_MODULE=ibus


Please propose your patch and explain your setting

Regards,

Osamu

#1008481#40
Date:
2022-03-29 07:58:41 UTC
From:
To:
Just to answer the protocol part.

IMO, there are at least 4 protocols that fcitx5 supports.
+ fcitx5, at dbus org.fcitx.Fcitx-0
+ fcitx4, at dbus org.fcitx.Fcitx5
+ dbus, at dbus address org.freedesktop.portal.Fcitx
+ ibus, at dbus address org.freedesktop.portal.IBus

Both fcitx4 and fcitx5 have a dbus frontend, and they listen on the
same address.
sdl2 implements fcitx support with dbus frontend. So both fcitx4 and
fcitx5 support it.

For kitty, it only supports ibus, but it can also connect to fcitx5's
ibus frontend.
For sdl2, it supports ibus, so it can connect to fcitx5's ibus
frontend as well, but since there's native fcitx support, using fcitx
dbus frontend is preferred.

In conclusion,

For SDL_IM_MODULE

+ fcitx(fcitx4) --> SDL_IM_MODULE=fcitx
+ fcitx5 --> SDL_IM_MODULE=fcitx
+ ibus --> no setting
+ others --> no settings

#1008481#45
Date:
2022-03-29 08:00:32 UTC
From:
To:

#1008481#50
Date:
2022-03-29 08:48:05 UTC
From:
To:
Hi,

You did good home work.  Impressed.

I am a bit confused what to do with closed patches.
https://salsa.debian.org/input-method-team/im-config/-/merge_requests/14

Does the INPUT_METHOD thing valid proposal ?  I don't understand rationale for adding
yet-another-variable.

Can you provide best solution as PR or patch?

Thanks,

Osamu

#1008481#55
Date:
2022-04-06 09:13:41 UTC
From:
To:
INPUT_METHOD have also been added in the patch.

INPUT_METHOD can be used to distinguish fcitx4 and fcitx5.



An environment variable INPUT_METHOD is required to tell which input method
framework is currently used by other third-party input method.

You did good home work.  Impressed.

I am a bit confused what to do with closed patches.
 <https://salsa.debian.org/input-method-team/im-config/-/merge_requests/14>
https://salsa.debian.org/input-method-team/im-config/-/merge_requests/14

Does the INPUT_METHOD thing valid proposal ?  I don't understand rationale
for adding
yet-another-variable.

Can you provide best solution as PR or patch?

Thanks,

Osamu

#1008481#60
Date:
2022-04-06 09:05:53 UTC
From:
To:
INPUT_METHOD have also been added in the patch.

INPUT_METHOD can be used to distinguish fcitx4 and fcitx5.

#1008481#63
Date:
2022-05-03 18:28:21 UTC
From:
To:
Hello,

Bug #1008481 in im-config reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/input-method-team/im-config/-/commit/74f8b98e1b4bf7f699059840bc2857b9a9140e3d
------------------------------------------------------------------------
Add SDL_IM_MODULE to fcitx4 and fcitx5

Closes: #1008481
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1008481

#1008481#70
Date:
2022-05-03 18:25:24 UTC
From:
To:
Please submit a separate bug about that. If you do, I think you need to
elaborate on the justification.

#1008481#75
Date:
2022-05-03 19:08:50 UTC
From:
To:
Hi

Thanks for moving forward.

I've been busy with life recently due to the lockdown in Shanghai.

#1008481#78
Date:
2022-06-03 19:22:25 UTC
From:
To:
Hello,

Bug #1008481 in im-config reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/input-method-team/im-config/-/commit/83556e3edf8d55fd48052a83128da0b09442a338
------------------------------------------------------------------------
Import Debian changes 0.52-1

im-config (0.52-1) unstable; urgency=medium

  * Team upload

  [ Gunnar Hjalmarsson ]
  * Add SDL_IM_MODULE to fcitx4 and fcitx5 (closes: #1008481)
  * d/copyright: Bump copyright year
  * Reverse "Set GTK_IM_MODULE in GNOME on Xorg sessions"
  * Bump Standards-Version to 4.6.1
  * Add basic debian/gbp.conf

  [ Osamu Aoki ]
  * Update package list and documentation
  * Update PO files
  * Add link to SDL_IM_MODULE
  * Add URL link to wiki
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1008481

#1008481#83
Date:
2022-06-03 19:49:02 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
im-config, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1008481@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gunnar Hjalmarsson <gunnarhj@debian.org> (supplier of updated im-config package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 03 Jun 2022 20:57:40 +0200
Source: im-config
Built-For-Profiles: noudeb
Architecture: source
Version: 0.52-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Input Method Team <debian-input-method@lists.debian.org>
Changed-By: Gunnar Hjalmarsson <gunnarhj@debian.org>
Closes: 1008481
Changes:
 im-config (0.52-1) unstable; urgency=medium
 .
   * Team upload
 .
   [ Gunnar Hjalmarsson ]
   * Add SDL_IM_MODULE to fcitx4 and fcitx5 (closes: #1008481)
   * d/copyright: Bump copyright year
   * Reverse "Set GTK_IM_MODULE in GNOME on Xorg sessions"
   * Bump Standards-Version to 4.6.1
   * Add basic debian/gbp.conf
 .
   [ Osamu Aoki ]
   * Update package list and documentation
   * Update PO files
   * Add link to SDL_IM_MODULE
   * Add URL link to wiki
Checksums-Sha1:
 b376dc3ea6ac08aa00dbe81f0bd929943fdba818 1632 im-config_0.52-1.dsc
 1028c95bc3f119ce9180e509f160ddcf9e43d608 56824 im-config_0.52.orig.tar.xz
 160eabfdbb5fd6676b36650cdbb63aeb280a1694 13608 im-config_0.52-1.debian.tar.xz
 abb38f19fc7e3ea2e4219f67d8a500823c22e916 9563 im-config_0.52-1_source.buildinfo
Checksums-Sha256:
 63a8de105a15a0ece2f370dd50c330b1b606792a191a63b79b0472499dc84ccc 1632 im-config_0.52-1.dsc
 1204ad4fd655348593353d3e0835ab06b8d7836e3f9fc7d4c49570674053a966 56824 im-config_0.52.orig.tar.xz
 ff49a2fefbdaadd033503a98dfa29f944638d45892177ad0d752b153da73f0ac 13608 im-config_0.52-1.debian.tar.xz
 8426e56fd92ecb27dd5770fb59046d4eea67cd26d464a36704c0b570a502c0f7 9563 im-config_0.52-1_source.buildinfo
Files:
 e8052042d6f4d50aad6c9f55fd292416 1632 utils optional im-config_0.52-1.dsc
 cc7a819812e8d82f44191448e8ad76a7 56824 utils optional im-config_0.52.orig.tar.xz
 01ad7d8bc4e91825b07dc4cdb25c1783 13608 utils optional im-config_0.52-1.debian.tar.xz
 2d22beae799fade56b105bd2cad931eb 9563 utils optional im-config_0.52-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEDP6Ze3JFgKf6cvjP8LEQ51ppLzIFAmKaYTMACgkQ8LEQ51pp
LzLnYggAm/fDdilnHb34WlJku+AKSV7lBP5uu/w7LiBm+Ad5vt4wGC2qG4ldksWD
Rhw9vThaJdi95CLDiRz1wG0evduw/nUszbzM//AZlabHyIoL8ItawSxydA065hTj
yZGb5Jdye+kkpo29/u47pHx3+t8Bv0Yu/k3KO2rDX/MEZycZvXZgV1JWGgjnGsYb
W9eZCkA78+qQiioQEbcAJRJ5GCThcAxQMdJV58LsFE5tduhmHh1acACbGzXoUXs1
TlOUjYBJgcPkFovH4TrEuU5jC6FtWX8MtAIrvk8NRJyLyGZqMEzUdgX1uc3cVKjG
zzDuAZEkBD6nCn4s3QZiD4QW5msEmA==
=cIm7
-----END PGP SIGNATURE-----