Support for GTK3

Bug #861351 reported by Michael Moroni
34
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Midori Web Browser
Fix Released
High
Unassigned

Bug Description

It seems that Midori is built upon GTK2. Is it possible to update the code in order to use GTK3?

Tags: gtk3
Michael Moroni (airon90)
tags: added: gtk
Revision history for this message
xapantu (xapantu) wrote :

I am quite interested by this bug, it must be doable using conditional compilation, I will take a look...

Changed in midori:
assignee: nobody → xapantu (xapantu)
Revision history for this message
xapantu (xapantu) wrote :

Midori in gtk3 http://pix.toile-libre.org/upload/original/1317415007.png

Here is a patch, it is not finished (just to show you the progress), it needs at least an option in waf (I never used it, so, I will need to investigate for that) to turn off/on gtk3. There are some bugs:
- It's aborting with ctrl+F
- The popup for the locationbar is misplaced
- The menubar doesn't want to be disabled by default (is it a indicator-gtk3 bug?)

It can't be built with unique and the extensions, so, if you want to try this patch, you'll have to build with "./configure --disable-unique --disable-addons".

I will completed it with GtkApplication + addons support...

Revision history for this message
Danielle Foré (danrabbit) wrote :

The menubar thing is indeed a bug from one of the indicator packages.

You are a beast dude, keep up the good work :D

Revision history for this message
Cris Dywan (kalikiana) wrote :

I suggest a way to keep the code simpler could be to have #defines, starting like this:

#if !GTK_CHECK_VERSION(3,0,0)
    #define GTK_DIALOG_NO_SEPARATOR 0
    #define gtk_combo_box_text_get_active_text gtk_combo_box_append_text
    #define gtk_combo_box_text_append_text gtk_combo_box_append_text
    #define gtk_combo_box_text_new gtk_combo_box_new_text
    /* key defines go here */
#endif

As for WAF, Postler can serve as an example. If you want, I can also take care of fixing that up. http://git.xfce.org/apps/postler/tree/wscript#n119

Revision history for this message
xapantu (xapantu) wrote :

This patch fixes the problem in the other one:
- a gtk3-compat.h file, which adds GDK_KEY_* and gtk_combo_box_text definitions for old gtk versions.
- --enable-gtk3 for waf (disable unique by default)
- extension building, statusbar-feature loading fail, because it uses a GtkComboboxEntry, which is not in gtk3 :(

I didn't test with a gtk version which doesn't have GDK_KEY*, so, I'm not 100% sure it works, but it should ^^ (if anyone would like to confirm me it works, the gtk version in ubuntu lucid doesn't have them).

Tell me if there is any problem :)

Revision history for this message
John Macdonald (jxtreme42) wrote :

How will Midori handle Flash? To to use Flash under WebKit and GTK+ 3, you'll have to use nspluginwrapper.

Cris Dywan (kalikiana)
Changed in midori:
assignee: xapantu (xapantu) → Christian Dywan (kalikiana)
status: New → In Progress
importance: Undecided → High
Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice work! I improved on the patch, there were warnings during the build, a wscript conflict and a runtime assertion when opening the preferences.

The bookmarkbar and speed dial thumbnails need to be looked into, as well as extensions. Let's address those separately. For thumbnails I'm working on a relevant change anyway, feel free to open follow-up bugs.

John, yes, nspluginwrapper is needed. If you don't have it yet, you will have to install it.

Changed in midori:
assignee: Christian Dywan (kalikiana) → nobody
status: In Progress → Fix Committed
Cris Dywan (kalikiana)
tags: added: gtk3
removed: gtk
Revision history for this message
Michael Moroni (airon90) wrote :

Is it possible to upload it in Midori dev PPA?

Cris Dywan (kalikiana)
Changed in midori:
status: Fix Committed → Fix Released
Revision history for this message
Cassidy James Blaede (cassidyjames) wrote :

When I compile from the latest branch I'm still getting GTK2. I assume I'm missing something?

Revision history for this message
Cris Dywan (kalikiana) wrote :

The default is still GTK+2 (as mentioned in the release announcements) due to the remaining bugs and you have to build it with "--enable-gtk3 --disable-addons".

Revision history for this message
Eduard Gotwig (gotwig) wrote :

When will this be fixed ? High-Important for me.

Revision history for this message
Cris Dywan (kalikiana) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.