diff options
| author | Jan Djärv | 2011-11-05 13:25:01 +0100 |
|---|---|---|
| committer | Jan Djärv | 2011-11-05 13:25:01 +0100 |
| commit | a97f8f3f16c6370acb0076011588822e572fa589 (patch) | |
| tree | f5c322496afd1a62b4f8b37090f35bf403b3dac6 /src | |
| parent | c9e7db78eff4bd8cf9e6abe3d33eb83c7d6cbf00 (diff) | |
| download | emacs-a97f8f3f16c6370acb0076011588822e572fa589.tar.gz emacs-a97f8f3f16c6370acb0076011588822e572fa589.zip | |
* nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
(unwind_create_frame): New function.
(Fx_create_frame): Restructure code to be more similar to the one in
xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
Move terminal->reference_count++ just before making the frame official
(Bug#9943).
* nsterm.m (x_free_frame_resources): New function.
(x_destroy_window): Move code to x_free_frame_resources.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/nsfns.m | 208 | ||||
| -rw-r--r-- | src/nsterm.m | 21 |
3 files changed, 140 insertions, 100 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2bad4e388d0..c66692ca7c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2011-11-05 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2011-11-05 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG. | ||
| 4 | (unwind_create_frame): New function (Bug#9943). | ||
| 5 | (Fx_create_frame): Restructure code to be more similar to the one in | ||
| 6 | xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943). | ||
| 7 | Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943). | ||
| 8 | Move terminal->reference_count++ just before making the frame official | ||
| 9 | (Bug#9943). | ||
| 10 | |||
| 11 | * nsterm.m (x_free_frame_resources): New function. | ||
| 12 | (x_destroy_window): Move code to x_free_frame_resources. | ||
| 13 | |||
| 3 | * xfns.c (unwind_create_frame): Fix comment. | 14 | * xfns.c (unwind_create_frame): Fix comment. |
| 4 | (Fx_create_frame, x_create_tip_frame): Move | 15 | (Fx_create_frame, x_create_tip_frame): Move |
| 5 | terminal->reference_count++ just before making the frame | 16 | terminal->reference_count++ just before making the frame |
diff --git a/src/nsfns.m b/src/nsfns.m index a09011d8461..23362433a39 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -101,6 +101,10 @@ extern BOOL ns_in_resize; | |||
| 101 | static Lisp_Object as_script, *as_result; | 101 | static Lisp_Object as_script, *as_result; |
| 102 | static int as_status; | 102 | static int as_status; |
| 103 | 103 | ||
| 104 | #if GLYPH_DEBUG | ||
| 105 | static ptrdiff_t image_cache_refcount; | ||
| 106 | #endif | ||
| 107 | |||
| 104 | /* ========================================================================== | 108 | /* ========================================================================== |
| 105 | 109 | ||
| 106 | Internal utility functions | 110 | Internal utility functions |
| @@ -1038,6 +1042,41 @@ frame_parm_handler ns_frame_parm_handlers[] = | |||
| 1038 | }; | 1042 | }; |
| 1039 | 1043 | ||
| 1040 | 1044 | ||
| 1045 | /* Handler for signals raised during x_create_frame. | ||
| 1046 | FRAME is the frame which is partially constructed. */ | ||
| 1047 | |||
| 1048 | static Lisp_Object | ||
| 1049 | unwind_create_frame (Lisp_Object frame) | ||
| 1050 | { | ||
| 1051 | struct frame *f = XFRAME (frame); | ||
| 1052 | |||
| 1053 | /* If frame is already dead, nothing to do. This can happen if the | ||
| 1054 | display is disconnected after the frame has become official, but | ||
| 1055 | before x_create_frame removes the unwind protect. */ | ||
| 1056 | if (!FRAME_LIVE_P (f)) | ||
| 1057 | return Qnil; | ||
| 1058 | |||
| 1059 | /* If frame is ``official'', nothing to do. */ | ||
| 1060 | if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame)) | ||
| 1061 | { | ||
| 1062 | #if GLYPH_DEBUG && XASSERTS | ||
| 1063 | struct ns_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | ||
| 1064 | #endif | ||
| 1065 | |||
| 1066 | x_free_frame_resources (f); | ||
| 1067 | free_glyphs (f); | ||
| 1068 | |||
| 1069 | #if GLYPH_DEBUG | ||
| 1070 | /* Check that reference counts are indeed correct. */ | ||
| 1071 | xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); | ||
| 1072 | #endif | ||
| 1073 | return Qt; | ||
| 1074 | } | ||
| 1075 | |||
| 1076 | return Qnil; | ||
| 1077 | } | ||
| 1078 | |||
| 1079 | |||
| 1041 | 1080 | ||
| 1042 | /* ========================================================================== | 1081 | /* ========================================================================== |
| 1043 | 1082 | ||
| @@ -1047,46 +1086,50 @@ frame_parm_handler ns_frame_parm_handlers[] = | |||
| 1047 | 1086 | ||
| 1048 | DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, | 1087 | DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
| 1049 | 1, 1, 0, | 1088 | 1, 1, 0, |
| 1050 | doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms. | 1089 | doc: /* Make a new Nextstep window, called a "frame" in Emacs terms. |
| 1051 | Return an Emacs frame object. | 1090 | Return an Emacs frame object. |
| 1052 | PARMS is an alist of frame parameters. | 1091 | PARMS is an alist of frame parameters. |
| 1053 | If the parameters specify that the frame should not have a minibuffer, | 1092 | If the parameters specify that the frame should not have a minibuffer, |
| 1054 | and do not specify a specific minibuffer window to use, | 1093 | and do not specify a specific minibuffer window to use, |
| 1055 | then `default-minibuffer-frame' must be a frame whose minibuffer can | 1094 | then `default-minibuffer-frame' must be a frame whose minibuffer can |
| 1056 | be shared by the new frame. */) | 1095 | be shared by the new frame. |
| 1096 | |||
| 1097 | This function is an internal primitive--use `make-frame' instead. */) | ||
| 1057 | (Lisp_Object parms) | 1098 | (Lisp_Object parms) |
| 1058 | { | 1099 | { |
| 1059 | static int desc_ctr = 1; | ||
| 1060 | struct frame *f; | 1100 | struct frame *f; |
| 1061 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | ||
| 1062 | Lisp_Object frame, tem; | 1101 | Lisp_Object frame, tem; |
| 1063 | Lisp_Object name; | 1102 | Lisp_Object name; |
| 1064 | int minibuffer_only = 0; | 1103 | int minibuffer_only = 0; |
| 1104 | int window_prompting = 0; | ||
| 1105 | int width, height; | ||
| 1065 | int count = specpdl_ptr - specpdl; | 1106 | int count = specpdl_ptr - specpdl; |
| 1107 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | ||
| 1066 | Lisp_Object display; | 1108 | Lisp_Object display; |
| 1067 | struct ns_display_info *dpyinfo = NULL; | 1109 | struct ns_display_info *dpyinfo = NULL; |
| 1068 | Lisp_Object parent; | 1110 | Lisp_Object parent; |
| 1069 | struct kboard *kb; | 1111 | struct kboard *kb; |
| 1070 | Lisp_Object tfont, tfontsize; | 1112 | Lisp_Object tfont, tfontsize; |
| 1071 | int window_prompting = 0; | 1113 | static int desc_ctr = 1; |
| 1072 | int width, height; | ||
| 1073 | 1114 | ||
| 1074 | check_ns (); | 1115 | check_ns (); |
| 1075 | 1116 | ||
| 1076 | /* Seems a little strange, but other terms do it. Perhaps the code below | 1117 | /* x_get_arg modifies parms. */ |
| 1077 | is modifying something? */ | ||
| 1078 | parms = Fcopy_alist (parms); | 1118 | parms = Fcopy_alist (parms); |
| 1079 | 1119 | ||
| 1120 | /* Use this general default value to start with | ||
| 1121 | until we know if this frame has a specified name. */ | ||
| 1122 | Vx_resource_name = Vinvocation_name; | ||
| 1123 | |||
| 1080 | display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING); | 1124 | display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING); |
| 1081 | if (EQ (display, Qunbound)) | 1125 | if (EQ (display, Qunbound)) |
| 1082 | display = Qnil; | 1126 | display = Qnil; |
| 1083 | dpyinfo = check_ns_display_info (display); | 1127 | dpyinfo = check_ns_display_info (display); |
| 1128 | kb = dpyinfo->terminal->kboard; | ||
| 1084 | 1129 | ||
| 1085 | if (!dpyinfo->terminal->name) | 1130 | if (!dpyinfo->terminal->name) |
| 1086 | error ("Terminal is not live, can't create new frames on it"); | 1131 | error ("Terminal is not live, can't create new frames on it"); |
| 1087 | 1132 | ||
| 1088 | kb = dpyinfo->terminal->kboard; | ||
| 1089 | |||
| 1090 | name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING); | 1133 | name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING); |
| 1091 | if (!STRINGP (name) | 1134 | if (!STRINGP (name) |
| 1092 | && ! EQ (name, Qunbound) | 1135 | && ! EQ (name, Qunbound) |
| @@ -1095,8 +1138,6 @@ be shared by the new frame. */) | |||
| 1095 | 1138 | ||
| 1096 | if (STRINGP (name)) | 1139 | if (STRINGP (name)) |
| 1097 | Vx_resource_name = name; | 1140 | Vx_resource_name = name; |
| 1098 | else | ||
| 1099 | Vx_resource_name = Vinvocation_name; | ||
| 1100 | 1141 | ||
| 1101 | parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER); | 1142 | parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER); |
| 1102 | if (EQ (parent, Qunbound)) | 1143 | if (EQ (parent, Qunbound)) |
| @@ -1104,57 +1145,36 @@ be shared by the new frame. */) | |||
| 1104 | if (! NILP (parent)) | 1145 | if (! NILP (parent)) |
| 1105 | CHECK_NUMBER (parent); | 1146 | CHECK_NUMBER (parent); |
| 1106 | 1147 | ||
| 1148 | /* make_frame_without_minibuffer can run Lisp code and garbage collect. */ | ||
| 1149 | /* No need to protect DISPLAY because that's not used after passing | ||
| 1150 | it to make_frame_without_minibuffer. */ | ||
| 1107 | frame = Qnil; | 1151 | frame = Qnil; |
| 1108 | GCPRO4 (parms, parent, name, frame); | 1152 | GCPRO4 (parms, parent, name, frame); |
| 1109 | |||
| 1110 | tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", | 1153 | tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", |
| 1111 | RES_TYPE_SYMBOL); | 1154 | RES_TYPE_SYMBOL); |
| 1112 | if (EQ (tem, Qnone) || NILP (tem)) | 1155 | if (EQ (tem, Qnone) || NILP (tem)) |
| 1113 | { | ||
| 1114 | f = make_frame_without_minibuffer (Qnil, kb, display); | 1156 | f = make_frame_without_minibuffer (Qnil, kb, display); |
| 1115 | } | ||
| 1116 | else if (EQ (tem, Qonly)) | 1157 | else if (EQ (tem, Qonly)) |
| 1117 | { | 1158 | { |
| 1118 | f = make_minibuffer_frame (); | 1159 | f = make_minibuffer_frame (); |
| 1119 | minibuffer_only = 1; | 1160 | minibuffer_only = 1; |
| 1120 | } | 1161 | } |
| 1121 | else if (WINDOWP (tem)) | 1162 | else if (WINDOWP (tem)) |
| 1122 | { | ||
| 1123 | f = make_frame_without_minibuffer (tem, kb, display); | 1163 | f = make_frame_without_minibuffer (tem, kb, display); |
| 1124 | } | ||
| 1125 | else | 1164 | else |
| 1126 | { | ||
| 1127 | f = make_frame (1); | 1165 | f = make_frame (1); |
| 1128 | } | ||
| 1129 | |||
| 1130 | /* Set the name; the functions to which we pass f expect the name to | ||
| 1131 | be set. */ | ||
| 1132 | if (EQ (name, Qunbound) || NILP (name) || (XTYPE (name) != Lisp_String)) | ||
| 1133 | { | ||
| 1134 | f->name = build_string ([ns_app_name UTF8String]); | ||
| 1135 | f->explicit_name =0; | ||
| 1136 | } | ||
| 1137 | else | ||
| 1138 | { | ||
| 1139 | f->name = name; | ||
| 1140 | f->explicit_name = 1; | ||
| 1141 | specbind (Qx_resource_name, name); | ||
| 1142 | } | ||
| 1143 | 1166 | ||
| 1144 | XSETFRAME (frame, f); | 1167 | XSETFRAME (frame, f); |
| 1145 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; | 1168 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; |
| 1146 | 1169 | ||
| 1147 | f->terminal = dpyinfo->terminal; | 1170 | f->terminal = dpyinfo->terminal; |
| 1148 | f->terminal->reference_count++; | ||
| 1149 | 1171 | ||
| 1150 | f->output_method = output_ns; | 1172 | f->output_method = output_ns; |
| 1151 | f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns)); | 1173 | f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns)); |
| 1152 | memset (f->output_data.ns, 0, sizeof (*(f->output_data.ns))); | 1174 | memset (f->output_data.ns, 0, sizeof *(f->output_data.ns)); |
| 1153 | 1175 | ||
| 1154 | FRAME_FONTSET (f) = -1; | 1176 | FRAME_FONTSET (f) = -1; |
| 1155 | 1177 | ||
| 1156 | /* record_unwind_protect (unwind_create_frame, frame); safety; maybe later? */ | ||
| 1157 | |||
| 1158 | f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", | 1178 | f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", |
| 1159 | RES_TYPE_STRING); | 1179 | RES_TYPE_STRING); |
| 1160 | if (! STRINGP (f->icon_name)) | 1180 | if (! STRINGP (f->icon_name)) |
| @@ -1162,6 +1182,9 @@ be shared by the new frame. */) | |||
| 1162 | 1182 | ||
| 1163 | FRAME_NS_DISPLAY_INFO (f) = dpyinfo; | 1183 | FRAME_NS_DISPLAY_INFO (f) = dpyinfo; |
| 1164 | 1184 | ||
| 1185 | /* With FRAME_NS_DISPLAY_INFO set up, this unwind-protect is safe. */ | ||
| 1186 | record_unwind_protect (unwind_create_frame, frame); | ||
| 1187 | |||
| 1165 | f->output_data.ns->window_desc = desc_ctr++; | 1188 | f->output_data.ns->window_desc = desc_ctr++; |
| 1166 | if (!NILP (parent)) | 1189 | if (!NILP (parent)) |
| 1167 | { | 1190 | { |
| @@ -1174,6 +1197,20 @@ be shared by the new frame. */) | |||
| 1174 | f->output_data.ns->explicit_parent = 0; | 1197 | f->output_data.ns->explicit_parent = 0; |
| 1175 | } | 1198 | } |
| 1176 | 1199 | ||
| 1200 | /* Set the name; the functions to which we pass f expect the name to | ||
| 1201 | be set. */ | ||
| 1202 | if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name)) | ||
| 1203 | { | ||
| 1204 | f->name = build_string ([ns_app_name UTF8String]); | ||
| 1205 | f->explicit_name = 0; | ||
| 1206 | } | ||
| 1207 | else | ||
| 1208 | { | ||
| 1209 | f->name = name; | ||
| 1210 | f->explicit_name = 1; | ||
| 1211 | specbind (Qx_resource_name, name); | ||
| 1212 | } | ||
| 1213 | |||
| 1177 | f->resx = dpyinfo->resx; | 1214 | f->resx = dpyinfo->resx; |
| 1178 | f->resy = dpyinfo->resy; | 1215 | f->resy = dpyinfo->resy; |
| 1179 | 1216 | ||
| @@ -1223,11 +1260,15 @@ be shared by the new frame. */) | |||
| 1223 | "leftFringe", "LeftFringe", RES_TYPE_NUMBER); | 1260 | "leftFringe", "LeftFringe", RES_TYPE_NUMBER); |
| 1224 | x_default_parameter (f, parms, Qright_fringe, Qnil, | 1261 | x_default_parameter (f, parms, Qright_fringe, Qnil, |
| 1225 | "rightFringe", "RightFringe", RES_TYPE_NUMBER); | 1262 | "rightFringe", "RightFringe", RES_TYPE_NUMBER); |
| 1226 | /* end PENDING */ | ||
| 1227 | 1263 | ||
| 1228 | init_frame_faces (f); | 1264 | #if GLYPH_DEBUG |
| 1265 | image_cache_refcount = | ||
| 1266 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 1267 | #endif | ||
| 1229 | 1268 | ||
| 1230 | /* The X resources controlling the menu-bar and tool-bar are | 1269 | init_frame_faces (f); |
| 1270 | |||
| 1271 | /* The resources controlling the menu-bar and tool-bar are | ||
| 1231 | processed specially at startup, and reflected in the mode | 1272 | processed specially at startup, and reflected in the mode |
| 1232 | variables; ignore them here. */ | 1273 | variables; ignore them here. */ |
| 1233 | x_default_parameter (f, parms, Qmenu_bar_lines, | 1274 | x_default_parameter (f, parms, Qmenu_bar_lines, |
| @@ -1244,38 +1285,6 @@ be shared by the new frame. */) | |||
| 1244 | x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", | 1285 | x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", |
| 1245 | RES_TYPE_STRING); | 1286 | RES_TYPE_STRING); |
| 1246 | 1287 | ||
| 1247 | /* TODO: other terms seem to get away w/o this complexity.. */ | ||
| 1248 | if (NILP (Fassq (Qwidth, parms))) | ||
| 1249 | { | ||
| 1250 | Lisp_Object value | ||
| 1251 | = x_get_arg (dpyinfo, parms, Qwidth, "width", "Width", | ||
| 1252 | RES_TYPE_NUMBER); | ||
| 1253 | if (! EQ (value, Qunbound)) | ||
| 1254 | parms = Fcons (Fcons (Qwidth, value), parms); | ||
| 1255 | } | ||
| 1256 | if (NILP (Fassq (Qheight, parms))) | ||
| 1257 | { | ||
| 1258 | Lisp_Object value | ||
| 1259 | = x_get_arg (dpyinfo, parms, Qheight, "height", "Height", | ||
| 1260 | RES_TYPE_NUMBER); | ||
| 1261 | if (! EQ (value, Qunbound)) | ||
| 1262 | parms = Fcons (Fcons (Qheight, value), parms); | ||
| 1263 | } | ||
| 1264 | if (NILP (Fassq (Qleft, parms))) | ||
| 1265 | { | ||
| 1266 | Lisp_Object value | ||
| 1267 | = x_get_arg (dpyinfo, parms, Qleft, "left", "Left", RES_TYPE_NUMBER); | ||
| 1268 | if (! EQ (value, Qunbound)) | ||
| 1269 | parms = Fcons (Fcons (Qleft, value), parms); | ||
| 1270 | } | ||
| 1271 | if (NILP (Fassq (Qtop, parms))) | ||
| 1272 | { | ||
| 1273 | Lisp_Object value | ||
| 1274 | = x_get_arg (dpyinfo, parms, Qtop, "top", "Top", RES_TYPE_NUMBER); | ||
| 1275 | if (! EQ (value, Qunbound)) | ||
| 1276 | parms = Fcons (Fcons (Qtop, value), parms); | ||
| 1277 | } | ||
| 1278 | |||
| 1279 | window_prompting = x_figure_window_size (f, parms, 1); | 1288 | window_prompting = x_figure_window_size (f, parms, 1); |
| 1280 | 1289 | ||
| 1281 | tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); | 1290 | tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); |
| @@ -1297,23 +1306,27 @@ be shared by the new frame. */) | |||
| 1297 | 1306 | ||
| 1298 | x_icon (f, parms); | 1307 | x_icon (f, parms); |
| 1299 | 1308 | ||
| 1309 | /* ns_display_info does not have a reference_count. */ | ||
| 1310 | f->terminal->reference_count++; | ||
| 1311 | |||
| 1300 | /* It is now ok to make the frame official even if we get an error below. | 1312 | /* It is now ok to make the frame official even if we get an error below. |
| 1301 | The frame needs to be on Vframe_list or making it visible won't work. */ | 1313 | The frame needs to be on Vframe_list or making it visible won't work. */ |
| 1302 | Vframe_list = Fcons (frame, Vframe_list); | 1314 | Vframe_list = Fcons (frame, Vframe_list); |
| 1303 | /*FRAME_NS_DISPLAY_INFO (f)->reference_count++; */ | 1315 | |
| 1304 | 1316 | x_default_parameter (f, parms, Qicon_type, Qnil, | |
| 1305 | x_default_parameter (f, parms, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon", | 1317 | "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL); |
| 1306 | RES_TYPE_SYMBOL); | 1318 | |
| 1307 | x_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower", | 1319 | x_default_parameter (f, parms, Qauto_raise, Qnil, |
| 1308 | RES_TYPE_BOOLEAN); | 1320 | "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
| 1309 | x_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoLower", | 1321 | x_default_parameter (f, parms, Qauto_lower, Qnil, |
| 1310 | RES_TYPE_BOOLEAN); | 1322 | "autoLower", "AutoLower", RES_TYPE_BOOLEAN); |
| 1311 | x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType", | 1323 | x_default_parameter (f, parms, Qcursor_type, Qbox, |
| 1312 | RES_TYPE_SYMBOL); | 1324 | "cursorType", "CursorType", RES_TYPE_SYMBOL); |
| 1313 | x_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth", | 1325 | x_default_parameter (f, parms, Qscroll_bar_width, Qnil, |
| 1314 | "ScrollBarWidth", RES_TYPE_NUMBER); | 1326 | "scrollBarWidth", "ScrollBarWidth", |
| 1315 | x_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha", | 1327 | RES_TYPE_NUMBER); |
| 1316 | RES_TYPE_NUMBER); | 1328 | x_default_parameter (f, parms, Qalpha, Qnil, |
| 1329 | "alpha", "Alpha", RES_TYPE_NUMBER); | ||
| 1317 | 1330 | ||
| 1318 | width = FRAME_COLS (f); | 1331 | width = FRAME_COLS (f); |
| 1319 | height = FRAME_LINES (f); | 1332 | height = FRAME_LINES (f); |
| @@ -1324,20 +1337,24 @@ be shared by the new frame. */) | |||
| 1324 | 1337 | ||
| 1325 | if (! f->output_data.ns->explicit_parent) | 1338 | if (! f->output_data.ns->explicit_parent) |
| 1326 | { | 1339 | { |
| 1327 | tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); | 1340 | Lisp_Object visibility; |
| 1328 | if (EQ (tem, Qunbound)) | 1341 | |
| 1329 | tem = Qt; | 1342 | visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, |
| 1330 | x_set_visibility (f, tem, Qnil); | 1343 | RES_TYPE_SYMBOL); |
| 1331 | if (EQ (tem, Qicon)) | 1344 | if (EQ (visibility, Qunbound)) |
| 1345 | visibility = Qt; | ||
| 1346 | |||
| 1347 | if (EQ (visibility, Qicon)) | ||
| 1332 | x_iconify_frame (f); | 1348 | x_iconify_frame (f); |
| 1333 | else if (! NILP (tem)) | 1349 | else if (! NILP (visibility)) |
| 1334 | { | 1350 | { |
| 1335 | x_make_frame_visible (f); | 1351 | x_make_frame_visible (f); |
| 1336 | f->async_visible = 1; | ||
| 1337 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; | 1352 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; |
| 1338 | } | 1353 | } |
| 1339 | else | 1354 | else |
| 1340 | f->async_visible = 0; | 1355 | { |
| 1356 | /* Must have been Qnil. */ | ||
| 1357 | } | ||
| 1341 | } | 1358 | } |
| 1342 | 1359 | ||
| 1343 | if (FRAME_HAS_MINIBUF_P (f) | 1360 | if (FRAME_HAS_MINIBUF_P (f) |
| @@ -1352,6 +1369,9 @@ be shared by the new frame. */) | |||
| 1352 | f->param_alist = Fcons (XCAR (tem), f->param_alist); | 1369 | f->param_alist = Fcons (XCAR (tem), f->param_alist); |
| 1353 | 1370 | ||
| 1354 | UNGCPRO; | 1371 | UNGCPRO; |
| 1372 | |||
| 1373 | /* Make sure windows on this frame appear in calls to next-window | ||
| 1374 | and similar functions. */ | ||
| 1355 | Vwindow_list = Qnil; | 1375 | Vwindow_list = Qnil; |
| 1356 | 1376 | ||
| 1357 | return unbind_to (count, frame); | 1377 | return unbind_to (count, frame); |
diff --git a/src/nsterm.m b/src/nsterm.m index a2ae5e69512..3d3723fc28c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -164,7 +164,7 @@ static Lisp_Object last_mouse_motion_frame; | |||
| 164 | static EmacsScroller *last_mouse_scroll_bar = nil; | 164 | static EmacsScroller *last_mouse_scroll_bar = nil; |
| 165 | static struct frame *ns_updating_frame; | 165 | static struct frame *ns_updating_frame; |
| 166 | static NSView *focus_view = NULL; | 166 | static NSView *focus_view = NULL; |
| 167 | static int ns_window_num =0; | 167 | static int ns_window_num = 0; |
| 168 | static NSRect uRect; | 168 | static NSRect uRect; |
| 169 | static BOOL gsaved = NO; | 169 | static BOOL gsaved = NO; |
| 170 | BOOL ns_in_resize = NO; | 170 | BOOL ns_in_resize = NO; |
| @@ -1123,12 +1123,10 @@ x_iconify_frame (struct frame *f) | |||
| 1123 | [[view window] miniaturize: NSApp]; | 1123 | [[view window] miniaturize: NSApp]; |
| 1124 | } | 1124 | } |
| 1125 | 1125 | ||
| 1126 | /* Free X resources of frame F. */ | ||
| 1126 | 1127 | ||
| 1127 | void | 1128 | void |
| 1128 | x_destroy_window (struct frame *f) | 1129 | x_free_frame_resources (struct frame *f) |
| 1129 | /* -------------------------------------------------------------------------- | ||
| 1130 | External: Delete the window | ||
| 1131 | -------------------------------------------------------------------------- */ | ||
| 1132 | { | 1130 | { |
| 1133 | NSView *view = FRAME_NS_VIEW (f); | 1131 | NSView *view = FRAME_NS_VIEW (f); |
| 1134 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); | 1132 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); |
| @@ -1163,10 +1161,21 @@ x_destroy_window (struct frame *f) | |||
| 1163 | [[view window] close]; | 1161 | [[view window] close]; |
| 1164 | [view release]; | 1162 | [view release]; |
| 1165 | 1163 | ||
| 1166 | ns_window_num--; | ||
| 1167 | UNBLOCK_INPUT; | 1164 | UNBLOCK_INPUT; |
| 1168 | } | 1165 | } |
| 1169 | 1166 | ||
| 1167 | void | ||
| 1168 | x_destroy_window (struct frame *f) | ||
| 1169 | /* -------------------------------------------------------------------------- | ||
| 1170 | External: Delete the window | ||
| 1171 | -------------------------------------------------------------------------- */ | ||
| 1172 | { | ||
| 1173 | NSTRACE (x_destroy_window); | ||
| 1174 | check_ns (); | ||
| 1175 | x_free_frame_resources (f); | ||
| 1176 | ns_window_num--; | ||
| 1177 | } | ||
| 1178 | |||
| 1170 | 1179 | ||
| 1171 | void | 1180 | void |
| 1172 | x_set_offset (struct frame *f, int xoff, int yoff, int change_grav) | 1181 | x_set_offset (struct frame *f, int xoff, int yoff, int change_grav) |