In these last two weeks, the master branch of GTK+ has seen 48 commits, with 4967 lines added and 3798 lines removed.
Planning and status
We skipped last week’s update due to most of the GTK+ developers being at GUADEC.
We had very productive discussions regarding the new release management and versioning scheme going forward; expect a full announcement on this blog.
GSK has been reviewed during GUADEC, and the work on the conversion of widgets to the new retained rendering API is ongoing; the API won’t be merged for 3.22, in order to improve rendering performance, shake out the last API issues found during porting, and especially avoid last minute breaking of applications using their own rendering on top of GTK+ windows, like Firefox and LibreOffice.
Carlos Garnacho has been porting the Wayland backend to the new tablet protocol; various changes have already landed in master, and the bulk of the review process is in bug 770026.
The work to support HiDPI displays in the Windows backend is progressing in bug 768081.
Andreas Pokorny has been updating the Mir backend for GDK to improve the integration of GTK+ applications.
Timm Bäder added two new methods to GtkPopover, gtk_popover_popup() and gtk_popover_popdown(); these two new methods implement animated transitions, while calling gtk_widget_show() and gtk_widget_hide() will immediately show or hide the GtkPopover. With the addition of these two new methods, the GtkPopover:transitions-enabled property is now redundant and has been deprecated.
769603 –gtk+-3.20.8: underlink issue with ld.gold – build fails: ./.libs/libgdk-3.so: error: undefined reference to ‘shm_open’
769601 –Dead link in faq on gtk-question-index.html
769568 –Modification date display incorrectly wraps calendar days (and is inconsistent with GTK2 and Nautilus)
768138 –Update the GDK-Mir backend to fix a few problems
Ruslan Izhbulatov fixed two long standing issues with the keyboard layout and dead keys handling on Windows. GTK+ applications on Windows should now behave more in line with the rest of the platform, especially on US international keyboards. The changes have been applied to the master branch, but after further testing they should be backported to the 2.x stable branch.
769287 –GtkMenuToolButton:show-menu is emitted twice and breaks dynamic menus
Georges Basile Stavracas Neto has made the formerly private GtkShortcutLabel widget, used by the shortcuts window, part of the public API; the widget will be used in the GNOME Control Center keyboard options, and can be used by applications that allow editing their own keyboard shortcuts, like PiTiVi.
768999 –Floating point exception (division by zero) when running under Xvfb
768930 –reftests: override GSETTINGS_SCHEMA_DIR when running tests
760944 –resizing and geometry (snap to character cells) regressed with Gtk 3.19+
755947 –wayland: gnome-terminal does not fill entire area when tiled
769047 –GtkWidget <-> GtkStyleContext API not clear
769205 –Expose GtkShortcutLabel as a public widget
In this last week, the master branch of GTK+ has seen 16 commits, with 2500 lines added and 2092 lines removed.
Planning and status
Jonas Ådahl and William Hua are working on the feature branch that provides a new, declarative API for positioning popups and menus; you can read about it in the blog post that was published last Friday, as well as on bug 756579.
Matthias Clasen merged the patches, written by Philip Withnall, that implement a structured logging API in GLib. This work is still ongoing.
768657 –places-view: fix open action for locations without a mount or volume
768659 –gtk/gtkfilechoosernativeportal.c: Don’t use g_autoptr()
768756 –GtkFileChooserNativePortal uses incorrect response id
Interested in working on GTK+? Look at the list of bugs for newcomers and join the IRC channel #gtk+ on irc.gnome.org.
Today, Jakub Steiner from the GNOME design team is going to talk about Adwaita, the default theme for GTK+; the tools that the designers can use to style GTK+; and how the toolkit changed to allow a better design workflow.
Adwaita is the user facing façade of GTK+. In the past GTK+ had no face; there was no properly defined look for the toolkit. Like many things in the FOSS world, it was a bring your own. There was Raleigh, a fallback skin that only showed up if something went sideways with theming or the system settings. And you didn’t really want to see that.
With GTK+ 3.0 a bold new effort has started. An effort to put visual designers in charge of visual design, using tools they understand. Instead of resorting to theme engines to draw unique controls, a styling engine used on the web has been chosen. The “everything is a box” CSS model applied to GTK+ rather well. It took a lot of effort, mainly on the shoulders of Benjamin Otte, who over the years managed to give us what we dreamed of: a CSS-like box model, allowing us to space elements/controls using padding, margins, borders and nifty features like minimum width. On the selector side, we aren’t dealing with the direct nested widget structure that changes from release to release, but we were given an abstracted, HTML-like DOM structure, with nodes and classes. Nodes are also consistently carrying state and are easier to animate.
In GTK+ there are a lot of controls that look like a button but aren’t a button. Every programmer is on the lazy side, and that’s a good thing. Designers aren’t any different. It’s so positive that there is an acronym for it, DRY — don’t repeat yourself. So in the old Adwaita, when we designed the look of some things that all looked the same, we only had one block of properties and a ton of selectors — the targets of that look. Buttons, dropdowns, you name it. Not much typing, but insanity to alter.
SASS came to the rescue by providing means to define a common drawing procedure once, but reuse it in a well structured stylesheet. You would be able to draw things “like a button” but not define it as a button. You would still find a dropdown nicely semantically organized in a dropdown section. SASS calls these macros mixins and you will find our drawing ones in src/gtk/theme/Adwaita/_drawing.scss.
/* Switch Slider being a button */
/* ... */
@include button(normal, $edge: $shadow_color);
A massive improvement for the designer’s workflow has been the introduction of the Inspector. The inspector is an invaluable tool to test out new style interactively or to figure out why a particular selector isn’t working. There are a couple of powerful tools it provides:
Widget selector. You can interactively point at a widget to learn about its properties or where it lives in the widget tree stack. Since 3.20 you can also learn about its CSS nodes, learn what sort of states it can get to, learn all the classes it has been assigned. It can also tell you where in the stylesheet the set property has been defined. This helps you figure out why your selector isn’t working. Somewhat. It would be real nice to see all matching selectors, even those that have been overriden by those that take precedence.
Interactive CSS stylesheet. You can write a CSS rule and have it applied in real time. This is not only useful to figure out a proper selector, but also experiment with drawing using GTK+ directly rather than using tools like Inkscape. Being able to iterate fast and try out things results in better design.
If this all sounds very similar to what modern browsers provide, it’s not much of a coincidence.
A major factor that’s making us less flexible in terms of being able to alter Adwaita are the graphic assets. There are still a couple of things that we have to resort to using image assets for. Those are actually in a large asset sheet SVG and we have a bunch of scripts to chop up multiple sized images (for HiDPI). It remains a hassle to add or change a particular bit.
To make this a little less boring, here’s a little web demo of how we could possibly avoid using image assets to draw GtkScale sliders and use simple CSS boxes instead: