| | 205 | static bool lastEventIsMouseUp() |
| | 206 | { |
| | 207 | // Many AK widgets run their own event loops and consume events while the mouse is down. |
| | 208 | // When they finish, currentEvent is the mouseUp that they exited on. We need to update |
| | 209 | // the khtml state with this mouseUp, which khtml never saw. This method lets us detect |
| | 210 | // that state. |
| | 211 | |
| | 212 | BEGIN_BLOCK_OBJC_EXCEPTIONS; |
| | 213 | NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent]; |
| | 214 | if (currentEvent != currentEventAfterHandlingMouseDown && |
| | 215 | [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp && |
| | 216 | [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent timestamp]) |
| | 217 | return true; |
| | 218 | END_BLOCK_OBJC_EXCEPTIONS; |
| | 219 | |
| | 220 | return false; |
| | 221 | } |
| | 222 | |
| 279 | | } |
| 280 | | |
| 281 | | bool EventHandler::lastEventIsMouseUp() const |
| 282 | | { |
| 283 | | // Many AK widgets run their own event loops and consume events while the mouse is down. |
| 284 | | // When they finish, currentEvent is the mouseUp that they exited on. We need to update |
| 285 | | // the khtml state with this mouseUp, which khtml never saw. This method lets us detect |
| 286 | | // that state. |
| 287 | | |
| 288 | | BEGIN_BLOCK_OBJC_EXCEPTIONS; |
| 289 | | NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent]; |
| 290 | | if (currentEvent != currentEventAfterHandlingMouseDown && |
| 291 | | [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp && |
| 292 | | [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent timestamp]) |
| 293 | | return true; |
| 294 | | END_BLOCK_OBJC_EXCEPTIONS; |
| 295 | | |
| 296 | | return false; |