Difference between revisions of "GTK+ 3 issues"

From Inkscape Wiki
Jump to: navigation, search
(Deferred changes)
(Items for discussion with GTK Experts)
 
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
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.
+
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:
 
Other pages:
* [[GTK%2B 3 migration]]
+
* [[GTK+ 3 migration]]
* [[GTK%2B Issues]]
+
* [[GTK+ Issues]]
  
 
External resources:
 
External resources:
Line 12: Line 12:
 
Document your issues with porting Inkscape to Gtk3 below.
 
Document your issues with porting Inkscape to Gtk3 below.
  
* [https://bugs.launchpad.net/inkscape/+bugs?field.tag=gtk3 GTK 3 Bugs]
+
''Updated 10 January 2018''
* Building with Gdk 3.20 and --enable-strict-build (default) fails due to deprecated symbols. Use --enable-strict-build=no.
+
 
* 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 launchpad bug [https://bugs.launchpad.net/inkscape/+bug/1201545 #1201545].
+
===GTK 3 Bugs===
** This might have been fixed by r14870 - the icon clipping problem.
+
[https://bugs.launchpad.net/inkscape/+bugs?field.tag=gtk3 Bug Tracker]
** Don't see why r14870 would have fixed this. r14871 disables the overlaid scrollbars introduced by Gtk3 3.16.
+
 
** The 'Wrap' option doubles the height of the swatches but doesn't actually do any wrapping.
+
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.
+
* We have too many ways of creating buttons with icons which leads to inconsistency of behavior. (Better after removing custom icon rendering code.)
* All custom widgets now use the Cairo drawing model. All need to be fully tested, and several (e.g., the filter editor) are not rendered correctly.
+
* <strike>Icons are now separate SVG files but theming does not work.</strike>
* Several of the Gtk+ widgets have changed their layout (in particular, the GtkSpinButton is now much wider). Many of the toolbars now overflow the screen horizontally, and many dialogs are now far too wide. The layout of affected containers should be redesigned to account for this.
+
* <strike>Icons are missing in toolbars until window resized.</strike> Haven't seen this for awhile... so maybe fixed.
* The rules for sizing of widgets within containers has changed in Gtk+ 3. In many cases, widgets will initially appear far too big, or with zero size.  All dialogs and containers need to be checked for these issues.
+
 
* Mac Issues:
+
===Build Issues===
** No tablet input support on Mac (e.g. Wacom). MyPaint seems to be working on this.
+
* Building with Gdk 3.20 and --enable-strict-build (default) fails due to deprecated symbols. Use --enable-strict-build=no.
*** https://community.mypaint.org/t/how-to-build-mypaint-on-mac-osx-without-macports/344
+
 
*** https://bugzilla.gnome.org/show_bug.cgi?id=695701
+
===Mac Issues===
** Support for global menu bar.
+
* No tablet input support on Mac (e.g. Wacom). MyPaint seems to be working on this.
*** GEdit uses OSX menu bar and has native file dialogs
+
** https://community.mypaint.org/t/how-to-build-mypaint-on-mac-osx-without-macports/344
* 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.
+
** https://bugzilla.gnome.org/show_bug.cgi?id=695701
* Window size preference "Small" does not result in a small window.
+
* Support for global menu bar.
* 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
+
** 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 ==
  
List any repetitive actions during the upgrade and note anything that needed doing when moving from gtk2 to gtk3 widgets (for examine hbox and vbox) be clear if the action is using gtk3 or gtkmm (which often papers over some of the move to gtk3)
+
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.
 
* GtkHBox and GtkVBox are now just GtkBox with an orientation attribute.
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 85: Line 126:
 
== Ideas ==
 
== Ideas ==
  
Any ideas which are interesting
+
Any ideas which are interesting.
  
* No ideas yet
+
* No ideas yet…
  
 
== Deferred changes ==
 
== Deferred changes ==
  
Work items, which should be carried out after the release of Inkscape 0.93.  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.
+
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.
  
* 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.
 
* 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).
 
* 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 ==
+
== GTK+ 3 Versions ==
  
How far back do we need to support?
+
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 110: Line 154:
 
|-
 
|-
 
! Release
 
! Release
! GTK 3 Version
+
! End of Life
|-
+
! GTK+ 3 Version
| 12.04 LTS (Precise)
+
| 3.4
+
 
|-
 
|-
 
| 14.04 LTS (Trusty)
 
| 14.04 LTS (Trusty)
 +
| 2019/04
 
| 3.10
 
| 3.10
|-
 
| 15.10
 
| 3.16
 
 
|-
 
|-
 
| 16.04 LTS (Xenial)
 
| 16.04 LTS (Xenial)
 +
| 2021/04
 
| 3.18
 
| 3.18
 
|-
 
|-
| 16.10
+
| 17.04 (Zesty)
| 3.20?
+
| 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:
 +
{| class="wikitable"
 +
|-
 +
!Release
 +
!End of Life
 +
! GTK+ 3 Version
 +
|-
 +
| Jessie
 +
| 2020/05
 +
| 3.14.5
 +
|-
 +
| Stretch
 +
|
 +
| 3.22.11
 +
|-
 +
| Testing Buster
 +
|
 +
| 3.22.26
 +
|}
 +
 
 +
Fedora:
 +
{| class="wikitable"
 +
|-
 +
!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:
 +
{| class="wikitable"
 +
|-
 +
!Release
 +
!End of Life
 +
! GTK+ 3 Version
 +
|-
 +
| 6.9
 +
| 2020/11
 +
| Not supported
 
|-
 
|-
 +
| 7.4
 +
| 2024/11
 +
| 3.22.10
 
|}
 
|}

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

Bug Tracker

Notable bugs:

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

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:
  • 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 { ... }
  • 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.cpp Removed
    • Should be replaced with regular GtkImage.
    • SPIcon does more than rendering the icon:
      1. Handles custom size: Inkscape::ICON_SIZE_DECORATION
      2. Old to new icon name conversion
      3. Rendering icons from icon.svg
      4. 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)

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