GTK theming: oxygen-gtk support broken

Ruslan Kabatsayev b7.10110111 at gmail.com
Wed Jan 9 09:08:46 PST 2013


Hi,

On Wed, Jan 9, 2013 at 4:51 PM, Michael Meeks <michael.meeks at suse.com> wrote:
> Hi Ruslan,
>
> On Sat, 2013-01-05 at 22:59 +0300, Ruslan Kabatsayev wrote:
>> What about such a simple change, which will let us set LibO version
>> once and for all GTK theme calls:
>
>         I guess we could do; we'd want to produce a real version string for a
> patch though :-)
>
>         The reason why I put it on the top-level windows was so that it can be
> avoided for native widgets (eg. the gtk+ file selector) - but if that's
> not an issue then fine :-)
>
>>      // init gtk/gdk
>>      gtk_init_check( &nParams, &pCmdLineAry );
>> +    g_setenv("LibreOffice_Version","4.0.0.0",true);
>>      gdk_error_trap_push();
>>      aOrigXIOErrorHandler = XSetIOErrorHandler(XIOErrorHdl);
>>
>> --------------------------------
>> Of course, "4.0.0.0" should be replaced by some variable, name of
>> which I currently don't know. But how do you like this idea? It seems
>> the easiest and most efficient compared to any g_object_set_data()
>> way.
>
>         The g_object_set_data stuff is already in:
>
> +    static char pVersion[16] = "";
> +    if( pVersion[0] == '\0' )
> +        g_sprintf( pVersion, "%d", SUPD );
> +    g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", pVersion );
> +
>
>         should be in 4.0 and master.

I've checked this and it appears to work *sometimes* (i.e. for some
widgets). Also, it doesn't look too clean to me to make per-widget
changes only to make theme detect LibO version once (and possibly at
the earliest stage). I'd rather just put this to environment variable
and didn't mess with all these parenting problems.
So, if you don't mind putting version to env var, I'll submit a patch
which will remove the above half-working g_object-based code and add
g_setenv() call.
What env var name should be used, if this matters? Is "LibreOffice_Version" OK?

>
>         I wonder if we get problems from the (un-parented) fake widgets that
> are used in the salnativewidgets-gtk pile [ could that be why it doesn't
> work for you ? ].
>
>         If that's the issue (and most likely it is) - then we'd want to add a
> similar chunk of version code to the above to:
>
> static void NWAddWidgetToCacheWindow( GtkWidget* widget, SalX11Screen nScreen )
>
>         Where we construct and realize the cache window (I guess).
>
>         Using SUPD is reasonably easy - it is a 4.0.0 -> 400 thing: not
> terribly robust over big versions, but easy enough to parse I guess.
>
>         If you propose a patch, we can get it into 4.0.1rc2 !
>
>         Thanks :-)
>
>                 Michael.
>
> --
> michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot
>

Regards,
Ruslan


More information about the LibreOffice mailing list