Commit d9d38314 authored by Jan Djärv's avatar Jan Djärv
Browse files

More flicker fixes for OSX, related to bug 18757.

* nsfns.m (ns_set_name_as_filename): Don't set represented filename
at once, call ns_set_represented_filename instead.

* nsterm.h: Declare ns_set_represented_filename.

* nsterm.m (represented_filename, represented_frame): New variables.
(ns_set_represented_filename): New function.
(sendEvent:): Set represented filename here to avoid flicker,
related to Bug#18757.
parent 02d462b2
2014-12-02 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (represented_filename, represented_frame): New variables.
(ns_set_represented_filename): New function.
(sendEvent:): Set represented filename here to avoid flicker,
related to Bug#18757.
* nsterm.h: Declare ns_set_represented_filename.
* nsfns.m (ns_set_name_as_filename): Don't set represented filename
at once, call ns_set_represented_filename instead.
2014-11-27 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (handle_single_display_spec): When ignoring a fringe
......
......@@ -621,18 +621,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
fstr = [NSString stringWithUTF8String: SSDATA (encoded_filename)];
if (fstr == nil) fstr = @"";
#ifdef NS_IMPL_COCOA
/* work around a bug observed on 10.3 and later where
setTitleWithRepresentedFilename does not clear out previous state
if given filename does not exist */
if (! [[NSFileManager defaultManager] fileExistsAtPath: fstr])
[[view window] setRepresentedFilename: @""];
#endif
}
else
fstr = @"";
[[view window] setRepresentedFilename: fstr];
ns_set_represented_filename (fstr, f);
[[view window] setTitle: str];
fset_name (f, name);
}
......
......@@ -895,11 +895,15 @@ extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
extern unsigned long ns_get_rgb_color (struct frame *f,
float r, float g, float b, float a);
/* From nsterm.m, needed in nsfont.m. */
#ifdef __OBJC__
/* From nsterm.m, needed in nsfont.m. */
extern void
ns_draw_text_decoration (struct glyph_string *s, struct face *face,
NSColor *defaultCol, CGFloat width, CGFloat x);
/* Needed in nsfns.m. */
extern void
ns_set_represented_filename (NSString* fstr, struct frame *f);
#endif
#ifdef NS_IMPL_GNUSTEP
......
......@@ -290,6 +290,9 @@ - (NSColor *)colorUsingDefaultColorSpace
NULL, 0, 0
};
static NSString *represented_filename = nil;
static struct frame *represented_frame = 0;
#ifdef NS_IMPL_COCOA
/*
* State for pending menu activation:
......@@ -396,6 +399,14 @@ - (NSColor *)colorUsingDefaultColorSpace
========================================================================== */
void
ns_set_represented_filename (NSString* fstr, struct frame *f)
{
represented_filename = [fstr retain];
represented_frame = f;
}
static void
hold_event (struct input_event *event)
{
......@@ -4560,6 +4571,23 @@ - (void)sendEvent: (NSEvent *)theEvent
}
#endif
if (represented_filename != nil && represented_frame)
{
NSString *fstr = represented_filename;
NSView *view = FRAME_NS_VIEW (represented_frame);
#ifdef NS_IMPL_COCOA
/* work around a bug observed on 10.3 and later where
setTitleWithRepresentedFilename does not clear out previous state
if given filename does not exist */
if (! [[NSFileManager defaultManager] fileExistsAtPath: fstr])
[[view window] setRepresentedFilename: @""];
#endif
[[view window] setRepresentedFilename: fstr];
[represented_filename release];
represented_filename = nil;
represented_frame = NULL;
}
if (type == NSApplicationDefined)
{
switch ([theEvent data2])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment