forked from enlightenment/enlightenment
parent
2bdd24ea93
commit
984d2c1869
|
@ -28,41 +28,41 @@ e_grabinput_get(Ecore_X_Window mouse_win, int confine_mouse, Ecore_X_Window key_
|
||||||
{
|
{
|
||||||
if (grab_mouse_win)
|
if (grab_mouse_win)
|
||||||
{
|
{
|
||||||
ecore_x_pointer_ungrab();
|
ecore_x_pointer_ungrab();
|
||||||
grab_mouse_win = 0;
|
grab_mouse_win = 0;
|
||||||
}
|
}
|
||||||
if (grab_key_win)
|
if (grab_key_win)
|
||||||
{
|
{
|
||||||
ecore_x_keyboard_ungrab();
|
ecore_x_keyboard_ungrab();
|
||||||
grab_key_win = 0;
|
grab_key_win = 0;
|
||||||
focus_win = 0;
|
focus_win = 0;
|
||||||
}
|
}
|
||||||
if (mouse_win)
|
if (mouse_win)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (confine_mouse)
|
if (confine_mouse)
|
||||||
ret = ecore_x_pointer_confine_grab(mouse_win);
|
ret = ecore_x_pointer_confine_grab(mouse_win);
|
||||||
else
|
else
|
||||||
ret = ecore_x_pointer_grab(mouse_win);
|
ret = ecore_x_pointer_grab(mouse_win);
|
||||||
if (!ret) return 0;
|
if (!ret) return 0;
|
||||||
grab_mouse_win = mouse_win;
|
grab_mouse_win = mouse_win;
|
||||||
}
|
}
|
||||||
if (key_win)
|
if (key_win)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
ret = ecore_x_keyboard_grab(key_win);
|
ret = ecore_x_keyboard_grab(key_win);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
if (grab_mouse_win)
|
if (grab_mouse_win)
|
||||||
{
|
{
|
||||||
ecore_x_pointer_ungrab();
|
ecore_x_pointer_ungrab();
|
||||||
grab_mouse_win = 0;
|
grab_mouse_win = 0;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
grab_key_win = key_win;
|
grab_key_win = key_win;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -72,19 +72,19 @@ e_grabinput_release(Ecore_X_Window mouse_win, Ecore_X_Window key_win)
|
||||||
{
|
{
|
||||||
if (mouse_win == grab_mouse_win)
|
if (mouse_win == grab_mouse_win)
|
||||||
{
|
{
|
||||||
ecore_x_pointer_ungrab();
|
ecore_x_pointer_ungrab();
|
||||||
grab_mouse_win = 0;
|
grab_mouse_win = 0;
|
||||||
}
|
}
|
||||||
if (key_win == grab_key_win)
|
if (key_win == grab_key_win)
|
||||||
{
|
{
|
||||||
ecore_x_keyboard_ungrab();
|
ecore_x_keyboard_ungrab();
|
||||||
grab_key_win = 0;
|
grab_key_win = 0;
|
||||||
if (focus_win != 0)
|
if (focus_win != 0)
|
||||||
{
|
{
|
||||||
_e_grabinput_focus(focus_win, focus_method);
|
_e_grabinput_focus(focus_win, focus_method);
|
||||||
focus_win = 0;
|
focus_win = 0;
|
||||||
focus_method = E_FOCUS_METHOD_NO_INPUT;
|
focus_method = E_FOCUS_METHOD_NO_INPUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,12 +93,12 @@ e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method)
|
||||||
{
|
{
|
||||||
if (grab_key_win != 0)
|
if (grab_key_win != 0)
|
||||||
{
|
{
|
||||||
focus_win = win;
|
focus_win = win;
|
||||||
focus_method = method;
|
focus_method = method;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_e_grabinput_focus(win, method);
|
_e_grabinput_focus(win, method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,19 +114,24 @@ _e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method)
|
||||||
switch (method)
|
switch (method)
|
||||||
{
|
{
|
||||||
case E_FOCUS_METHOD_NO_INPUT:
|
case E_FOCUS_METHOD_NO_INPUT:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_FOCUS_METHOD_LOCALLY_ACTIVE:
|
case E_FOCUS_METHOD_LOCALLY_ACTIVE:
|
||||||
ecore_x_window_focus_at_time(win, ecore_x_current_time_get());
|
ecore_x_window_focus_at_time(win, ecore_x_current_time_get());
|
||||||
ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get());
|
ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_FOCUS_METHOD_GLOBALLY_ACTIVE:
|
case E_FOCUS_METHOD_GLOBALLY_ACTIVE:
|
||||||
ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get());
|
ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_FOCUS_METHOD_PASSIVE:
|
case E_FOCUS_METHOD_PASSIVE:
|
||||||
ecore_x_window_focus_at_time(win, ecore_x_current_time_get());
|
ecore_x_window_focus_at_time(win, ecore_x_current_time_get());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
last_focus_time = ecore_loop_time_get();
|
last_focus_time = ecore_loop_time_get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue