diff options
author | pierre lamot <pierre.lamot@openwide.fr> | 2015-03-03 17:11:08 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-03-17 10:42:51 +0100 |
commit | ef7e8562a1cb73e0df5d5ee97d0d7c2c1426c0c4 (patch) | |
tree | ecfb7ccf696623110b936488540dbfe28213c5dd /src/lib/ecore_cocoa | |
parent | de767cabfaf84f262c785ce468508f6ed52cc009 (diff) |
ecore_cocoa: don't reject mouse events outside the window
mouse events ouside the window where rejected. that was creating
interactions where half an event was created, the application was
then not able to process correctly following events.
@fix
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r-- | src/lib/ecore_cocoa/ecore_cocoa_window.m | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m index 62743d9ceb..25860872a6 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa_window.m +++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m | |||
@@ -117,18 +117,14 @@ | |||
117 | NSPoint event_location = [event locationInWindow]; | 117 | NSPoint event_location = [event locationInWindow]; |
118 | NSPoint pt = [view convertPoint:event_location fromView:nil]; | 118 | NSPoint pt = [view convertPoint:event_location fromView:nil]; |
119 | 119 | ||
120 | int w = [view frame].size.width; | ||
121 | int h = [view frame].size.height; | 120 | int h = [view frame].size.height; |
122 | int x = pt.x; | 121 | int x = pt.x; |
123 | int y = h - pt.y; | 122 | int y = h - pt.y; |
124 | 123 | ||
125 | if (y <= 0 || x <= 0 || y > h || x > w) | ||
126 | return; | ||
127 | |||
128 | Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); | 124 | Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); |
129 | if (!ev) return; | 125 | if (!ev) return; |
130 | 126 | ||
131 | ev->x = pt.x; | 127 | ev->x = x; |
132 | ev->y = y; | 128 | ev->y = y; |
133 | ev->root.x = ev->x; | 129 | ev->root.x = ev->x; |
134 | ev->root.y = ev->y; | 130 | ev->root.y = ev->y; |
@@ -174,18 +170,14 @@ | |||
174 | NSPoint event_location = [event locationInWindow]; | 170 | NSPoint event_location = [event locationInWindow]; |
175 | NSPoint pt = [view convertPoint:event_location fromView:nil]; | 171 | NSPoint pt = [view convertPoint:event_location fromView:nil]; |
176 | 172 | ||
177 | int w = [view frame].size.width; | ||
178 | int h = [view frame].size.height; | 173 | int h = [view frame].size.height; |
179 | int x = pt.x; | 174 | int x = pt.x; |
180 | int y = h - pt.y; | 175 | int y = h - pt.y; |
181 | 176 | ||
182 | if (y <= 0 || x <= 0 || y > h || x > w) | ||
183 | return; | ||
184 | |||
185 | Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); | 177 | Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); |
186 | if (!ev) return; | 178 | if (!ev) return; |
187 | 179 | ||
188 | ev->x = pt.x; | 180 | ev->x = x; |
189 | ev->y = y; | 181 | ev->y = y; |
190 | ev->root.x = ev->x; | 182 | ev->root.x = ev->x; |
191 | ev->root.y = ev->y; | 183 | ev->root.y = ev->y; |