After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 415853 - g_set_application_name() binding
g_set_application_name() binding
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2007-03-07 21:56 UTC by Havoc Pennington
Modified: 2007-11-28 05:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2007-03-07 21:56:30 UTC
maybe I'm blind, is this missing?
Comment 1 Gustavo Carneiro 2007-03-07 22:34:07 UTC
Yes, it's missing.
Comment 2 Havoc Pennington 2007-03-08 21:54:43 UTC
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...
Comment 3 Johan (not receiving bugmail) Dahlin 2007-03-08 22:51:49 UTC
(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.
Comment 4 Havoc Pennington 2007-03-08 23:14:55 UTC
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;
}
Comment 5 Gustavo Carneiro 2007-04-14 17:11:34 UTC
Committed revision 644.
Comment 6 Bug flys 2007-11-28 05:16:59 UTC
and g_get_application_name() is not wrapped. It's confusing. Besides, not document mentioned this wrapper.