mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-12 16:21:10 +00:00
Check if Xrandr did not succeed and provide fallback.
This commit is contained in:
parent
88bc2a4efd
commit
ae3510f385
2 changed files with 15 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-01-31 Riccardo Mottola <rm@gnu.org>
|
||||||
|
|
||||||
|
* Source/x11/XGServerWindow.m (boundsForScreen:):
|
||||||
|
Check if Xrandr did not succeed and provide fallback.
|
||||||
|
|
||||||
2020-01-26 Sergii Stoian <stoyan255@gmail.com>
|
2020-01-26 Sergii Stoian <stoyan255@gmail.com>
|
||||||
|
|
||||||
* Source/x11/XGServerWindow.m (boundsForScreen:): use `screen` variable
|
* Source/x11/XGServerWindow.m (boundsForScreen:): use `screen` variable
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* XGServerWindows - methods for window/screen handling
|
/* XGServerWindows - methods for window/screen handling
|
||||||
|
|
||||||
Copyright (C) 1999-2015 Free Software Foundation, Inc.
|
Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Adam Fedor <fedor@gnu.org>
|
Written by: Adam Fedor <fedor@gnu.org>
|
||||||
Date: Nov 1999
|
Date: Nov 1999
|
||||||
|
@ -4525,7 +4525,7 @@ _computeDepth(int class, int bpp)
|
||||||
XRROutputInfo *output_info;
|
XRROutputInfo *output_info;
|
||||||
screen_res = XRRGetScreenResources(dpy, RootWindow(dpy, screen));
|
screen_res = XRRGetScreenResources(dpy, RootWindow(dpy, screen));
|
||||||
output_info = XRRGetOutputInfo(dpy, screen_res, screen_res->outputs[screen]);
|
output_info = XRRGetOutputInfo(dpy, screen_res, screen_res->outputs[screen]);
|
||||||
if (output_info->crtc)
|
if (NULL != output_info && 0 != output_info->crtc)
|
||||||
{
|
{
|
||||||
XRRCrtcInfo *crtc_info;
|
XRRCrtcInfo *crtc_info;
|
||||||
crtc_info = XRRGetCrtcInfo(dpy, screen_res, output_info->crtc);
|
crtc_info = XRRGetCrtcInfo(dpy, screen_res, output_info->crtc);
|
||||||
|
@ -4533,11 +4533,15 @@ _computeDepth(int class, int bpp)
|
||||||
crtc_info->width, crtc_info->height);
|
crtc_info->width, crtc_info->height);
|
||||||
}
|
}
|
||||||
XRRFreeScreenResources(screen_res);
|
XRRFreeScreenResources(screen_res);
|
||||||
#else
|
|
||||||
boundsRect = NSMakeRect(0, 0, DisplayWidth(dpy, screen),
|
|
||||||
DisplayHeight(dpy, screen));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// no XRandr available or XRR call failed
|
||||||
|
if (NSEqualRects(boundsRect, NSZeroRect))
|
||||||
|
{
|
||||||
|
boundsRect = NSMakeRect(0, 0, DisplayWidth(dpy, screen),
|
||||||
|
DisplayHeight(dpy, screen));
|
||||||
|
}
|
||||||
|
|
||||||
return boundsRect;
|
return boundsRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue