if (!event) return ECORE_CALLBACK_PASS_ON;
Ecore_Event_Mouse_Button *e = event;
+ Ecore_Wl_Window *ew;
+ SDL_Window *window;
+
+ ew = ecore_wl_window_find(e->window);
+ window = Tizen_FindWindow(_this, ew);
+
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "mouse down (%d x %d)",e->x,e->y);
- if(_this->current_glwin->indicator_type == 0)
+ if(window->indicator_type == 0)
{
- if(e->x > _this->current_glwin->x && e->x < _this->current_glwin->x + _this->current_glwin->w &&
- e->y > _this->current_glwin->y && e->y < _this->current_glwin->y + 52)
+ if(e->x > window->x && e->x < window->x + window->w &&
+ e->y > window->y && e->y < window->y + 52)
{
ModelMatrixLoadIdentity(&mMatrix);
- _this->current_glwin->indicator_show = SDL_TRUE;
- _this->current_glwin->last_indicator_showtime = SDL_GetTicks();
+ window->indicator_show = SDL_TRUE;
+ window->last_indicator_showtime = SDL_GetTicks();
}
}
- else if(_this->current_glwin->indicator_type == 1)
+ else if(window->indicator_type == 1)
{
- if(e->x > _this->current_glwin->x && e->x < _this->current_glwin->x + 52 &&
- e->y > _this->current_glwin->y && e->y < _this->current_glwin->y + _this->current_glwin->h)
+ if(e->x > window->x && e->x < window->x + 52 &&
+ e->y > window->y && e->y < window->y + window->h)
{
ModelMatrixLoadIdentity(&mMatrix);
- _this->current_glwin->indicator_show = SDL_TRUE;
- _this->current_glwin->last_indicator_showtime = SDL_GetTicks();
+ window->indicator_show = SDL_TRUE;
+ window->last_indicator_showtime = SDL_GetTicks();
}
}
- else if(_this->current_glwin->indicator_type == 2)
+ else if(window->indicator_type == 2)
{
- if(e->x > _this->current_glwin->x && e->x < _this->current_glwin->x + _this->current_glwin->w &&
- e->y > _this->current_glwin->y + _this->current_glwin->h -52 && e->y < _this->current_glwin->y + _this->current_glwin->h)
+ if(e->x > window->x && e->x < window->x + window->w &&
+ e->y > window->y + window->h -52 && e->y < window->y + window->h)
{
ModelMatrixLoadIdentity(&mMatrix);
- _this->current_glwin->indicator_show = SDL_TRUE;
- _this->current_glwin->last_indicator_showtime = SDL_GetTicks();
+ window->indicator_show = SDL_TRUE;
+ window->last_indicator_showtime = SDL_GetTicks();
}
}
- else if(_this->current_glwin->indicator_type == 3)
+ else if(window->indicator_type == 3)
{
- if(e->x > _this->current_glwin->x + _this->current_glwin->w -52 && e->x < _this->current_glwin->x + _this->current_glwin->w &&
- e->y > _this->current_glwin->y && e->y < _this->current_glwin->y + _this->current_glwin->h)
+ if(e->x > window->x + window->w -52 && e->x < window->x + window->w &&
+ e->y > window->y && e->y < window->y + window->h)
{
ModelMatrixLoadIdentity(&mMatrix);
- _this->current_glwin->indicator_show = SDL_TRUE;
- _this->current_glwin->last_indicator_showtime = SDL_GetTicks();
+ window->indicator_show = SDL_TRUE;
+ window->last_indicator_showtime = SDL_GetTicks();
}
}
- SDL_SendMouseMotion(_this->current_glwin, 0, 0, e->x, e->y);
- SDL_SendMouseButton(_this->current_glwin, 0, SDL_PRESSED, SDL_BUTTON_LEFT);
+ SDL_SendMouseMotion(window, 0, 0, e->x, e->y);
+ SDL_SendMouseButton(window, 0, SDL_PRESSED, SDL_BUTTON_LEFT);
Tizen_OnTouch(_this,1,e->multi.device,ACTION_POINTER_DOWN,e->x,e->y,1.0f);
if (!event) return ECORE_CALLBACK_PASS_ON;
Ecore_Event_Mouse_Button *e = event;
+ Ecore_Wl_Window *ew;
+ SDL_Window *window;
+
+ ew = ecore_wl_window_find(e->window);
+ window = Tizen_FindWindow(_this, ew);
+
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "mouse up (%d x %d)",e->x,e->y);
- SDL_SendMouseMotion(_this->current_glwin, 0, 0, e->x, e->y);
- SDL_SendMouseButton(_this->current_glwin, 0, SDL_RELEASED, SDL_BUTTON_LEFT);
+ SDL_SendMouseMotion(window, 0, 0, e->x, e->y);
+ SDL_SendMouseButton(window, 0, SDL_RELEASED, SDL_BUTTON_LEFT);
Tizen_OnTouch(_this,1,e->multi.device,ACTION_POINTER_UP,e->x,e->y,1.0f);
if (!event) return ECORE_CALLBACK_PASS_ON;
Ecore_Event_Mouse_Move *e = event;
+ Ecore_Wl_Window *ew;
+ SDL_Window *window;
+
+ ew = ecore_wl_window_find(e->window);
+ window = Tizen_FindWindow(_this, ew);
+
//SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "mouse move (%d x %d)",e->x,e->y);
- SDL_SendMouseMotion(_this->current_glwin, 0, 0, e->x, e->y);
+ SDL_SendMouseMotion(window, 0, 0, e->x, e->y);
Tizen_OnTouch(_this,1,e->multi.device,ACTION_POINTER_MOVE,e->x,e->y,1.0f);
return ECORE_CALLBACK_PASS_ON;
}
+Eina_Bool
+_tizen_cb_event_mouse_in(void *data, int type EINA_UNUSED, void *event)
+{
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ Ecore_Wl_Event_Mouse_In *ev;
+ Ecore_Wl_Window *ew;
+ SDL_Window *window;
+
+ ev = event;
+ ew = ecore_wl_window_find(ev->window);
+ window = Tizen_FindWindow(_this, ew);
+ SDL_SetMouseFocus(window);
+ return ECORE_CALLBACK_PASS_ON;
+}
+Eina_Bool
+_tizen_cb_event_mouse_out(void *data, int type EINA_UNUSED, void *event)
+{
+ SDL_SetMouseFocus(NULL);
+ return ECORE_CALLBACK_PASS_ON;
+}
window->driverdata = NULL;
}
-static SDL_Window*
-_tizen_find_window(_THIS, Ecore_Wl_Window *ewin)
+SDL_Window*
+Tizen_FindWindow(_THIS, Ecore_Wl_Window *ewin)
{
SDL_VideoData *data = _this->driverdata;
int id;
ev = event;
ew = ecore_wl_window_find(ev->win);
- window = _tizen_find_window(_this, ew);
+ window = Tizen_FindWindow(_this, ew);
SDL_Log( "visibility window: %p, ecore_wl_window: %p\n", window, ew);
int nx = 0, ny = 0, nw = 0, nh = 0;
ev = event;
ew = ecore_wl_window_find(ev->win);
- window = _tizen_find_window(_this, ew);
+ window = Tizen_FindWindow(_this, ew);
wind = window->driverdata;
if (wind->rotation_supported == 0){
}
ew = ecore_wl_window_find(ev->win);
- window = _tizen_find_window(_this, ew);
+ window = Tizen_FindWindow(_this, ew);
wind = window->driverdata;
if (wind->rotation != ev->angle) {
_tizen_cb_window_configure,_this);
ecore_event_handler_add(ECORE_EVENT_JOYSTICK,
_tizen_cb_event_joystick_change,_this);
+ ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
+ _tizen_cb_event_focus_in,_this);
+ ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
+ _tizen_cb_event_focus_out,_this);
+ ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
+ _tizen_cb_event_mouse_in,_this);
+ ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
+ _tizen_cb_event_mouse_out,_this);
+
return 0;
}