summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2019-12-23 14:35:41 +0100
committerMatthias Melcher <git@matthiasm.com>2019-12-23 14:35:41 +0100
commit70179b618aaf02715c2f5fd2f4094369258cbe14 (patch)
tree4658eb9a9843c88b60a27fe21b2fe77ecf8a0979 /src
parentd97836f5dd8f94e5e55c65ab21a9ddfa82b919cd (diff)
parentf68dee3288202259fb2b417a590c462e3f4ff658 (diff)
Merge remote-tracking branch 'refs/remotes/origin/master'
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 9a66a3479..b0a13d714 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1250,7 +1250,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil;
if (![[notif object] isKindOfClass:[FLView class]]) return;
FLView *view = (FLView*)[notif object];
FLWindow *nsw = (FLWindow*)[view window];
- if (!nsw) return;
+ if (!nsw || ![nsw getFl_Window]) return;
fl_lock_function();
Fl_Window *window = [nsw getFl_Window];
int X, Y;
@@ -1879,7 +1879,7 @@ int Fl_Cocoa_Screen_Driver::get_mouse(int &x, int &y)
NSPoint pt = [NSEvent mouseLocation];
x = int(pt.x);
y = int(main_screen_height - pt.y);
- return screen_num(x, y);
+ return screen_num(x/scale(0), y/scale(0));
}
@@ -2234,9 +2234,10 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
*/
- (void)drawRect:(NSRect)rect
{
- fl_lock_function();
FLWindow *cw = (FLWindow*)[self window];
Fl_Window *window = [cw getFl_Window];
+ if (!window) return; // may happen after closing full-screen window
+ fl_lock_function();
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
CGContextRef gc = views_use_CA ? [[NSGraphicsContext currentContext] CGContext] : NULL;
#endif