summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiscomfitor <michael.blumenkrantz@gmail.com>2013-10-19 13:41:40 +0100
committerdiscomfitor <michael.blumenkrantz@gmail.com>2013-10-19 13:50:30 +0100
commit4246c60c0edeae85b14da58ed4545eb31692899c (patch)
treeff5406884831dc2c6e2ae8df0394e55c4cd510ef
parentbcb6c662ac27e68bd89b1f3d83da5a16c3c5bb00 (diff)
run flips in order until user has seen all flips
-rw-r--r--src/desksanity.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/desksanity.c b/src/desksanity.c
index 0f34e6b..dc5b328 100644
--- a/src/desksanity.c
+++ b/src/desksanity.c
@@ -5,7 +5,7 @@ static Evas_Object *dm_show = NULL;
5static E_Desk *desk_hide = NULL; 5static E_Desk *desk_hide = NULL;
6static Evas_Object *dm_hide = NULL; 6static Evas_Object *dm_hide = NULL;
7 7
8enum 8typedef enum
9{ 9{
10 DS_PAN, 10 DS_PAN,
11 DS_BATMAN, 11 DS_BATMAN,
@@ -19,6 +19,8 @@ enum
19 DS_LAST, 19 DS_LAST,
20} DS_Type; 20} DS_Type;
21 21
22static DS_Type cur_type = DS_PAN;
23
22static void 24static void
23_ds_end(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED) 25_ds_end(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
24{ 26{
@@ -63,6 +65,7 @@ static void
63_ds_show(E_Desk *desk, int dx, int dy) 65_ds_show(E_Desk *desk, int dx, int dy)
64{ 66{
65 E_Client *ec; 67 E_Client *ec;
68 DS_Type use_type;
66 69
67 /* free existing mirror */ 70 /* free existing mirror */
68 E_FREE_FUNC(dm_show, evas_object_del); 71 E_FREE_FUNC(dm_show, evas_object_del);
@@ -93,8 +96,15 @@ _ds_show(E_Desk *desk, int dx, int dy)
93 dm_show = dm_add(desk); 96 dm_show = dm_add(desk);
94 evas_object_name_set(dm_show, "dm_show"); 97 evas_object_name_set(dm_show, "dm_show");
95 e_comp_shape_queue_block(e_comp_get(desk), 1); 98 e_comp_shape_queue_block(e_comp_get(desk), 1);
99 /* guarantee that the user gets to see each flip
100 * at least once
101 */
102 if (cur_type < DS_LAST)
103 use_type = cur_type++;
104 else
105 use_type = rand() % DS_LAST;
96 /* pick a random flip */ 106 /* pick a random flip */
97 switch (rand() % DS_LAST) 107 switch (use_type)
98 { 108 {
99 int x, y, hx, hy, w, h; 109 int x, y, hx, hy, w, h;
100 Evas_Object *o; 110 Evas_Object *o;
@@ -327,4 +337,5 @@ ds_shutdown(void)
327{ 337{
328 e_desk_flip_cb_set(NULL, NULL); 338 e_desk_flip_cb_set(NULL, NULL);
329 _ds_end(NULL, NULL, NULL); 339 _ds_end(NULL, NULL, NULL);
340 cur_type = DS_PAN;
330} 341}