From 31b2e6dcf99c582eb9fcb9cd7910d90ad1476d7a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 12 Nov 2012 10:49:28 +0000 Subject: [PATCH] add "Flip To Previous Desktop" action ticket #1717, patch originally by Robert David SVN revision: 79148 --- AUTHORS | 1 + src/bin/e_actions.c | 15 +++++++++++++++ src/bin/e_desk.c | 2 ++ src/bin/e_zone.h | 1 + 4 files changed, 19 insertions(+) diff --git a/AUTHORS b/AUTHORS index 429e228..c1c2393 100644 --- a/AUTHORS +++ b/AUTHORS @@ -38,3 +38,4 @@ Maxime Villard Jeremy Zurcher Shinwoo Kim Daniel Juyung Seo (SeoZ) +Robert David diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index 369c447..b157f23 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -1439,6 +1439,16 @@ ACT_FN_GO(desk_flip_to, ) } /***************************************************************************/ +ACT_FN_GO(desk_flip_prev, __UNUSED__) +{ + E_Zone *zone; + + zone = _e_actions_zone_get(obj); + if (!zone) return; + e_zone_desk_flip_to(zone, zone->desk_x_prev, zone->desk_y_prev); +} + +/***************************************************************************/ #define ACT_FLIP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0)) #define ACT_FLIP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count)) #define ACT_FLIP_UP(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || ((zone)->desk_y_current > 0)) @@ -3107,6 +3117,11 @@ e_actions_init(void) "desk_flip_by", NULL, "syntax: X-offset Y-offset, example: -1 0", 1); + /* desk_flip_prev */ + ACT_GO(desk_flip_prev); + e_action_predef_name_set(N_("Desktop"), N_("Flip To Previous Desktop"), + "desk_flip_prev", NULL, NULL, 0); + /* desk_deskshow_toggle */ ACT_GO(desk_deskshow_toggle); e_action_predef_name_set(N_("Desktop"), N_("Show The Desktop"), diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index a594845..6b91f1b 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -251,6 +251,8 @@ e_desk_show(E_Desk *desk) } } + desk->zone->desk_x_prev = desk->zone->desk_x_current; + desk->zone->desk_y_prev = desk->zone->desk_y_current; desk->zone->desk_x_current = desk->x; desk->zone->desk_y_current = desk->y; desk->visible = 1; diff --git a/src/bin/e_zone.h b/src/bin/e_zone.h index 70da4d3..e56121e 100644 --- a/src/bin/e_zone.h +++ b/src/bin/e_zone.h @@ -49,6 +49,7 @@ struct _E_Zone int desk_x_count, desk_y_count; int desk_x_current, desk_y_current; + int desk_x_prev, desk_y_prev; E_Desk **desks; Eina_List *handlers; -- 2.7.4