You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/games-action/openclonk/files/openclonk-5.3.3-xrandr-prim...

39 lines
1.1 KiB

Description: fix XRandr use
Author: Guillem Jover <guillem@debian.org>
--- a/src/platform/C4AppGTK.cpp
+++ b/src/platform/C4AppGTK.cpp
@@ -212,20 +212,25 @@ static XRROutputInfo* GetXRROutputInfoFo
XRRScreenResources * r = XRRGetScreenResources(dpy, w);
if (!r) return NULL;
- XRROutputInfo * info = XRRGetOutputInfo(dpy, r, XRRGetOutputPrimary(dpy, w));
- if (!info)
+ XRROutputInfo * info;
+ RROutput primary = XRRGetOutputPrimary(dpy, w);
+ if (primary == None)
+ info = NULL;
+ else
{
- XRRFreeScreenResources(r);
- return NULL;
+ info = XRRGetOutputInfo(dpy, r, primary);
+ if (info->connection == RR_Disconnected || info->crtc == 0)
+ {
+ XRRFreeOutputInfo(info);
+ info = NULL;
+ }
}
- if(info->connection == RR_Disconnected || info->crtc == 0)
+ if (info == NULL)
{
// The default "primary" output does not seem to be connected
// to a piece of actual hardware. As a fallback, go through
// all outputs and choose the first active one.
- XRRFreeOutputInfo(info);
- info = NULL;
for(int i = 0; i < r->noutput; ++i)
{
info = XRRGetOutputInfo(dpy, r, r->outputs[i]);