From 4143f0353f3f3e2f9f4e903dba25683b62be1038 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 20 Mar 2001 03:15:05 +0000 Subject: [PATCH] multiple desktops... BAD BAD BAD hack (alt F1-F8 take u to them) - just thoguth i'd see how well ti really works in real life... not to bad actually :) SVN revision: 4412 --- data/config/behavior/default/actions.db | Bin 36864 -> 81920 bytes data/config/behavior/default/grabs.db | Bin 12288 -> 12288 bytes data/config/behavior/default/settings.db | Bin 12288 -> 12288 bytes data/scripts/build_db.sh | 64 +++++++++++++++++++++++ src/actions.c | 20 +++++++ src/desktops.c | 16 ++++++ src/e.h | 1 + 7 files changed, 101 insertions(+) diff --git a/data/config/behavior/default/actions.db b/data/config/behavior/default/actions.db index aec13cc5a4d8d609a6fa42ad0cfed39c2a20c773..58b457760b846ddb118a5d2d1ade2fe1e50087fa 100644 GIT binary patch delta 4273 zcmcIn3vd)w7M&TvAoJe62_!QiWRf5O10c|PC46I2)kN1imE?-I_Eke&NmfI3Bqi94EY*awZ|>+ITDR?FErhI>ZYtg@=vR$s&q&kX)* za_HUG(G|0AudSI8`4hDw!(lT#Sgm=%a?e@%B3H6nnv|mkCA(TuVkJfiLGg9>Rm!!M*t3^aCBFkLeA1k)EVg)Iy7?p61bQbPG+S z2{eL+(?GhEVyHWPE5DYX$PeXq*{`bmE$(*qHxoEhxG^#5%MD>9tQp4*_dCX(8o>sIM` zS!!9{de!(KsrnK5EhA%ZOt*Xw5RU`I-TW56$Xmh*un;;@%f)=-ISFu@exf7vDZNW? z(hIZ^ATFhQC`dI_NmFPNjiww*qg3ievaM?5!&1}HWU5ay)rH)@VB-1^Fh`tWgc$3O zh>a1F4?{y`GYnN)5NiW)W`cW7J^DJ|qe}8!Y7>Zi@z{V`J~l<|tRwZ~*hF*enZneT zak0T1%NXqS6rbdS{4wuPK-}HRTC;RQ^N0E4Rv*=v(xE#gVBs%_=CQ+Cx*$y&V-v_8n*ia%B$@y|_uP^-Dp z0Z}{E=ulLY{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z#K5WjNZ-Mg9>O-?KsxFUcQrM^h*Z+8Amw<#tBH!Bo{6Ec`G1YV^AR delta 1431 zcmY+EeNdED6vp?(4>q{xoK-;=19nkV3}gX6R&Co|8=NH3CDZf|K}?wu74U;fO<_UB zqBP)?uSF%&q&ej%zNYz|rirDF7CPyO!j#(3$m;YlX6AMl{ii!~=gyt`{&Ak?_dKuP z-^1S!R%4CnW_q;3c9QQf?zcRBF*__shDo6}Tzrm0z!by7Q>6I};r7i|_* z)wGtDimqImNm(>r03=g1^`ao&$6NR_w&0JV?Wkzmf*Y_JR|tUV0^nK9Ks(0b6Zimr zg=2+WlDZ@K1#Xkn)!^%bGaqMS7G`1^reI&}WfXZg0Z;Oc(odl_msk7joMl5j znY2_keEma+^y#F%&8@zHd@z>ucG8BhIVZ&7p>POL2mM4XbdpZc9$`^W8_7>AC0_+J zg(j0rNIXhdPx>7LcwIPzM%sa&;YO^()mVv3uo&|&S5h_sM`1d~V}I<9!7d&b;0$~P zdxVD$YoP*)p%A9Q3*bh028O~Qh!!4U@X%<=xf@yAwvZhu7RKB$d@{Eslp(#=CQ7#D zS-C16^`kZ|(KwqoT+>@@+6Xr1tDrM~#LKxFL}`2Zv!FdQ1MqE#KXtUW~;^!f5)ax9Ymm5m*xiCn2n?p-t^CDI5 zHAO%u{kQ1~U7}-jh_+HA)yTlhWZ(jt+tq6~4WizJ^bkA$*Xw%x0N07<#aJlW_n}LE zKSQL|fM&c4x1klT!uN1W{N4%m;&>I5!9tiPj^}_2M#JEqkN^k~M#cHXs!K!6DmR}j z>n+tKz0s}N`MF}^n`H?if%FS*ZFyI8qsy!H86IsUZ!RAZYPr7Nqa|{Cxs4~-NN@6J czB+$Y_tB>Lz*hefqw;*43V}3Mtgj0D4^1D)0ssI2 diff --git a/data/config/behavior/default/grabs.db b/data/config/behavior/default/grabs.db index ba5c2cf212961affc5e7264c51fdc7aaea0c64f5..f1c3d7452e478c9bd7087cdb83e8c32a23e70cb8 100644 GIT binary patch delta 32 kcmZojXh@i_m!E%M83Pz_2w81A&bHZ5!G?b`hrkbc0HN0jXaE2J delta 32 kcmZojXh@i_m!HwWl>rPmgse9IIJ((T!G?b`hrkbc0GgZ$m;e9( diff --git a/data/config/behavior/default/settings.db b/data/config/behavior/default/settings.db index d514e1f51c69dc3212b8786297e07e2072ba8ee5..3f9a8cedb266b3ea05fd4224190c2c89da10d99f 100644 GIT binary patch delta 32 kcmZojXh@i_m!E%MDFYaA2w81A&bHZ5z=nS_hrkbc0HHt$R{#J2 delta 32 kcmZojXh@i_m!Hx86ayG=2w83ZadfkxfDQj<4uK!?0HyZ|3;+NC diff --git a/data/scripts/build_db.sh b/data/scripts/build_db.sh index 7121b7238..32caabbf9 100755 --- a/data/scripts/build_db.sh +++ b/data/scripts/build_db.sh @@ -177,6 +177,70 @@ edb_ed $DB add "/actions/"$NUM"/button" int 0 edb_ed $DB add "/actions/"$NUM"/key" str "m" edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "0" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F1" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "1" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F2" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "2" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F3" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "3" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F4" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "4" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F5" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "5" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F6" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "6" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F7" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "7" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F8" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; edb_ed $DB add "/actions/count" int $NUM # basic settings diff --git a/src/actions.c b/src/actions.c index 893c7b67f..7e375d547 100644 --- a/src/actions.c +++ b/src/actions.c @@ -55,6 +55,8 @@ static void e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, in static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry); +static void e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry); + static void _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o) { @@ -467,6 +469,7 @@ e_actions_init(void) e_action_add_proto("Window_Max_Size", e_act_max_start, NULL, NULL); e_action_add_proto("Winodw_Snap", e_act_snap_start, NULL, NULL); e_action_add_proto("Window_Zoom", e_act_zoom_start, NULL, NULL); + e_action_add_proto("Desktop", e_act_desk_start, NULL, NULL); } @@ -1240,3 +1243,20 @@ e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry UN(ry); } + +static void +e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry) +{ + int desk = 0; + + if (a->params) desk = atoi(a->params); + e_desktops_goto(desk); + return; + UN(a); + UN(data); + UN(x); + UN(y); + UN(rx); + UN(ry); +} + diff --git a/src/desktops.c b/src/desktops.c index 133fb7655..d82dc7e37 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -4,6 +4,7 @@ static Evas_List desktops = NULL; static Window e_base_win = 0; static int screen_w, screen_h; static int current_desk = 0; +static int current_desk_x = 0; static void e_idle(void *data); @@ -267,3 +268,18 @@ e_desktops_get_current(void) { return current_desk; } + +void +e_desktops_goto(int d) +{ + int dx; + E_Desktop *desk; + + dx = d - current_desk_x; + desk = e_desktops_get(0); + if (desk) + { + e_desktops_scroll(desk, -(dx * desk->real.w), 0); + } + current_desk_x = d; +} diff --git a/src/e.h b/src/e.h index bec052de4..03814dc5c 100644 --- a/src/e.h +++ b/src/e.h @@ -754,6 +754,7 @@ void e_desktops_hide(E_Desktop *d); int e_desktops_get_num(void); E_Desktop * e_desktops_get(int d); int e_desktops_get_current(void); +void e_desktops_goto(int num); void e_desktops_update(E_Desktop *desk); void e_resist_border(E_Border *b);