forked from enlightenment/enlightenment
make click to focus behave a bit better - previously focused windwo gets the
focus now always - even in pointer focus. if flippign desktosp last window focused on that desktop is focused bakc when u flip - they are options too :) SVN revision: 15746
This commit is contained in:
parent
97902d95a3
commit
b0b86dde57
|
@ -576,13 +576,6 @@ e_border_hide(E_Border *bd, int manage)
|
|||
_e_border_resize_end(bd);
|
||||
}
|
||||
|
||||
if (!bd->need_reparent)
|
||||
{
|
||||
if (bd->focused)
|
||||
// ecore_x_window_focus(bd->zone->container->manager->root);
|
||||
e_grabinput_focus(bd->zone->container->bg_win, E_FOCUS_METHOD_PASSIVE);
|
||||
ecore_x_window_hide(bd->client.win);
|
||||
}
|
||||
e_container_shape_hide(bd->shape);
|
||||
/* FIXME: If the client unmaps itself, the border should be
|
||||
* withdrawn, not iconic */
|
||||
|
@ -592,6 +585,17 @@ e_border_hide(E_Border *bd, int manage)
|
|||
bd->visible = 0;
|
||||
bd->changes.visible = 1;
|
||||
|
||||
if (!bd->need_reparent)
|
||||
{
|
||||
if (bd->focused)
|
||||
{
|
||||
e_border_focus_set(bd, 0, 1);
|
||||
if (e_config->focus_revert_on_hide_or_close)
|
||||
e_desk_last_focused_focus(bd->desk);
|
||||
}
|
||||
ecore_x_window_hide(bd->client.win);
|
||||
}
|
||||
|
||||
visible = 0;
|
||||
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MAPPED, &visible, 1);
|
||||
if (!manage)
|
||||
|
@ -853,6 +857,12 @@ e_border_focus_set(E_Border *bd, int focus, int set)
|
|||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
if ((focus) && (!bd->focused))
|
||||
{
|
||||
if ((bd->visible) && (bd->changes.visible))
|
||||
{
|
||||
bd->want_focus = 1;
|
||||
bd->changed = 1;
|
||||
return;
|
||||
}
|
||||
if (!e_winlist_active_get())
|
||||
{
|
||||
focus_stack = evas_list_remove(focus_stack, bd);
|
||||
|
@ -1901,6 +1911,11 @@ e_border_immortal_windows_get(void)
|
|||
static void
|
||||
_e_border_free(E_Border *bd)
|
||||
{
|
||||
if (bd->focused)
|
||||
{
|
||||
if (e_config->focus_revert_on_hide_or_close)
|
||||
e_desk_last_focused_focus(bd->desk);
|
||||
}
|
||||
if (resize == bd)
|
||||
_e_border_resize_end(bd);
|
||||
if (move == bd)
|
||||
|
@ -2908,10 +2923,7 @@ _e_border_cb_pointer_warp(void *data, int ev_type, void *ev)
|
|||
|
||||
e = ev;
|
||||
if (!move) return 1;
|
||||
|
||||
printf("warp: %d %d %d %d\n", e->curr.x, e->prev.x, e->curr.y, e->prev.y);
|
||||
e_border_move(move, move->x + (e->curr.x - e->prev.x), move->y + (e->curr.y - e->prev.y));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -4709,16 +4721,15 @@ _e_border_eval(E_Border *bd)
|
|||
}
|
||||
bd->need_shape_export = 0;
|
||||
}
|
||||
|
||||
if (bd->take_focus)
|
||||
|
||||
if ((bd->take_focus) || (bd->want_focus))
|
||||
{
|
||||
if (e_config->focus_setting == E_FOCUS_NEW_WINDOW)
|
||||
if ((e_config->focus_setting == E_FOCUS_NEW_WINDOW) ||
|
||||
(bd->want_focus))
|
||||
{
|
||||
if (!bd->lock_focus_out)
|
||||
{
|
||||
printf("noo\n");
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
}
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
bd->want_focus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4732,7 +4743,6 @@ _e_border_eval(E_Border *bd)
|
|||
{
|
||||
if (!bd->lock_focus_out)
|
||||
{
|
||||
printf("noo2\n");
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -285,6 +285,7 @@ struct _E_Border
|
|||
unsigned int ping_ok : 1;
|
||||
unsigned int hung : 1;
|
||||
unsigned int take_focus : 1;
|
||||
unsigned int want_focus : 1;
|
||||
unsigned int user_skip_winlist : 1;
|
||||
E_Maximize maximized;
|
||||
|
||||
|
|
|
@ -244,8 +244,10 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, transition_desk, STR); /**/
|
||||
E_CONFIG_VAL(D, T, transition_change, STR); /**/
|
||||
E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
|
||||
E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
|
||||
E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
|
||||
E_CONFIG_VAL(D, T, move_info_follows, INT);
|
||||
E_CONFIG_VAL(D, T, resize_info_follows, INT);
|
||||
E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT);
|
||||
E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT);
|
||||
|
||||
e_config = e_config_domain_load("e", _e_config_edd);
|
||||
if (e_config)
|
||||
|
@ -348,6 +350,9 @@ e_config_init(void)
|
|||
e_config->transition_change = strdup("crossfade");
|
||||
e_config->move_info_follows = 1;
|
||||
e_config->resize_info_follows = 1;
|
||||
e_config->focus_last_focused_per_desktop = 1;
|
||||
e_config->focus_revert_on_hide_or_close = 1;
|
||||
|
||||
{
|
||||
E_Config_Module *em;
|
||||
|
||||
|
@ -877,6 +882,10 @@ e_config_init(void)
|
|||
E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0);
|
||||
E_CONFIG_LIMIT(e_config->ping_clients, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->ping_clients_wait, 0.0, 120.0);
|
||||
E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1);
|
||||
|
||||
/* apply lang config - exception because config is loaded after intl setup */
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef Eet_Data_Descriptor E_Config_DD;
|
|||
* defaults for e to work - started at 100 when we introduced this config
|
||||
* versioning feature
|
||||
*/
|
||||
#define E_CONFIG_FILE_VERSION 118
|
||||
#define E_CONFIG_FILE_VERSION 119
|
||||
|
||||
#define E_EVAS_ENGINE_DEFAULT 0
|
||||
#define E_EVAS_ENGINE_SOFTWARE_X11 1
|
||||
|
@ -137,6 +137,8 @@ struct _E_Config
|
|||
Evas_List *remembers;
|
||||
int move_info_follows;
|
||||
int resize_info_follows;
|
||||
int focus_last_focused_per_desktop;
|
||||
int focus_revert_on_hide_or_close;
|
||||
};
|
||||
|
||||
struct _E_Config_Module
|
||||
|
|
|
@ -83,6 +83,7 @@ e_desk_show(E_Desk *desk)
|
|||
int was_zone = 0;
|
||||
int x, y;
|
||||
E_Event_Desk_Show *ev;
|
||||
Evas_List *l;
|
||||
|
||||
E_OBJECT_CHECK(desk);
|
||||
E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
|
||||
|
@ -118,7 +119,10 @@ e_desk_show(E_Desk *desk)
|
|||
}
|
||||
}
|
||||
e_container_border_list_free(bl);
|
||||
|
||||
|
||||
if (e_config->focus_last_focused_per_desktop)
|
||||
e_desk_last_focused_focus(desk);
|
||||
|
||||
desk->zone->desk_x_current = desk->x;
|
||||
desk->zone->desk_y_current = desk->y;
|
||||
if (desk->fullscreen)
|
||||
|
@ -141,6 +145,26 @@ e_desk_show(E_Desk *desk)
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
e_desk_last_focused_focus(E_Desk *desk)
|
||||
{
|
||||
Evas_List *l;
|
||||
E_Border *bd;
|
||||
|
||||
for (l = e_border_focus_stack_get(); l; l = l->next)
|
||||
{
|
||||
bd = l->data;
|
||||
if ((!bd->iconic) && (bd->visible) &&
|
||||
(((bd->desk == desk) ||
|
||||
((bd->sticky) && (bd->zone == desk->zone)))))
|
||||
{
|
||||
/* this was the window last focused in this desktop */
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
e_desk_fullscreen_set(E_Desk *desk, E_Border *bd)
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@ EAPI int e_desk_shutdown(void);
|
|||
EAPI E_Desk *e_desk_new(E_Zone *zone, int x, int y);
|
||||
EAPI void e_desk_name_set(E_Desk *desk, const char *name);
|
||||
EAPI void e_desk_show(E_Desk *desk);
|
||||
EAPI void e_desk_last_focused_focus(E_Desk *desk);
|
||||
EAPI void e_desk_fullscreen_set(E_Desk *desk, E_Border *bd);
|
||||
EAPI E_Desk *e_desk_current_get(E_Zone *zone);
|
||||
EAPI E_Desk *e_desk_at_xy_get(E_Zone *zone, int x, int y);
|
||||
|
|
Loading…
Reference in New Issue