1. 24 Jun, 2019 9 commits
  2. 27 May, 2019 3 commits
  3. 14 May, 2019 1 commit
  4. 03 May, 2019 4 commits
    • Marco Trevisan's avatar
      compositor: Disconnect from stage signals on destruction · b838fe8f
      Marco Trevisan authored
      From this point there's not any need for the compositor to listen to signals
      so we can disconnect from the stage ones we are connected to.
      
      !556
      
      
      (cherry picked from commit 3ba79961)
      b838fe8f
    • Marco Trevisan's avatar
      compositor: Destroy window actors list on destruction · 2e64457f
      Marco Trevisan authored
      When the compositor is destroyed we should cleanup the list of window actors we
      created and destroy them.
      Since all the actors are added to the window_group or top_window_group we can
      just destroy these containers (together with the feedback_group), and simply
      free the windows list.
      
      This is particularly needed under X11 because before we destroy the display, we
      might do some cleanups as detaching the surface pixmaps and freeing the damages
      and if this happens at later point (for example when triggered by garbage
      collector in gnome-shell), we might crash because the x11 dpy reference is
      already gone.
      
      Destroying the window actors instead, ensures we avoid any further call to X11
      related functions and that we release the actors XServer resources.
      
      Fixes #576
      
      
      (cherry picked from commit 7718e67f)
      2e64457f
    • Daniel van Vugt's avatar
      wayland: Remove unused GList *l · 9b289728
      Daniel van Vugt authored
      
      (cherry picked from commit db5abbb2)
      9b289728
    • Andrea Azzarone's avatar
      clutter/x11: Implement keycode remap to keysyms on virtual key devices · 6198d389
      Andrea Azzarone authored
      Keycode lookup can fail for serveral reasons, e.g. if there is no combination of
      modifiers and keycodes that can produce the target keysym with the current
      keyboard layout.
      
      In case the keycode lookup fails, remap temporarily the keysym to an unused
      keycodes.
      
      Fixes: gnome-shell#109
      
      (cherry-picked from commit e3e933c4)
      6198d389
  5. 30 Apr, 2019 1 commit
    • Andrea Azzarone's avatar
      clutter/x11: Consider remapped keys when guessing the keycode from the keysym · 24b4c82a
      Andrea Azzarone authored
      Since e3e933c4 a keyval can be temporarily remapped to an unused keycode. Due to
      some limitations in XTestFakeKeyEvent, the remapping has to be done in the first
      xkb group/layout. In case there are two or more keyboard layouts enabled and the
      selected keyboard layout is not the first, clutter_keymap_x11_keycode_for_keyval
      will fail to retrieve the correct keycode for a remapped keyval. Let's use the
      reserved_keycodes map in order to retrieve the correct keycode if needed.
      
      Fixes: #443
      
      
      (cherry picked from commit e0811ce1)
      24b4c82a
  6. 24 Jan, 2019 6 commits
    • Carlos Garnacho's avatar
      compositor: Avoid changing pipeline/source if shadow is not being painted · 4af8d9d4
      Carlos Garnacho authored
      Avoids some context invalidations in cogl.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=782344
      
      
      (cherry picked from commit 3c6a518d)
      4af8d9d4
    • Carlos Garnacho's avatar
      tests: Don't check pixels outside actor allocation · 0f9eb656
      Carlos Garnacho authored
      The actor-shader-effect test actors are 50px wide, but we check the 51st
      pixel. This went along undetected until "clutter: Avoid rounding
      compensation when invalidating 2D actors" because the paint volumes were
      made slightly bigger and the shaders paint all over them (I guess nobody
      noticed those actors being actually ~52px wide).
      
      Update the test to check the middle of the opposite edge, so we keep neatly
      rounded numbers.
      
      
      (cherry picked from commit 1d73533f)
      0f9eb656
    • Carlos Garnacho's avatar
      clutter: Avoid rounding compensation when invalidating 2D actors · 56a4f33d
      Carlos Garnacho authored
      This allows the redraw clip to be more constrained, so MetaCullable doesn't
      end up rendering portions of window shadows, frame and background when a
      window invalidates (part of) its contents.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=782344
      
      
      (cherry picked from commit a7df4594)
      56a4f33d
    • Jonas Ådahl's avatar
      wayland/data-device: Focus out when focus surface destroyed · 0be81216
      Jonas Ådahl authored
      When repicking after a surface was destroyed, if the destroyed surface
      was the drag focus, we'd try to focus-out from it after it was
      destroyed, causing a NULL pointer dereference.
      
      Fixes: #336
      
      
      (cherry picked from commit 95649fd2)
      0be81216
    • Jonas Ådahl's avatar
      window/wayland: Don't initialize a window as showing · b63bbda4
      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
      
      
      (cherry picked from commit 49780245)
      b63bbda4
    • Florian Müllner's avatar
      x11/window-props: Do not convert WM_NAME · 6603925f
      Florian Müllner authored
      The WM_NAME property is of type TEXT_PROPERTY, which is supposed to be
      returned as UTF-8. Commit 840378ae broke that assumption, resulting
      in crashes with non-UTF8 locales; however the "fix" of converting from
      LATIN1 to UTF8 is wrong as well, as the conversion will spit out garbage
      when the input encoding isn't actually LATIN1.
      
      Now that the original issue in text_property_to_utf8() has been fixed,
      we can simply revert the relevant bits of commit d62491f4.
      
      !227
      
      
      (cherry picked from commit 62775d19)
      6603925f
  7. 23 Jan, 2019 1 commit
    • Florian Müllner's avatar
      xprops: Make sure text_property_to_utf8() returns UTF8 · fe4c3aa6
      Florian Müllner authored
      Commit 840378ae changed the code to use XmbTextPropertyToTextList()
      instead of gdk_text_property_to_utf8_list_for_display(), but didn't
      take into account that the replacement returns text in the current
      locale's encoding, while any callers (rightfully) expect UTF8.
      
      Fix this by converting the text if necessary.
      
      !227
      
      
      (cherry picked from commit 76abe870)
      fe4c3aa6
  8. 16 Jan, 2019 1 commit
    • Carlos Garnacho's avatar
      clutter: Do not latch modifiers on modifier keys · d9cc8530
      Carlos Garnacho authored
      If the user maps eg. Alt+F2 to a pad button, the MetaInputSettings will
      send the full Alt press, F2 press, F2 release, Alt release sequence.
      However the keycode corresponding to Alt is found in level 1, so the
      Shift modifier gets unintendedly latched in addition to the Alt key
      press/release pair.
      
      We could probably improve keycode lookup heuristics so level=0 (and
      no modifier latching) is preferred, but we can do without it altogether
      for modifier keys.
      
      
      (cherry picked from commit 67aab7c1)
      d9cc8530
  9. 19 Dec, 2018 2 commits
    • Daniel van Vugt's avatar
      clutter-offscreen-effect: Disable if no texture · 1b78ca8c
      Daniel van Vugt authored
      If texture allocation fails (e.g. on an old GPU with size limit 2048)
      then `update_fbo` would return `FALSE` but leaves `priv->offscreen`
      as non-NULL. So the next paint will try to use the offscreen with a
      `NULL` texture and crashes. The solution is simply to ensure that
      `priv->offscreen` is NULL if there is no `priv->texture`, so the default
      (non-offscreen) paint path gets used instead.
      
      Bug reported and fix provided by Gert van de Kraats.
      
      https://launchpad.net/bugs/1795774
      
      
      (cherry picked from commit f31cf0c3)
      1b78ca8c
    • Daniel van Vugt's avatar
      cogl-auto-texture: Avoid a double-free crash · 6a6d477d
      Daniel van Vugt authored
      If texture allocation fails (e.g. on an old GPU with size limit 2048)
      then `cogl_texture_new_with_size` was trying to use the same CoglError
      twice. The second time was after it had already been freed.
      
      Bug reported and fix provided by Gert van de Kraats.
      
      https://launchpad.net/bugs/1790525
      
      
      (cherry picked from commit d21478b0)
      6a6d477d
  10. 13 Nov, 2018 1 commit
    • Olivier Fourdan's avatar
      window: Really force update monitor on hot plugs · 721de281
      Olivier Fourdan authored
      Commit 8d3e0530 ("window: Force update monitor on hot plugs") added the
      flag `META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE` passed to
      `update_monitor()` from `update_for_monitors_changed()`.
      
      However, `update_for_monitors_changed()` may choose to call another code
      path to `move_between_rects()` and `meta_window_move_resize_internal()`
      eventually.
      
      As `meta_window_move_resize_internal()` does not use the "force" flag,
      we may still end up in case where the window->monitor is left unchanged.
      
      To avoid that problem, add a new `MetaMoveResizeFlags` that
      `update_for_monitors_changed()` can use to force the monitor update from
      `meta_window_move_resize_internal()`.
      
      Fixes: 8d3e0530 ("window: Force update monitor on hot plugs")
      Closes: #189
      
      
      (cherry picked from commit fa495286)
      
      (cherry picked from commit 8eabfaaa)
      721de281
  11. 23 Oct, 2018 1 commit
  12. 04 Oct, 2018 8 commits
    • Jonas Ådahl's avatar
      wayland/gtk-shell: Handle requests after toplevel was unmanaged · 8ddbe9d9
      Jonas Ådahl authored
      As with xdg-toplevel, a gtk-surface can be unmanaged by the compositor
      without the client knowing about it, meaning the client may still send
      updates and make requests. Handle this gracefully by ignoring them. The
      client needs to reset all the state anyway, if it wants to remap the
      same surface.
      
      #240
      (cherry picked from commit ca5b27ba)
      8ddbe9d9
    • Jonas Ådahl's avatar
      wayland/legacy-xdg-shell: Handle requests after toplevel was unmanaged · a22cb883
      Jonas Ådahl authored
      As with xdg-toplevel proper, a legacy xdg-toplevel can be unmanaged by
      the compositor without the client knowing about it, meaning the client
      may still send updates and make requests. Handle this gracefully by
      ignoring them. The client needs to reassign the surface the legacy
      xdg-toplevel role again, if it wants to remap the same surface, meaning
      all state would be reset anyway.
      
      Closes: #240
      (cherry picked from commit 64df6276)
      a22cb883
    • Jonas Ådahl's avatar
      wayland/legacy-xdg-shell: Cache frame callbacks if toplevel is unmanaged · 082efaca
      Jonas Ådahl authored
      A toplevel window can be unmanaged without the client knowing it (e.g. a
      modal dialog being unmapped together with its parent. When this has
      happened, take frame callbacks queued on a commit and cache them on the
      generic surface queue. If the toplevel is to be remapped because the
      surface was reassigned the toplevel role, the cached frame callbacks
      will be queued on the surface actor and dispatched accordingly.
      
      #240
      (cherry picked from commit a740f50c)
      082efaca
    • Jonas Ådahl's avatar
      wayland/xdg-shell: Handle requests after toplevel was unmanaged · 80f94277
      Jonas Ådahl authored
      A window can be unmanaged without asking the client to do it, for
      example as a side effect of a parent window being unmanaged, if the
      child window was a attached dialog.
      
      This means that the client might still make requests post updates to it
      after that it was unmapped. Handle this gracefully by NULL-checking the
      surface's MetaWindow pointer. We're not loosing any state due to this,
      as if the client wants to map the same surface again, it needs to either
      reassign it the toplevel role, or reset the xdg-toplevel, both resulting
      in all state being lost anyway.
      
      #240
      (cherry picked from commit 5fd0f62a)
      80f94277
    • Jonas Ådahl's avatar
      wayland/xdg-shell: Cache frame callbacks if toplevel is unmanaged · b5c25556
      Jonas Ådahl authored
      A toplevel window can be unmanaged without the client knowing it (e.g. a
      modal dialog being unmapped together with its parent. When this has
      happened, take frame callbacks queued on a commit and cache them on the
      generic surface queue. If the toplevel is to be remapped, either because
      the surface was reassigned the toplevel role, or if it was reset and
      remapped, the cached frame callbacks will be queued on the surface actor
      and dispatched accordingly.
      
      #240
      (cherry picked from commit 80d420ff)
      b5c25556
    • Jonas Ådahl's avatar
      wayland/xdg-shell: Cache pending frame callbacks on popup reset · 0a85e627
      Jonas Ådahl authored
      A popup can be reset, and when that happens, window and actor are
      destroyed, and won't be created again unless it is reassigned the
      popup role.
      
      If a client queued frame callbacks when resetting a popup, the frame
      callbacks would be left in the pending state, as they were not queued on
      the actor, meaning we'd hit an assert about the frame callbacks not
      being handled. Fix this by caching them on the MetaWaylandSurface, so
      that they either are cleaned up on destruction, or queued on the actor
      would the surface be re-assigned the popup role.
      
      #240
      (cherry picked from commit 407d6294)
      0a85e627
    • Jonas Ådahl's avatar
      wayland/surface: Add API to cache frame callbacks · 4dfe4256
      Jonas Ådahl authored
      Sometimes it may be useful for roles to put callbacks in the generic
      surface frame callback queue. The surface frame callback queue will
      either eventually be processed on the next surface role assignment that
      places the frame callbacks in a role specific queue, processed at some
      other point in time by a role, or cleaned up on surface destruction.
      
      #240
      (cherry picked from commit 0ace58d0)
      4dfe4256
    • Jonas Ådahl's avatar
      wayland/xdg-shell: Queue frame callbacks on new actor after resetting · 998e3279
      Jonas Ådahl authored
      When a xdg-toplevel is reset, the window and actor are recreated, and
      all state is cleared. When this happened, we earlied out from the
      xdg-toplevel commit handler, which would mean that if the client had
      queued frame callbacks when resetting, they'd be left in the pending
      commit state, later hitting an assert as they were not handled.
      
      Fix this by queuing the frame callbacks no the new actor, so that they
      are emitted whenever the actor is eventually painted.
      
      #240
      (cherry picked from commit d7917101)
      998e3279
  13. 03 Oct, 2018 1 commit
    • Jonas Ådahl's avatar
      window/wayland: Don't recursive indefinitely when updating monitor · 1514880e
      Jonas Ådahl authored
      When we update the main monitor, there is a rule that makes it so that
      popup windows use the same main monitor as their parent. In the commit
      f4d07caa the call that updates and
      fetches the main monitor of the toplevel accidentally changed to update
      from itself, causing a indefinite recursion eventually resulting in a
      crash.
      
      Closes: #279
      (cherry picked from commit e191c21e)
      1514880e
  14. 27 Sep, 2018 1 commit
    • Olivier Fourdan's avatar
      wayland: No xdg-output events without a logical monitor · 6ed36cd6
      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
      
      (cherry picked from commit 68ec9ac0)
      6ed36cd6