[PATCH weston 00/19] Don't allow direct use of seat->device pointers

Derek Foreman derekf at osg.samsung.com
Wed Jun 3 13:53:19 PDT 2015


I guess this is v6 of my Don't test keyboard/pointer/touch pointers patch.

I've tried to simplify the monster patch at the end by doing clean-up in
the earlier patches, the ultimate goal being to stop most code from
directly accessing seat->touch, seat->keyboard and seat->pointer.

Those pointers are funny in that they only exist after a device has been
plugged in, and they don't ever go away.  We're supposed to check if
the associated _device_count > 0 before using them.  The final patch
in this series adds helper functions that do that, renames the pointers
in the seat struct and updates users accordingly.

On the way there I've made a few opportunistic changes (ints to bools),
and updated a bunch of binding code to take the "appropriate" pointer
type instead of just a seat.  By doing this we know we can trust the
one pointer we're passed, but we need to go back to the helper functions
to get to the other device types.

A few functions already made a temp for keyboard = seat->keyboard,
yet continued to use seat->keyboard instead of the temp.  I cleaned that
up first because it simplifies the monster patch at the end.

I'm hoping some of the simpler stuff can land independently so I don't
have to carry so much around.  :)

Derek Foreman (19):
  text-backend: Replace focus_listener_initialized with a bool
  exposay: Test keyboard presence before using keyboard pointer
  desktop-shell: make client_initiated a bool
  input: minor clean up in weston_seat_repick()
  bindings: Stop exporting internal functions
  compositor-drm: Simplify logic in setup_output_seat_constraint
  input: clean up notify_modifiers a little
  input: clean up update_keymap a little
  input: clean up seat_get_keyboard a little
  screenshooter: clean up recorder_binding a little
  input: Pass the appropriate pointer type to bindings instead of a seat
  desktop-shell: Make surface_touch_move take a touch instead of a seat
  desktop-shell: Make surface_move take a pointer instead of a seat
  desktop-shell: Make surface_rotate take a pointer instead of a seat
  desktop-shell: Make surface_resize take a pointer instead of a seat
  desktop-shell: Use the grabbed pointer in popup_grab_button
  bindings: make install_binding_grab take a keyboard instead of a seat
  bindings: Make run binding functions take apropriate device instead of
    a seat
  input: Don't test keyboard/pointer/touch pointers

 desktop-shell/exposay.c             |  40 ++--
 desktop-shell/input-panel.c         |   7 +-
 desktop-shell/shell.c               | 367 +++++++++++++++++++++---------------
 desktop-shell/shell.h               |   2 +-
 fullscreen-shell/fullscreen-shell.c |  20 +-
 ivi-shell/hmi-controller.c          |  30 +--
 ivi-shell/input-panel-ivi.c         |   7 +-
 ivi-shell/ivi-shell.c               |   4 +-
 src/bindings.c                      |  85 +++++----
 src/compositor-drm.c                |  31 +--
 src/compositor-fbdev.c              |   3 +-
 src/compositor-rpi.c                |   3 +-
 src/compositor-wayland.c            |  12 +-
 src/compositor-x11.c                |  18 +-
 src/compositor.c                    |  36 ++--
 src/compositor.h                    |  38 ++--
 src/data-device.c                   |  41 ++--
 src/gl-renderer.c                   |   8 +-
 src/input.c                         | 302 ++++++++++++++++++-----------
 src/libinput-seat.c                 |  15 +-
 src/pixman-renderer.c               |   2 +-
 src/screenshooter.c                 |  16 +-
 src/text-backend.c                  |  25 +--
 src/zoom.c                          |   8 +-
 tests/surface-screenshot.c          |  10 +-
 tests/weston-test.c                 |   9 +-
 xwayland/dnd.c                      |   3 +-
 xwayland/window-manager.c           |  23 ++-
 28 files changed, 704 insertions(+), 461 deletions(-)

-- 
2.1.4



More information about the wayland-devel mailing list