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

open_dialog warning #71

Closed
pvermees opened this issue Aug 1, 2024 · 8 comments
Closed

open_dialog warning #71

pvermees opened this issue Aug 1, 2024 · 8 comments

Comments

@pvermees
Copy link

pvermees commented Aug 1, 2024

The following script was put together using code snippets from the documentation:

using Gtk4
win = GtkWindow("open_dialog tester", 400, 200)
function f(filename)
   println(filename * " loaded")
end
open_dialog(f, "Pick a file to open", win)

Running it from the REPL gives the following warning:

(process:259564): Gtk-WARNING **: 08:28:46.055: Attempting to add 'file:///home/test/test.txt' to the list of recently used resources, but no name of the application that is registering it was defined

I don't know if this is a bug or a feature, but how does one get rid of this warning?

@jwahlstrand
Copy link
Member

What platform? This is something the underlying C library is doing. I will look for a way of quieting the warning this weekend.

@pvermees
Copy link
Author

pvermees commented Aug 1, 2024

Julia 1.10.4 under Ubuntu 22.04.4 with i3wm

Thanks!

@jwahlstrand
Copy link
Member

The warning is being emitted because the application name isn't set: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkrecentmanager.c?ref_type=heads#L932

Try the following before calling open_dialog:

Gtk4.GLib.G_.set_application_name("myapp")
Gtk4.GLib.G_.set_prgname("myapp")

For me that gets rid of the warning. Maybe these should be set to something like "julia" or "Gtk4.jl" by default in the package if GtkApplication is not used (which handles this automatically).

Let me know if this helps.

@pvermees
Copy link
Author

pvermees commented Aug 3, 2024

Now I get

Gtk-WARNING **: 13:05:47.701: No IM module matching GTK_IM_MODULE=ibus found

@jwahlstrand
Copy link
Member

jwahlstrand commented Aug 3, 2024

I don't see that "ibus" warning using i3wm on Fedora.

Potential clue:

https://discourse.ubuntu.com/t/ibus-no-more-gtk-im-module-ibus/17727

Could you set ENV["GTK_IM_MODULE"]="ibus"?

@pvermees
Copy link
Author

pvermees commented Aug 3, 2024

I can't quite figure out how to do this. I will be offline for a couple of days but will investigate it further when I return. You've already helped me a lot. Thanks!

@jwahlstrand
Copy link
Member

I was able to try this on GNOME on Ubuntu and the "ibus" warning doesn't appear. So it looks like a i3wm + Ubuntu issue? Thanks for pointing out the other warning, I had seen it but didn't realize it was easy to fix.

@pvermees
Copy link
Author

All fine now. Thanks for the help!

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

No branches or pull requests

2 participants