GNOME Bugzilla – Bug 415853
g_set_application_name() binding
Last modified: 2007-11-28 05:16:59 UTC
maybe I'm blind, is this missing?
Yes, it's missing.
g_set_prgname is needed also. Without these two, it looks like all pygtk apps have a broken window class (the name of the source file they are run as, like "foo.py"), which would e.g. show up as the name of the app when grouping windows in the taskbar. Also the default window title is messed up. I'd do a patch but I'm assuming it's a trivial addition to the .defs file that someone with a clue can do just as quickly as downloading the patch...
(In reply to comment #2) > g_set_prgname is needed also. > > Without these two, it looks like all pygtk apps have a broken window class (the > name of the source file they are run as, like "foo.py"), which would e.g. show > up as the name of the app when grouping windows in the taskbar. Also the > default window title is messed up. Nod. > I'd do a patch but I'm assuming it's a trivial addition to the .defs file that > someone with a clue can do just as quickly as downloading the patch... > It's not, gobject does not the code generator. It's more like 10 lines per function you need to implement.
here's the code from our local workaround... which file in pygobject would this go in? (do you know btw if the string there needs to be freed ;-) also, do you want to "fix" g_set_prgname to not be weirdly abbreviated? PyObject* bigboard_set_application_name(PyObject *self, PyObject *args) { PyObject *result = NULL; char *s; if (PyArg_ParseTuple(args, "s:bigboard_set_application_name", &s)) { /* my impression from the python docs is that "s" is not owned by us so not freed */ g_set_application_name(s); Py_INCREF(Py_None); result = Py_None; } return result; } PyObject* bigboard_set_program_name(PyObject *self, PyObject *args) { PyObject *result = NULL; char *s; if (PyArg_ParseTuple(args, "s:bigboard_set_program_name", &s)) { /* my impression from the python docs is that "s" is not owned by us so not freed */ g_set_prgname(s); Py_INCREF(Py_None); result = Py_None; } return result; }
Committed revision 644.
and g_get_application_name() is not wrapped. It's confusing. Besides, not document mentioned this wrapper.