mirror of
https://github.com/fltk/fltk.git
synced 2026-06-04 23:42:15 +08:00
Mac OS. This simpler algorithm is just as good: remove the constraint
altogether for subwindows; keep it unchanged for windows. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10913 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+4
-16
@@ -649,12 +649,10 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
|
|||||||
- (void)recursivelySendToSubwindows:(SEL)sel;
|
- (void)recursivelySendToSubwindows:(SEL)sel;
|
||||||
- (void)setSubwindowFrame;
|
- (void)setSubwindowFrame;
|
||||||
- (void)checkSubwindowFrame;
|
- (void)checkSubwindowFrame;
|
||||||
|
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||||
- (NSPoint)convertBaseToScreen:(NSPoint)aPoint;
|
- (NSPoint)convertBaseToScreen:(NSPoint)aPoint;
|
||||||
#endif
|
#endif
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
|
|
||||||
#endif
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation FLWindow
|
@implementation FLWindow
|
||||||
@@ -771,26 +769,16 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
|
||||||
/* With Mac OS 10.11 the green window button makes window fullscreen (covers system menu bar and dock).
|
/* With Mac OS 10.11 the green window button makes window fullscreen (covers system menu bar and dock).
|
||||||
When there are subwindows, they are by default constrained not to cover the menu bar
|
When there are subwindows, they are by default constrained not to cover the menu bar
|
||||||
(this is arguably a Mac OS bug).
|
(this is arguably a Mac OS bug).
|
||||||
Overriding this method prevents them from having this constraint.
|
Overriding the constrainFrameRect:toScreen: method removes this constraint.
|
||||||
*/
|
*/
|
||||||
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
|
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
|
||||||
{
|
{
|
||||||
if (fl_mac_os_version >= 101100) {
|
if ([self parentWindow]) return frameRect; // do not constrain subwindows
|
||||||
NSWindow *p = self, *win; // compute win the toplevel window
|
return [super constrainFrameRect:frameRect toScreen:screen]; // will prevent a window from going above the menu bar
|
||||||
while (p) {
|
|
||||||
win = p;
|
|
||||||
p = [win parentWindow];
|
|
||||||
}
|
|
||||||
if ([win inLiveResize]) // inLiveResize requires 10.6
|
|
||||||
return frameRect;
|
|
||||||
}
|
|
||||||
return [super constrainFrameRect:frameRect toScreen:screen]; // will prevent a window from covering the menu bar
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface FLApplication : NSObject
|
@interface FLApplication : NSObject
|
||||||
|
|||||||
Reference in New Issue
Block a user