diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index cae1234..60fc523 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -651,40 +651,6 @@ namespace QuickMedia { #endif } - enum class WindowFullscreenState { - UNSET, - SET, - TOGGLE - }; - - static bool window_set_fullscreen(Display *display, Window window, WindowFullscreenState state) { - Atom wm_state_atom = XInternAtom(display, "_NET_WM_STATE", False); - Atom wm_state_fullscreen_atom = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", False); - if(wm_state_atom == False || wm_state_fullscreen_atom == False) { - fprintf(stderr, "Failed to fullscreen window. The window manager doesn't support fullscreening windows.\n"); - return false; - } - - XEvent xev; - xev.type = ClientMessage; - xev.xclient.window = window; - xev.xclient.message_type = wm_state_atom; - xev.xclient.format = 32; - xev.xclient.data.l[0] = (int)state; - xev.xclient.data.l[1] = wm_state_fullscreen_atom; - xev.xclient.data.l[2] = 0; - xev.xclient.data.l[3] = 1; - xev.xclient.data.l[4] = 0; - - if(!XSendEvent(display, XDefaultRootWindow(display), 0, SubstructureRedirectMask | SubstructureNotifyMask, &xev)) { - fprintf(stderr, "Failed to fullscreen window\n"); - return false; - } - - XFlush(display); - return true; - } - void Program::video_content_page() { search_bar->onTextUpdateCallback = nullptr; search_bar->onTextSubmitCallback = nullptr; @@ -753,12 +719,7 @@ namespace QuickMedia { }, on_window_create); load_video_error_check(); - auto on_doubleclick = [this]() { - window_set_fullscreen(disp, window.getSystemHandle(), WindowFullscreenState::TOGGLE); - }; - sf::Clock time_since_last_left_click; - int left_click_counter; sf::Event event; sf::RectangleShape rect; @@ -773,21 +734,6 @@ namespace QuickMedia { while (current_page == Page::VIDEO_CONTENT) { while (window.pollEvent(event)) { base_event_handler(event, previous_page, true, false, false); - if(event.type == sf::Event::Resized) { - } else if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Space) { - if(video_player->toggle_pause() != VideoPlayer::Error::OK) { - fprintf(stderr, "Failed to toggle pause!\n"); - } - } else if(event.type == sf::Event::MouseButtonPressed && event.mouseButton.button == sf::Mouse::Left) { - if(time_since_last_left_click.restart().asMilliseconds() <= DOUBLE_CLICK_TIME) { - if(++left_click_counter == 2) { - on_doubleclick(); - left_click_counter = 0; - } - } else { - left_click_counter = 1; - } - } } if(video_player_window && XCheckTypedWindowEvent(disp, video_player_window, KeyPress, &xev)/* && xev.xkey.subwindow == video_player_window*/) { @@ -815,7 +761,6 @@ namespace QuickMedia { std::this_thread::sleep_for(std::chrono::milliseconds(50)); } - window_set_fullscreen(disp, window.getSystemHandle(), WindowFullscreenState::UNSET); //window.setMouseCursorVisible(true); } |