From 60ad9ed93e3e2cc0cd7861002e104a49a0018e25 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 3 Aug 2012 14:02:14 +0000 Subject: [PATCH] formatting SVN revision: 74850 --- src/bin/e_focus.c | 156 +++++++++++++++++++++++----------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/src/bin/e_focus.c b/src/bin/e_focus.c index 1bb8a7619..6eef63b30 100644 --- a/src/bin/e_focus.c +++ b/src/bin/e_focus.c @@ -1,7 +1,7 @@ #include "e.h" /* local subsystem functions */ -static Eina_Bool _e_focus_raise_timer(void* data); +static Eina_Bool _e_focus_raise_timer(void *data); /* local subsystem globals */ @@ -25,86 +25,86 @@ e_focus_idler_before(void) } EAPI void -e_focus_event_mouse_in(E_Border* bd) +e_focus_event_mouse_in(E_Border *bd) { if ((e_config->focus_policy == E_FOCUS_MOUSE) || (e_config->focus_policy == E_FOCUS_SLOPPY)) { - e_border_focus_set(bd, 1, 1); + e_border_focus_set(bd, 1, 1); } if (bd->raise_timer) ecore_timer_del(bd->raise_timer); bd->raise_timer = NULL; if (e_config->use_auto_raise) { - if (e_config->auto_raise_delay == 0.0) - { - if (!bd->lock_user_stacking) - { - if (e_config->border_raise_on_focus) - e_border_raise(bd); - } - } - else - bd->raise_timer = ecore_timer_add(e_config->auto_raise_delay, _e_focus_raise_timer, bd); + if (e_config->auto_raise_delay == 0.0) + { + if (!bd->lock_user_stacking) + { + if (e_config->border_raise_on_focus) + e_border_raise(bd); + } + } + else + bd->raise_timer = ecore_timer_add(e_config->auto_raise_delay, _e_focus_raise_timer, bd); } } EAPI void -e_focus_event_mouse_out(E_Border* bd) +e_focus_event_mouse_out(E_Border *bd) { 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 - * so by waiting more than 0.2 secs before reverting focus to nothing - * since we entered root, we are ignoring mouse in's on the root - * container for a bit after the mosue may have entered it - */ - if ((ecore_loop_time_get() - e_grabinput_last_focus_time_get()) > 0.2) - { - if (!bd->lock_focus_in) + * as we dont know always exactly what action causes what event + * so by waiting more than 0.2 secs before reverting focus to nothing + * since we entered root, we are ignoring mouse in's on the root + * container for a bit after the mosue may have entered it + */ + if ((ecore_loop_time_get() - e_grabinput_last_focus_time_get()) > 0.2) + { + if (!bd->lock_focus_in) { if (bd->focused) e_border_focus_set(bd, 0, 1); } - } + } } if (bd->raise_timer) { - ecore_timer_del(bd->raise_timer); - bd->raise_timer = NULL; + ecore_timer_del(bd->raise_timer); + bd->raise_timer = NULL; } } EAPI void -e_focus_event_mouse_down(E_Border* bd) +e_focus_event_mouse_down(E_Border *bd) { if (e_config->focus_policy == E_FOCUS_CLICK) { - e_border_focus_set(bd, 1, 1); + e_border_focus_set(bd, 1, 1); - if (!bd->lock_user_stacking) - { - if (e_config->border_raise_on_focus) - e_border_raise(bd); - } + if (!bd->lock_user_stacking) + { + if (e_config->border_raise_on_focus) + e_border_raise(bd); + } } else if (e_config->always_click_to_raise) { - if (!bd->lock_user_stacking) - { - if (e_config->border_raise_on_focus) - e_border_raise(bd); - } + if (!bd->lock_user_stacking) + { + if (e_config->border_raise_on_focus) + e_border_raise(bd); + } } else if (e_config->always_click_to_focus) { - e_border_focus_set(bd, 1, 1); + e_border_focus_set(bd, 1, 1); } } EAPI void -e_focus_event_mouse_up(E_Border* bd __UNUSED__) +e_focus_event_mouse_up(E_Border *bd __UNUSED__) { } @@ -115,15 +115,15 @@ e_focus_event_focus_in(E_Border *bd) (!e_config->always_click_to_raise) && (!e_config->always_click_to_focus)) { - if (!bd->button_grabbed) return; - e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); - e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); - ecore_x_window_button_ungrab(bd->win, 1, 0, 1); - ecore_x_window_button_ungrab(bd->win, 2, 0, 1); - ecore_x_window_button_ungrab(bd->win, 3, 0, 1); - e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win); - e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win); - bd->button_grabbed = 0; + if (!bd->button_grabbed) return; + e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); + e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); + ecore_x_window_button_ungrab(bd->win, 1, 0, 1); + ecore_x_window_button_ungrab(bd->win, 2, 0, 1); + ecore_x_window_button_ungrab(bd->win, 3, 0, 1); + e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win); + e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win); + bd->button_grabbed = 0; } } @@ -134,20 +134,20 @@ e_focus_event_focus_out(E_Border *bd) (!e_config->always_click_to_raise) && (!e_config->always_click_to_focus)) { - if (bd->button_grabbed) return; - ecore_x_window_button_grab(bd->win, 1, - ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); - ecore_x_window_button_grab(bd->win, 2, - ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); - ecore_x_window_button_grab(bd->win, 3, - ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); - bd->button_grabbed = 1; + if (bd->button_grabbed) return; + ecore_x_window_button_grab(bd->win, 1, + ECORE_X_EVENT_MASK_MOUSE_DOWN | + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); + ecore_x_window_button_grab(bd->win, 2, + ECORE_X_EVENT_MASK_MOUSE_DOWN | + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); + ecore_x_window_button_grab(bd->win, 3, + ECORE_X_EVENT_MASK_MOUSE_DOWN | + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); + bd->button_grabbed = 1; } } @@ -158,20 +158,20 @@ e_focus_setup(E_Border *bd) (e_config->always_click_to_raise) || (e_config->always_click_to_focus)) { - if (bd->button_grabbed) return; - ecore_x_window_button_grab(bd->win, 1, - ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); - ecore_x_window_button_grab(bd->win, 2, - ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); - ecore_x_window_button_grab(bd->win, 3, - ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); - bd->button_grabbed = 1; + if (bd->button_grabbed) return; + ecore_x_window_button_grab(bd->win, 1, + ECORE_X_EVENT_MASK_MOUSE_DOWN | + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); + ecore_x_window_button_grab(bd->win, 2, + ECORE_X_EVENT_MASK_MOUSE_DOWN | + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); + ecore_x_window_button_grab(bd->win, 3, + ECORE_X_EVENT_MASK_MOUSE_DOWN | + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1); + bd->button_grabbed = 1; } } @@ -189,10 +189,9 @@ e_focus_setdown(E_Border *bd) bd->button_grabbed = 0; } - /* local subsystem functions */ static Eina_Bool -_e_focus_raise_timer(void* data) +_e_focus_raise_timer(void *data) { E_Border *bd; @@ -201,3 +200,4 @@ _e_focus_raise_timer(void* data) bd->raise_timer = NULL; return ECORE_CALLBACK_CANCEL; } +