mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-24 04:11:28 +00:00
* Source/x11/XGServerWindow.m (screenList): revert back to old code
logic: if XRandR available but can't get screens info for some reasons, return array with one element (Xlib screen info).
This commit is contained in:
parent
6923a62820
commit
00a79638cf
1 changed files with 18 additions and 11 deletions
|
@ -4448,6 +4448,9 @@ _computeDepth(int class, int bpp)
|
|||
We map XRandR monitors (outputs) to NSScreen. */
|
||||
- (NSArray *)screenList
|
||||
{
|
||||
NSMutableArray *tmpScreens;
|
||||
NSArray *screens;
|
||||
|
||||
monitorsCount = 0;
|
||||
if (monitors != NULL) {
|
||||
NSZoneFree([self zone], monitors);
|
||||
|
@ -4462,7 +4465,6 @@ _computeDepth(int class, int bpp)
|
|||
if (screen_res != NULL)
|
||||
{
|
||||
RROutput primary_output;
|
||||
NSMutableArray *tmpScreens;
|
||||
int i;
|
||||
int mi;
|
||||
int xScreenHeight = DisplayHeight(dpy, defScreen);
|
||||
|
@ -4509,13 +4511,15 @@ _computeDepth(int class, int bpp)
|
|||
XRRFreeOutputInfo(output_info);
|
||||
}
|
||||
XRRFreeScreenResources(screen_res);
|
||||
return [NSArray arrayWithArray: tmpScreens];
|
||||
screens = [NSArray arrayWithArray: tmpScreens];
|
||||
}
|
||||
#endif
|
||||
|
||||
/* It is assumed that there is always only one screen per application.
|
||||
We only need to know its number and it was saved in _initXContext as
|
||||
`defScreen`. */
|
||||
if (monitorsCount == 0)
|
||||
{
|
||||
monitorsCount = 1;
|
||||
monitors = NSZoneMalloc([self zone], sizeof(MonitorDevice));
|
||||
monitors[0].screen_id = defScreen;
|
||||
|
@ -4524,7 +4528,10 @@ _computeDepth(int class, int bpp)
|
|||
monitors[0].frame = NSMakeRect(0, 0,
|
||||
DisplayWidth(dpy, defScreen),
|
||||
DisplayHeight(dpy, defScreen));
|
||||
return [NSArray arrayWithObject: [NSNumber numberWithInt: 0]];
|
||||
screens = [NSArray arrayWithObject: [NSNumber numberWithInt: defScreen]];
|
||||
}
|
||||
|
||||
return screens;
|
||||
}
|
||||
|
||||
// `screen` is a monitor index not X11 screen
|
||||
|
|
Loading…
Reference in a new issue