Am 24.04.2018 um 18:28 schrieb Andreas Höschler:
>> All of these values look correct, I really don’t understand why it is
>> going wrong here. I see two ways to proceed from here. Either you
>> could move on to a more current GNUstep version just to see whether
>> the error is resolved there. Or I could write a tiny test application,
>> check it locally with current GNustep and send you the test code to
>> confirm the behaviour on your side.
>>
>> I hope to find the time for the later, but am promising nothing for
>> this week.
>
> I assume I would find the more recent version on
>
> https://github.com/gnustep
>
> I will try the most recent gui and back ...
>
> I am also looking forward to your little test app!
Here comes my tiny test application. It is about the minimal code that
is needed to test this behaviour. A minimal GNUmakefile for this would
look something like this:
================================
include $(GNUSTEP_MAKEFILES)/common.make
NEEDS_GUI = yes
# The application to be compiled
TEST_APP_NAME = resize
resize_OBJC_FILES = resize.m
include $(GNUSTEP_MAKEFILES)/test-application.make
================================
For me this give the expected values when trying to resize the window.
But on the other hand, the GNUstep fallback window border sizes are
tailored to my KWin window manager. I promise to have a look at the
window manager specific code that Josh has put into PikoPixel to provide
a better user experience on more environments.
Fred
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSString.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSBezierPath.h>
#import <AppKit/NSColor.h>
#import "AppKit/NSGraphics.h"
#import <AppKit/NSMenu.h>
#import <AppKit/NSView.h>
#import <AppKit/NSWindow.h>
#include <AppKit/PSOperators.h>
@interface MyContentView: NSView
{
}
@end
@implementation MyContentView
- (void) setFrame: (NSRect)frameRect
{
NSLog(@"Content view set frame to %@", NSStringFromRect(frameRect));
[super setFrame: frameRect];
}
- (void) drawRect: (NSRect)rect
{
[[NSColor redColor] set];
NSRectFill(rect);
}
@end
@interface AppController: NSObject
{
}
@end
@implementation AppController
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
NSWindow *aWin;
NSMenu *menu = [NSMenu new];
[menu addItemWithTitle: @"Quit"
action: @selector(terminate:)
keyEquivalent: @"q"];
[NSApp setMainMenu: menu];
RELEASE(menu);
aWin = [[NSWindow alloc] initWithContentRect: NSMakeRect(200,200,140,140)
styleMask: NSTitledWindowMask | NSResizableWindowMask
backing: NSBackingStoreBuffered
defer: NO];
[aWin setMaxSize: NSMakeSize(200, 200)];
[aWin setBackgroundColor: [NSColor blueColor]];
NSView *contentView = [[MyContentView alloc] initWithFrame: NSMakeRect(200,200,140,140)];
[aWin setContentView: contentView];
[contentView release];
[aWin makeKeyAndOrderFront: nil];
}
@end
int main (int argc, const char *argv[])
{
CREATE_AUTORELEASE_POOL(pool);
id app;
app = [NSApplication sharedApplication];
[app setDelegate: [AppController new]];
[app run];
RELEASE(pool);
return 0;
}
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep