forked from enlightenment/efl
ecore-evas-fb: This patch fixes a bug in ecore_evas_fb.c introduced by the big eina
list conversion. The bug resulted in no input devices where added when using framebuffer. This patch also cleans up some related NULL checks that are not needed any more. Signed-off-by: Lars Munch <lars@segv.dk> SVN revision: 40224
This commit is contained in:
parent
8801b817ea
commit
bb74cf5f48
|
@ -87,11 +87,9 @@ _ecore_evas_fb_lose(void *data __UNUSED__)
|
||||||
ee = (Ecore_Evas *)l;
|
ee = (Ecore_Evas *)l;
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
}
|
}
|
||||||
if (ecore_evas_input_devices)
|
|
||||||
{
|
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
||||||
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
ecore_fb_input_device_listen(dev, 0);
|
||||||
ecore_fb_input_device_listen(dev, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -112,11 +110,9 @@ _ecore_evas_fb_gain(void *data __UNUSED__)
|
||||||
else
|
else
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
}
|
}
|
||||||
if (ecore_evas_input_devices)
|
|
||||||
{
|
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
||||||
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
ecore_fb_input_device_listen(dev, 1);
|
||||||
ecore_fb_input_device_listen(dev, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -289,38 +285,35 @@ _ecore_evas_fb_init(int w, int h)
|
||||||
|
|
||||||
caps = ecore_fb_input_device_cap_get(device);
|
caps = ecore_fb_input_device_cap_get(device);
|
||||||
|
|
||||||
if (ecore_evas_input_devices)
|
/* Mouse */
|
||||||
{
|
|
||||||
/* Mouse */
|
|
||||||
#ifdef HAVE_TSLIB
|
#ifdef HAVE_TSLIB
|
||||||
if (caps & ECORE_FB_INPUT_DEVICE_CAP_RELATIVE)
|
if (caps & ECORE_FB_INPUT_DEVICE_CAP_RELATIVE)
|
||||||
#else
|
#else
|
||||||
if ((caps & ECORE_FB_INPUT_DEVICE_CAP_RELATIVE) || (caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE))
|
if ((caps & ECORE_FB_INPUT_DEVICE_CAP_RELATIVE) || (caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE))
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
ecore_fb_input_device_axis_size_set(device, w, h);
|
||||||
|
ecore_fb_input_device_listen(device,1);
|
||||||
|
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
||||||
|
if (!mouse_handled)
|
||||||
{
|
{
|
||||||
ecore_fb_input_device_axis_size_set(device, w, h);
|
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL);
|
||||||
ecore_fb_input_device_listen(device,1);
|
ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, _ecore_evas_event_mouse_button_up, NULL);
|
||||||
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_MOVE, _ecore_evas_event_mouse_move, NULL);
|
||||||
if (!mouse_handled)
|
ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_WHEEL, _ecore_evas_event_mouse_wheel, NULL);
|
||||||
{
|
mouse_handled = 1;
|
||||||
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL);
|
|
||||||
ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, _ecore_evas_event_mouse_button_up, NULL);
|
|
||||||
ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_MOVE, _ecore_evas_event_mouse_move, NULL);
|
|
||||||
ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_WHEEL, _ecore_evas_event_mouse_wheel, NULL);
|
|
||||||
mouse_handled = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Keyboard */
|
}
|
||||||
else if ((caps & ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS) && !(caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE))
|
/* Keyboard */
|
||||||
|
else if ((caps & ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS) && !(caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE))
|
||||||
|
{
|
||||||
|
ecore_fb_input_device_listen(device,1);
|
||||||
|
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
||||||
|
if (!keyboard_handled)
|
||||||
{
|
{
|
||||||
ecore_fb_input_device_listen(device,1);
|
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_FB_EVENT_KEY_DOWN, _ecore_evas_event_key_down, NULL);
|
||||||
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_FB_EVENT_KEY_UP, _ecore_evas_event_key_up, NULL);
|
||||||
if (!keyboard_handled)
|
keyboard_handled = 1;
|
||||||
{
|
|
||||||
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_FB_EVENT_KEY_DOWN, _ecore_evas_event_key_down, NULL);
|
|
||||||
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_FB_EVENT_KEY_UP, _ecore_evas_event_key_up, NULL);
|
|
||||||
keyboard_handled = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,6 +479,7 @@ static void
|
||||||
_ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
_ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
Ecore_Fb_Input_Device *dev;
|
||||||
int resized = 0;
|
int resized = 0;
|
||||||
|
|
||||||
if (((ee->prop.fullscreen) && (on)) ||
|
if (((ee->prop.fullscreen) && (on)) ||
|
||||||
|
@ -521,14 +515,9 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
}
|
}
|
||||||
ee->prop.fullscreen = on;
|
ee->prop.fullscreen = on;
|
||||||
|
EINA_LIST_FOREACH(ecore_evas_input_devices, l, dev)
|
||||||
|
ecore_fb_input_device_axis_size_set(dev, ee->w, ee->h);
|
||||||
/* rescale the input device area */
|
/* rescale the input device area */
|
||||||
if (ecore_evas_input_devices)
|
|
||||||
{
|
|
||||||
Ecore_Fb_Input_Device *dev;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ecore_evas_input_devices, l, dev)
|
|
||||||
ecore_fb_input_device_axis_size_set(dev, ee->w, ee->h);
|
|
||||||
}
|
|
||||||
if (resized)
|
if (resized)
|
||||||
{
|
{
|
||||||
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||||
|
|
Loading…
Reference in New Issue