aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index e00bb85..1ec178d 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3211,7 +3211,6 @@ namespace QuickMedia {
PageType previous_page = pop_page_stack();
bool video_loaded = false;
- bool shutdown = false;
double video_time_pos = 0.0; // Time in media in seconds. Updates every 5 seconds and when starting to watch the video and when seeking.
VideoInfo video_info; // Duration time in seconds. 0 if unknown
bool successfully_fetched_video_duration = false;
@@ -3312,7 +3311,6 @@ namespace QuickMedia {
video_player.reset();
video_info.channel_url.clear();
video_loaded = false;
- shutdown = false;
successfully_fetched_video_duration = false;
successfully_fetched_time_pos = false;
video_player_window = None;
@@ -3515,7 +3513,6 @@ namespace QuickMedia {
added_recommendations = false;
time_watched_timer.restart();
video_loaded = true;
- shutdown = false;
update_time_pos = true;
update_window_focus = true;
} else if(strcmp(event_name, "file-loaded") == 0) {
@@ -3531,8 +3528,6 @@ namespace QuickMedia {
} else if(strcmp(event_name, "end-file") == 0) {
if(successfully_fetched_time_pos && successfully_fetched_video_duration)
video_page->set_watch_progress(video_time_pos, video_info.duration);
- } else if(strcmp(event_name, "shutdown") == 0) {
- shutdown = true;
}
//fprintf(stderr, "event name: %s\n", event_name);
@@ -3623,7 +3618,16 @@ namespace QuickMedia {
const bool pressing_shift = (CLEANMASK(xev.xkey.state) & ShiftMask);
if(pressed_keysym == XK_q && pressing_ctrl) {
window.close();
- } else if(pressed_keysym == XK_Escape) {
+ } else if(pressed_keysym == XK_Escape || pressed_keysym == XK_BackSpace) {
+ if(window_is_fullscreen(disp, window.get_system_handle())) {
+ if(pressed_keysym != XK_Escape)
+ video_player->cycle_fullscreen();
+ } else {
+ current_page = previous_page;
+ go_to_previous_page = true;
+ break;
+ }
+ } else if(pressed_keysym == XK_q && !pressing_ctrl) {
current_page = previous_page;
go_to_previous_page = true;
break;
@@ -3736,7 +3740,7 @@ namespace QuickMedia {
} else if(update_err == VideoPlayer::Error::EXITED && video_player->exit_status == 0 && (!is_matrix || is_youtube)) {
std::string new_video_url;
- if(!video_page->should_autoplay() || shutdown) {
+ if(!video_page->should_autoplay()) {
current_page = previous_page;
go_to_previous_page = true;
break;
@@ -3882,7 +3886,6 @@ namespace QuickMedia {
window_size.x = window_size_u.x;
window_size.y = window_size_u.y;
- // TODO: Is this needed? end-file handles this
if(successfully_fetched_time_pos && successfully_fetched_video_duration)
video_page->set_watch_progress(video_time_pos, video_info.duration);
}