* Headers/x11/XGServerWindow.h (_gswindow_device_t): new structure

memeber was added - `osframe`. This member intended to hold cached frame
  of windows in OpenStep coordinate system. This makes backend more
  reliable to the cases when gui changes NSWindow's _frame ivar before
  call to backend methods which make windows placement.

* Source/x11/XGServerWindow.m (placewindow::): use `osframe` structure
  member to decide if window change position or size. Removed usage of
  temporary `frame` (used only for making desicion).
This commit is contained in:
Sergii Stoian 2020-02-26 01:53:01 +02:00
parent 0e811399dc
commit 2a0e305a4f
3 changed files with 24 additions and 7 deletions

View file

@ -1,3 +1,15 @@
2020-02-26 Sergii Stoian <stoyan255@gmail.com>
* Headers/x11/XGServerWindow.h (_gswindow_device_t): new structure
memeber was added - `osframe`. This member intended to hold cached frame
of windows in OpenStep coordinate system. This makes backend more
reliable to the cases when gui changes NSWindow's _frame ivar before
call to backend methods which make windows placement.
* Source/x11/XGServerWindow.m (placewindow::): use `osframe` structure
member to decide if window change position or size. Removed usage of
temporary `frame` (used only for making desicion).
2020-02-24 Sergii Stoian <stoyan255@gmail.com>
* Source/x11/XGServerWindow.m (placewindow::): use window->xframe

View file

@ -95,7 +95,8 @@ typedef struct _gswindow_device_t {
int visibility; /* X visibility */
int wm_state; /* X WM state */
NSBackingStoreType type; /* Backing type */
NSRect xframe; /* Window frame */
NSRect xframe; /* Window frame in X11 coordinates */
NSRect osframe; /* Window frame in OpenStep coordinates */
unsigned int buffer_width; /* Size in pixels of the current buffers. */
unsigned int buffer_height;

View file

@ -3219,7 +3219,6 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep)
NSEvent *e;
NSRect xVal;
NSRect xHint;
NSRect frame;
gswindow_device_t *window;
NSWindow *nswin;
BOOL resize = NO;
@ -3234,19 +3233,24 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep)
NSDebugLLog(@"XGTrace", @"DPSplacewindow: %@ : %d", NSStringFromRect(rect),
win);
frame = [self _XFrameToOSFrame: window->xframe for: window];
if (NSEqualRects(rect, frame) == YES)
return;
if (NSEqualSizes(rect.size, frame.size) == NO)
if (NSEqualRects(rect, window->osframe) == YES)
{
return;
}
if (NSEqualSizes(rect.size, window->osframe.size) == NO)
{
resize = YES;
move = YES;
}
if (NSEqualPoints(rect.origin, frame.origin) == NO)
else if (NSEqualPoints(rect.origin, window->osframe.origin) == NO)
{
move = YES;
}
// Cache OpenStep window frame for future comparison
window->osframe = rect;
/* Temporarily remove minimum and maximum window size hints to make
* the window resizable programatically.
*/