Merge pull request #21 from gnustep/randr

Align screens origin to OpenStep coordinate system.
This commit is contained in:
Fred Kiefer 2020-02-11 23:19:17 +01:00 committed by GitHub
commit 6923a62820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2020-02-11 Sergii Stoian <stoyan255@gmail.com>
* Source/x11/XGServerWindow.m (screenList): Transform screen
origin into unflipped (OpenStep) coordinate system for XRandR capable
systems. After this change windows and screen will use the same start
of coordinate system for their origins.
2020-02-08 Fred Kiefer <FredKiefer@gmx.de>
* Source/xlib/GSXftFontInfo.m,

View file

@ -4465,6 +4465,7 @@ _computeDepth(int class, int bpp)
NSMutableArray *tmpScreens;
int i;
int mi;
int xScreenHeight = DisplayHeight(dpy, defScreen);
monitorsCount = screen_res->noutput;
tmpScreens = [NSMutableArray arrayWithCapacity: monitorsCount];
@ -4485,8 +4486,12 @@ _computeDepth(int class, int bpp)
monitors[mi].screen_id = defScreen;
monitors[mi].depth = [self windowDepthForScreen: mi];
monitors[mi].resolution = [self resolutionForScreen: defScreen];
monitors[mi].frame = NSMakeRect(crtc_info->x, crtc_info->y,
crtc_info->width, crtc_info->height);
/* Transform coordinates from Xlib (flipped) to OpenStep (unflippped).
Windows and screens should have the same coordinate system. */
monitors[mi].frame = NSMakeRect(crtc_info->x,
xScreenHeight - crtc_info->height - crtc_info->y,
crtc_info->width,
crtc_info->height);
/* Add monitor ID (index in monitors array).
Put primary monitor ID at index 0 since NSScreen get this as main
screen if application has no key window. */