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 637268 - port gthumb to GTK+3
port gthumb to GTK+3
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.12.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2010-12-14 22:28 UTC by Christian Krause
Modified: 2012-06-13 12:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Krause 2010-12-14 22:28:25 UTC
In the near future (e.g. in Fedora beginning with F15 in May 2011), GTK+3 will be available and lots of GNOME's base libraries (e.g. clutter-gtk, brasero etc.) will be linked against GTK+3.

Since mixed linkage is highly discouraged ( http://library.gnome.org/devel/gtk/unstable/ch25s02.html#id1288469 ) gthumb can't use these libraries then (and will loose e.g. some features) or must be compiled against GTK+3 itself.

I would assume that porting gthumb to GTK+3 seems to best way to go...
Comment 1 Lincoln de Sousa 2011-05-07 14:50:50 UTC
Hello there, I've just started working on this bug. I have published a git tree [0] with the working progress, I guess it's better than sending a lot of patches against this bug report. If you think I'm wrong, please let me know :)

I don't have an extimative about how many work still needed, but I've made a lot of progress in a few hours of work.

[0] http://git.comum.org/gitweb.cgi?p=lincoln/gthumb.git;a=shortlog;h=refs/heads/gtk3

ps.: The clone url is http://git.comum.org/lincoln/gthumb.git -- in the gtk3 branch
Comment 2 Paolo Bacchilega 2011-05-07 18:18:07 UTC
Lincoln, 

thanks for your work, but keep in mind that the next stable version (2.14) will still use gtk2, the porting you are doing will be merged in the next development cycle, anyway the remaining features to add to version 2.13 will not affect the current code but will be added as extensions, so your work will not be lost.
Comment 3 Lincoln de Sousa 2011-05-07 19:16:26 UTC
(In reply to comment #2)
> Lincoln, 
> 
> thanks for your work, but keep in mind that the next stable version (2.14) will
> still use gtk2, the porting you are doing will be merged in the next
> development cycle, anyway the remaining features to add to version 2.13 will
> not affect the current code but will be added as extensions, so your work will
> not be lost.

Thank you for pointing it up. With this tip, I'll rebase my working branch most fequently to make it easy to merge these changes in the next version.
Comment 4 Paolo Bacchilega 2011-05-08 12:50:21 UTC
gthumb 2.13 could be ported to gtk+ 2.24, which is the version that current distributions already use, and would make the porting to gtk+ 3.0 easier.

Lincoln, if you are interested in a porting to gtk+ 2.24 please let me know, or I'll try make it when I'll have the time.
Comment 5 Paolo Bacchilega 2011-05-12 20:24:07 UTC
I've now pushed to master many of the commits of Lincoln's gtk3 branch, gthumb now compiles with gtk+ 2.24 with all the deprecations enabled, this will make the port to gtk+ 3 easier in the future.
Comment 6 Michael Chudobiak 2011-05-13 13:31:21 UTC
git master will no longer compile on Fedora 14 (gtk2-2.22.0-1.fc14.1.x86_64).

Is that intentional?
Comment 7 Lincoln de Sousa 2011-05-13 15:23:34 UTC
(In reply to comment #4)
> gthumb 2.13 could be ported to gtk+ 2.24, which is the version that current
> distributions already use, and would make the porting to gtk+ 3.0 easier.
> 
> Lincoln, if you are interested in a porting to gtk+ 2.24 please let me know, or
> I'll try make it when I'll have the time.

I agree with that. So, I'll focus on getting gthumb compiling with the --enable-geseal and --disable-deprecated flags.

Anyway, I have started to work on two specific things that can be applied in next releases:

 * using cairo for drawing instead of gdk_draw_*
 * replacing size_request by get_preferred_{width,height}

ps.: I have also created another bug that would be good to be fixed to continue the work on this issue: #650117
Comment 8 Paolo Bacchilega 2011-05-13 20:01:34 UTC
(In reply to comment #6)
> git master will no longer compile on Fedora 14 (gtk2-2.22.0-1.fc14.1.x86_64).
> 
> Is that intentional?

gtk+ 2.24 is now explicitly required in configure.ac, however I didn't try to compile it with gtk+ 2.22, you can try to change the minimum required version of gtk+ to 2.22 and see if it works.
Comment 9 Paolo Bacchilega 2011-05-13 20:04:45 UTC
(In reply to comment #7)
> (In reply to comment #4)
> > gthumb 2.13 could be ported to gtk+ 2.24, which is the version that current
> > distributions already use, and would make the porting to gtk+ 3.0 easier.
> > 
> > Lincoln, if you are interested in a porting to gtk+ 2.24 please let me know, or
> > I'll try make it when I'll have the time.
> 
> I agree with that. So, I'll focus on getting gthumb compiling with the
> --enable-geseal and --disable-deprecated flags.
> 
> Anyway, I have started to work on two specific things that can be applied in
> next releases:
> 
>  * using cairo for drawing instead of gdk_draw_*

gdk_draw_* functions are already gone, I did the work some time ago 

>  * replacing size_request by get_preferred_{width,height}

great, thank you.
Comment 10 Michael Chudobiak 2011-05-13 20:31:57 UTC
No, it won't compile with gtk 2.22.x. You would need lots of #ifs like this:

+#if GTK_CHECK_VERSION (2, 24, 0)
       gdk_x11_set_sm_client_id (xsmp->client_id);
+#else
+      gdk_set_sm_client_id (xsmp->client_id);      
+#endif


Also, the gtk_combo_box_text stuff would all have to be #if'd.

Anyway, git master won't build on the major current distros... I don't know if that's a problem for you, but I won't be testing gThumb until after Fedora 15 in that case.

- Mike
Comment 11 Lincoln de Sousa 2011-05-13 21:09:01 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > (In reply to comment #4)
> > > gthumb 2.13 could be ported to gtk+ 2.24, which is the version that current
> > > distributions already use, and would make the porting to gtk+ 3.0 easier.
> > > 
> > > Lincoln, if you are interested in a porting to gtk+ 2.24 please let me know, or
> > > I'll try make it when I'll have the time.
> > 
> > I agree with that. So, I'll focus on getting gthumb compiling with the
> > --enable-geseal and --disable-deprecated flags.
> > 
> > Anyway, I have started to work on two specific things that can be applied in
> > next releases:
> > 
> >  * using cairo for drawing instead of gdk_draw_*

Perfect :)

> gdk_draw_* functions are already gone, I did the work some time ago 
> 
> >  * replacing size_request by get_preferred_{width,height}
> 
> great, thank you.

There's other line in the todo list:

Migrating the _expose_event methods by _draw ones
Comment 12 Lincoln de Sousa 2011-05-13 21:32:43 UTC
with this commit[0] gthumb compiles linking against gtk 2.24 with --enable-gseal and --disable-deprecated. I recommend a cherry pick :)

[0] ec5f2f8b7d3293df673e1117e5eb28df3d26a0c7

http://git.comum.org/lincoln/gthumb.git (gtk3 branch)
Comment 13 Paolo Bacchilega 2011-05-14 07:33:08 UTC
(In reply to comment #10)
> No, it won't compile with gtk 2.22.x. You would need lots of #ifs like this:
> 
> +#if GTK_CHECK_VERSION (2, 24, 0)
>        gdk_x11_set_sm_client_id (xsmp->client_id);
> +#else
> +      gdk_set_sm_client_id (xsmp->client_id);      
> +#endif
> 
> 
> Also, the gtk_combo_box_text stuff would all have to be #if'd.
> 
> Anyway, git master won't build on the major current distros... I don't know if
> that's a problem for you, but I won't be testing gThumb until after Fedora 15
> in that case.
> 
> - Mike

that's not a big problem, you have to wait 11 days according to the fedora project site.
Comment 14 Paolo Bacchilega 2011-05-14 08:12:41 UTC
(In reply to comment #12)
> with this commit[0] gthumb compiles linking against gtk 2.24 with
> --enable-gseal and --disable-deprecated. I recommend a cherry pick :)
> 
> [0] ec5f2f8b7d3293df673e1117e5eb28df3d26a0c7
> 
> http://git.comum.org/lincoln/gthumb.git (gtk3 branch)

pushed to master now, thank you.
Comment 15 Paolo Bacchilega 2012-06-13 12:44:44 UTC
version 3.0 uses gtk+ 3