aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2011-09-03 16:03:38 -0700
committerPaul Eggert <[email protected]>2011-09-03 16:03:38 -0700
commitb49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch)
tree9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /src/nsterm.m
parent74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff)
parentbc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff)
Merge from trunk.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index d4b1a3f847..4c9574c35b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1341,7 +1341,7 @@ unsigned long
ns_index_color (NSColor *color, struct frame *f)
{
struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table;
- int idx;
+ ptrdiff_t idx;
NSNumber *index;
if (!color_table->colors)
@@ -1356,7 +1356,7 @@ ns_index_color (NSColor *color, struct frame *f)
/* do we already have this color ? */
{
- int i;
+ ptrdiff_t i;
for (i = 1; i < color_table->avail; i++)
{
if (color_table->colors[i] && [color_table->colors[i] isEqual: color])
@@ -1371,17 +1371,14 @@ ns_index_color (NSColor *color, struct frame *f)
{
index = [color_table->empty_indices anyObject];
[color_table->empty_indices removeObject: index];
- idx = [index unsignedIntValue];
+ idx = [index unsignedLongValue];
}
else
{
if (color_table->avail == color_table->size)
- {
- color_table->size += NS_COLOR_CAPACITY;
- color_table->colors
- = (NSColor **)xrealloc (color_table->colors,
- color_table->size * sizeof (NSColor *));
- }
+ color_table->colors =
+ xpalloc (color_table->colors, &color_table->size, 1,
+ min (ULONG_MAX, PTRDIFF_MAX), sizeof *color_table->colors);
idx = color_table->avail++;
}
@@ -2321,7 +2318,7 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
if (!img)
{
unsigned short *bits = p->bits + p->dh;
- int len = 8 * p->h/8;
+ int len = p->h;
int i;
unsigned char *cbits = xmalloc (len);
@@ -4257,6 +4254,16 @@ ns_term_shutdown (int sig)
/* NSTRACE (sendEvent); */
/*fprintf (stderr, "received event of type %d\t%d\n", type);*/
+#ifdef NS_IMPL_COCOA
+ if (type == NSApplicationDefined
+ && [theEvent data2] == NSAPP_DATA2_RUNASSCRIPT)
+ {
+ ns_run_ascript ();
+ [self stop: self];
+ return;
+ }
+#endif
+
if (type == NSCursorUpdate && window == nil)
{
fprintf (stderr, "Dropping external cursor update event.\n");
@@ -4857,7 +4864,7 @@ ns_term_shutdown (int sig)
}
}
-
+
#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
/* if we get here we should send the key for input manager processing */
if (firstTime && [[NSInputManager currentInputManager]