modules/graphics/src/main/native-glass/mac/GlassWindow+Overrides.m

Print this page




  97     (*env)->CallVoidMethod(env, self->jWindow, jWindowNotifyFocus, com_sun_glass_events_WindowEvent_FOCUS_LOST);
  98 }
  99 
 100 - (void)windowWillClose:(NSNotification *)notification
 101 {
 102     // Unparent self. Otherwise the code hangs
 103     if ([self->nsWindow parentWindow])
 104     {
 105         [[self->nsWindow parentWindow] removeChildWindow:self->nsWindow];
 106     }
 107 
 108     // Finally, close owned windows to mimic MS Windows behavior
 109     NSArray *children = [self->nsWindow childWindows];
 110     for (NSUInteger i=0; i<[children count]; i++)
 111     {
 112         NSWindow *child = (NSWindow*)[children objectAtIndex:i];
 113         [child close];
 114     }
 115     
 116     // Call the notification method
 117     GET_MAIN_JENV;


 118     (*env)->CallVoidMethod(env, self->jWindow, jWindowNotifyDestroy);

 119 }
 120 
 121 - (void)windowWillMove:(NSNotification *)notification
 122 {
 123     //NSLog(@"windowWillMove");
 124 }
 125 
 126 - (void)windowDidMove:(NSNotification *)notification
 127 {
 128     //NSLog(@"windowDidMove");
 129     [self _sendJavaWindowMoveEventForFrame:[self _flipFrame]];
 130 }
 131 
 132 - (void)windowDidChangeBackingProperties:(NSNotification *)notification
 133 {
 134     // The spec for [NSWindow backingScaleFactor] only mentions 1.0 and 2.0
 135     // whereas NSScreen's one is more generic. So use the latter.
 136     if ([self->nsWindow screen]) {
 137         [self->view notifyScaleFactorChanged:GetScreenScaleFactor([self->nsWindow screen])];
 138     }




  97     (*env)->CallVoidMethod(env, self->jWindow, jWindowNotifyFocus, com_sun_glass_events_WindowEvent_FOCUS_LOST);
  98 }
  99 
 100 - (void)windowWillClose:(NSNotification *)notification
 101 {
 102     // Unparent self. Otherwise the code hangs
 103     if ([self->nsWindow parentWindow])
 104     {
 105         [[self->nsWindow parentWindow] removeChildWindow:self->nsWindow];
 106     }
 107 
 108     // Finally, close owned windows to mimic MS Windows behavior
 109     NSArray *children = [self->nsWindow childWindows];
 110     for (NSUInteger i=0; i<[children count]; i++)
 111     {
 112         NSWindow *child = (NSWindow*)[children objectAtIndex:i];
 113         [child close];
 114     }
 115     
 116     // Call the notification method
 117     assert(pthread_main_np() == 1);
 118     JNIEnv *env = jEnv;
 119     if (env != NULL) {
 120         (*env)->CallVoidMethod(env, self->jWindow, jWindowNotifyDestroy);
 121     }
 122 }
 123 
 124 - (void)windowWillMove:(NSNotification *)notification
 125 {
 126     //NSLog(@"windowWillMove");
 127 }
 128 
 129 - (void)windowDidMove:(NSNotification *)notification
 130 {
 131     //NSLog(@"windowDidMove");
 132     [self _sendJavaWindowMoveEventForFrame:[self _flipFrame]];
 133 }
 134 
 135 - (void)windowDidChangeBackingProperties:(NSNotification *)notification
 136 {
 137     // The spec for [NSWindow backingScaleFactor] only mentions 1.0 and 2.0
 138     // whereas NSScreen's one is more generic. So use the latter.
 139     if ([self->nsWindow screen]) {
 140         [self->view notifyScaleFactorChanged:GetScreenScaleFactor([self->nsWindow screen])];
 141     }