revise d739ed0e2e
to not break changing focus policies
thise commit added focus_policy member to E_Border as something to be used for setting a per-window focus policy. setting it on each window is a huge pain if the global policy ever changes, so it's better to use this member only as an override for the global policy which can be checked to see if it's been set
This commit is contained in:
parent
5f042a480c
commit
22651a4318
|
@ -421,7 +421,7 @@ e_border_new(E_Container *con,
|
|||
ecore_x_window_shadow_tree_flush();
|
||||
e_object_del_func_set(E_OBJECT(bd), E_OBJECT_CLEANUP_FUNC(_e_border_del));
|
||||
|
||||
bd->focus_policy = e_config->focus_policy;
|
||||
bd->focus_policy_override = E_FOCUS_LAST;
|
||||
bd->w = 1;
|
||||
bd->h = 1;
|
||||
/* FIXME: ewww - round trip */
|
||||
|
@ -7460,7 +7460,7 @@ _e_border_eval0(E_Border *bd)
|
|||
}
|
||||
else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP)
|
||||
{
|
||||
bd->focus_policy = E_FOCUS_CLICK;
|
||||
bd->focus_policy_override = E_FOCUS_CLICK;
|
||||
e_focus_setup(bd);
|
||||
if (!bd->client.netwm.state.skip_pager)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,8 @@ typedef enum _E_Focus_Policy
|
|||
{
|
||||
E_FOCUS_CLICK,
|
||||
E_FOCUS_MOUSE,
|
||||
E_FOCUS_SLOPPY
|
||||
E_FOCUS_SLOPPY,
|
||||
E_FOCUS_LAST
|
||||
} E_Focus_Policy;
|
||||
|
||||
typedef enum _E_Urgency_Policy
|
||||
|
@ -669,7 +670,7 @@ struct _E_Border
|
|||
Eina_Bool argb;
|
||||
|
||||
int tmp_input_hidden;
|
||||
int focus_policy;
|
||||
E_Focus_Policy focus_policy_override;
|
||||
};
|
||||
|
||||
struct _E_Border_Pending_Move_Resize
|
||||
|
@ -840,6 +841,16 @@ extern EAPI int E_EVENT_BORDER_PROPERTY;
|
|||
extern EAPI int E_EVENT_BORDER_FULLSCREEN;
|
||||
extern EAPI int E_EVENT_BORDER_UNFULLSCREEN;
|
||||
|
||||
/* e_config not available everywhere e_border.h is used...
|
||||
static inline Eina_Bool
|
||||
e_border_focus_policy_click(const E_Border *bd)
|
||||
{
|
||||
return ((bd->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK));
|
||||
}
|
||||
*/
|
||||
#define e_border_focus_policy_click(bd) \
|
||||
((bd->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK))
|
||||
|
||||
/* macro for finding misuse of changed flag */
|
||||
#if 0
|
||||
# define BD_CHANGED(BD) \
|
||||
|
|
|
@ -27,8 +27,8 @@ e_focus_idler_before(void)
|
|||
EAPI void
|
||||
e_focus_event_mouse_in(E_Border *bd)
|
||||
{
|
||||
if ((bd->focus_policy == E_FOCUS_MOUSE) ||
|
||||
(bd->focus_policy == E_FOCUS_SLOPPY))
|
||||
if ((e_config->focus_policy == E_FOCUS_MOUSE) ||
|
||||
(e_config->focus_policy == E_FOCUS_SLOPPY))
|
||||
{
|
||||
if (bd != e_border_focused_get())
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
|
@ -53,7 +53,7 @@ e_focus_event_mouse_in(E_Border *bd)
|
|||
EAPI void
|
||||
e_focus_event_mouse_out(E_Border *bd)
|
||||
{
|
||||
if (bd->focus_policy == E_FOCUS_MOUSE)
|
||||
if (e_config->focus_policy == E_FOCUS_MOUSE)
|
||||
{
|
||||
/* FIXME: this is such a hack. its a big hack around x's async events
|
||||
* as we dont know always exactly what action causes what event
|
||||
|
@ -82,7 +82,7 @@ e_focus_event_mouse_down(E_Border *bd)
|
|||
{
|
||||
if (!bd->focused)
|
||||
{
|
||||
if (bd->focus_policy == E_FOCUS_CLICK)
|
||||
if (e_border_focus_policy_click(bd))
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
else if (e_config->always_click_to_focus)
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
|
@ -102,7 +102,7 @@ e_focus_event_mouse_up(E_Border *bd __UNUSED__)
|
|||
EAPI void
|
||||
e_focus_event_focus_in(E_Border *bd)
|
||||
{
|
||||
if ((bd->focus_policy == E_FOCUS_CLICK) &&
|
||||
if ((e_border_focus_policy_click(bd)) &&
|
||||
(!e_config->always_click_to_raise) &&
|
||||
(!e_config->always_click_to_focus))
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ e_focus_event_focus_in(E_Border *bd)
|
|||
EAPI void
|
||||
e_focus_event_focus_out(E_Border *bd)
|
||||
{
|
||||
if ((bd->focus_policy == E_FOCUS_CLICK) &&
|
||||
if ((e_border_focus_policy_click(bd)) &&
|
||||
(!e_config->always_click_to_raise) &&
|
||||
(!e_config->always_click_to_focus))
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ e_focus_event_focus_out(E_Border *bd)
|
|||
EAPI void
|
||||
e_focus_setup(E_Border *bd)
|
||||
{
|
||||
if ((bd->focus_policy == E_FOCUS_CLICK) ||
|
||||
if ((e_border_focus_policy_click(bd)) ||
|
||||
(e_config->always_click_to_raise) ||
|
||||
(e_config->always_click_to_focus))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue