mike-fabian / ibus-typing-booster

ibus-typing-booster is a completion input method for faster typing
https://mike-fabian.github.io/ibus-typing-booster/
Other
233 stars 15 forks source link

[BUG] - Preferences not openning - "Settings schema 'org.freedesktop.ibus.engine.typing-booster' does not contain a key named 'qtimmoduleworkaround'" #444

Closed beobcode closed 1 year ago

beobcode commented 1 year ago

Describe the bug Type booster will not work. Also, when clicking on "Preferences" in the ibus app, nothing happens.

To Reproduce Steps to reproduce the behaviour:

  1. Go to 'ibus preferences'
  2. Click on 'Input method'
  3. Click on 'Other - Type Booster'
  4. Click on 'Preferences'
  5. No Preferences windows shows up.

Expected behaviour I would expect the Type Booster to show.

Screenshots or videos N/A

ibus-typing-booster version?

I complied ibus-typing-booster-2.22.5 following the basic instructions in the INSTALL file. I used './configure && sudo make && sudo make install' please not I had to use sudo, otherwise I was getting permission errors. Also, note there were no errors during this process.

Also, please note, I did try other older versions of the and was getting the same problem. The version that comes with mint worked fine, but it was so outdated and didn't have the options I wanted, hence i why I chose to update.

ibus version? IBus 1.5.22

Distribution and version? Linux Mint 20.3 Una

Desktop and version? Cinnamon 5.2.7

Xorg or Wayland? x11

Additional context Just the error I'm getting from ibus

$ ibus-daemon -v

(ibus-ui-gtk3:392520): IBUS-WARNING **: 11:20:49.161: panel.vala:255: If you launch KDE5 on xterm, export XDG_CURRENT_DESKTOP=KDE before launch KDE5.

(ibus-ui-gtk3:392520): IBUS-WARNING **: 11:20:49.230: ibus_bus_call_sync: org.freedesktop.DBus.Properties.Get: GDBus.Error:org.freedesktop.DBus.Error.Failed: No global engine.

(ibus-ui-gtk3:392520): Gdk-CRITICAL **: 11:20:49.547: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed

(main.py:392571): GLib-GIO-ERROR **: 11:21:02.140: Settings schema 'org.freedesktop.ibus.engine.typing-booster' does not contain a key named 'qtimmoduleworkaround'

(ibus-ui-gtk3:392520): IBUS-WARNING **: 11:21:02.443: ibus_bus_call_sync: org.freedesktop.IBus.SetGlobalEngine: GDBus.Error:org.freedesktop.DBus.Error.Failed: Set global engine failed: The connection is closed

(ibus-ui-gtk3:392520): IBUS-WARNING **: 11:21:02.443: panel.vala:818: Switch engine to typing-booster failed.

(main.py:392617): GLib-GIO-ERROR **: 11:21:05.948: Settings schema 'org.freedesktop.ibus.engine.typing-booster' does not contain a key named 'qtimmoduleworkaround'

(ibus-ui-gtk3:392520): IBUS-WARNING **: 11:21:06.194: ibus_bus_call_sync: org.freedesktop.IBus.SetGlobalEngine: GDBus.Error:org.freedesktop.DBus.Error.Failed: Set global engine failed: The connection is closed

(ibus-ui-gtk3:392520): IBUS-WARNING **: 11:21:06.194: panel.vala:818: Switch engine to typing-booster failed.

mike-fabian commented 1 year ago

(main.py:392571): GLib-GIO-ERROR **: 11:21:02.140: Settings schema 'org.freedesktop.ibus.engine.typing-booster' does not contain a key named 'qtimmoduleworkaround'

That means that

/usr/share/glib-2.0/schemas/org.freedesktop.ibus.engine.typing-booster.gschema.xml

was not installed and/or not compiled.

I am not sure why this happened for you because sudo make install should have done that.

If I type sudo make -n install (The option -n is to see what would be done without actually doing anything), it ends with:

list='org.freedesktop.ibus.engine.typing-booster.gschema.xml'; test -n "/usr/share/glib-2.0/schemas/" || list=; \
if test -n "$list"; then \
  echo " /usr/bin/mkdir -p '/usr/share/glib-2.0/schemas/'"; \
  /usr/bin/mkdir -p "/usr/share/glib-2.0/schemas/" || exit 1; \
fi; \
for p in $list; do \
  if test -f "$p"; then d=; else d="./"; fi; \
  echo "$d$p"; \
done | sed '$!N;$!N;$!N;$!N;$!N;$!N;$!N;s/\n/ /g' | sed '$!N;$!N;$!N;$!N;s/\n/ /g' | \
while read files; do \
  echo " /usr/bin/install -c -m 644 $files '/usr/share/glib-2.0/schemas/'"; \
  /usr/bin/install -c -m 644 $files "/usr/share/glib-2.0/schemas/" || exit $?; \
done
:
make  install-data-hook
make[3]: Entering directory '/local/mfabian/src/ibus-typing-booster'
if test -z ""; then \
    glib-compile-schemas /usr/share/glib-2.0/schemas/; \
fi
make[3]: Leaving directory '/local/mfabian/src/ibus-typing-booster'
make[2]: Leaving directory '/local/mfabian/src/ibus-typing-booster'
make[1]: Leaving directory '/local/mfabian/src/ibus-typing-booster'

I.e. it installs the file org.freedesktop.ibus.engine.typing-booster.gschema.xml to /usr/share/glib-2.0/schemas/org.freedesktop.ibus.engine.typing-booster.gschema.xml and then compiles the schema files in that directory.

Looking at your error message, this file has not been installed and/or the schema files have not been compiled.

To fix that manually you can install that file manually:

sudo cp org.freedesktop.ibus.engine.typing-booster.gschema.xml /usr/share/glib-2.0/schemas/

and then compile the schema file manually like this:

sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

After doing that, you should be able to start the setup tool and use ibus-typing-booster.

beobcode commented 1 year ago

Hi Mike, thank you for getting back to me. I am pleased to report, I am typing using type-booster. I noticed in your output that it's being installed into '/usr/share/' where mine was being installed into '/usr/local/'. So, after a lot of digging, I found I still had the old version running and the new version. So, I uninstalled the old version completely and uninstalled the new version using 'make uninstalled'. Then I ran './configure --prefix=/usr' and 'sudo make install'. Now everything seems to be working.

I am not sure why, but it will not run if it's installed in the '/usr/local'

mike-fabian commented 1 year ago

Hi Mike, thank you for getting back to me. I am pleased to report, I am typing using type-booster. I noticed in your output that it's being installed into '/usr/share/' where mine was being installed into '/usr/local/'. So, after a lot of digging, I found I still had the old version running and the new version. So, I uninstalled the old version completely and uninstalled the new version using 'make uninstalled'. Then I ran './configure --prefix=/usr' and 'sudo make install'. Now everything seems to be working.

I am not sure why, but it will not run if it's installed in the '/usr/local'

Yes, installing in /usr/local doesn't work. I am not sure whether this is fixable.

For example,

https://github.com/mike-fabian/ibus-typing-booster/blob/main/setup/main.py#L146

self._gsettings = Gio.Settings(schema='org.freedesktop.ibus.engine.typing-booster')

tries to open the schema file /usr/share/glib-2.0/schemas/org.freedesktop.ibus.engine.typing-booster.gschema.xml.

Note that the path /usr/share/glib-2.0/schemas/ is not specified in

self._gsettings = Gio.Settings(schema='org.freedesktop.ibus.engine.typing-booster')

Gio.Settings is from glib2:

$ rpm -ql glib2 | grep -i gio
/usr/bin/gio
/usr/bin/gio-querymodules-64
/usr/lib64/gio
/usr/lib64/gio/modules
/usr/lib64/gio/modules/giomodule.cache
/usr/lib64/libgio-2.0.so.0
/usr/lib64/libgio-2.0.so.0.7600.3
/usr/libexec/gio-launch-desktop
/usr/share/bash-completion/completions/gio
/usr/share/man/man1/gio-querymodules.1.gz
/usr/share/man/man1/gio.1.gz

glib2 searches in /usr/share/glib-2.0, ibus-typing-booster does not influence that.

Probably, if you install everything needed into /usr/local it would work. That might require to install glib2, ibus, gtk, ... maybe lots of other stuff into /usr/local. I never tried that. I think it won't be easy to make that work.

When you installed to /usr/local, the file /usr/share/glib-2.0/schemas/org.freedesktop.ibus.engine.typing-booster.gschema.xml was still the old one, the new one was probably in /usr/local/share/glib-2.0/schemas/org.freedesktop.ibus.engine.typing-booster.gschema.xml. And therefore it was ignored and the old one was still loaded.

A similar problem might occur with the start scripts, on Fedora these are in

/usr/libexec/ibus-engine-typing-booster
/usr/libexec/ibus-setup-typing-booster

If Mint is a Debian/Ubuntu variant, these are probably in

/usr/lib/ibus/ibus-engine-typing-booster
/usr/lib/ibus/ibus-setup-typing-booster

So on Fedora you would use

./configure --prefix=/usr --libexecdir=/usr/libexec

(and --libexecdir=/usr/libexec can be omitted because it is the default.

And on Ubuntu/Debian one needs to use:

./configure --prefix=/usr --libexecdir=/usr/lib/ibus

Another important file is /usr/share/ibus/component/typing-booster.xml:

$ cat /usr/share/ibus/component/typing-booster.xml 
<?xml version='1.0' encoding='utf-8'?>
<!-- filename: typing-booster.xml -->
<component>
    <name>org.freedesktop.IBus.IbusTypingBooster</name>
    <description>Typing Booster Component</description>
    <exec>/usr/libexec/ibus-engine-typing-booster --ibus</exec>
    <version>2.22.5</version>
    <author>
      Mike FABIAN &lt;mfabian@redhat.com&gt;
      Anish Patil &lt;anish.developer@gmail.com&gt;
    </author>
    <license>GPL</license>
    <homepage>http://mike-fabian.github.io/ibus-typing-booster</homepage>
    <textdomain>ibus-typing-booster</textdomain>
    <observed-paths>
        <path>/usr/share/ibus-typing-booster/data/</path>
    </observed-paths>
    <engines exec='/usr/libexec/ibus-engine-typing-booster --xml'/>
</component>

If that file is installed to /usr/local/share/ibus/component/typing-booster.xml, then ibus will not find it (unless ibus itself was installed to /usr/local maybe). And that file contains the important exec information, it by reading this ibus knows how to start typing booster and how to find out which engines typing booster offers:

$ /usr/libexec/ibus-engine-typing-booster --xml
<engines>
    <engine>
        <name>typing-booster</name>
        <longname>Typing Booster</longname>
        <language>t</language>
        <license>GPL</license>
        <author>Mike FABIAN &lt;mfabian@redhat.com&gt;, Anish Patil &lt;anish.developer@gmail.com&gt;</author>
        <icon>/usr/share/ibus-typing-booster/icons/ibus-typing-booster.svg</icon>
        <layout>default</layout>
        <description>A completion input method to speedup typing.</description>
        <symbol>🚀</symbol>
        <setup>/usr/libexec/ibus-setup-typing-booster</setup>
        <icon_prop_key>InputMode</icon_prop_key>
        </engine>
</engines>
mike-fabian commented 1 year ago

Hi Mike, thank you for getting back to me. I am pleased to report, I am typing using type-booster. I noticed in your output that it's being installed into '/usr/share/' where mine was being installed into '/usr/local/'. So, after a lot of digging, I found I still had the old version running and the new version. So, I uninstalled the old version completely and uninstalled the new version using 'make uninstalled'. Then I ran './configure --prefix=/usr' and 'sudo make install'. Now everything seems to be working.

I am not sure why, but it will not run if it's installed in the '/usr/local'

I added something to the documentation warning about not installing to /usr/local:

https://mike-fabian.github.io/ibus-typing-booster/docs/dev/

now contains:

For all distributions: please use --prefix=/usr and not the default /usr/local, installing into /usr/local will usually not work! And use the correct --libexecdir option for your distribution, the default is --libexecdir=/usr/libexec which is correct for Fedora, but on openSUSE and Debian based distributions it is --libexecdir=/usr/lib/ibus!

mike-fabian commented 1 year ago

In ibus-typing-booster-2.23.0:

https://github.com/mike-fabian/ibus-typing-booster/releases/tag/2.23.0

./autoreconf.sh and ./configure print a warning now when the prefix is /usr/local.