1. 08 Oct, 2018 1 commit
    • Daniel Drake's avatar
      monitor-manager: use MonitorsConfig to track switch_config · 6267732b
      Daniel Drake authored
      When constructing MetaMonitorsConfig objects, store which type
      of switch_config they are for (or UNKNOWN if it is not such
      type of config).
      
      Stop unconditionally setting current_switch_config to UNKNOWN when
      handling monitors changed events. Instead, set it to the switch_config
      type stored in the MonitorsConfig in the codepath that updates logical
      state. In addition to being called in the hotplug case along the same
      code flow that generates monitors changed events, this is also called
      in the coldplug case where a secondary monitor was connected before
      mutter was started.
      
      When creating the default linear display config, create it as a
      switch_config so that internal state gets updated to represent
      linear mode when this config is used.
      
      The previous behaviour of unconditionally resetting current_switch_config
      to UNKNOWN was breaking the internal state machine for display config
      switching, causing misbehaviour in gnome-shell's switchMonitor UI when
      using display switch hotkeys. The lack of internal tracking when the
      displays are already in the default "Join Displays" linear mode was
      then causing the first display switch hotkey press to do nothing
      (it would attempt to select "Join Displays" mode, but that was already
      active).
      
      Fixes: #281
      !213
      6267732b
  2. 07 Oct, 2018 1 commit
  3. 05 Oct, 2018 1 commit
    • Jonas Ådahl's avatar
      window/wayland: Don't initialize a window as showing · 49780245
      Jonas Ådahl authored
      With Wayland, a window is not showing until it's shown. Until this
      patch, the initial state of MetaWindow, on the other hand, was that a
      window is initialized as showing. This means that for a window to
      actually be classified as shown (MetaWindow::hidden set to FALSE),
      something would first have to hide it.
      
      Normally, this wasn't an issue, as normally we'd first create a window,
      determine it shouldn't be visible (due to missing buffer), hide it
      before the next paint, then eventually show it. This doesn't work if
      mutter isn't drawing any frames at the moment (e.g. the user switched
      VT), as we'd miss the hiding before showing as e result of a buffer
      being attached. The most visible side effect is that a window can't be
      moved as the window actor remains frozen.
      
      This commit fixes this issue by correctly classifying a newly created
      Wayland window as "hidden".
      
      Fixes: #331
      49780245
  4. 04 Oct, 2018 8 commits
    • Jonas Ådahl's avatar
      shaped-texture: Transform clip and opaque region to texture space · ff08e19f
      Jonas Ådahl authored
      The clip and opaque region are both in a translated stage coordinate
      space, where the origin is in the top left corner of the painted
      texture. The painting, however, is in the texture coordinate space,
      so when the texture is scaled, the coordinate spaces differ.
      
      Handle this by transforming the clip and opaque region to texture
      coordinate space before computing the blend region and the opaque region
      to paint.
      
      Closes: #300
      ff08e19f
    • Jonas Ådahl's avatar
      region-utils: Add API to scale an integer region with a double · 9c77e52a
      Jonas Ådahl authored
      The added API lets the caller decide whether to shrink or grow the
      rectangles if there are rounding issues.
      
      Related: #300
      9c77e52a
    • Jonas Ådahl's avatar
      region-utils: Some whitespace fixes · 0ae7ef4b
      Jonas Ådahl authored
      Related: #300
      0ae7ef4b
    • Jonas Ådahl's avatar
      shaped-texture: Move variable declaration on top · 556ed7b9
      Jonas Ådahl authored
      Related: #300
      556ed7b9
    • Jonas Ådahl's avatar
      shaped-texture: Use ints for sizes · b5a00680
      Jonas Ådahl authored
      They were int before entering MetaShapedTexture, used as ints in the
      cairo regions and rectangles, so there is no reason they should be
      stored as unsigned.
      
      Related: #300
      b5a00680
    • Pekka Paalanen's avatar
      renderer/native: honour dumb buffer stride · a3d826c5
      Pekka Paalanen authored
      meta_renderer_native_gles3_read_pixels() was assuming that the target
      buffer stride == width * 4. This is not generally true. When a DRM
      driver allocates a dumb buffer, it is free to choose a stride so that
      the buffer can actually work on the hardware.
      
      Record the driver chosen stride in MetaDumbBuffer, and use it in the CPU
      copy path. This should fix any possible stride issues in
      meta_renderer_native_gles3_read_pixels().
      a3d826c5
    • Pekka Paalanen's avatar
      renderer/native: assert dumb buffer size on CPU copy · 72e23610
      Pekka Paalanen authored
      Track the allocated dumb buffer size in MetaDumbBuffer. Assert that the
      size is as expected in copy_shared_framebuffer_cpu().
      
      This is just to ensure that Cogl and the real size match. The size from
      Cogl was used in the copy, so getting that wrong might have written
      beyond the allocation.
      
      This is a safety measure and has not been observed to happen yet.
      72e23610
    • Pekka Paalanen's avatar
      renderer/native: check format for drmModeAddFB fallback · 3e1ca627
      Pekka Paalanen authored
      If drmModeAddFB2() does not work, the fallback to drmModeAddFB() can
      only handle a single specific format. Make sure the requested format is
      that one format, and fail the operation otherwise.
      
      This should at least makes the failure mode obvious on such old systems
      where the kernel does not support AddFB2, rather than producing wrong
      colors.
      3e1ca627
  5. 01 Oct, 2018 2 commits
  6. 29 Sep, 2018 1 commit
  7. 25 Sep, 2018 1 commit
    • Olivier Fourdan's avatar
      wayland: No xdg-output events without a logical monitor · 68ec9ac0
      Olivier Fourdan authored
      To avoid a known race condition in the wl_output protocol documented in
      https://phabricator.freedesktop.org/T7722, mutter delays the `wl_output`
      destruction but nullify the `logical_monitor` associated with the
      `wl_output` and the binding routine `bind_output()` makes sure not to
      send wl_output events if the `logical_monitor` is `NULL` (see commit
      1923db97).
      
      The binding routine for `xdg_output` however does not check for such a
      condition, hence if the output configuration changes while a client is
      binding to xdg-output (typically Xwayland at startup), mutter would
      crash while trying to access the `logical_monitor` which was nullified
      by the change in configuration.
      
      Just like `bind_output()` does for wl_output, do not send xdg-output
      events if there is no `logical_monitor` yet.
      
      Closes: #194
      68ec9ac0
  8. 24 Sep, 2018 1 commit
    • Carlos Garnacho's avatar
      core: Preserve focus across decoration changes · 8dcac664
      Carlos Garnacho authored
      Changes in window decoration result in the window being reparented
      in and out its frame. This in turn causes unmap/map events, and
      XI_FocusOut if the window happened to be focused.
      
      In order to preserve the focused window across the decoration change,
      add a flag so that the focus may be restored on MapNotify.
      
      Closes: #273
      8dcac664
  9. 21 Sep, 2018 1 commit
    • Olivier Fourdan's avatar
      compositor: Skip windows not visible to the compositor · 2fb3db76
      Olivier Fourdan authored
      The compositor will automatically unredirect the top most window which
      is fully visible on screen. When unredirecting windows, it also shapes
      the compositor overlay window (COW) so that other redirected windows
      still shows correctly.
      
      The function `get_top_visible_window_actor()` however will simply walks
      down the window list, so if a window is placed on a layer above and
      unredirected, then iconified by the client, it will still be picked up
      by `get_top_visible_window_actor()` and he compositor will reckon it's
      still unredirected while not in a visible state anymore, thus leaving a
      black area on screen.
      
      Make sure we skip the windows not known to the compositor while picking
      the top visible window actor to avoid this issue.
      
      Closes: #306
      2fb3db76
  10. 19 Sep, 2018 3 commits
    • Jonas Ådahl's avatar
      window/wayland: Freeze updates until shown · 7d82cdee
      Jonas Ådahl authored
      Not until the window is shown do we know what monitor it's on, thus the
      size, so freeze updates (shape etc) until the window is shown.
      
      !229
      7d82cdee
    • Jonas Ådahl's avatar
      window: Move out 'updates frozen' state into implementations · e2e72966
      Jonas Ådahl authored
      Implementation of said state was just related to X11, so move it into
      window-x11.c. The Wayland path always fell back on the returning TRUE,
      so just do that for now.
      
      !229
      e2e72966
    • Tony Novak's avatar
      input-settings: detect trackball using udev ID_INPUT_TRACKBALL · 8685de96
      Tony Novak authored
      Previously, trackballs were detected based on the presence of the
      substring "trackball" in the device name. This had the downside of
      missing devices, such as the Kensington Expert Mouse, which don't have
      "trackball" in their names.
      
      Rather than depending on the device name, use the ID_INPUT_TRACKBALL
      property from udev to determine whether or not to treat a device as a
      trackball.
      
      This adds a new function, `is_trackball_device`, to MetaInputEvents, and
      eliminates the `meta_input_device_is_trackball` function.
      
      Fixes: #258
      8685de96
  11. 18 Sep, 2018 3 commits
    • Sam Spilsbury's avatar
      actor: Also recompute paint volume if we recently dropped effects · a8a3c101
      Sam Spilsbury authored
      Otherwise we'll be stuck with the same paint volume on the last
      frame of the given effect, which could be wrong.
      a8a3c101
    • Sam Spilsbury's avatar
      actor: Always use get_paint_volume override for active effects · 5d19aee2
      Sam Spilsbury authored
      If an effect is active and it overrides the paint volume, we should
      always recompute the paint volume when requested and not use the
      cache, since the paint volume override can change from call to
      call depending on what phase of painting we are in. For instance,
      if we are part way through painting effects and request the
      paint volume, the paint volume should only go up to the current
      effect, but in a later call to compute repaint regions, the
      paint volume needs to expand to accomadate the effect.
      
      This still involves a lot of recomputation in the case of effects -
      in a later clutter version it would be worth adding an API to
      allow effects to explicitly recompute and return a new the paint
      volume up to the current effect as opposed to recomputing
      the cached one.
      5d19aee2
    • Sam Spilsbury's avatar
      actor: Fix logic error in determining terminal effect for paint volume · 4270eef1
      Sam Spilsbury authored
      Previously we were checking l->data != NULL || (l->data != NULL &&
      l->data != priv->current_effect). This would continue the loop even
      if l->data == priv->current_effect, since l->data != NULL, which was
      not the intention of that loop.
      
      We also don't need to check that l->data != NULL before checking if
      it does not match the current_effect, since we already checked
      that current_effect was non-NULL before entering the loop.
      4270eef1
  12. 14 Sep, 2018 1 commit
    • Olivier Fourdan's avatar
      window: unmanage dialog when clearing transient_for · b443bd42
      Olivier Fourdan authored
      On Wayland, xdg-foreign would leave a modal dialog managed even after
      the imported surface is destroyed.
      
      This is sub-optimal and this breaks the atomic relationship one would
      expect between the parent and its modal dialog.
      
      Make sure we unmanage the dialog if transient_for is unset even for
      Wayland native windows.
      
      Related: #174
      Related: #221
      b443bd42
  13. 11 Sep, 2018 1 commit
  14. 07 Sep, 2018 3 commits
  15. 06 Sep, 2018 1 commit
  16. 03 Sep, 2018 1 commit
  17. 02 Sep, 2018 1 commit
  18. 01 Sep, 2018 2 commits
  19. 31 Aug, 2018 2 commits
  20. 29 Aug, 2018 4 commits
  21. 28 Aug, 2018 1 commit