mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-24 12:21:34 +00:00
* 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:
parent
0e811399dc
commit
2a0e305a4f
3 changed files with 24 additions and 7 deletions
12
ChangeLog
12
ChangeLog
|
@ -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>
|
2020-02-24 Sergii Stoian <stoyan255@gmail.com>
|
||||||
|
|
||||||
* Source/x11/XGServerWindow.m (placewindow::): use window->xframe
|
* Source/x11/XGServerWindow.m (placewindow::): use window->xframe
|
||||||
|
|
|
@ -95,7 +95,8 @@ typedef struct _gswindow_device_t {
|
||||||
int visibility; /* X visibility */
|
int visibility; /* X visibility */
|
||||||
int wm_state; /* X WM state */
|
int wm_state; /* X WM state */
|
||||||
NSBackingStoreType type; /* Backing type */
|
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_width; /* Size in pixels of the current buffers. */
|
||||||
unsigned int buffer_height;
|
unsigned int buffer_height;
|
||||||
|
|
|
@ -3219,7 +3219,6 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep)
|
||||||
NSEvent *e;
|
NSEvent *e;
|
||||||
NSRect xVal;
|
NSRect xVal;
|
||||||
NSRect xHint;
|
NSRect xHint;
|
||||||
NSRect frame;
|
|
||||||
gswindow_device_t *window;
|
gswindow_device_t *window;
|
||||||
NSWindow *nswin;
|
NSWindow *nswin;
|
||||||
BOOL resize = NO;
|
BOOL resize = NO;
|
||||||
|
@ -3234,19 +3233,24 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep)
|
||||||
|
|
||||||
NSDebugLLog(@"XGTrace", @"DPSplacewindow: %@ : %d", NSStringFromRect(rect),
|
NSDebugLLog(@"XGTrace", @"DPSplacewindow: %@ : %d", NSStringFromRect(rect),
|
||||||
win);
|
win);
|
||||||
frame = [self _XFrameToOSFrame: window->xframe for: window];
|
if (NSEqualRects(rect, window->osframe) == YES)
|
||||||
if (NSEqualRects(rect, frame) == YES)
|
{
|
||||||
return;
|
return;
|
||||||
if (NSEqualSizes(rect.size, frame.size) == NO)
|
}
|
||||||
|
|
||||||
|
if (NSEqualSizes(rect.size, window->osframe.size) == NO)
|
||||||
{
|
{
|
||||||
resize = YES;
|
resize = YES;
|
||||||
move = YES;
|
move = YES;
|
||||||
}
|
}
|
||||||
if (NSEqualPoints(rect.origin, frame.origin) == NO)
|
else if (NSEqualPoints(rect.origin, window->osframe.origin) == NO)
|
||||||
{
|
{
|
||||||
move = YES;
|
move = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cache OpenStep window frame for future comparison
|
||||||
|
window->osframe = rect;
|
||||||
|
|
||||||
/* Temporarily remove minimum and maximum window size hints to make
|
/* Temporarily remove minimum and maximum window size hints to make
|
||||||
* the window resizable programatically.
|
* the window resizable programatically.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue