Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fcitx5 causes crash due to missing dbus name #12371

Closed
ThereGoesMySanity opened this issue Jul 29, 2023 · 3 comments · Fixed by #12377
Closed

Fcitx5 causes crash due to missing dbus name #12371

ThereGoesMySanity opened this issue Jul 29, 2023 · 3 comments · Fixed by #12377
Labels

Comments

@ThereGoesMySanity
Copy link
Contributor

Describe the bug
With Fcitx5 (on my system), the available dbus names are org.fcitx.Fcitx-0, org.fcitx.Fcitx5, and org.freedesktop.portal.Fcitx.

On version 11.0.1 my application crashes when a text box is rendered with the error

Tmds.DBus.Protocol.DBusException : org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.fcitx.Fcitx': no such name

When I change org.fcitx.Fcitx on these lines:

public FcitxX11TextInputMethod(Connection connection) : base(connection, "org.fcitx.Fcitx", "org.freedesktop.portal.Fcitx") { }


to org.fcitx.Fcitx-0, it works correctly.

To Reproduce
Steps to reproduce the behavior:

Run an application on a Linux system with Fcitx5 installed and try to use a text box.

Expected behavior
The application should not crash.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Version 11.0.1, commit 9808a44

Additional context

@kekekeks
Copy link
Member

If you look closer, you'll see that it tries multiple dbus names in a try/catch block:

try
{
if (await Connect(name))
{
_onlineNamesQueue.Clear();
_currentName = name;
return;
}
}
catch (Exception ex)
{
Logger.TryGet(LogEventLevel.Error, "IME")
?.Log(this, "Unable to create IME input context:\n" + ex);
}

So it would eventually find the portal-based version.

@ThereGoesMySanity
Copy link
Contributor Author

Ignore my previous comment - it looks like only the first dbus name is actually being tried.

When I change the order of the names so that "org.freedesktop.portal.Fcitx" is first in the list, it works correctly.

@ThereGoesMySanity
Copy link
Contributor Author

Figured it out. Exceptions were causing the for loop to end early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants