GTK theming: oxygen-gtk support broken

classic Classic list List threaded Threaded
24 messages Options
Next » 12
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

GTK theming: oxygen-gtk support broken

Hello,

Some time after my commits, which enabled almost fully correct
oxygen-gtk support (latest commit was on Jul 8 2012), this support was
broken. See screenshots at [1], [2], [3] and [4] for details.
Those who hacked on GTK theming support since Jul 8 2012, please have
a look at this. If you think it's oxygen-gtk which should be fixed,
not libreoffice, please report the particular problems to
https://bugs.kde.org (product=Oxygen, component=gtk2-engine). I'll be
happy to improve things on oxygen-gtk side.

Thanks,
Ruslan

[1] Edit field and combo button sizes mismatch: http://i.imgur.com/lnvfS.png
[2] Background gradient not rendered: http://i.imgur.com/lRPLY.png
[3] Text line entry clips text to the left too much http://i.imgur.com/sV10D.png
[4] Menu expansion arrows are clipped at top: http://i.imgur.com/Gn67Z.png
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ivan Timofeev Ivan Timofeev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

Hi Ruslan,

On 01.11.2012 23:48, Ruslan Kabatsayev wrote:
> Some time after my commits, which enabled almost fully correct
> oxygen-gtk support (latest commit was on Jul 8 2012), this support was
> broken. See screenshots at [1], [2], [3] and [4] for details.

The problem at [1] is due to the following commits

  https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=50a20f94
  https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=681e894b

which take logic from _gtk_entry_get_borders

  http://git.gnome.org/browse/gtk+/tree/gtk/gtkentry.c?h=gtk-2-24#n2874

I have no idea of what is wrong with those commits.

Regards,
Ivan

> [1] Edit field and combo button sizes mismatch: http://i.imgur.com/lnvfS.png
> [2] Background gradient not rendered: http://i.imgur.com/lRPLY.png
> [3] Text line entry clips text to the left too much http://i.imgur.com/sV10D.png
> [4] Menu expansion arrows are clipped at top: http://i.imgur.com/Gn67Z.png

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

Hi Ivan,

OK, it appears that these commits have made LibO work more correctly
in GTK handling, and now oxygen-gtk's old hacks to work around
previous LibO incorrectness overcompensate the margins and need to be
removed.
To get this all work more or less as expected (i.e. to fix oxygen-gtk
at correct time), I'd need to know, which LibO releases will contain
these commits. Any pointers to this?

Thanks,
Ruslan

On Fri, Nov 2, 2012 at 1:26 PM, Ivan Timofeev <[hidden email]> wrote:

> Hi Ruslan,
>
> On 01.11.2012 23:48, Ruslan Kabatsayev wrote:
>> Some time after my commits, which enabled almost fully correct
>> oxygen-gtk support (latest commit was on Jul 8 2012), this support was
>> broken. See screenshots at [1], [2], [3] and [4] for details.
>
> The problem at [1] is due to the following commits
>
>   https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=50a20f94
>   https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=681e894b
>
> which take logic from _gtk_entry_get_borders
>
>   http://git.gnome.org/browse/gtk+/tree/gtk/gtkentry.c?h=gtk-2-24#n2874
>
> I have no idea of what is wrong with those commits.
>
> Regards,
> Ivan
>
>> [1] Edit field and combo button sizes mismatch: http://i.imgur.com/lnvfS.png
>> [2] Background gradient not rendered: http://i.imgur.com/lRPLY.png
>> [3] Text line entry clips text to the left too much http://i.imgur.com/sV10D.png
>> [4] Menu expansion arrows are clipped at top: http://i.imgur.com/Gn67Z.png
>
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Enrico Weigelt-2 Enrico Weigelt-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Ruslan Kabatsayev
Hi,

> Some time after my commits, which enabled almost fully correct
> oxygen-gtk support (latest commit was on Jul 8 2012), this support
> was
> broken. See screenshots at [1], [2], [3] and [4] for details.
> Those who hacked on GTK theming support since Jul 8 2012, please have
> a look at this. If you think it's oxygen-gtk which should be fixed,
> not libreoffice, please report the particular problems to
> https://bugs.kde.org (product=Oxygen, component=gtk2-engine). I'll be
> happy to improve things on oxygen-gtk side.

IIRC, this provides KDE look+feel using Gtk, right ?
That, IMHO, could count as argument for dropping Qt/KDE vcl.
(see my other postings about vcl's/widget toolkits)


cu
--
Mit freundlichen Grüßen / Kind regards

Enrico Weigelt
VNC - Virtual Network Consult GmbH
Head Of Development

Pariser Platz 4a, D-10117 Berlin
Tel.: +49 (30) 3464615-20
Fax: +49 (30) 3464615-59

[hidden email]; www.vnc.de
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

On Tue, Nov 20, 2012 at 2:45 AM, Enrico Weigelt <[hidden email]> wrote:
>
> IIRC, this provides KDE look+feel using Gtk, right ?
> That, IMHO, could count as argument for dropping Qt/KDE vcl.
> (see my other postings about vcl's/widget toolkits)

Not quite KDE look&feel in general, rather only Oxygen widget style
(not any other Qt style like Plastique). But still, KDE is indeed
mostly used with oxygen, so I do agree with you about dropping Qt/KDE
support in VCL (especially since it's much poorer than gtk support).
One thing which might be not so good here is KDE file open, file save,
print etc. dialogs. They appear much more usable than GTK ones, so
this is what I'd like to have left in (maybe even provide them for GTK
users if possible in principle & available at run time).

>
>
> cu
> --
> Mit freundlichen Grüßen / Kind regards
>
> Enrico Weigelt
> VNC - Virtual Network Consult GmbH
> Head Of Development
>
> Pariser Platz 4a, D-10117 Berlin
> Tel.: +49 (30) 3464615-20
> Fax: +49 (30) 3464615-59
>
> [hidden email]; www.vnc.de
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Enrico Weigelt-2

On Mon, 2012-11-19 at 23:45 +0100, Enrico Weigelt wrote:
> IIRC, this provides KDE look+feel using Gtk, right ?
> That, IMHO, could count as argument for dropping Qt/KDE vcl.
> (see my other postings about vcl's/widget toolkits)

        Please stop trolling on this topic.

        ATB,

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ivan Timofeev Ivan Timofeev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Ruslan Kabatsayev
On 19.11.2012 23:55, Ruslan Kabatsayev wrote:
> Hi Ivan,
>
> OK, it appears that these commits have made LibO work more correctly
> in GTK handling, and now oxygen-gtk's old hacks to work around
> previous LibO incorrectness overcompensate the margins and need to be
> removed.
> To get this all work more or less as expected (i.e. to fix oxygen-gtk
> at correct time), I'd need to know, which LibO releases will contain
> these commits. Any pointers to this?

Hi Ruslan,

The commits are included to the (upcoming) 4.0 release, and the release
plan says the 4.0.0 will be out Week 6, Feb 4 - Feb 10, 2013, see

  http://wiki.documentfoundation.org/ReleasePlan/4.0

Thanks!

Ivan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ivan Timofeev Ivan Timofeev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Ruslan Kabatsayev
Hi,

So, background gradients are fixed now with
http://cgit.freedesktop.org/libreoffice/core/commit/?id=a0a5eed63b871e2febb36e27e9dea4b7e57f681b

Regards,
Ivan

On 01.11.2012 23:48, Ruslan Kabatsayev wrote:
> Some time after my commits, which enabled almost fully correct
> oxygen-gtk support (latest commit was on Jul 8 2012), this support was
> broken. See screenshots at [1], [2], [3] and [4] for details.
[...]
> [1] Edit field and combo button sizes mismatch: http://i.imgur.com/lnvfS.png
> [2] Background gradient not rendered: http://i.imgur.com/lRPLY.png
> [3] Text line entry clips text to the left too much http://i.imgur.com/sV10D.png
> [4] Menu expansion arrows are clipped at top: http://i.imgur.com/Gn67Z.png

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Ruslan Kabatsayev

On Mon, 2012-11-19 at 23:55 +0400, Ruslan Kabatsayev wrote:
> OK, it appears that these commits have made LibO work more correctly
> in GTK handling, and now oxygen-gtk's old hacks to work around
> previous LibO incorrectness overcompensate the margins and need to be
> removed.

        Drat ... that is annoying. Hopefully we ended up fixing everything in
the right place in the end though ?

> To get this all work more or less as expected (i.e. to fix oxygen-gtk
> at correct time), I'd need to know, which LibO releases will contain
> these commits. Any pointers to this?

        Is it an easy thing to check from a gtk theme ? if not, is there
anything we can do to expose our version to theme authors more
helpfully ?

        It'd be reasonably easy to set some g_object_data on our top-level
windows or somesuch - if that helps you ? I guess we have no
GApplication usage as of now (in case that helps).

        Thanks so much for fixing things !

        All the best,

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

Hi Michael,

On Wed, Nov 21, 2012 at 7:09 PM, Michael Meeks <[hidden email]> wrote:
>
>> To get this all work more or less as expected (i.e. to fix oxygen-gtk
>> at correct time), I'd need to know, which LibO releases will contain
>> these commits. Any pointers to this?
>
>         Is it an easy thing to check from a gtk theme ?

This doesn't seem to be a very easy thing. Oxygen-gtk gets application
name via g_get_prgname() and also from PID reading /proc/$PID/cmdline.
Not very extensible for versions.

>         It'd be reasonably easy to set some g_object_data on our top-level
> windows or somesuch - if that helps you ? I guess we have no
> GApplication usage as of now (in case that helps).

Yeah, g_object_set_data with LibO version on widget passed to theme
would be just fine.
Something like this:
g_object_set_data(G_OBJECT(widget),"LibreOfficeVersion",(gpointer)0xMAJVMINV).
At least this will work for gtk2, not for gtk3 since no widgets are
passed there. Though I don't think we really want to explicitely
support LibO in oxygen-gtk3.

Regards,
Ruslan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Ivan Timofeev
Hi,

On Wed, Nov 21, 2012 at 6:36 PM, Ivan Timofeev <[hidden email]> wrote:
> Hi,
>
> So, background gradients are fixed now with
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=a0a5eed63b871e2febb36e27e9dea4b7e57f681b

Thanks, I confirm that it's fixed.

Regards,
Ruslan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Ruslan Kabatsayev

On Wed, 2012-11-21 at 19:46 +0400, Ruslan Kabatsayev wrote:
> This doesn't seem to be a very easy thing. Oxygen-gtk gets application
> name via g_get_prgname() and also from PID reading /proc/$PID/cmdline.
> Not very extensible for versions.

        Right :-)

> Yeah, g_object_set_data with LibO version on widget passed to theme
> would be just fine.

        Drat - I added it to each gtk top-level; but now I recall that the
widgets prolly behave somewhat oddly wrt. their parenting.

> Something like this:
> g_object_set_data(G_OBJECT(widget),"LibreOfficeVersion",(gpointer)0xMAJVMINV).
> At least this will work for gtk2, not for gtk3 since no widgets are
> passed there. Though I don't think we really want to explicitely
> support LibO in oxygen-gtk3.

        I have:

        m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType,
                                    "visible", FALSE, NULL );
    g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this );

    static char pVersion[16] = "";
    if( pVersion[0] == '\0' )
        g_sprintf( pVersion, "%d", SUPD );
    g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", pVersion );

        If that helps; if not - a patch to
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx would be appreciated :-) [ I
guess adding a helper and calling it in all those NWFooBaaEnsure methods
would do it - they look like they could use some re-factoring love
anyway ].

        Thanks !

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

Hi Michael,

What about such a simple change, which will let us set LibO version
once and for all GTK theme calls:
-------------------------------
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 14a1949..ec11a8f 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -667,6 +667,7 @@ void GtkData::Init()

     // 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.

Regards,
Ruslan

On Thu, Nov 22, 2012 at 4:19 PM, Michael Meeks <[hidden email]> wrote:

>
> On Wed, 2012-11-21 at 19:46 +0400, Ruslan Kabatsayev wrote:
>> This doesn't seem to be a very easy thing. Oxygen-gtk gets application
>> name via g_get_prgname() and also from PID reading /proc/$PID/cmdline.
>> Not very extensible for versions.
>
>         Right :-)
>
>> Yeah, g_object_set_data with LibO version on widget passed to theme
>> would be just fine.
>
>         Drat - I added it to each gtk top-level; but now I recall that the
> widgets prolly behave somewhat oddly wrt. their parenting.
>
>> Something like this:
>> g_object_set_data(G_OBJECT(widget),"LibreOfficeVersion",(gpointer)0xMAJVMINV).
>> At least this will work for gtk2, not for gtk3 since no widgets are
>> passed there. Though I don't think we really want to explicitely
>> support LibO in oxygen-gtk3.
>
>         I have:
>
>         m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType,
>                                     "visible", FALSE, NULL );
>     g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this );
>
>     static char pVersion[16] = "";
>     if( pVersion[0] == '\0' )
>         g_sprintf( pVersion, "%d", SUPD );
>     g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", pVersion );
>
>         If that helps; if not - a patch to
> vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx would be appreciated :-) [ I
> guess adding a helper and calling it in all those NWFooBaaEnsure methods
> would do it - they look like they could use some re-factoring love
> anyway ].
>
>         Thanks !
>
>                 Michael.
>
> --
> [hidden email]  <><, Pseudo Engineer, itinerant idiot
>
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

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 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.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Tor Lillqvist-2 Tor Lillqvist-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

>         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.

Hmm, I have wanted us to eventually get rid of this mysterious "SUPD"
symbol, and SOURCEVERSION == WORK_STAMP, who have their historical
roots in the MWS names of the old Sun OOo, and thus are meaningless to
us.

Why not just use some more normal, verbose and explicitly named macros
like LIBO_MAJOR_VERSION, LIBO_MINOR_VERSION, LIBO_MICRO_VERSION,
LIBO_PATCHLEVEL, or something similar?

--tml
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

Hi Tor,

On Wed, 2013-01-09 at 15:06 +0200, Tor Lillqvist wrote:
> Hmm, I have wanted us to eventually get rid of this mysterious "SUPD"
> symbol, and SOURCEVERSION == WORK_STAMP, who have their historical
> roots in the MWS names of the old Sun OOo, and thus are meaningless to
> us.

        :-)

> Why not just use some more normal, verbose and explicitly named macros
> like LIBO_MAJOR_VERSION, LIBO_MINOR_VERSION, LIBO_MICRO_VERSION,
> LIBO_PATCHLEVEL, or something similar?

        Go for it - it sounds like the libo-version thing is not currently
used; and if there is a nicer macro (I couldn't find it for some reason
- prolly I was looking on the compile line for a -D ;-), then we should
clearly use it.

        Thanks !

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

On 01/09/2013 02:54 PM, Michael Meeks wrote:
>> Why not just use some more normal, verbose and explicitly named macros
>> like LIBO_MAJOR_VERSION, LIBO_MINOR_VERSION, LIBO_MICRO_VERSION,
>> LIBO_PATCHLEVEL, or something similar?
>
> Go for it - it sounds like the libo-version thing is not currently
> used; and if there is a nicer macro (I couldn't find it for some reason
> - prolly I was looking on the compile line for a -D ;-), then we should
> clearly use it.

Regarding version information, there is solver/*/inc/*minor.mk
(make-level variables VERSIONMAJOR, VERSIONMINOR, etc.) and there is
solenv/inc/version.hrc including versionlist.hrc (#defines for VERSION,
SUBVERSION, etc.).

C++ code like desktop/source/deployment/misc/dp_dependencies.cxx uses
utl::ConfigManager::getAboutBoxProductVersion, which in turn reads the
/org.openoffice.Setup/Product/ configuration data.

(In case anything of that is useful or relevant for the current thread,
which I didn't quite get.)

Stephan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken


On Wed, 2013-01-09 at 15:47 +0100, Stephan Bergmann wrote:
> Regarding version information, there is solver/*/inc/*minor.mk
> (make-level variables VERSIONMAJOR, VERSIONMINOR, etc.) and there is
> solenv/inc/version.hrc including versionlist.hrc (#defines for VERSION,
> SUBVERSION, etc.).

        Wow - sounds like Tor is right - we have a proliferation of duplicated
macros here that need cleaning :-)

> C++ code like desktop/source/deployment/misc/dp_dependencies.cxx uses
> utl::ConfigManager::getAboutBoxProductVersion, which in turn reads the
> /org.openoffice.Setup/Product/ configuration data.

        I considered using that; but I didn't really want to fetch a configmgr
instance, and go through all that rats nest for each VCL window creation
- particularly when we know the version at compile time :-)

> (In case anything of that is useful or relevant for the current thread,
> which I didn't quite get.)

        :-) all about allowing complex gtk+ 2.0 themes to adapt to our version.

        HTH,

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Ruslan Kabatsayev Ruslan Kabatsayev
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by Michael Meeks-2
Hi,

On Wed, Jan 9, 2013 at 4:51 PM, Michael Meeks <[hidden email]> 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.
>
> --
> [hidden email]  <><, Pseudo Engineer, itinerant idiot
>

Regards,
Ruslan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Tor Lillqvist-2 Tor Lillqvist-2
Reply | Threaded
Open this post in threaded view
|

Re: GTK theming: oxygen-gtk support broken

In reply to this post by sberg
> Regarding version information, there is solver/*/inc/*minor.mk

And of course the very file name of that "*minor.mk" contains the
mysterious three-digits-no-separators number which is a relic from
conventions in the OOo EIS/MWS/CWS days;)

> (make-level
> variables VERSIONMAJOR, VERSIONMINOR, etc.) and there is
> solenv/inc/version.hrc including versionlist.hrc (#defines for VERSION,
> SUBVERSION, etc.).

All names which are horribly generic, and it's just good luck they
haven't clashed with anything in some system header, or 3rd-.party
header, or something else;)

> (In case anything of that is useful or relevant for the current thread,
> which I didn't quite get.)

I should have started a new thread when I replied to the mention of
"SUPD" in Michael's email.

--tml
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Next » 12