forked from enlightenment/enlightenment
e - fix up resize/move by kbd to work again
this used to work years ago ... it seems tihave broken. this fixes it all up to work again so you can bind a move/resize of a window tothe kbd and then use arrow keys etc. like you used to.... @fix
This commit is contained in:
parent
af199f6c0f
commit
c97ea9f1c0
|
@ -103,7 +103,8 @@ ACT_FN_GO(window_move, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_MOUSE(window_move, EINA_UNUSED)
|
ACT_FN_GO_MOUSE(window_move, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return EINA_FALSE;
|
if (!obj) return EINA_FALSE;
|
||||||
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
||||||
e_client_act_move_begin((E_Client *)(void *)obj, ev);
|
e_client_act_move_begin((E_Client *)(void *)obj, ev);
|
||||||
|
@ -112,7 +113,8 @@ ACT_FN_GO_MOUSE(window_move, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_SIGNAL(window_move, )
|
ACT_FN_GO_SIGNAL(window_move, )
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE) return;
|
if (obj->type != E_CLIENT_TYPE) return;
|
||||||
if (!((E_Client *)(void *)obj)->lock_user_location)
|
if (!((E_Client *)(void *)obj)->lock_user_location)
|
||||||
|
@ -129,7 +131,8 @@ ACT_FN_GO_SIGNAL(window_move, )
|
||||||
|
|
||||||
ACT_FN_END(window_move, EINA_UNUSED)
|
ACT_FN_END(window_move, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE) return;
|
if (obj->type != E_CLIENT_TYPE) return;
|
||||||
e_client_act_move_end((E_Client *)(void *)obj, NULL);
|
e_client_act_move_end((E_Client *)(void *)obj, NULL);
|
||||||
|
@ -137,7 +140,8 @@ ACT_FN_END(window_move, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_END_MOUSE(window_move, EINA_UNUSED)
|
ACT_FN_END_MOUSE(window_move, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return EINA_FALSE;
|
if (!obj) return EINA_FALSE;
|
||||||
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
||||||
e_client_act_move_end((E_Client *)(void *)obj, ev);
|
e_client_act_move_end((E_Client *)(void *)obj, ev);
|
||||||
|
@ -146,7 +150,8 @@ ACT_FN_END_MOUSE(window_move, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_KEY(window_move, EINA_UNUSED, EINA_UNUSED)
|
ACT_FN_GO_KEY(window_move, EINA_UNUSED, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (!((E_Client *)(void *)obj)->lock_user_location)
|
if (!((E_Client *)(void *)obj)->lock_user_location)
|
||||||
e_client_act_move_keyboard((E_Client *)(void *)obj);
|
e_client_act_move_keyboard((E_Client *)(void *)obj);
|
||||||
|
@ -164,7 +169,8 @@ ACT_FN_GO(window_resize, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_MOUSE(window_resize, EINA_UNUSED)
|
ACT_FN_GO_MOUSE(window_resize, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return EINA_FALSE;
|
if (!obj) return EINA_FALSE;
|
||||||
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
||||||
if (!((E_Client *)(void *)obj)->lock_user_size)
|
if (!((E_Client *)(void *)obj)->lock_user_size)
|
||||||
|
@ -174,7 +180,8 @@ ACT_FN_GO_MOUSE(window_resize, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_SIGNAL(window_resize, )
|
ACT_FN_GO_SIGNAL(window_resize, )
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE) return;
|
if (obj->type != E_CLIENT_TYPE) return;
|
||||||
if (!((E_Client *)(void *)obj)->lock_user_size)
|
if (!((E_Client *)(void *)obj)->lock_user_size)
|
||||||
|
@ -194,7 +201,8 @@ ACT_FN_GO_SIGNAL(window_resize, )
|
||||||
|
|
||||||
ACT_FN_END(window_resize, EINA_UNUSED)
|
ACT_FN_END(window_resize, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE) return;
|
if (obj->type != E_CLIENT_TYPE) return;
|
||||||
e_client_act_resize_end((E_Client *)(void *)obj, NULL);
|
e_client_act_resize_end((E_Client *)(void *)obj, NULL);
|
||||||
|
@ -202,7 +210,8 @@ ACT_FN_END(window_resize, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_END_MOUSE(window_resize, EINA_UNUSED)
|
ACT_FN_END_MOUSE(window_resize, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return EINA_FALSE;
|
if (!obj) return EINA_FALSE;
|
||||||
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
if (obj->type != E_CLIENT_TYPE) return EINA_FALSE;
|
||||||
e_client_act_resize_end((E_Client *)(void *)obj, ev);
|
e_client_act_resize_end((E_Client *)(void *)obj, ev);
|
||||||
|
@ -211,7 +220,8 @@ ACT_FN_END_MOUSE(window_resize, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_KEY(window_resize, EINA_UNUSED, EINA_UNUSED)
|
ACT_FN_GO_KEY(window_resize, EINA_UNUSED, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE)
|
if (obj->type != E_CLIENT_TYPE)
|
||||||
{
|
{
|
||||||
|
@ -233,7 +243,8 @@ ACT_FN_GO(window_menu, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_MOUSE(window_menu, EINA_UNUSED)
|
ACT_FN_GO_MOUSE(window_menu, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return EINA_FALSE;
|
if (!obj) return EINA_FALSE;
|
||||||
if (obj->type != E_CLIENT_TYPE)
|
if (obj->type != E_CLIENT_TYPE)
|
||||||
{
|
{
|
||||||
|
@ -246,7 +257,8 @@ ACT_FN_GO_MOUSE(window_menu, EINA_UNUSED)
|
||||||
|
|
||||||
ACT_FN_GO_KEY(window_menu, EINA_UNUSED, EINA_UNUSED)
|
ACT_FN_GO_KEY(window_menu, EINA_UNUSED, EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE)
|
if (obj->type != E_CLIENT_TYPE)
|
||||||
{
|
{
|
||||||
|
@ -833,7 +845,8 @@ ACT_FN_GO(window_pinned_toggle, EINA_UNUSED)
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
ACT_FN_GO(window_move_by, )
|
ACT_FN_GO(window_move_by, )
|
||||||
{
|
{
|
||||||
if (!obj) obj = E_OBJECT(e_client_focused_get());
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->type != E_CLIENT_TYPE)
|
if (obj->type != E_CLIENT_TYPE)
|
||||||
{
|
{
|
||||||
|
@ -912,9 +925,9 @@ ACT_FN_GO(window_quick_tile_to_quadrant, )
|
||||||
{
|
{
|
||||||
E_Client *ec;
|
E_Client *ec;
|
||||||
int x, y, zx, zy, zw, zh;
|
int x, y, zx, zy, zw, zh;
|
||||||
|
|
||||||
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
if ((!obj) || (obj->type != E_CLIENT_TYPE))
|
||||||
obj = E_OBJECT(e_client_focused_get());
|
obj = E_OBJECT(e_client_focused_get());
|
||||||
|
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
|
|
||||||
ec = (E_Client *)(void *)obj;
|
ec = (E_Client *)(void *)obj;
|
||||||
|
|
|
@ -820,15 +820,12 @@ _e_client_action_restore_orig(E_Client *ec)
|
||||||
static int
|
static int
|
||||||
_e_client_key_down_modifier_apply(int modifier, int value)
|
_e_client_key_down_modifier_apply(int modifier, int value)
|
||||||
{
|
{
|
||||||
if (modifier & ECORE_EVENT_MODIFIER_CTRL)
|
if (modifier & ECORE_EVENT_MODIFIER_CTRL) return value * 5;
|
||||||
return value * 2;
|
|
||||||
else if (modifier & ECORE_EVENT_MODIFIER_ALT)
|
else if (modifier & ECORE_EVENT_MODIFIER_ALT)
|
||||||
{
|
{
|
||||||
value /= 2;
|
value /= 5;
|
||||||
if (value)
|
if (value) return value;
|
||||||
return value;
|
else return 1;
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
@ -897,16 +894,17 @@ _e_client_action_move_timeout(void *data EINA_UNUSED)
|
||||||
static void
|
static void
|
||||||
_e_client_action_move_timeout_add(void)
|
_e_client_action_move_timeout_add(void)
|
||||||
{
|
{
|
||||||
|
double timeout = e_config->border_keyboard.timeout;
|
||||||
E_FREE_FUNC(action_timer, ecore_timer_del);
|
E_FREE_FUNC(action_timer, ecore_timer_del);
|
||||||
if (EINA_DBL_NONZERO(e_config->border_keyboard.timeout))
|
if (!EINA_DBL_NONZERO(timeout)) timeout = 5.0;
|
||||||
action_timer = ecore_timer_loop_add(e_config->border_keyboard.timeout, _e_client_action_move_timeout, NULL);
|
action_timer = ecore_timer_loop_add(timeout, _e_client_action_move_timeout, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_client_move_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_e_client_move_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Event_Key *ev = event;
|
Ecore_Event_Key *ev = event;
|
||||||
int x, y;
|
int x, y, dx, dy;
|
||||||
|
|
||||||
if (!comp_grabbed) return ECORE_CALLBACK_RENEW;
|
if (!comp_grabbed) return ECORE_CALLBACK_RENEW;
|
||||||
if (!action_client)
|
if (!action_client)
|
||||||
|
@ -918,27 +916,28 @@ _e_client_move_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *even
|
||||||
x = action_client->x;
|
x = action_client->x;
|
||||||
y = action_client->y;
|
y = action_client->y;
|
||||||
|
|
||||||
if ((strcmp(ev->key, "Up") == 0) || (strcmp(ev->key, "k") == 0))
|
dx = e_config->border_keyboard.move.dx;
|
||||||
y -= _e_client_key_down_modifier_apply(ev->modifiers, MAX(e_config->border_keyboard.move.dy, 1));
|
dx = _e_client_key_down_modifier_apply(ev->modifiers, dx);
|
||||||
else if ((strcmp(ev->key, "Down") == 0) || (strcmp(ev->key, "j") == 0))
|
dy = e_config->border_keyboard.move.dy;
|
||||||
y += _e_client_key_down_modifier_apply(ev->modifiers, MAX(e_config->border_keyboard.move.dy, 1));
|
dy = _e_client_key_down_modifier_apply(ev->modifiers, dy);
|
||||||
else if ((strcmp(ev->key, "Left") == 0) || (strcmp(ev->key, "h") == 0))
|
|
||||||
x -= _e_client_key_down_modifier_apply(ev->modifiers, MAX(e_config->border_keyboard.move.dx, 1));
|
switch (e_util_key_geometry_action_get(ev->key, &x, &y, dx, dy))
|
||||||
else if ((strcmp(ev->key, "Right") == 0) || (strcmp(ev->key, "l") == 0))
|
|
||||||
x += _e_client_key_down_modifier_apply(ev->modifiers, MAX(e_config->border_keyboard.move.dx, 1));
|
|
||||||
else if (strcmp(ev->key, "Return") == 0)
|
|
||||||
goto stop;
|
|
||||||
else if (strcmp(ev->key, "Escape") == 0)
|
|
||||||
{
|
{
|
||||||
|
case E_UTIL_ACTION_DONE:
|
||||||
|
goto stop;
|
||||||
|
break;
|
||||||
|
case E_UTIL_ACTION_ABORT:
|
||||||
_e_client_action_restore_orig(action_client);
|
_e_client_action_restore_orig(action_client);
|
||||||
goto stop;
|
goto stop;
|
||||||
}
|
break;
|
||||||
else if ((strncmp(ev->key, "Control", sizeof("Control") - 1) != 0) &&
|
case E_UTIL_ACTION_DO:
|
||||||
(strncmp(ev->key, "Alt", sizeof("Alt") - 1) != 0))
|
|
||||||
goto stop;
|
|
||||||
|
|
||||||
evas_object_move(action_client->frame, x, y);
|
evas_object_move(action_client->frame, x, y);
|
||||||
_e_client_action_move_timeout_add();
|
_e_client_action_move_timeout_add();
|
||||||
|
break;
|
||||||
|
case E_UTIL_ACTION_NONE:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
|
||||||
|
@ -1118,9 +1117,10 @@ _e_client_action_resize_timeout(void *data EINA_UNUSED)
|
||||||
static void
|
static void
|
||||||
_e_client_action_resize_timeout_add(void)
|
_e_client_action_resize_timeout_add(void)
|
||||||
{
|
{
|
||||||
|
double timeout = e_config->border_keyboard.timeout;
|
||||||
E_FREE_FUNC(action_timer, ecore_timer_del);
|
E_FREE_FUNC(action_timer, ecore_timer_del);
|
||||||
if (EINA_DBL_NONZERO(e_config->border_keyboard.timeout))
|
if (!EINA_DBL_NONZERO(timeout)) timeout = 5.0;
|
||||||
action_timer = ecore_timer_loop_add(e_config->border_keyboard.timeout, _e_client_action_resize_timeout, NULL);
|
action_timer = ecore_timer_loop_add(timeout, _e_client_action_resize_timeout, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -1140,37 +1140,25 @@ _e_client_resize_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev
|
||||||
h = action_client->h;
|
h = action_client->h;
|
||||||
|
|
||||||
dx = e_config->border_keyboard.resize.dx;
|
dx = e_config->border_keyboard.resize.dx;
|
||||||
if (dx < action_client->icccm.step_w)
|
if (dx < action_client->icccm.step_w) dx = action_client->icccm.step_w;
|
||||||
dx = action_client->icccm.step_w;
|
|
||||||
dx = _e_client_key_down_modifier_apply(ev->modifiers, dx);
|
dx = _e_client_key_down_modifier_apply(ev->modifiers, dx);
|
||||||
if (dx < action_client->icccm.step_w)
|
if (dx < action_client->icccm.step_w) dx = action_client->icccm.step_w;
|
||||||
dx = action_client->icccm.step_w;
|
|
||||||
|
|
||||||
dy = e_config->border_keyboard.resize.dy;
|
dy = e_config->border_keyboard.resize.dy;
|
||||||
if (dy < action_client->icccm.step_h)
|
if (dy < action_client->icccm.step_h) dy = action_client->icccm.step_h;
|
||||||
dy = action_client->icccm.step_h;
|
|
||||||
dy = _e_client_key_down_modifier_apply(ev->modifiers, dy);
|
dy = _e_client_key_down_modifier_apply(ev->modifiers, dy);
|
||||||
if (dy < action_client->icccm.step_h)
|
if (dy < action_client->icccm.step_h) dy = action_client->icccm.step_h;
|
||||||
dy = action_client->icccm.step_h;
|
|
||||||
|
|
||||||
if ((strcmp(ev->key, "Up") == 0) || (strcmp(ev->key, "k") == 0))
|
switch (e_util_key_geometry_action_get(ev->key, &w, &h, dx, dy))
|
||||||
h -= dy;
|
|
||||||
else if ((strcmp(ev->key, "Down") == 0) || (strcmp(ev->key, "j") == 0))
|
|
||||||
h += dy;
|
|
||||||
else if ((strcmp(ev->key, "Left") == 0) || (strcmp(ev->key, "h") == 0))
|
|
||||||
w -= dx;
|
|
||||||
else if ((strcmp(ev->key, "Right") == 0) || (strcmp(ev->key, "l") == 0))
|
|
||||||
w += dx;
|
|
||||||
else if (strcmp(ev->key, "Return") == 0)
|
|
||||||
goto stop;
|
|
||||||
else if (strcmp(ev->key, "Escape") == 0)
|
|
||||||
{
|
{
|
||||||
|
case E_UTIL_ACTION_DONE:
|
||||||
|
goto stop;
|
||||||
|
break;
|
||||||
|
case E_UTIL_ACTION_ABORT:
|
||||||
_e_client_action_restore_orig(action_client);
|
_e_client_action_restore_orig(action_client);
|
||||||
goto stop;
|
goto stop;
|
||||||
}
|
break;
|
||||||
else if ((strncmp(ev->key, "Control", sizeof("Control") - 1) != 0) &&
|
case E_UTIL_ACTION_DO:
|
||||||
(strncmp(ev->key, "Alt", sizeof("Alt") - 1) != 0))
|
|
||||||
goto stop;
|
|
||||||
if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
|
if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
|
||||||
{
|
{
|
||||||
if (action_client->zone)
|
if (action_client->zone)
|
||||||
|
@ -1182,6 +1170,11 @@ _e_client_resize_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev
|
||||||
e_client_resize_limit(action_client, &w, &h);
|
e_client_resize_limit(action_client, &w, &h);
|
||||||
evas_object_resize(action_client->frame, w, h);
|
evas_object_resize(action_client->frame, w, h);
|
||||||
_e_client_action_resize_timeout_add();
|
_e_client_action_resize_timeout_add();
|
||||||
|
break;
|
||||||
|
case E_UTIL_ACTION_NONE:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
|
||||||
|
@ -2427,7 +2420,6 @@ e_client_idler_before(void)
|
||||||
|
|
||||||
if ((!eina_hash_population(clients_hash[0])) && (!eina_hash_population(clients_hash[1]))) return;
|
if ((!eina_hash_population(clients_hash[0])) && (!eina_hash_population(clients_hash[1]))) return;
|
||||||
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_comp->clients, l, ec)
|
EINA_LIST_FOREACH(e_comp->clients, l, ec)
|
||||||
{
|
{
|
||||||
Eina_Stringshare *title;
|
Eina_Stringshare *title;
|
||||||
|
@ -4870,17 +4862,15 @@ e_client_act_move_keyboard(E_Client *ec)
|
||||||
|
|
||||||
if (!_e_client_move_begin(ec))
|
if (!_e_client_move_begin(ec))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_e_client_action_init(ec);
|
_e_client_action_init(ec);
|
||||||
_e_client_action_move_timeout_add();
|
|
||||||
if (!_e_client_hook_call(E_CLIENT_HOOK_MOVE_UPDATE, ec)) return;
|
if (!_e_client_hook_call(E_CLIENT_HOOK_MOVE_UPDATE, ec)) return;
|
||||||
evas_object_freeze_events_set(ec->frame, 1);
|
|
||||||
|
|
||||||
if (!action_handler_key)
|
if (!action_handler_key)
|
||||||
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_client_move_key_down, NULL);
|
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_client_move_key_down, NULL);
|
||||||
|
|
||||||
if (!action_handler_mouse)
|
if (!action_handler_mouse)
|
||||||
action_handler_mouse = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_client_move_mouse_down, NULL);
|
action_handler_mouse = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_client_move_mouse_down, NULL);
|
||||||
|
_e_client_action_move_timeout_add();
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
E_API void
|
||||||
|
@ -4896,16 +4886,14 @@ e_client_act_resize_keyboard(E_Client *ec)
|
||||||
ec->keyboard_resizing = 0;
|
ec->keyboard_resizing = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_e_client_action_init(ec);
|
_e_client_action_init(ec);
|
||||||
_e_client_action_resize_timeout_add();
|
|
||||||
evas_object_freeze_events_set(ec->frame, 1);
|
|
||||||
|
|
||||||
if (!action_handler_key)
|
if (!action_handler_key)
|
||||||
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_client_resize_key_down, NULL);
|
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_client_resize_key_down, NULL);
|
||||||
|
|
||||||
if (!action_handler_mouse)
|
if (!action_handler_mouse)
|
||||||
action_handler_mouse = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_client_resize_mouse_down, NULL);
|
action_handler_mouse = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_client_resize_mouse_down, NULL);
|
||||||
|
_e_client_action_resize_timeout_add();
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
E_API void
|
||||||
|
|
|
@ -292,10 +292,18 @@ _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object
|
||||||
if (!cw->ec) return;
|
if (!cw->ec) return;
|
||||||
*/
|
*/
|
||||||
if (above)
|
if (above)
|
||||||
|
{
|
||||||
|
cw->layer = above->layer;
|
||||||
e_comp->layers[above->layer].clients = eina_inlist_append_relative(e_comp->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec));
|
e_comp->layers[above->layer].clients = eina_inlist_append_relative(e_comp->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec));
|
||||||
|
e_comp->layers[above->layer].clients_count++;
|
||||||
|
}
|
||||||
else if (below)
|
else if (below)
|
||||||
|
{
|
||||||
|
cw->layer = below->layer;
|
||||||
e_comp->layers[below->layer].clients = eina_inlist_prepend_relative(e_comp->layers[below->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(below->ec));
|
e_comp->layers[below->layer].clients = eina_inlist_prepend_relative(e_comp->layers[below->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(below->ec));
|
||||||
if ((!above) && (!below))
|
e_comp->layers[below->layer].clients_count++;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (prepend)
|
if (prepend)
|
||||||
e_comp->layers[cw->layer].clients = eina_inlist_prepend(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
|
e_comp->layers[cw->layer].clients = eina_inlist_prepend(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
|
||||||
|
@ -303,8 +311,8 @@ _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object
|
||||||
e_comp->layers[cw->layer].clients = eina_inlist_prepend_relative(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(layer_cw->ec));
|
e_comp->layers[cw->layer].clients = eina_inlist_prepend_relative(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(layer_cw->ec));
|
||||||
else //this is either the layer object or a tough actin tinactin^W^W^Wfast stacking client
|
else //this is either the layer object or a tough actin tinactin^W^W^Wfast stacking client
|
||||||
e_comp->layers[cw->layer].clients = eina_inlist_append(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
|
e_comp->layers[cw->layer].clients = eina_inlist_append(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
|
||||||
}
|
|
||||||
e_comp->layers[cw->layer].clients_count++;
|
e_comp->layers[cw->layer].clients_count++;
|
||||||
|
}
|
||||||
#ifndef E_RELEASE_BUILD
|
#ifndef E_RELEASE_BUILD
|
||||||
if (layer_cw)
|
if (layer_cw)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1506,3 +1506,37 @@ e_util_exe_safe_run(const char *cmd, void *data)
|
||||||
#endif
|
#endif
|
||||||
return ecore_exe_pipe_run(cmd, flags, data);
|
return ecore_exe_pipe_run(cmd, flags, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
str_matches_one(const char *instr, const char **strset)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if ((!instr) || (!strset)) return EINA_FALSE;
|
||||||
|
for (i = 0; strset[i]; i++)
|
||||||
|
{
|
||||||
|
if (!strcmp(strset[i], instr)) return EINA_TRUE;
|
||||||
|
}
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
E_API E_Util_Action
|
||||||
|
e_util_key_geometry_action_get(const char *key, int *x, int *y, int dx, int dy)
|
||||||
|
{
|
||||||
|
const char *k_up[] = { "Up", "KP_Up", "k", "K", "w", "W", NULL };
|
||||||
|
const char *k_down[] = { "Down", "KP_Down", "j", "J", "s", "S", NULL };
|
||||||
|
const char *k_left[] = { "Left", "KP_Left", "h", "H", "a", "A", NULL };
|
||||||
|
const char *k_right[] = { "Right", "KP_Right", "l", "L", "d", "D", NULL };
|
||||||
|
const char *k_done[] = { "Return", "KP_Enter", "space", NULL };
|
||||||
|
const char *k_abort[] = { "Escape", "BackSpace", "Delete", "x", "X", NULL };
|
||||||
|
|
||||||
|
if (str_matches_one(key, k_up)) *y -= dy;
|
||||||
|
else if (str_matches_one(key, k_down)) *y += dy;
|
||||||
|
else if (str_matches_one(key, k_left)) *x -= dx;
|
||||||
|
else if (str_matches_one(key, k_right)) *x += dx;
|
||||||
|
else if (str_matches_one(key, k_done)) return E_UTIL_ACTION_DONE;
|
||||||
|
else if (str_matches_one(key, k_abort)) return E_UTIL_ACTION_ABORT;
|
||||||
|
else return E_UTIL_ACTION_NONE;
|
||||||
|
|
||||||
|
return E_UTIL_ACTION_DO;
|
||||||
|
}
|
||||||
|
|
|
@ -70,6 +70,16 @@ E_API Ecore_Exe *e_util_open(const char *exe, void *data);
|
||||||
|
|
||||||
E_API Ecore_Exe *e_util_exe_safe_run(const char *cmd, void *data);
|
E_API Ecore_Exe *e_util_exe_safe_run(const char *cmd, void *data);
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
E_UTIL_ACTION_NONE,
|
||||||
|
E_UTIL_ACTION_DONE,
|
||||||
|
E_UTIL_ACTION_ABORT,
|
||||||
|
E_UTIL_ACTION_DO
|
||||||
|
} E_Util_Action;
|
||||||
|
|
||||||
|
E_API E_Util_Action e_util_key_geometry_action_get(const char *key, int *x, int *y, int dx, int dy);
|
||||||
|
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
isedje(const Evas_Object *obj)
|
isedje(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue