diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | include/Utils.hpp | 2 | ||||
-rw-r--r-- | src/QuickMedia.cpp | 5 | ||||
-rw-r--r-- | src/Utils.cpp | 15 | ||||
-rw-r--r-- | src/VideoPlayer.cpp | 2 |
5 files changed, 11 insertions, 15 deletions
@@ -302,4 +302,4 @@ Keep the rooms that we were kicked/banned from so we can still read them and re- Fix youtube broken without yt-dlp. Unable to download video. Use different font for chinese, japanese and korean (or maybe only for korean). Include noto font instead of having to install it. Only require installing it for other noto fonts. -Press g to start typing text in matrix with /encrypt text. +ctrl+g to reply to someone, starting with /encrypt. diff --git a/include/Utils.hpp b/include/Utils.hpp index fe0e583..370311a 100644 --- a/include/Utils.hpp +++ b/include/Utils.hpp @@ -8,7 +8,7 @@ namespace QuickMedia { void show_virtual_keyboard(); void hide_virtual_keyboard(); bool is_touch_enabled(); - bool is_running_wayland(); + bool is_running_wayland(void *dpy); time_t iso_utc_to_unix_time(const char *time_str); std::string unix_time_to_local_time_str(time_t unix_time); int64_t get_boottime_milliseconds(); diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 037d218..8cdc874 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3102,7 +3102,10 @@ namespace QuickMedia { } static bool url_should_download_with_youtube_dl(const std::string &url) { - return url.find("pornhub.com") != std::string::npos + return url.find("youtube.com") != std::string::npos + || url.find("youtu.be") != std::string::npos + || url.find("googlevideo.com") != std::string::npos + || url.find("pornhub.com") != std::string::npos || url.find("xhamster.com") != std::string::npos || url.find("spankbang.com") != std::string::npos // TODO: Remove when youtube-dl is no longer required to download soundcloud music diff --git a/src/Utils.cpp b/src/Utils.cpp index ca153ab..e6628d1 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -2,13 +2,11 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <locale.h> +#include <X11/Xlib.h> namespace QuickMedia { static bool qm_enable_touch = false; static bool qm_enable_touch_set = false; - static bool wayland_display_set = false; - static const char *wayland_display = nullptr; void show_virtual_keyboard() { if(!is_touch_enabled()) @@ -38,14 +36,9 @@ namespace QuickMedia { return qm_enable_touch; } - // TODO: Find a better way to detect this. This will return true on ubuntu when running gnome in x11 mode - bool is_running_wayland() { - if(wayland_display_set) - return wayland_display; - - wayland_display = getenv("WAYLAND_DISPLAY"); - wayland_display_set = true; - return wayland_display; + bool is_running_wayland(void *dpy) { + int opcode, event, error; + return XQueryExtension((Display*)dpy, "XWAYLAND", &opcode, &event, &error); } time_t iso_utc_to_unix_time(const char *time_str) { diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 0fac7aa..da92bf7 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -218,7 +218,7 @@ namespace QuickMedia { args.push_back("--resume-playback=no"); } - if(is_running_wayland()) { + if(is_running_wayland(display)) { args.push_back("--gpu-context=x11egl"); fprintf(stderr, "Wayland detected. Launching mpv in x11egl mode\n"); } |