mirror of
https://github.com/fltk/fltk.git
synced 2026-06-04 15:32:12 +08:00
Avoid possible autorelease warning message sent by "fluid -c" that calls Fl_Window::size_range()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11992 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+4
-4
@@ -1824,15 +1824,15 @@ void Fl_Cocoa_Screen_Driver::disable_im() {
|
|||||||
|
|
||||||
// Gets the border sizes and the titlebar size
|
// Gets the border sizes and the titlebar size
|
||||||
static void get_window_frame_sizes(int &bx, int &by, int &bt) {
|
static void get_window_frame_sizes(int &bx, int &by, int &bt) {
|
||||||
static bool first = true;
|
static int top = 0, left, bottom;
|
||||||
static int top, left, bottom;
|
if (!top) {
|
||||||
if (first) {
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
first = false;
|
|
||||||
NSRect inside = { {20,20}, {100,100} };
|
NSRect inside = { {20,20}, {100,100} };
|
||||||
NSRect outside = [NSWindow frameRectForContentRect:inside styleMask:NSTitledWindowMask];
|
NSRect outside = [NSWindow frameRectForContentRect:inside styleMask:NSTitledWindowMask];
|
||||||
left = int(outside.origin.x - inside.origin.x);
|
left = int(outside.origin.x - inside.origin.x);
|
||||||
bottom = int(outside.origin.y - inside.origin.y);
|
bottom = int(outside.origin.y - inside.origin.y);
|
||||||
top = int(outside.size.height - inside.size.height) - bottom;
|
top = int(outside.size.height - inside.size.height) - bottom;
|
||||||
|
[pool release];
|
||||||
}
|
}
|
||||||
bx = left;
|
bx = left;
|
||||||
by = bottom;
|
by = bottom;
|
||||||
|
|||||||
Reference in New Issue
Block a user