1. 19 Apr, 2019 1 commit
  2. 18 Apr, 2019 1 commit
    • Pekka Paalanen's avatar
      Rename compositor.h to libweston/libweston.h · 3d5d9476
      Pekka Paalanen authored
      The main idea is to make libweston users use the form
       #include <libweston/libweston.h>
      instead of the plain
       #include <compositor.h>
      which is prone to name conflicts. This is reflected both in the installed
      files, and the internal header search paths so that Weston would use the exact
      same form as an external project using libweston would.
      The public headers are moved under a new top-level directory include/ to make
      them clearly stand out as special (public API).
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
  3. 15 Feb, 2018 1 commit
    • Alexandros Frantzis's avatar
      libweston: Make weston_seat release safe · 8480d13f
      Alexandros Frantzis authored
      Ensure the server can safely handle client requests for wl_seat resource
      that have become inert due to weston_seat object release and subsequent
      The clean-up involves, among other things, unsetting the destroyed
      weston_seat object from the user data of wl_seat resources, and handling
      this NULL user data case where required.
      The list of sites extracting and using weston_seat object from wl_seat
      resources which were audited for this patch are:
      N/A = Not Applicable (not implemented by weston)
      FIXED = Fixed in the commit
      OK = Already works correctly
      == keyboard_shortcuts_inhibit_unstable_v1 ==
      [N/A] zwp_keyboard_shortcuts_inhibit_manager_v1.inhibit_shortcuts
      == tablet_input_unstable_v{1,2} ==
      [N/A] zwp_tablet_manager_v{1,2}.get_tablet_seat
      == text_input_unstable_v1 ==
      [FIXED] zwp_text_input_v1.activate
      [FIXED] zwp_text_input_v1.deactivate
      == wl_data_device ==
      [FIXED] wl_data_device_manager.get_data_device
      [OK] wl_data_device.start_drag
      [FIXED] wl_data_device.set_selection
      [OK] wl_data_device.release
      == wl_shell ==
      [FIXED] wl_shell_surface.move
      [FIXED] wl_shell_surface.resize
      [FIXED] wl_shell_surface.set_popup
      == xdg_shell and xdg_shell_unstable_v6 ==
      [FIXED] xdg_toplevel.show_window_menu
      [FIXED] xdg_toplevel.move
      [FIXED] xdg_toplevel.resize
      [FIXED] xdg_popup.grab
      == xdg_shell_unstable_v5 ==
      [FIXED] xdg_shell.get_xdg_popup
      [FIXED] xdg_surface.show_window_menu
      [FIXED] xdg_surface.move
      [FIXED] xdg_surface.resize
      Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
      Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      Reviewed-by: Quentin Glidic's avatarQuentin Glidic <sardemff7+git@sardemff7.net>
  4. 27 Nov, 2017 7 commits
  5. 14 Aug, 2016 1 commit
  6. 26 Jul, 2016 1 commit
  7. 01 Jul, 2016 1 commit
    • Armin Krezović's avatar
      compositor: Untangle surface/view is_mapped from output assignments · f8486c33
      Armin Krezović authored
      Currently, weston assumes a surface/view is mapped if
      it has an output assigned. In a zero outputs scenario,
      this isn't really desirable.
      This patch introduces a new flag to weston_surface and
      weston_view, which has to be set manually to indicate
      that a surface/view is mapped.
      - Remove usage of new flags from
        weston_{view,surface}_is_mapped at this point. They
        will be added after all the implicit mappings have
        been introduced
      - Unmap a surface before unmapping a view so the input
        foci is cleaned up properly
      - Remove implicit view mapping from view_list_add
      - Cosmetic fixes
      - Rebased to apply on git master
      Signed-off-by: default avatarArmin Krezović <krezovic.armin@gmail.com>
      Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
  8. 23 Jun, 2016 1 commit
  9. 22 Apr, 2016 1 commit
  10. 01 Feb, 2016 1 commit
  11. 19 Jan, 2016 5 commits
    • Carlos Garnacho's avatar
      data-device: Implement compositor-chosen actions · b288988e
      Carlos Garnacho authored
      Set up a keyboard grab during drag-and-drop, so we can translate
      modifiers into preferred actions. The compositor chosen action
      is stored in the current weston_data_source in order to make it
      accessible to the source/offer at the time of calculating the new
      action, but would conceptually be part of weston_drag.
      The mapping has been made similar to what GTK+/QT usually do, the
      shift key defaults to "move" and ctrl defaults to "copy".
      Changes since v2:
        - Use enum types and values for the compositor action. Fix
          code formatting issues.
      Changes since v1:
        - Handle the keyboard grab being cancelled. Initialize new
          wl_data_source fields.
      Signed-off-by: Carlos Garnacho's avatarCarlos Garnacho <carlosg@gnome.org>
      Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
      Reviewed-by: default avatarBryce Harrington <bryce@osg.samsung.com>
    • Carlos Garnacho's avatar
      data-device: Implement DnD actions · 9c931790
      Carlos Garnacho authored
      The policy in weston in order to determine the chosen DnD action is
      deliberately simple, and is probably the minimals that any compositor
      should be doing here.
      Besides honoring the set_actions requests on both wl_data_source and
      wl_data_offer, weston now will emit the newly added "action" events
      notifying both source and dest of the chosen action.
      The "dnd" client has been updated too (although minimally), so it
      notifies the compositor of a "move" action on both sides.
      Changes since v8:
        - Add back wl_data_offer.source_actions emission, gone during last
          code shuffling. Fix nits found in review.
      Changes since v7:
        - Fixes spotted during review. Add client-side version checks.
          Implement .action emission as specified in protocol patch v11.
      Changes since v6:
        - Emit errors as defined in DnD actions patch v10.
      Changes since v5:
        - Use enum types and values for not-a-bitfield stored values.
          handle errors when finding unexpected dnd_actions values.
      Changes since v4:
        - Added compositor-side version checks. Spaces vs tabs fixes.
          Fixed resource versioning. Initialized new weston_data_source/offer
      Changes since v3:
        - Put data_source.action to use in the dnd client, now updates
          the dnd surface like data_source.target events do.
      Changes since v2:
        - Split from DnD progress notification changes.
      Changes since v1:
        - Updated to v2 of DnD actions protocol changes, implement
        - Fixed coding style issues.
      Signed-off-by: Carlos Garnacho's avatarCarlos Garnacho <carlosg@gnome.org>
      Reviewed-by: default avatarMichael Catanzaro <mcatanzaro@igalia.com>
      Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
    • Carlos Garnacho's avatar
      data-device: Implement DnD progress notification · 78d4bf9a
      Carlos Garnacho authored
      Weston now sends wl_data_source.dnd_drop_performed and .dnd_finished in
      order to notify about the different phases of DnD.
      wl_data_source.cancelled is also used as mentioned in the docs, being
      emitted also on DnD when the operation is meant to fail (eg. source
      and dest didn't agree on a mimetype).
      The dnd demo is also fixed so the struct dnd_drag isn't leaked.
      Changes since v6:
        - Add client-side version checks. Minor code shuffling.
      Changes since v5:
        - Dissociate source and offer after cancel. Updated to
          apply on top of c9f8f8a7
      Changes since v4:
        - Make wl_data_offer.finish with the wrong state an error.
      Changes since v3:
        - Fixed wl_data_source.dnd_finished vs cancelled emission on
          when interoperating with version < 3 drag destinations.
      Changes since v2:
        - Handle wl_data_offer.finish. Fixed commit log inconsistencies.
          Added version checks. Spaces vs tabs fixes. Fixed resource
      Changes since v1:
        - Updated to protocol v2.
      Signed-off-by: Carlos Garnacho's avatarCarlos Garnacho <carlosg@gnome.org>
      Reviewed-by: default avatarMichael Catanzaro <mcatanzaro@igalia.com>
      Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
      Reviewed-by: default avatarBryce Harrington <bryce@osg.samsung.com>
    • Peter Hutterer's avatar
      Support axis source, axis discrete, frame and axis stop events · 87743e93
      Peter Hutterer authored
      [jonas: only send focus wl_pointer.frame if resource supports it]
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
      Signed-off-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
    • Peter Hutterer's avatar
      Add a weston_pointer_axis_event · 89b6a493
      Peter Hutterer authored
      Use an event struct to pass axis events around. This helps dealing with the
      upcoming axis discrete changes.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
  12. 13 Jan, 2016 1 commit
  13. 20 Nov, 2015 1 commit
  14. 02 Nov, 2015 1 commit
  15. 06 Aug, 2015 2 commits
    • Derek Foreman's avatar
      input: add a weston_pointer_clear_focus() helper function · f9318d14
      Derek Foreman authored
      Valgrind has shown that in at least one place (default_grab_pointer_focus)
      we're testing uninitialized values coming out of weston_compositor_pick_view.
      This is happening when default_grab_pointer_focus is called when there is
      nothing on the view list, and during the first repaint when only the black
      surface with no input region exists.
      This patch adds a function to clear pointer focus and also set the sx,sy
      co-ordinates to a sentinel value we shouldn't compute with.
      Assertions are added to make sure any time pointer focus is set to NULL
      these values are used.
      weston_compositor_pick_view() now returns these values too.
      Now the values are always initialized, even when no view exists, and
      they're initialized in such a way that actually doing computation
      with them should fail in an obvious way, but we can compare them
      safely for equality.
      Signed-off-by: default avatarDerek Foreman <derekf@osg.samsung.com>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
    • Giulio Camuffo's avatar
      input: pass the global touch coordinates to the touch grab · 61ed7b6b
      Giulio Camuffo authored
      This makes it consistent with the pointer grab, which also gets
      global coordinates and not surface relative ones, and allows to
      easily filter out gestures based on compositor global hotspots.
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
  16. 31 Jul, 2015 1 commit
    • Derek Foreman's avatar
      input: Don't test keyboard/pointer/touch pointers · 1281a36e
      Derek Foreman authored
      Keyboards and pointers aren't freed when devices are removed, so we should
      really be testing keyboard_device_count and pointer_device_count in most
      cases, not the actual pointers. Otherwise we end up with different
      behaviour after removing a device than we had before it was inserted.
      This commit renames the touch/keyboard/pointer pointers and adds helper
      functions to get them that hide this complexity and return NULL when
      *_device_count is 0.
      Signed-off-by: default avatarDerek Foreman <derekf@osg.samsung.com>
      Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
  17. 16 Jun, 2015 1 commit
  18. 15 Jun, 2015 1 commit
  19. 01 May, 2015 2 commits
  20. 08 Dec, 2014 1 commit
    • Pekka Paalanen's avatar
      compositor: add weston_surface_set_label_func() · 8274d901
      Pekka Paalanen authored
      When printing out logs from Weston's actions, mainly for debugging, it
      can be very difficult to identify the different surfaces.  Inspecting
      the configure function pointer is not useful, as the configure functions
      may live in modules.
      Add vfunc get_label to weston_surface, which will produce a short,
      human-readable description of the surface, which allows identifying it
      better, rather than just looking at the surface size, for instance.
      Set the label function from most parts of Weston, to identify cursors and
      drag icons, and panels, backgrounds, screensavers and lock surfaces, and
      the desktop shell's application surfaces.
      v2: renamed 'description' to 'label', so we get
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
  21. 04 Nov, 2014 1 commit
  22. 08 Oct, 2014 1 commit
    • Pekka Paalanen's avatar
      compositor: send error for surface role resets · 50b67479
      Pekka Paalanen authored
      With the more accurate definition of wl_surface roles in Wayland,
      enforce the restriction: a role is always set permanently, and
      attempting to change it is a protocol error.
      This patch is based on Jasper's patch:
      The difference in this patch compared to his are:
      - send role errors on the interface whose request triggers it, not on
      - an interface could have several requests assigning different roles,
        cannot use wl_interface as the unique key; use an arbitary string
      - ensure in window-manager.c that create_shell_surface() ->
        create_common_surface() is never called with surface->configure set,
        to avoid compositor abort
      - use wl_resource_post_no_memory() where appropriate instead of
        hand-rolling it with wl_resource_post_error()
      Ideally we would not add weston_surface::role_name field, but use
      weston_surface::configure. At the moment this is not possible though,
      because at least shell.c uses several different roles with the same
      configure function. Drag'n'drop uses two configure functions for the
      same role. The configure hook is also reset in several places,
      which is not good for role tracking.
      This patch overlooks the wl_surface roles assigned in privileged
      extensions: screensaver, panel, background, lock, input panel.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      Reviewed-by: Jasper St. Pierre's avatarJasper St. Pierre <jstpierre@mecheye.net>
  23. 23 Jul, 2014 1 commit
    • Giulio Camuffo's avatar
      compositor: keep track of the weston_layer a weston_view is in · 412e6a59
      Giulio Camuffo authored
      This introduces a new struct, weston_layer_entry, which is now used
      in place of wl_list to keep the link for the layer list in weston_view
      and the head of the list in weston_layer.
      weston_layer_entry also has a weston_layer*, which points to the layer
      the view is in or, in the case the entry it's the head of the list, to
      the layer itself.
  24. 05 Jul, 2014 1 commit
  25. 25 Jun, 2014 1 commit
    • Jason Ekstrand's avatar
      data-device: Clean up the logic in start_drag · 8202d720
      Jason Ekstrand authored
      Previoiusly, we had a mess of logic that was repeated with one of the
      repeats negated.  Not only was this unnecisaraly confusing, but it
      segfaulted and one of the negations was wrong.  This cleans the whole mess
      up and should fix bug #79725.
  26. 21 Apr, 2014 1 commit
  27. 03 Dec, 2013 2 commits
    • Jonas Ådahl's avatar
      data-device: Fix surface configure function type · 767d891c
      Jonas Ådahl authored
      The commit "Remove the weston_view.geometry.width/height fields" changed
      the type of the surface configure callback function, but did not change
      the callbacks in data-device.c. This commit fixes the type of the
      functions left needed to be changed.
      Signed-off-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
    • Jason Ekstrand's avatar
      Remove the weston_view.geometry.width/height fields · 918f2dd4
      Jason Ekstrand authored
      This has a couple of additional implications for the internal weston API:
       1) weston_view_configure no longer exists.  Use weston_view_set_position
       2) The weston_surface.configure callback no longer takes a width and
          height.  If you need these, surface.width/height are set before
          configure is called.  If you need to know when the width/height
          changes, you must track that yourself.