* mouseUpAt */
| 387 | * mouseUpAt |
| 388 | */ |
| 389 | WD_RESULT mouseUpAt(WINDOW_HANDLE windowHandle, long x, long y, long button) |
| 390 | { |
| 391 | init_logging(); |
| 392 | |
| 393 | const int timePerEvent = 10 /* ms */; |
| 394 | |
| 395 | LOG(DEBUG) << "---------- starting mouseUpAt: " << windowHandle << "---------"; |
| 396 | GdkDrawable* hwnd = (GdkDrawable*) windowHandle; |
| 397 | |
| 398 | MouseEventsHandler mousep_handler(hwnd); |
| 399 | |
| 400 | struct timespec sleep_time; |
| 401 | sleep_time.tv_sec = timePerEvent / 1000; |
| 402 | sleep_time.tv_nsec = (timePerEvent % 1000) * 1000000; |
| 403 | LOG(DEBUG) << "Sleep time is " << sleep_time.tv_sec << " seconds and " << |
| 404 | sleep_time.tv_nsec << " nanoseconds."; |
| 405 | |
| 406 | list<GdkEvent*> events_for_mouse = mousep_handler.CreateEventsForMouseUp(x, y, button); |
| 407 | submit_and_free_events_list(events_for_mouse, timePerEvent); |
| 408 | |
| 409 | |
| 410 | if (gLatestEventTime < mousep_handler.get_last_event_time()) { |
| 411 | gLatestEventTime = mousep_handler.get_last_event_time(); |
| 412 | } |
| 413 | |
| 414 | LOG(DEBUG) << "---------- Ending mouseUpAt ----------"; |
| 415 | return 0; |
| 416 | } |
| 417 | |
| 418 | bool pending_mouse_events() |
| 419 | { |
nothing calls this directly
no test coverage detected