summaryrefslogtreecommitdiff
path: root/src/nsfns.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/nsfns.m')
-rw-r--r--src/nsfns.m36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 0f879fe390c..cbde93b3f10 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -255,7 +255,10 @@ ns_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
[col getRed: &r green: &g blue: &b alpha: &alpha];
FRAME_FOREGROUND_PIXEL (f) =
- ARGB_TO_ULONG ((int)(alpha*0xff), (int)(r*0xff), (int)(g*0xff), (int)(b*0xff));
+ ARGB_TO_ULONG ((unsigned long) (alpha * 0xff),
+ (unsigned long) (r * 0xff),
+ (unsigned long) (g * 0xff),
+ (unsigned long) (b * 0xff));
if (FRAME_NS_VIEW (f))
{
@@ -284,19 +287,16 @@ ns_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
error ("Unknown color");
}
- /* Clear the frame; in some instances the NS-internal GC appears not
- to update, or it does update and cannot clear old text
- properly. */
- if (FRAME_VISIBLE_P (f))
- ns_clear_frame (f);
-
[col retain];
[f->output_data.ns->background_color release];
f->output_data.ns->background_color = col;
[col getRed: &r green: &g blue: &b alpha: &alpha];
FRAME_BACKGROUND_PIXEL (f) =
- ARGB_TO_ULONG ((int)(alpha*0xff), (int)(r*0xff), (int)(g*0xff), (int)(b*0xff));
+ ARGB_TO_ULONG ((unsigned long) (alpha * 0xff),
+ (unsigned long) (r * 0xff),
+ (unsigned long) (g * 0xff),
+ (unsigned long) (b * 0xff));
if (view != nil)
{
@@ -318,7 +318,10 @@ ns_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
}
if (FRAME_VISIBLE_P (f))
- SET_FRAME_GARBAGED (f);
+ {
+ SET_FRAME_GARBAGED (f);
+ ns_clear_frame (f);
+ }
}
unblock_input ();
}
@@ -1271,14 +1274,20 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
#ifdef NS_IMPL_COCOA
tem = gui_display_get_arg (dpyinfo, parms, Qns_appearance, NULL, NULL,
RES_TYPE_SYMBOL);
- FRAME_NS_APPEARANCE (f) = EQ (tem, Qdark)
- ? ns_appearance_vibrant_dark : ns_appearance_aqua;
- store_frame_param (f, Qns_appearance, tem);
+ if (EQ (tem, Qdark))
+ FRAME_NS_APPEARANCE (f) = ns_appearance_vibrant_dark;
+ else if (EQ (tem, Qlight))
+ FRAME_NS_APPEARANCE (f) = ns_appearance_aqua;
+ else
+ FRAME_NS_APPEARANCE (f) = ns_appearance_system_default;
+ store_frame_param (f, Qns_appearance,
+ (!NILP (tem) && !EQ (tem, Qunbound)) ? tem : Qnil);
tem = gui_display_get_arg (dpyinfo, parms, Qns_transparent_titlebar,
NULL, NULL, RES_TYPE_BOOLEAN);
FRAME_NS_TRANSPARENT_TITLEBAR (f) = !NILP (tem) && !EQ (tem, Qunbound);
- store_frame_param (f, Qns_transparent_titlebar, tem);
+ store_frame_param (f, Qns_transparent_titlebar,
+ FRAME_NS_TRANSPARENT_TITLEBAR (f) ? Qt : Qnil);
#endif
parent_frame = gui_display_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL,
@@ -3112,6 +3121,7 @@ syms_of_nsfns (void)
DEFSYM (Qframe_title_format, "frame-title-format");
DEFSYM (Qicon_title_format, "icon-title-format");
DEFSYM (Qdark, "dark");
+ DEFSYM (Qlight, "light");
DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist,
doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames.