Skip to content

Commit

Permalink
non-activating panel instead of windows for drawing holders. Closes #567
Browse files Browse the repository at this point in the history
  • Loading branch information
asmagill authored and cmsj committed Sep 30, 2015
1 parent 02b9aeb commit 3271df2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions extensions/drawing/internal.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
NSMutableArray *drawingWindows;

// Objective-C class interface definitions
@interface HSDrawingWindow : NSWindow <NSWindowDelegate>
@interface HSDrawingWindow : NSPanel <NSWindowDelegate>
@end

@interface HSDrawingView : NSView {
Expand Down Expand Up @@ -75,7 +75,8 @@ - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger __unused)win
return nil;
}

self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask | NSNonactivatingPanelMask
backing:NSBackingStoreBuffered defer:YES];
if (self) {
[self setDelegate:self];
contentRect.origin.y=[[NSScreen screens][0] frame].size.height - contentRect.origin.y - contentRect.size.height;
Expand All @@ -90,6 +91,7 @@ - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger __unused)win
self.hasShadow = NO;
self.ignoresMouseEvents = YES;
self.restorable = NO;
self.hidesOnDeactivate = NO;
self.animationBehavior = NSWindowAnimationBehaviorNone;
self.level = NSScreenSaverWindowLevel;
}
Expand Down Expand Up @@ -1920,8 +1922,7 @@ static int setBehavior(lua_State *L) {
[drawingWindow setCollectionBehavior:newLevel] ;
}
@catch ( NSException *theException ) {
showError(L, (char *)[[NSString stringWithFormat:@"%@: %@", theException.name, theException.reason] UTF8String]);
return 0 ;
return luaL_error(L, "%s, %s", [[theException name] UTF8String], [[theException reason] UTF8String]) ;
}

lua_settop(L, 1);
Expand Down Expand Up @@ -2070,6 +2071,7 @@ static int userdata_tostring(lua_State* L) {
{"setBehavior", setBehavior},
{"behavior", getBehavior},
{"setTextStyle", drawing_setTextStyle},

{"__tostring", userdata_tostring},
{"__gc", drawing_delete},
{NULL, NULL}
Expand Down

0 comments on commit 3271df2

Please sign in to comment.