compositor: Keep track of what views were activated by clicking

Adds a weston_view_activate() that can be passed an additional active
flag WESTON_ACTIVATE_CLICKED, that the shell passes when a view was
activated by clicking.

This allows shell-independent components implement heuristics depending
on how a view was activated.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 0ce7909..b1f8203 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -802,6 +802,8 @@
 	clockid_t presentation_clock;
 	int32_t repaint_msec;
 
+	unsigned int activate_serial;
+
 	int exit_code;
 
 	void *user_data;
@@ -900,6 +902,8 @@
 	/* For weston_layer inheritance from another view */
 	struct weston_view *parent_view;
 
+	unsigned int click_to_activate_serial;
+
 	pixman_region32_t clip;          /* See weston_view_damage_below() */
 	float alpha;                     /* part of geometry, see below */
 
@@ -1127,6 +1131,7 @@
 enum weston_activate_flag {
 	WESTON_ACTIVATE_FLAG_NONE = 0,
 	WESTON_ACTIVATE_FLAG_CONFIGURE = 1 << 0,
+	WESTON_ACTIVATE_FLAG_CLICKED = 1 << 1,
 };
 
 void
@@ -1178,6 +1183,11 @@
 weston_spring_done(struct weston_spring *spring);
 
 void
+weston_view_activate(struct weston_view *view,
+		     struct weston_seat *seat,
+		     uint32_t flags);
+
+void
 notify_motion(struct weston_seat *seat, uint32_t time,
 	      struct weston_pointer_motion_event *event);
 void