From 4c9ca90eacb8548137e91a8fbb2ad95da3c592e3 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Mon, 24 Feb 2020 01:20:54 +0200 Subject: [PATCH 1/2] * Source/x11/XGServerWindow.m (placewindow::): use window->xframe as current window frame instead of NSWindow's frame because `_frame` ivar may be already changed to target value. --- ChangeLog | 6 ++++++ Source/x11/XGServerWindow.m | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 48e636a..ff60f24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-02-24 Sergii Stoian + + * Source/x11/XGServerWindow.m (placewindow::): use window->xframe + as current window frame instead of NSWindow's frame because + `_frame` ivar may be already changed to desired value. + 2020-02-11 Sergii Stoian * Source/x11/XGServerWindow.m (screenList): Transform screen diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 842d1bb..2fc24f8 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -3219,7 +3219,7 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep) NSDebugLLog(@"XGTrace", @"DPSplacewindow: %@ : %d", NSStringFromRect(rect), win); nswin = GSWindowWithNumber(win); - frame = [nswin frame]; + frame = [self _XFrameToOSFrame: window->xframe for: window]; if (NSEqualRects(rect, frame) == YES) return; if (NSEqualSizes(rect.size, frame.size) == NO) From 70e4222ece638d12aad10e188f2ea543ccfdf928 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Mon, 24 Feb 2020 23:53:57 +0200 Subject: [PATCH 2/2] * Source/x11/XGServerWindow.m (placewindow::): move NSWindow fetching code closer to its usage. --- Source/x11/XGServerWindow.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index a891dac..81be6b0 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -3234,7 +3234,6 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep) NSDebugLLog(@"XGTrace", @"DPSplacewindow: %@ : %d", NSStringFromRect(rect), win); - nswin = GSWindowWithNumber(win); frame = [self _XFrameToOSFrame: window->xframe for: window]; if (NSEqualRects(rect, frame) == YES) return; @@ -3285,6 +3284,7 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep) with min/max sizes and resizability in some window managers. */ setNormalHints(dpy, window); + nswin = GSWindowWithNumber(win); if (resize == YES) { NSDebugLLog(@"Moving", @"Fake size %lu - %@", window->number,