summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-12 17:54:11 -0500
committerDudemanguy <random342@airmail.cc>2023-08-20 02:01:39 +0000
commita0038504a3ef408304f87cda32f3aec7cd9975e3 (patch)
treed3e6bfa397297c0d1427d2ccaaadcd22c1b30021 /video/out/x11_common.c
parent19384e07e4a34a2f6eb54da8d683d5536d4b694b (diff)
downloadmpv-a0038504a3ef408304f87cda32f3aec7cd9975e3.tar.bz2
mpv-a0038504a3ef408304f87cda32f3aec7cd9975e3.tar.xz
x11: require randr 1.4
There really is no reason to not just hard require randr 1.4. xorg added 1.4 support in 2012 and someone somehow using an xorg server older than that today surely has several other problems.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r--video/out/x11_common.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 4010d2f5e5..bcd9c72171 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -400,7 +400,6 @@ static void xrandr_read(struct vo_x11_state *x11)
talloc_free(x11->displays[i].name);
x11->num_displays = 0;
- bool randr_14 = false;
if (x11->xrandr_event < 0) {
int event_base, error_base;
@@ -408,10 +407,6 @@ static void xrandr_read(struct vo_x11_state *x11)
MP_VERBOSE(x11, "Couldn't init Xrandr.\n");
return;
}
- int major, minor;
- XRRQueryVersion(x11->display, &major, &minor);
- if (major >= 2 || minor >= 4)
- randr_14 = true;
x11->xrandr_event = event_base + RRNotify;
XRRSelectInput(x11->display, x11->rootwin, RRScreenChangeNotifyMask |
RRCrtcChangeNotifyMask | RROutputChangeNotifyMask);
@@ -429,27 +424,25 @@ static void xrandr_read(struct vo_x11_state *x11)
* a laptop with switchable graphics), we need to know both of these things.
* In practice, this is used for determining whether or not to use XPresent
* (i.e. needs to be Mesa and not Nvidia). Requires Randr 1.4. */
- if (randr_14) {
- XRRProviderResources *pr = XRRGetProviderResources(x11->display, x11->rootwin);
- for (int i = 0; i < pr->nproviders; i++) {
- XRRProviderInfo *info = XRRGetProviderInfo(x11->display, r, pr->providers[i]);
- struct bstr provider_name = bstrdup(x11, bstr0(info->name));
- bstr_lower(provider_name);
- int amd = bstr_find0(provider_name, "amd");
- int intel = bstr_find0(provider_name, "intel");
- int modesetting = bstr_find0(provider_name, "modesetting");
- int nouveau = bstr_find0(provider_name, "nouveau");
- int nvidia = bstr_find0(provider_name, "nvidia");
- int radeon = bstr_find0(provider_name, "radeon");
- x11->has_mesa = x11->has_mesa || amd >= 0 || intel >= 0 ||
- modesetting >= 0 || nouveau >= 0 || radeon >= 0;
- x11->has_nvidia = x11->has_nvidia || nvidia >= 0;
- XRRFreeProviderInfo(info);
- }
- if (x11->present_code)
- xpresent_set(x11);
- XRRFreeProviderResources(pr);
- }
+ XRRProviderResources *pr = XRRGetProviderResources(x11->display, x11->rootwin);
+ for (int i = 0; i < pr->nproviders; i++) {
+ XRRProviderInfo *info = XRRGetProviderInfo(x11->display, r, pr->providers[i]);
+ struct bstr provider_name = bstrdup(x11, bstr0(info->name));
+ bstr_lower(provider_name);
+ int amd = bstr_find0(provider_name, "amd");
+ int intel = bstr_find0(provider_name, "intel");
+ int modesetting = bstr_find0(provider_name, "modesetting");
+ int nouveau = bstr_find0(provider_name, "nouveau");
+ int nvidia = bstr_find0(provider_name, "nvidia");
+ int radeon = bstr_find0(provider_name, "radeon");
+ x11->has_mesa = x11->has_mesa || amd >= 0 || intel >= 0 ||
+ modesetting >= 0 || nouveau >= 0 || radeon >= 0;
+ x11->has_nvidia = x11->has_nvidia || nvidia >= 0;
+ XRRFreeProviderInfo(info);
+ }
+ if (x11->present_code)
+ xpresent_set(x11);
+ XRRFreeProviderResources(pr);
int primary_id = -1;
RROutput primary = XRRGetOutputPrimary(x11->display, x11->rootwin);