Bug 2054680 - workaround gtk4 preferring ibus-gtk4 to Wayland input protocol
Summary: workaround gtk4 preferring ibus-gtk4 to Wayland input protocol
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: fujiwara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-15 13:46 UTC by Jens Petersen
Modified: 2022-04-12 04:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-12 02:35:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-401 0 None None None 2022-03-08 07:57:29 UTC

Description Jens Petersen 2022-02-15 13:46:45 UTC
Description of problem:
Currently in Fedora WS Wayland Gnome, gtk4 prefers ibus-gtk4
to the Wayland protocol - which causes the candidate window
to be badly placed. (However we need ibus-gtk4 for Xorg sessions.)

Seems a workaround might be to patch:

--- ibus-1.5.24/client/gtk4/ibusim.c.orig	2021-07-30 23:12:21.747541875 +0900
+++ ibus-1.5.24/client/gtk4/ibusim.c	2021-07-31 01:55:43.785097447 +0900
@@ -34,10 +34,13 @@ g_io_im_ibus_load (GTypeModule *type_mod
     if (!inited) {
         ibus_init ();
         ibus_im_context_register_type (type_module);
+        /* "wayand" prority is 0 and "gtk-im-context-simple" one is G_MININT,
+         * "ibus" one is -100 here.
+         */
         g_io_extension_point_implement ("gtk-im-module",
                                         IBUS_TYPE_IM_CONTEXT,
                                         "ibus",
-                                        50);
+                                        -100);
         inited = TRUE;
     }
     /* make module resident */


But does this cause some problems?

Comment 1 Jens Petersen 2022-02-24 02:59:13 UTC
(related upstream gtk4 issue:

https://gitlab.gnome.org/GNOME/gtk/-/issues/4699 )

Comment 2 fujiwara 2022-03-09 00:04:54 UTC
There is no GTK4 applications.
I also think GNOME will change the priority if ibus-gtk4 will be installed by default.

Comment 3 Jens Petersen 2022-03-16 06:36:16 UTC
(In reply to fujiwara from comment #2)
> There is no GTK4 applications.

Well in Fedora 36:

$ rpm -e gtk4 |& grep libgtk-4
	libgtk-4.so.1()(64bit) is needed by (installed) libadwaita-1.1~beta-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-bluetooth-libs-1:42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-bluetooth-1:42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-desktop4-42~beta-3.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) xdg-desktop-portal-gnome-42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gtksourceview5-5.3.2-3.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) baobab-42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-tour-42~beta-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) colord-gtk4-0.3.0-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) libnma-gtk4-1.8.34-1.fc36.1.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-control-center-42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-shell-42~rc-2.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-contacts-42~alpha-2.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-calendar-42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-calculator-42~rc-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-text-editor-42~rc1-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-software-42~rc-2.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-clocks-42~beta-1.fc36.x86_64
	libgtk-4.so.1()(64bit) is needed by (installed) gnome-font-viewer-42~rc-1.fc36.x86_64


> I also think GNOME will change the priority if ibus-gtk4 will be installed
> by default.

It needs to be installed by default for Xorg sessions.

Comment 4 Jens Petersen 2022-04-12 02:35:16 UTC
I believe gtk4 is now fixed so this is no longer needed.

Comment 5 Jens Petersen 2022-04-12 04:59:01 UTC
Tested in Fedora-Workstation-Live-x86_64-36-20220410.n.0.iso


Note You need to log in before you can comment on or make changes to this bug.