Skip to content
  • Alberts Muktupāvels's avatar
    display: ensure that we ignore our own focus events for focus predictions · 66a4cb4a
    Alberts Muktupāvels authored
    When we set the input focus, we first set the predicted window,
    and then try to process focus events. But as FocusOut on the
    existing window comes before FocusIn on the new window, we'll
    see the focus out on the old window and think the focus is going
    to nothing, which makes metacity think the prediction failed.
    
    Fix this by making sure that we ignore focus window changes of our
    own cause when updating the focus window field, by ignoring all
    focus events that have a serial the same as the focus request or
    lower. Note that if metacity doens't make any requests after the
    focus request, this could be racy, as another client could steal
    the focus, but metacity would ignore it as the serial was the same.
    Bump the serial by making a dummy ChangeProperty request to a
    metactiy-controlled window in this case.
    
    Based on mutter commit:
    GNOME/mutter@7fdfbad6
    66a4cb4a