mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-15 15:33:55 +00:00
* Source/NSWindow.m (_applyFrame:): new helper method to do actual
resizing and repositionning. (setFrame:display:): use _applyFrame method. (applicationDidChangeScreenParameters:): use _applyFrame: method.
This commit is contained in:
parent
3f85f86f3b
commit
a61aa9f68f
2 changed files with 30 additions and 29 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,9 +1,11 @@
|
||||||
2020-03-05 Sergii Stoian <stoyan255@gmail.com>
|
2020-03-05 Sergii Stoian <stoyan255@gmail.com>
|
||||||
|
|
||||||
* Source/NSWindow.m (applicationDidChangeScreenParameters:):
|
* Source/NSWindow.m (_applyFrame:): new helper method to do actual
|
||||||
Call backend's `placewindow::` directly because our origin in OpenStep
|
resizing.
|
||||||
coordinates might left unchanged and `setFrame:display:` has check
|
(setFrame:display:): use _applyFrame method.
|
||||||
for it.
|
(applicationDidChangeScreenParameters:): Use _applyFrame: because our
|
||||||
|
origin in OpenStep coordinates might be unchanged and `setFrame:display:`
|
||||||
|
has check for it.
|
||||||
|
|
||||||
2020-02-28 Sergii Stoian <stoyan255@gmail.com>
|
2020-02-28 Sergii Stoian <stoyan255@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -2227,6 +2227,20 @@ titleWithRepresentedFilename(NSString *representedFilename)
|
||||||
[self setFrame: r display: YES];
|
[self setFrame: r display: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) _applyFrame: (NSRect )frameRect
|
||||||
|
{
|
||||||
|
if (_windowNum)
|
||||||
|
{
|
||||||
|
[GSServerForWindow(self) placewindow: frameRect : _windowNum];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_frame = frameRect;
|
||||||
|
frameRect.origin = NSZeroPoint;
|
||||||
|
[_wv setFrame: frameRect];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) setFrame: (NSRect)frameRect display: (BOOL)flag
|
- (void) setFrame: (NSRect)frameRect display: (BOOL)flag
|
||||||
{
|
{
|
||||||
if (_maximumSize.width > 0 && frameRect.size.width > _maximumSize.width)
|
if (_maximumSize.width > 0 && frameRect.size.width > _maximumSize.width)
|
||||||
|
@ -2265,14 +2279,7 @@ titleWithRepresentedFilename(NSString *representedFilename)
|
||||||
* Now we can tell the graphics context to do the actual resizing.
|
* Now we can tell the graphics context to do the actual resizing.
|
||||||
* We will recieve an event to tell us when the resize is done.
|
* We will recieve an event to tell us when the resize is done.
|
||||||
*/
|
*/
|
||||||
if (_windowNum)
|
[self _applyFrame: frameRect];
|
||||||
[GSServerForWindow(self) placewindow: frameRect : _windowNum];
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_frame = frameRect;
|
|
||||||
frameRect.origin = NSZeroPoint;
|
|
||||||
[_wv setFrame: frameRect];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
[self display];
|
[self display];
|
||||||
|
@ -2738,24 +2745,16 @@ titleWithRepresentedFilename(NSString *representedFilename)
|
||||||
// Screen X origin change. Screen width change shouldn't affect our frame.
|
// Screen X origin change. Screen width change shouldn't affect our frame.
|
||||||
newFrame.origin.x += newScreenFrame.origin.x - oldScreenFrame.origin.x;
|
newFrame.origin.x += newScreenFrame.origin.x - oldScreenFrame.origin.x;
|
||||||
|
|
||||||
if (_windowNum)
|
|
||||||
{
|
|
||||||
/* Call backend's `placewindow::` directly because our origin in OpenStep
|
/* Call backend's `placewindow::` directly because our origin in OpenStep
|
||||||
coordinates might left unchanged and `setFrame:display:` has check
|
coordinates might be unchanged and `setFrame:display:` has check
|
||||||
for it. */
|
for it. */
|
||||||
[GSServerForWindow(self) placewindow: newFrame : _windowNum];
|
[self _applyFrame: newFrame];
|
||||||
|
[self display];
|
||||||
|
|
||||||
if (_autosaveName != nil)
|
if (_autosaveName != nil)
|
||||||
{
|
{
|
||||||
[self saveFrameUsingName: _autosaveName];
|
[self saveFrameUsingName: _autosaveName];
|
||||||
}
|
}
|
||||||
[self display];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_frame = newFrame;
|
|
||||||
newFrame.origin = NSZeroPoint;
|
|
||||||
[_wv setFrame: newFrame];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setDepthLimit: (NSWindowDepth)limit
|
- (void) setDepthLimit: (NSWindowDepth)limit
|
||||||
|
|
Loading…
Reference in a new issue