Are there any SDL people out there?

IMG_3893Back in 2005, a Metacity crash when running certain SDL apps was reported in GNOME bug 169684.

This bug remains at “critical”, but there has been no new comment on it for five years. Nobody appears to be experiencing the same problem now.

Gentle reader, do you have any experience in SDL? Can you tell us whether the problem is still present?

Photo © Ingy the Wingy, cc-by-nd.

Justified and ancient

Although it’s common for Metacity themes to have centred titles, there are still several themes which have the title justified to the left or right . GNOME bug 612940 makes the not unreasonable suggestion that the justification should be swapped when the system is running in a language such as Hebrew, Arabic, or Urdu which is written from right to left.

There is a patch supplied, but it swaps only the position of the text. This isn’t a problem when the titlebar’s decoration is symmetrical, but when (as in the case of Crux) it isn’t, the title moves without taking the decoration along for the ride.  See the illustration on the right; the word “שלום” is written in white on the grey part of the titlebar instead of on the blue part.

The way forward from here might be:

  • to leave everything as it is
  • to commit this patch, and hope that people who speak these languages will avoid themes with non-centred window titles and asymmetrical titlebars
  • to mirror the entire window border decoration if we’re running in a right-to-left language.  This may be non-trivial.

Your thoughts, gentle reader, are as welcome as they ever were.

Going back to the previous workspace

Momentile 10th December 2009Eugeni Dodonov has asked for a keybinding to return to the previous workspace. For example, if you were on workspace 1 and switched to workspace 2, then pressing this key would jump back to workspace 1. Pressing it again would jump to workspace 2. Apparently this is a standard keybinding in xfwm4.

This is GNOME bug 618018, and there is a patch.

However, we believe this can be done adequately with an external EWMH-based script, although it’s a little more difficult than most EWMH scripts because it requires internal state.

Incidentally, this may be an interesting moment to discuss the question of whether Metacity should be able to make DBus calls on given keypresses as well as launching external scripts. Supplementing the EWMH controls with DBus is often suggested (see, for example , GNOME bug 531512 and ewmhbus) but perhaps we should instead be considering sending signals when windows are opened, hot keys are pressed, and workspaces are switched.

Photo © coffee bee, cc-by-nc.

Switching between workspaces

66.365 - Fascinating FingersMetacity allows you to keep your windows on workspaces.  You can have between one and 36 of them.  (The number 36 is rather arbitrary; it’s described as “a fixed maximum to prevent making the desktop unusable by accidentally asking for too many workspaces.“)

You can switch between these workspaces either by using the switcher applet, or using directional keys (“move to the workspace below the current one”, and so on).  You may also use specialised keys to jump to a specific workspace. For example, you might keep your email app open on workspace 7 all the time, and bind F7 to jump to that workspace.  Each such specialised key is treated as a special case, and there are twelve of them.

GNOME bug 115584 makes the point that it’s inconsistent to allow three dozen workspaces and only allow keyboard switching for a dozen of them.  There is even a patch to add twenty more special cases (your chronicler is not sure what happened to the remaining four).

It’s not clear that this problem needs to be solved at all, but if it does, adding a score of new keybindings is certainly not the way forward.  A better solution would be to use GConf’s ability to store lists of strings.  A single new GConf key could store a list of keybindings for the corresponding workspaces, and it could extend to whatever length made the user happy.  The existing special-case keybindings would need to be retained for backward compatibility, but they could then be deprecated.

Photo © Josh Libatique, cc-by.

The order of windows in alt-tab

Big surpriseWhen you press alt-tab under Metacity, the windows you see in the switcher are displayed in most-recently-used (MRU) order, except that minimised windows are always sorted to the end, and urgent (“needs attention”) windows are sorted to the beginning. A comment in the source describes this as “Windows sellout mode”.

In a recent blog post, Aza Raskin suggests using Markov modelling to learn which applications you commonly switch between, so that they will be in the right place when you need them.  For example, if the system learns that you most often switch between gedit and firefox, then when you are using firefox, gedit will be the first application in the list.

Your chronicler believes the readership of this journal may be interested in discussing the idea.  Anyone who wishes to implement it may count on all the help and advice they need from the Metacity maintainers.

Thanks to Arun Raghavan for bringing this to our attention.

Photo © Kevin Dooley, cc-by.

Setting the button order

Old Pink ButtonsUbuntu Lucid Lynx was released last week. It modifies the order of the titlebar buttons so that they all appear on the left-hand side. Some people would like the buttons in another order.

This post explains how to change the order of the buttons.

Firstly, decide which buttons you want:

  • Here are your choices.
  • Only the top four are available in every theme.  Themes which support all the button types include Crux and Bright.

Take all the names and separate them with commas.  However, for the gap in the middle where the title goes, use a colon.  Thus for the traditional order:

menu:minimize,maximize,close

Now open a terminal, and type:

gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close

or whatever order you prefer.

It has also been suggested that we might allow button order to be set by the theme, so the default theme in Lucid has the buttons on the left and the other themes have them in the traditional order.

Photo © Debora, cc-by-nc-nd.

The positions of sounds

Glass smash with liquid GNOME bug 616743 includes a patch which, if you have stereo speakers, will make the system bell move horizontally depending on which window it happened in. For example, if you’re editing a file in a terminal on the left of the screen, and the terminal bleeps, the sound will come from the left. If your mutt terminal is on the right of the screen, you will hear a bleep on the right when you receive new mail.

Sounds other than the system bell won’t be affected by this change. For example, music played by a music player will not be affected by the position of the window.

(The patch also appears to set the vertical position of the system bell according to the y-coordinate of the window.  Your chronicler is having difficulty imagining the sound system where this would be distinguishable, but perhaps is not experienced enough in these matters.)

We are rarely minded to accept enhancement patches, since every new line of code is a line of code we have to maintain for ever.  However, this one isn’t complicated, and appears to have a positively useful result.

What are your thoughts on the matter, gentle reader?

Photo © whisperwolf, cc-by-nc.

How to help with Metacity

Never turn your back on the fire...Someone was asking how they could help with Metacity. Here are some thoughts.

Why it’s important.  Metacity is (for now) the official window manager of the GNOME desktop.  Even though Metacity supports compositing, one of its strengths is that it can also run in a non-composited mode: plenty of people run Metacity who can’t or don’t want to run a compositing window manager.  Then there are the people who use Metacity in compositing mode because they prefer it that way, often because Metacity’s maturity gives it the edge over other window managers. Even after Mutter becomes the official window manager, Metacity will remain important: the core of Metacity is the core of Mutter.

Things you should read.

What needs doing. Metacity is a mature system, coming up to its ninth birthday, so there isn’t much new development to deal with.  Day-to-day work falls into one of these categories:

  • Triaging new bugs.  A bug is either a report of breakage or a request for an enhancement. Bugzilla will show you a summary of current bugs. There are a lot of them.
  • For reports of breakage, writing patches. This is really important.  If you’re looking for something to work on, try searching for the “gnome-love” keyword in Bugzilla.  This is used to mark bugs which are particularly suited to being fixed by newcomers to the project.  There are currently six of them.
  • For enhancement requests, deciding whether they should go in or not.  Usually the answer is “not” (see Havoc’s policy document).  This kind of bug has traditionally been discussed in a “bug of the day” feature here on the blog, but this took more time to write than it took to fix bugs, and so it’s been quiet recently.
  • For enhancement requests which should go in, writing patches.
  • Reviewing those patches and deciding whether they should be committed.
  • Making releases.

New developments. But if it’s new development you want, you might be interested in helping out with:

  • Mutter.  This is the forthcoming window manager and desktop system for GNOME 3.  It uses Metacity as its core.
  • Cowbell. This is an attempt to reform the recondite window border theme system into CSS, which is much simpler to understand.  This is stalled for the moment for lack of time and direction.

Photo © Chris Dixon, cc-by-nc-nd.

Plans for May

Bournville Maypole: The ChainI want to apologise to all the people who have been waiting on Bugzilla recently, especially to those of you waiting for patch review. There’s a terrible mountain of work to do, and few people doing it, and I’ve had a lot of my time taken up writing a book. But none of that is any good excuse.

My heartfelt thanks go to Owen Taylor and others who have stepped in to review some patches.

Here are the patches processed so far today:

  • GNOME bug 611260 – a simple patch to remove a warning for pedantic linkers
  • GNOME bug 577576 – Metacity was reporting a warning where there should not have been one
  • GNOME bug 570275 – this seems to be Subversion-specific and is presumably no longer relevant
  • GNOME bug 609502 – a crash in some circumstances retrieving a string list from gconf.  This appears to introduce a memory leak; asked patch author to reconsider this.
  • GNOME bug 565540 – Metacity doesn’t refresh keymaps when XKB refreshes.  Definitely a problem.  Owen reviewed someone else’s patch; I attempted to fix that patch to meet Owen’s objections.
  • GNOME bug 573922 – when there are two timestamps we could use for a window, use the earlier one.  This fixes a Nautilus issue.
  • GNOME bug 531012 – small memory leaks
  • GNOME bug 572332 – removing more deprecated symbols

There are about fifty bugs with patches remaining for review, and I’ve decided that this is my priority for May. By the end of the month I’d like to have reviewed all the patches. After that, I’ll go through and triage everything, and post the results here. One day, I’d like to get the bug count down to zero, but that clearly won’t happen this year.

Photo © Pete Ashton, cc-by-nc.