1. 26 Apr, 2018 3 commits
    • wayland: Check if state and size changed before calling move_resize() · 20176d03
      The current implementation of the XdgSurface v6 protocol does not check
      if the window changed before calling meta_window_wayland_move_resize().
      
      The problem with this approach is that calling this function is a costly
      operation since we enter the compositor side. In GNOME Shell case, it is
      in JavaScript, which triggers a GJS trampoline. Calling this function on
      every mouse movement is naturally as terrible as it could be - and is
      exactly what happens now.
      
      This commit adds the necessary checks to only call move_resize() when
      the window actually changed, or when it needs to be updated.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=780292
      Issue: #78
      Georges Basile Stavracas Neto authored
    • wayland: Add function to query if window needs move or resize · 762a3f89
      This will be used by the next commit to determine when a window
      geometry change should be ignored or not. Normally, it would be
      enough to just check if the position and sizes changed.
      
      The position, in this case, is relative to the client buffer, not
      the global position. But because it is not global, there is one,
      admitedly unlikely, situation where the window state is updated
      while the client size and relative positions don't change.
      
      One can trigger this by e.g. tiling the window to the half-left of
      the monitor, then immediately tile it to half-right. In this case,
      the window didn't change, just it's state, but nonetheless we need
      to notify the compositor and run the full move/resize routines.
      
      When that case happens, though, the MetaWindowWayland is tracking
      the pending state change or a move. And this is what we need to
      expose.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=780292
      Issue: #78
      Georges Basile Stavracas Neto authored
    • window: Let implementations finish state changes · 822c2666
      In the old, synchronous X.org world, we could assume that
      a state change always meant a synchronizing the window
      geometry right after. After firing an operation that
      would change the window state, such as maximizing or
      tiling the window,
      
      With Wayland, however, this is not valid anymore, since
      Wayland is asynchronous. In this scenario, we call
      meta_window_move_resize_internal() twice: when the user
      executes an state-changing operation, and when the server
      ACKs this operation. This breaks the previous assumptions,
      and as a consequence, it breaks the GNOME Shell animations
      in Wayland.
      
      The solution is giving the MetaWindow control over the time
      when the window geometry is synchronized with the compositor.
      That is done by introducing a new result flag. Wayland asks
      for a compositor sync after receiving an ACK from the server,
      while X11 asks for it right away.
      
      Fixes #78
      Georges Basile Stavracas Neto authored
  2. 25 Apr, 2018 4 commits
    • Bump version to 3.29.1 · b412e6c4
      Update NEWS.
      Florian Müllner authored
    • native: Restore previous EGL state after blitting onto secondary GPU · ae26cd07
      Before we just set it to "none", but this was not enough since various
      calls will depend on not just the context being active, but the main
      rendering surface.
      
      Fixes #21
      Jonas Ådahl authored
    • cogl: Do not unref a NULL object · 3104d697
      Add return-if-fail statement to avoid deferencing NULL object
      Marco Trevisan authored
    • monitor-manager: Find active monitor when deriving global scale · 0b3a1c9c
      When deriving the global scale directly from the current hardware state
      (as done when using the X11 backend) we are inspecting the logical
      state they had prior to the most recent hot plug. That means that a
      primary monitor might have been disabled, and a new primary monitor may
      not have been assigned yet.
      
      Stop assuming a primary monitor has an active mode before having
      reconstructed the logical state by finding some active monitor if the
      old primary monitor was disabled. This avoids a crash when trying to
      derive the global scale from a disabled monitor.
      
      Closes: #130
      Jonas Ådahl authored
  3. 24 Apr, 2018 2 commits
    • wayland: Let IM events go through · 423c5f8e
      These paths implicitly relied on the forwarded IM key events having
      a source_device backed by a real HW device. This assumption is no
      longer held true since commit b5328c97.
      
      Explicitly check the INPUT_METHOD flag so they are handled as they
      should despite not being "real HW" events.
      Carlos Garnacho authored
    • backend: Don't center the pointers on monitor changes · 3bbff948
      As a follow up to the patch from a95cbd0a, we need to make sure
      that the pointer is out of the way as well when monitors changed,
      since that's the event that will prevail in some cases. Besides,
      this is also consistent with what the code before a95cbd0a was,
      which initialized the pointer position in the same way both in
      this case and in the real_post_init() function.
      
      Closes: gnome-shell#157
      Mario Sanchez Prada authored
  4. 23 Apr, 2018 5 commits
  5. 21 Apr, 2018 3 commits
    • wayland: Do not reset frame list when merging pending state · 44502be5
      In the synchronized subsurface case, the destination list may
      contain other elements from previous wl_surface.commit calls.
      Resetting the list will leave those dangling frame callbacks
      that will lead to invalid writes when those get to be destroyed
      (eg. on client shutdown).
      Carlos Garnacho authored
    • clutter: Plug minor leak · 8cf42cd0
      clutter_stage_manager_list_stages() returns a copied list, which
      should be freed.
      Carlos Garnacho authored
    • clutter: Set slave=master in IM forwarded key events · b5328c97
      The fix is twofold. On one hand, it makes sense not to relate IM (nor
      any other) generated events to a HW device. On the other hand, if we
      are unfortunate that an IM event is in flight when we are switching
      to another TTY, it may arrive at a time when the source device is no
      longer existent.
      Carlos Garnacho authored
  6. 20 Apr, 2018 1 commit
  7. 18 Apr, 2018 3 commits
    • backends: Don't center the pointer on initialization · a95cbd0a
      Centering the pointer at startup causes undesired behaviour if
      it ends up hovering over reactive elements, that might react
      to that positioning, causing confusion. This is the case of
      the login dialog when a list of different users is shown, as
      centering the pointer at startup in that case will get the
      user in the center of the screen pre-selected, which is not
      the expected behaviour (i.e. pre-selecting the first one).
      
      Fix this by simply moving the pointer out of the way, close
      to the bottom-right corner, during initialization.
      
      Closes: gnome-shell#157
      Mario Sanchez Prada authored
    • clutter/evdev: Don't ignore CAPS lock as modifier · 6df2b7af
      Mark CAPS lock as a modifier (as it should) so that when using XKB
      options to change the default behaviour of CAPS lock, the new assigned
      key can by used as a sticky key as well.
      
      Closes: #112
      Olivier Fourdan authored
    • clutter/evdev: ignore injected events from IM · c01b099d
      Input method can inject key events, which leads to multiple reported key
      press/release events for a single user action.
      
      Ignore those events as this confuses keyboard accessibility.
      Olivier Fourdan authored
  8. 17 Apr, 2018 2 commits
    • xwayland: Don't abort if Xwayland crashes · 2d80fd02
      Right now if Xwayland crashes, we crash, too.
      
      On some level that makes sense, since we're supposed to control the
      lifecycle of Xwayland, and by it crashing we've lost that control.
      
      But practically speaking, the knock-on crash adds noise to the logs,
      bug trackers, and retrace servers that only makes debugging harder.
      And the crash isn't something mutter can "fix", since it's
      ultimately from a bug in Xwayland anyway.
      
      This commit makes mutter exit instead of crash if Xwayland goes away
      unexpectedly.
      Ray Strode authored
    • xwayland: use g_autoptr for GError in xserver_died · bb658540
      Right now we explicitly g_clear_error any error we find, but that
      makes it tricky to return early from the function, which a
      subsequent commit will want to to do.
      
      This commit switches GError to use g_autoptr so the error clearing
      happens automatically.
      Ray Strode authored
  9. 16 Apr, 2018 9 commits
  10. 12 Apr, 2018 1 commit
    • wayland: Plug surface pending state contents leak · b6f5bab2
      When moving the pending state of an effectively synchronized subsurface
      so it is applied together with the parent, perform a merge of the source
      MetaWaylandPendingState into the destination one, instead of simply
      overwriting the struct.
      
      The other approach had 2 kind of leaks, one that would happen everytime
      a wl_surface.commit happens on a sync subsurface (both surface/buffer
      damage regions are leaked). The other more unlikely one would apply on
      the rest of pending state data, happening whenever the compositor gets
      >1 wl_surface.commit calls on the subsurface before the parent surface
      gets its own.
      
      The function has also been renamed to use the more descriptive "merge"
      term.
      
      Related: gnome-shell#64
      Carlos Garnacho authored
  11. 11 Apr, 2018 1 commit
  12. 10 Apr, 2018 2 commits
  13. 09 Apr, 2018 2 commits
    • wayland: update enter/leave output after effects · 17a745bf
      Compositor effects change the actor size and position, which can lead to
      inconsistent output enter/leave notifications, leaving clients' surfaces
      without any output set.
      
      Update output enter/leave notifications after all compositor effects are
      completed so that we give clients accurate output location.
      
      Closes: #104
      Olivier Fourdan authored
    • window-actor: add new signal "effects-completed" · 85bbd82a
      When using plugins, the effects will affect the MetaWindowActor size
      and position.
      
      Add a new signal "effects-completed" wired to the corresponding
      MetaWindowActor which is emitted when all effects are completed so that
      derived objects can be notified when all effects are completed and use
      the actual size and position.
      
      Closes: #104
      Olivier Fourdan authored
  14. 03 Apr, 2018 2 commits