Difference between revisions of "GTK+ 3 issues"
(18 intermediate revisions by 4 users not shown) | |||
Line 12: | Line 12: | ||
Document your issues with porting Inkscape to Gtk3 below. | Document your issues with porting Inkscape to Gtk3 below. | ||
''Updated 10 January 2018'' | |||
* | |||
* Jumping palette. The color bar/palette does not seem to be able to decide how high it should be, at least for some combinations of palette width, height, etc. See bug {{bug|id=1201545|status=fixcommitted}}. | ===GTK 3 Bugs=== | ||
* | [https://bugs.launchpad.net/inkscape/+bugs?field.tag=gtk3 Bug Tracker] | ||
** | |||
* | Notable bugs: | ||
* <strike>[https://bugs.launchpad.net/inkscape/+bug/1285887 HiDPI scaling Bug]</strike> Fixed. | |||
* <strike>[https://bugs.launchpad.net/inkscape/+bug/1704178 Color pallette hidden partially by scroll bar Bug]</strike> Fixed. | |||
* <strike>[https://bugs.launchpad.net/inkscape/+bug/1720096 Crash in Wayland with docked dialogs Bug]</strike> c866617 | |||
* [https://bugs.launchpad.net/inkscape/+bug/1723247 Severe performance regression with gtk3 on Windows] In progress. Help needed. | |||
===Widgets=== | |||
* All custom widgets now use the Cairo drawing model; some are now not rendered correctly: | |||
** <strike>Filter Editor</strike>. Custom widget fixed to work as in GTK2; rewrite desired (started at Hackfest 2017) but not required. | |||
** Any others?? | |||
* Gtk+ 3 widgets have changed as well as rules for sizing widgets inside containers. Widgets may be bigger (e.g GtkSpinButton) or may appear with zero size. All toolbars and dialogs need to be checked: | |||
** Text Toolbar is too wide. | |||
** Spray Toolbar is too wide. | |||
** Transform dialog too wide (matrix tab) | |||
* <strike>The text "Blur" and "Opacity" inside the "interactive progress bar" widgets (are these custom widgets?) in Fill and stroke dialog are cut in half or less, and are rendered unreadable.</strike> | |||
* <strike>There is also some different modes of interaction, with top half of the widgets meaning "move instantly to this point" and (part of) bottom half meaning "slightly adjust value", however the latter is really hard to use as it's something like on or two pixel rows high.</strike> Fixed by new InkSpinScale widget. | |||
** <strike>Inconsistency between Blur and Opacity in Objects dialog (also different from Fill and Stroke dialog).</strike> Fixed by rewrite. | |||
* Default window size preference does not work. | |||
* <strike>Jumping palette. The color bar/palette does not seem to be able to decide how high it should be, at least for some combinations of palette width, height, etc.</strike> See bug {{bug|id=1201545|status=fixcommitted}}. | |||
* Gtk 3.20: "Gtk-WARNING **: Allocating size to GdlDock 0x4ca2930 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?" Maybe not our bug, see: https://bugzilla.gnome.org/show_bug.cgi?id=765700 | |||
G_DEBUG=fatal_warnings gdb inkscape | |||
===Dialogs=== | |||
* Serious brokenness under Wayland with docking. | |||
===Icons=== | |||
* <strike>Icons are too small / cut. (if someone can find the launchpad bug for this one, please add link here). This is probably caused by the use of SPIcon instead of a standard GtkImage widget.</strike> | * <strike>Icons are too small / cut. (if someone can find the launchpad bug for this one, please add link here). This is probably caused by the use of SPIcon instead of a standard GtkImage widget.</strike> | ||
** The clipping of icons in the toolbar is fixed in r14870. Problem had to do with custom button widget which wraps icon. The preferred/minimum width/height was not taking into account the padding around the icon. | ** The clipping of icons in the toolbar is fixed in r14870. Problem had to do with custom button widget which wraps icon. The preferred/minimum width/height was not taking into account the padding around the icon. | ||
* We have too many ways of creating buttons with icons which leads to inconsistency of behavior. (Better after removing custom icon rendering code.) | |||
* <strike>Icons are now separate SVG files but theming does not work.</strike> | |||
* | * <strike>Icons are missing in toolbars until window resized.</strike> Haven't seen this for awhile... so maybe fixed. | ||
* | |||
===Build Issues=== | |||
* Building with Gdk 3.20 and --enable-strict-build (default) fails due to deprecated symbols. Use --enable-strict-build=no. | |||
===Mac Issues=== | |||
* No tablet input support on Mac (e.g. Wacom). MyPaint seems to be working on this. | |||
** https://community.mypaint.org/t/how-to-build-mypaint-on-mac-osx-without-macports/344 | |||
* | ** https://bugzilla.gnome.org/show_bug.cgi?id=695701 | ||
* | * Support for global menu bar. | ||
* | ** GEdit uses OSX menu bar and has native file dialogs | ||
===Items for discussion with GTK Experts=== | |||
* GtkActions (deprecated, what to do). | |||
* Gio::Actions: replacement for verbs? | |||
* Custom widgets with Gio::Actions (RadioButtons without circle). | |||
* Widget sizing. | |||
* Styling of custom widgets. | |||
* Icon theming. | |||
* Width of custom ComboBox (gradient toolbar) | |||
* GDL (docking library) under Wayland. | |||
* Windows slowdown. | |||
* GTK3 Event loop. | |||
* GTK4 Prep. | |||
== Standard Practice == | == Standard Practice == | ||
Line 67: | Line 108: | ||
List any and all custom widgets currently being used in Inkscape. | List any and all custom widgets currently being used in Inkscape. | ||
* Rulers - src/widgets/ruler.cpp | * Rulers - src/widgets/gimp/ruler.cpp (moved from src/widgets/ruler.cpp) | ||
** Should probably be updated from GIMP. | ** Should probably be updated from GIMP. | ||
* SPIcon - src/widgets/icon.cpp | * <strike>SPIcon - src/widgets/icon.cpp</strike> '''Removed''' | ||
** Should be replaced with regular GtkImage. | ** Should be replaced with regular GtkImage. | ||
** SPIcon does more than rendering the icon: | ** SPIcon does more than rendering the icon: | ||
Line 95: | Line 136: | ||
* [DONE] Delete all Gtk+ 2 backward-compatibility code. This will remove over 700 blocks of conditional build instructions from our code base, and thousands of lines of redundant code. This is essential for future maintainability, and will greatly simplify future work on Gtk+ 3 features. | * [DONE] Delete all Gtk+ 2 backward-compatibility code. This will remove over 700 blocks of conditional build instructions from our code base, and thousands of lines of redundant code. This is essential for future maintainability, and will greatly simplify future work on Gtk+ 3 features. | ||
* Load all theme information from an external CSS style sheet. This will potentially tidy our code by removing hard-coded styling instructions, and will make it possible to properly apply user themes to Inkscape. | * Load all theme information from an external CSS style sheet. This will potentially tidy our code by removing hard-coded styling instructions, and will make it possible to properly apply user themes to Inkscape. | ||
* Switch to using a GtkIconTheme, with all custom icons installed in a standard way instead of bundled within a single SVG document. This will make it easier to provide user icon themes, and get rid of a lot of deprecated code. | * [DONE] Switch to using a GtkIconTheme, with all custom icons installed in a standard way instead of bundled within a single SVG document. This will make it easier to provide user icon themes, and get rid of a lot of deprecated code. | ||
** We should also unify all the code for creating buttons with icons. | ** We should also unify all the code for creating buttons with icons. | ||
** GTK3 respects the HiDPI setting while GTK2 does not. System icons are rendered with high DPI when needed but Inkscape specific icons are not. This will probably be fixed by moving to GtkIconTheme. | ** <strike>GTK3 respects the HiDPI setting while GTK2 does not. System icons are rendered with high DPI when needed but Inkscape specific icons are not. This will probably be fixed by moving to GtkIconTheme.</strike> | ||
** Many GTK methods using GtkIconSize have been deprecated but GtkIconSize itself has not been. This can be confusing. We have a custom value for GtkIconSize that we should try to remove. | ** Many GTK methods using GtkIconSize have been deprecated but GtkIconSize itself has not been. This can be confusing. We have a custom value for GtkIconSize that we should try to remove. | ||
* Switch to using GtkApplication instead of GtkMain. | * Switch to using GtkApplication instead of GtkMain. | ||
Line 105: | Line 146: | ||
How far back do we need to support? See: https://distrowatch.com | How far back do we need to support? See: https://distrowatch.com | ||
Note: API is frozen as of 3.22 as work has started on GTK 4. | |||
Some vendors are doing incremental updates for minor numbers. | |||
Ubuntu: | Ubuntu: | ||
Line 121: | Line 165: | ||
| 3.18 | | 3.18 | ||
|- | |- | ||
| | | 17.04 (Zesty) | ||
| 2018/01 | | 2018/01 | ||
| 3.22.11 | | 3.22.11 | ||
|- | |- | ||
| | | 17.10 (Artful) | ||
| 2018/07 | | 2018/07 | ||
| 3.22.24 | | 3.22.24 | ||
|- | |||
| 18.04 LTS (Bionic) | |||
| 2023/04 | |||
| 3.22.26 | |||
|- | |- | ||
| Snapshot | | Snapshot | ||
| | | | ||
| 3.22. | | 3.22.26 | ||
|} | |||
Debian: | |||
{| class="wikitable" | |||
|- | |||
!Release | |||
!End of Life | |||
! GTK+ 3 Version | |||
|- | |||
| Jessie | |||
| 2020/05 | |||
| 3.14.5 | |||
|- | |||
| Stretch | |||
| | |||
| 3.22.11 | |||
|- | |||
| Testing Buster | |||
| | |||
| 3.22.26 | |||
|} | |} | ||
Line 140: | Line 208: | ||
!End of Life | !End of Life | ||
! GTK+ 3 Version | ! GTK+ 3 Version | ||
|- | |- | ||
| 26 | | 26 | ||
| 2018/08? | | 2018/08? | ||
| 3.24 (3.22. | | 3.22.16 (Updated to 3.22.21) | ||
|- | |||
| 27 | |||
| 2018/12? | |||
| 3.22.24 (Updated to 3.22.26) | |||
|- | |- | ||
| Rawhide | | Rawhide | ||
| | | | ||
| | | 3.22.26 | ||
|} | |} | ||
Latest revision as of 12:48, 12 February 2018
This page is for GTK+ documentation, any issues, questions or notes about the porting of Inkscape to Gtk3. This document will be sent to the GTK+/GNOME developers and may be useful for GIMP developers who undergo the same process.
Other pages:
External resources:
- gtk+ IRC channel: irc.gnome.org (GIMPNet) #gtk+
Issues
Document your issues with porting Inkscape to Gtk3 below.
Updated 10 January 2018
GTK 3 Bugs
Notable bugs:
HiDPI scaling BugFixed.Color pallette hidden partially by scroll bar BugFixed.Crash in Wayland with docked dialogs Bugc866617- Severe performance regression with gtk3 on Windows In progress. Help needed.
Widgets
- All custom widgets now use the Cairo drawing model; some are now not rendered correctly:
Filter Editor. Custom widget fixed to work as in GTK2; rewrite desired (started at Hackfest 2017) but not required.- Any others??
- Gtk+ 3 widgets have changed as well as rules for sizing widgets inside containers. Widgets may be bigger (e.g GtkSpinButton) or may appear with zero size. All toolbars and dialogs need to be checked:
- Text Toolbar is too wide.
- Spray Toolbar is too wide.
- Transform dialog too wide (matrix tab)
The text "Blur" and "Opacity" inside the "interactive progress bar" widgets (are these custom widgets?) in Fill and stroke dialog are cut in half or less, and are rendered unreadable.There is also some different modes of interaction, with top half of the widgets meaning "move instantly to this point" and (part of) bottom half meaning "slightly adjust value", however the latter is really hard to use as it's something like on or two pixel rows high.Fixed by new InkSpinScale widget.Inconsistency between Blur and Opacity in Objects dialog (also different from Fill and Stroke dialog).Fixed by rewrite.
- Default window size preference does not work.
Jumping palette. The color bar/palette does not seem to be able to decide how high it should be, at least for some combinations of palette width, height, etc.See bug {{#if: | {{{name}}} (lp:1201545)| lp:1201545 }}.- Gtk 3.20: "Gtk-WARNING **: Allocating size to GdlDock 0x4ca2930 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?" Maybe not our bug, see: https://bugzilla.gnome.org/show_bug.cgi?id=765700
G_DEBUG=fatal_warnings gdb inkscape
Dialogs
- Serious brokenness under Wayland with docking.
Icons
Icons are too small / cut. (if someone can find the launchpad bug for this one, please add link here). This is probably caused by the use of SPIcon instead of a standard GtkImage widget.- The clipping of icons in the toolbar is fixed in r14870. Problem had to do with custom button widget which wraps icon. The preferred/minimum width/height was not taking into account the padding around the icon.
- We have too many ways of creating buttons with icons which leads to inconsistency of behavior. (Better after removing custom icon rendering code.)
Icons are now separate SVG files but theming does not work.Icons are missing in toolbars until window resized.Haven't seen this for awhile... so maybe fixed.
Build Issues
- Building with Gdk 3.20 and --enable-strict-build (default) fails due to deprecated symbols. Use --enable-strict-build=no.
Mac Issues
- No tablet input support on Mac (e.g. Wacom). MyPaint seems to be working on this.
- Support for global menu bar.
- GEdit uses OSX menu bar and has native file dialogs
Items for discussion with GTK Experts
- GtkActions (deprecated, what to do).
- Gio::Actions: replacement for verbs?
- Custom widgets with Gio::Actions (RadioButtons without circle).
- Widget sizing.
- Styling of custom widgets.
- Icon theming.
- Width of custom ComboBox (gradient toolbar)
- GDL (docking library) under Wayland.
- Windows slowdown.
- GTK3 Event loop.
- GTK4 Prep.
Standard Practice
List any repetitive actions during the upgrade and note anything that needed doing when moving from gtk2 to gtk3 widgets; be clear if the action is using gtk3 or gtkmm (which often papers over some of the move to gtk3).
- GtkHBox and GtkVBox are now just GtkBox with an orientation attribute.
- Changing to Gtk::Box is a quick fix but there is a warning in the documentation that Gtk::Box will eventually be removed. Gtk::Grid is the "proper" replacement.
We should switch to using CSS styling.
- See: http://www.gtkforums.com/viewtopic.php?f=3&t=988&p=72088=GTK3+with+CSS#p72088
- Ruler code uses CSS styling but @bg_color doesn't seem to be defined. I (Tav) have hard coded off-white for the moment. This works in 3.18 but is ignored in 3.20. The CSS API changed in 3.20. See:
- https://bugzilla.gnome.org/show_bug.cgi?id=765433
- https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/
- https://feaneron.com/2016/01/04/quick-guide-to-port-an-app-for-gtk-3-20/
- Looks like we'll need a lot of #ifdefs to handle the changes in 3.20.
- It appears possible to have separate style files for pre 3.20 and 3.20 but I (Tav) don't know how to do this.
- A number of places in our code we use hard coded CSS.
- spw-utilities.cpp
GtkWidget { font-size: 12pt; }
(In utility for setting font size of widgets.) - ruler.cpp
SPRuler { background-color: @bg_color; }
Removed r14876. - svg-view-widget.cpp
SPCanvas { background-color: white; }
- desktop-widget.cpp
GtkWidget { padding-left: 0; ... }
(Restricted to Lock guides) - font-selector.cpp
#font_selector_family { -GtkWidget-wide-seperators: true; -GtkWidget-seperator-height: 6; }
- text-toolbar.cpp
#TextFontFamilyAction_combobox { ... }
combobox window.popup scrolledwindow treeview seperator { ... }
- spw-utilities.cpp
- We should standardize the widget naming scheme.
Use GtkInspector:
GTK_DEBUG=interactive ~/path_to_gtk3/bin/inkscape
Widgets
List any and all custom widgets currently being used in Inkscape.
- Rulers - src/widgets/gimp/ruler.cpp (moved from src/widgets/ruler.cpp)
- Should probably be updated from GIMP.
SPIcon - src/widgets/icon.cppRemoved- Should be replaced with regular GtkImage.
- SPIcon does more than rendering the icon:
- Handles custom size: Inkscape::ICON_SIZE_DECORATION
- Old to new icon name conversion
- Rendering icons from icon.svg
- Rendering into cache
- All the above could be removed.
- SPCanvas - src/display/sp-canvas.cpp
- Needs to stay a custom widget. Fixed for GTK3.
- EgeAdjustmentAction (ege-adjustment-action.h/.cpp)
- Used for things like Height, Width
- Internally uses GtkSpinbutton which has large '+' '-' buttons. See https://developer.gnome.org/gtk3/stable/GtkSpinButton.html
Ideas
Any ideas which are interesting.
- No ideas yet…
Deferred changes
Work items, which should be carried out after the release of Inkscape 0.92. These are tasks, which would be impractical to perform until after we have permanently ended our support for Gtk+ 2. For example, these may make use of new Gtk+ 3 features, which have no simple fallback available in Gtk+ 2.
- [DONE] Delete all Gtk+ 2 backward-compatibility code. This will remove over 700 blocks of conditional build instructions from our code base, and thousands of lines of redundant code. This is essential for future maintainability, and will greatly simplify future work on Gtk+ 3 features.
- Load all theme information from an external CSS style sheet. This will potentially tidy our code by removing hard-coded styling instructions, and will make it possible to properly apply user themes to Inkscape.
- [DONE] Switch to using a GtkIconTheme, with all custom icons installed in a standard way instead of bundled within a single SVG document. This will make it easier to provide user icon themes, and get rid of a lot of deprecated code.
- We should also unify all the code for creating buttons with icons.
GTK3 respects the HiDPI setting while GTK2 does not. System icons are rendered with high DPI when needed but Inkscape specific icons are not. This will probably be fixed by moving to GtkIconTheme.- Many GTK methods using GtkIconSize have been deprecated but GtkIconSize itself has not been. This can be confusing. We have a custom value for GtkIconSize that we should try to remove.
- Switch to using GtkApplication instead of GtkMain.
- Switch to using GAction instead of GtkAction <- this one might be deferred indefinitely; see Gimp's direction for comparison (Gimp has stated they will not switch).
GTK+ 3 Versions
How far back do we need to support? See: https://distrowatch.com
Note: API is frozen as of 3.22 as work has started on GTK 4. Some vendors are doing incremental updates for minor numbers.
Ubuntu:
Release | End of Life | GTK+ 3 Version |
---|---|---|
14.04 LTS (Trusty) | 2019/04 | 3.10 |
16.04 LTS (Xenial) | 2021/04 | 3.18 |
17.04 (Zesty) | 2018/01 | 3.22.11 |
17.10 (Artful) | 2018/07 | 3.22.24 |
18.04 LTS (Bionic) | 2023/04 | 3.22.26 |
Snapshot | 3.22.26 |
Debian:
Release | End of Life | GTK+ 3 Version |
---|---|---|
Jessie | 2020/05 | 3.14.5 |
Stretch | 3.22.11 | |
Testing Buster | 3.22.26 |
Fedora:
Release | End of Life | GTK+ 3 Version |
---|---|---|
26 | 2018/08? | 3.22.16 (Updated to 3.22.21) |
27 | 2018/12? | 3.22.24 (Updated to 3.22.26) |
Rawhide | 3.22.26 |
Redhat:
Release | End of Life | GTK+ 3 Version |
---|---|---|
6.9 | 2020/11 | Not supported |
7.4 | 2024/11 | 3.22.10 |