Wayland porting continues

Mosaic by Alison's Eyes.

It has been a while since I’ve last reported progress on the ongoing port of GNOME to Wayland. Giovanni did an unbelievable amount of groundwork in mutter and gnome-shell during the 3.10 cycle. After that all landed, we took a bit of a break to catch our breath, while GNOME 3.10 matured to 3.10.1 and now 3.10.2.

Now it is time to pick up the effort again, and sort out what remains to be done for full Wayland support in GNOME 3.12. From a high-level perspective:

  • Wayland sessions in gdm
  • Keyboard handling (layout switching, on-screen keyboard, accessibility, input methods, shortcuts,…)
  • Pointer handling (pointer barriers, accessibility, better touchpad support,…)
  • Window management (lots of details)
  • Application support (gstreamer, clutter-gtk,…)
  • Application testing and porting

If this sounds like a lot of work, that is because it is a lot of work.

Thankfully, quite a few of these things are already in progress or at least being planned. For example, a new xdg_shell interface has been discussed for a while to handle window management. For keyboard handling, Rui has started by implementing layout switching for weston. A new library for sharing input handling code is beginning to take shape too. clutter-gtk support needs subsurfaces, for which Jonas has patches here.

But there is still a lot to do, and any help is welcome. If you feel adventurous and want to learn about Wayland, please join us – there are tasks in all levels of difficulty here, you don’t need to be a über-X-hacker to find something useful to do.

More details on the Wayland port, including the list of open tasks, can be found on the wiki.

Smooth progress

Alex did a nice writeup of the GTK+ 3 drawing model, explaining how the frame clock lets you do smooth animations with a tick callback. To show the difference that this makes, I did a quick exercise this weekend: I converted the activity mode in GtkProgressBar to use a tick callback. You can see the necessary changes here.

In activity mode, the progressbar displays a ‘bouncing’ block, to indicate activitity, instead of showing definitive progress. Applications manually trigger the bouncing by calling gtk_progress_bar_pulse() periodically. What we have done so far is to just move the block a fixed amount, taking care to change the direction whenever we hit the edge of the bar. This works, but gives a jumpy effect that is not very smooth.  Applications can influence the speed of the block by calling pulse() more or less frequently.

Since I did not want to change the public API of GtkProgressBar, and I still want to let applications influence the speed of the block, I use the time interval between the most recent pulse() calls to estimate of the desired speed, and move the block the appropriate amount in a tick callback that gets called for each frame. Note that the tick callback has to explicitly request a repaint, by calling gtk_widget_queue_draw().

Here is how this looks in practice: