static EmacsScroller *last_mouse_scroll_bar = nil;
static struct frame *ns_updating_frame;
static NSView *focus_view = NULL;
-static int ns_window_num =0;
+static int ns_window_num = 0;
static NSRect uRect;
static BOOL gsaved = NO;
BOOL ns_in_resize = NO;
[[view window] miniaturize: NSApp];
}
+/* Free X resources of frame F. */
void
-x_destroy_window (struct frame *f)
-/* --------------------------------------------------------------------------
- External: Delete the window
- -------------------------------------------------------------------------- */
+x_free_frame_resources (struct frame *f)
{
NSView *view = FRAME_NS_VIEW (f);
struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
[[view window] close];
[view release];
- ns_window_num--;
UNBLOCK_INPUT;
}
+void
+x_destroy_window (struct frame *f)
+/* --------------------------------------------------------------------------
+ External: Delete the window
+ -------------------------------------------------------------------------- */
+{
+ NSTRACE (x_destroy_window);
+ check_ns ();
+ x_free_frame_resources (f);
+ ns_window_num--;
+}
+
void
x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
/* Currently on NS img->mask is always 0. Since
get_window_cursor_type specifies a hollow box cursor when on
a non-masked image we never reach this clause. But we put it
- in in antipication of better support for image masks on
+ in in anticipation of better support for image masks on
NS. */
tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
}
/* If there is no mask, the background won't be seen,
so draw a rectangle on the image for the cursor.
- Do this for all images, getting trancparency right is not reliable. */
+ Do this for all images, getting transparency right is not reliable. */
if (s->hl == DRAW_CURSOR)
{
int thickness = abs (s->img->relief);
//ns_app_active=YES;
ns_update_auto_hide_menu_bar ();
- // No constrining takes place when the application is not active.
+ // No constraining takes place when the application is not active.
ns_constrain_all_frames ();
}
- (void)applicationDidResignActive: (NSNotification *)notification
a "windowDidResize" which calls x_set_window_size). */
#ifndef NS_IMPL_GNUSTEP
if (cols > 0 && rows > 0)
- x_set_window_size (emacsframe, 0, cols, rows);
+ {
+ if (ns_in_resize)
+ x_set_window_size (emacsframe, 0, cols, rows);
+ else
+ {
+ NSWindow *window = [self window];
+ NSRect wr = [window frame];
+ FRAME_PIXEL_WIDTH (emacsframe) = (int)wr.size.width
+ - emacsframe->border_width;
+ FRAME_PIXEL_HEIGHT (emacsframe) = (int)wr.size.height
+ - FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
+ - FRAME_TOOLBAR_HEIGHT (emacsframe);
+ change_frame_size (emacsframe, rows, cols, 0, 0, 1);
+ SET_FRAME_GARBAGED (emacsframe);
+ cancel_mouse_face (emacsframe);
+ }
+ }
#endif
ns_send_appdefined (-1);