Now that the seek only happens with the right mouse button, it makes
sense to toggle full screen when double-clicking with the left mouse
button, like other video players do.
Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
... | ... |
@@ -3473,6 +3473,16 @@ static void event_loop(VideoState *cur_stream) |
3473 | 3473 |
do_exit(cur_stream); |
3474 | 3474 |
break; |
3475 | 3475 |
} |
3476 |
+ if (event.button.button == SDL_BUTTON_LEFT) { |
|
3477 |
+ static int64_t last_mouse_left_click = 0; |
|
3478 |
+ if (av_gettime_relative() - last_mouse_left_click <= 500000) { |
|
3479 |
+ toggle_full_screen(cur_stream); |
|
3480 |
+ cur_stream->force_refresh = 1; |
|
3481 |
+ last_mouse_left_click = 0; |
|
3482 |
+ } else { |
|
3483 |
+ last_mouse_left_click = av_gettime_relative(); |
|
3484 |
+ } |
|
3485 |
+ } |
|
3476 | 3486 |
case SDL_MOUSEMOTION: |
3477 | 3487 |
if (cursor_hidden) { |
3478 | 3488 |
SDL_ShowCursor(1); |