Fixing Window Focus ("Activation") Bugs

In May, Havoc blogged
about various Metacity tasks
that he’d love to see people hack on.
I tried to tackle the focus related bugs since that was something that
has really bothered me (of course, it turns out that some of the bugs
are actually libwnck problems rather than Metacity ones). I’m really
curious as to whether anyone is aware of some focus bugs that I don’t
know about yet. The ones that I am aware of are:


  • 87531
    – “Sticky” or “On-all-workspace” windows which have
    focus show up as having focus on all workspaces in the pager

  • 101190
    – focus can leave a window when an override redirect
    window (i.e. an application menu, a tab-completion pop-up for an
    entry, etc.) is closed (see also 145387; it
    appears that people typically assume this is a gtk+ bug)

  • 102665
    – unminimizing a window from the tasklist (via the
    right-click menu) doesn’t focus the unminimized window (fixed)

  • 120100
    – focus is left on the panel when using workspace
    switcher (fixed)

  • 124798
    – simultaneous workspace switching with keynav and use
    of the mouse can result in the wrong window being focused (see
    also
    123803
    –there is more to this in order to get a more complete
    fix; unfortunately, this has me kind of baffled at the moment)

  • 124981
    – windows clicked in the pager shouldn’t get focus if
    they are on a different workspace (fixed)

  • 128200
    – wrong window focused after minimizing focus window
    via tasklist (see also 107681)

  • 131581
    – race condition for focus choice on window
    minimize/close (fixed)

  • 135810
    – need a focus choice policy that can make things
    consistent for each focus mode (fixed)

  • 136581
    – focus vs. minimize for tasklist click when using
    mouse focus (fixed)

  • 144900
    – wrong window focused after “un-showing” the desktop
    with ctrl-alt-d (fixed)

  • 149543
    – no window focused after “un-showing” the desktop via
    show-desktop applet (fixed)

  • 149589
    – race condition for focus choice when using tasklist
    applet (fixed)

    –>

  • Another race condition (window close followed by very rapid mouse
    movement resulting in the wrong window being focused) that I
    haven’t filed a bug about yet. (I’m also a little confused about
    this one as to why the race condition doesn’t appear to also
    affect window minimization; perhaps I’m just not fast enough to
    trigger it?)
  • It also turned out that 147475, a
    rare locking of the keyboard on workspace change, was a focus
    related bug too. (this was also fixed)

(I also tried to help with focus-stealing-prevention (“tried to”,
because I had so many questions and misunderstandings that it probably
took Rob longer to explain to me how to get things to work than it
would have taken for him to do it without my help; but it was very
nice of him to take the time to teach me so much). Unfortunately,
that has been disabled for
now
because there were still some remaining issues; in particular,
bugs
150910
and 151245)

Update: Ken Harris made me aware of 135786 (and
convinced me it was a real bug), about an issue affecting only
click-to-focus when lowering a focused window via a middle-click on
the frame.