I have a project using GTK+ 3 only for certain tasks, for example to provide file open dialog with gtk_file_chooser_dialog_new
. I have to set parent
to NULL
as I have no "main" GTK window. However it's quite annoying that stdout of my program is flooded with message like this (especially because I use stdin with libreadline to have command line interface as well):
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
How can I avoid this? Or better (probably also more correct method), not just avoid: can I assign somehow an X11 window as parent for a GTK widget, without too much work? Actually, it's an SDL project, but I don't want to "embed" SDL into a GTK window for just this. However I can say the X11 Window id of my SDL window with SDL_GetWindowWMInfo()
. As far as I see this would be better than just "avoiding" the message from GTK (but I even don't know how to do that), because -for example - window manager knows about the relation of dialog and main (SDL/X11) window, etc ...
That's only a side note (and should be another question indeed) that it seems, various GUI events (mouse clicks, key presses etc) done during the GTK file selection may be "sensed" by SDL then (after dialog box is closed, etc) which is not wanted of course. I guess I should try to empty SDL event queue from the unwanted events ...