diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-06-11 23:49:59 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-06-11 23:49:59 +0200 |
commit | a3843702b93513052e1e167d52f232b5a5301bd0 (patch) | |
tree | a1393c0491a7d83e7397120a9f5fc8ba7ec75020 /src/Utils.cpp | |
parent | fd20b4fba2d9a3b5d6be28208dc9f2b58f9cd3ff (diff) |
Fix youtube download
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r-- | src/Utils.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
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) { |