summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuuki Harano <masm+github@masm11.me>2021-05-19 22:02:06 +0900
committerYuuki Harano <masm+github@masm11.me>2021-05-19 22:02:06 +0900
commite48372f8e5722643e37185b004469acd174663f7 (patch)
treeb77ec71bb51856f98d34182eca56322750533017 /src
parentd0fa569b7303c2d893b54d0a7af7a521308a5ed4 (diff)
parent61291e06cc804de2075305c220d31ef6072f28c8 (diff)
downloademacs-e48372f8e5722643e37185b004469acd174663f7.tar.gz
emacs-e48372f8e5722643e37185b004469acd174663f7.tar.bz2
emacs-e48372f8e5722643e37185b004469acd174663f7.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in5
-rw-r--r--src/comp.c38
-rw-r--r--src/doc.c24
-rw-r--r--src/dynlib.c2
-rw-r--r--src/emacs.c1
-rw-r--r--src/eval.c9
-rw-r--r--src/frame.c13
-rw-r--r--src/frame.h6
-rw-r--r--src/image.c12
-rw-r--r--src/lisp.h1
-rw-r--r--src/lread.c17
-rw-r--r--src/minibuf.c51
-rw-r--r--src/nsfns.m1
-rw-r--r--src/process.c15
-rw-r--r--src/process.h1
-rw-r--r--src/search.c11
-rw-r--r--src/w32.c4
-rw-r--r--src/w32common.h4
-rw-r--r--src/w32console.c2
-rw-r--r--src/w32fns.c20
-rw-r--r--src/w32heap.c4
-rw-r--r--src/w32notify.c2
-rw-r--r--src/w32proc.c8
-rw-r--r--src/w32select.c2
-rw-r--r--src/w32term.c8
-rw-r--r--src/w32term.h2
-rw-r--r--src/window.c4
-rw-r--r--src/xdisp.c42
-rw-r--r--src/xfns.c20
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c26
31 files changed, 250 insertions, 107 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 5d0d1fb17bd..5da2257ba97 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -674,7 +674,7 @@ ns-app: emacs$(EXEEXT) $(pdmp)
$(MAKE) -C ../nextstep all
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
-.PHONY: versionclean extraclean
+.PHONY: versionclean
mostlyclean:
rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o
@@ -709,9 +709,6 @@ distclean: bootstrap-clean
maintainer-clean: distclean
rm -f TAGS
-extraclean: distclean
- rm -f ./*~ \#* TAGS config.in
-
ETAGS = ../lib-src/etags${EXEEXT}
diff --git a/src/comp.c b/src/comp.c
index 89667b2febc..c0445050b71 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -2745,8 +2745,8 @@ emit_ctxt_code (void)
{
/* Emit optimize qualities. */
Lisp_Object opt_qly[] =
- { Fcons (Qcomp_speed, make_fixnum (comp.speed)),
- Fcons (Qcomp_debug, make_fixnum (comp.debug)),
+ { Fcons (Qnative_comp_speed, make_fixnum (comp.speed)),
+ Fcons (Qnative_comp_debug, make_fixnum (comp.debug)),
Fcons (Qgccjit,
Fcomp_libgccjit_version ()) };
emit_static_object (TEXT_OPTIM_QLY_SYM, Flist (ARRAYELTS (opt_qly), opt_qly));
@@ -4095,11 +4095,11 @@ directory in `comp-eln-load-path' otherwise. */)
Lisp_Object source_filename = filename;
filename = Fcomp_el_to_eln_rel_filename (filename);
- /* If base_dir was not specified search inside Vcomp_eln_load_path
+ /* If base_dir was not specified search inside Vnative_comp_eln_load_path
for the first directory where we have write access. */
if (NILP (base_dir))
{
- Lisp_Object eln_load_paths = Vcomp_eln_load_path;
+ Lisp_Object eln_load_paths = Vnative_comp_eln_load_path;
FOR_EACH_TAIL (eln_load_paths)
{
Lisp_Object dir = XCAR (eln_load_paths);
@@ -4358,7 +4358,7 @@ DEFUN ("comp-native-driver-options-effective-p",
static void
add_driver_options (void)
{
- Lisp_Object options = Fsymbol_value (Qcomp_native_driver_options);
+ Lisp_Object options = Fsymbol_value (Qnative_comp_driver_options);
#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
|| defined (WINDOWSNT)
@@ -4630,7 +4630,7 @@ void
eln_load_path_final_clean_up (void)
{
#ifdef WINDOWSNT
- Lisp_Object dir_tail = Vcomp_eln_load_path;
+ Lisp_Object dir_tail = Vnative_comp_eln_load_path;
FOR_EACH_TAIL (dir_tail)
{
Lisp_Object files_in_dir =
@@ -4697,7 +4697,7 @@ maybe_defer_native_compilation (Lisp_Object function_name,
if (!load_gccjit_if_necessary (false))
return;
- if (!comp_deferred_compilation
+ if (!native_comp_deferred_compilation
|| noninteractive
|| !NILP (Vpurify_flag)
|| !COMPILEDP (definition)
@@ -4755,7 +4755,7 @@ void
fixup_eln_load_path (Lisp_Object eln_filename)
{
Lisp_Object last_cell = Qnil;
- Lisp_Object tem = Vcomp_eln_load_path;
+ Lisp_Object tem = Vnative_comp_eln_load_path;
FOR_EACH_TAIL (tem)
if (CONSP (tem))
last_cell = tem;
@@ -4856,7 +4856,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump,
/* 'dlopen' returns the same handle when trying to load two times
the same shared. In this case touching 'd_reloc' etc leads to
fails in case a frame with a reference to it in a live reg is
- active (comp-speed > 0).
+ active (native-comp-speed > 0).
We must *never* mess with static pointers in an already loaded
eln. */
@@ -5127,7 +5127,7 @@ static bool
file_in_eln_sys_dir (Lisp_Object filename)
{
Lisp_Object eln_sys_dir = Qnil;
- Lisp_Object tmp = Vcomp_eln_load_path;
+ Lisp_Object tmp = Vnative_comp_eln_load_path;
FOR_EACH_TAIL (tmp)
eln_sys_dir = XCAR (tmp);
return !NILP (Fstring_match (Fregexp_quote (Fexpand_file_name (eln_sys_dir,
@@ -5200,16 +5200,17 @@ syms_of_comp (void)
{
#ifdef HAVE_NATIVE_COMP
/* Compiler control customizes. */
- DEFVAR_BOOL ("comp-deferred-compilation", comp_deferred_compilation,
+ DEFVAR_BOOL ("native-comp-deferred-compilation",
+ native_comp_deferred_compilation,
doc: /* If non-nil compile loaded .elc files asynchronously.
After compilation, each function definition is updated to the native
compiled one. */);
- comp_deferred_compilation = true;
+ native_comp_deferred_compilation = true;
- DEFSYM (Qcomp_speed, "comp-speed");
- DEFSYM (Qcomp_debug, "comp-debug");
- DEFSYM (Qcomp_native_driver_options, "comp-native-driver-options");
+ DEFSYM (Qnative_comp_speed, "native-comp-speed");
+ DEFSYM (Qnative_comp_debug, "native-comp-debug");
+ DEFSYM (Qnative_comp_driver_options, "native-comp-driver-options");
DEFSYM (Qcomp_libgccjit_reproducer, "comp-libgccjit-reproducer");
/* Limple instruction set. */
@@ -5272,7 +5273,8 @@ compiled one. */);
DEFSYM (Qlambda_fixup, "lambda-fixup");
DEFSYM (Qgccjit, "gccjit");
DEFSYM (Qcomp_subr_trampoline_install, "comp-subr-trampoline-install");
- DEFSYM (Qcomp_warning_on_missing_source, "comp-warning-on-missing-source");
+ DEFSYM (Qnative_comp_warning_on_missing_source,
+ "native-comp-warning-on-missing-source");
/* To be signaled by the compiler. */
DEFSYM (Qnative_compiler_error, "native-compiler-error");
@@ -5368,7 +5370,7 @@ For internal use. */);
doc: /* Hash table eln-filename -> el-filename. */);
Vcomp_eln_to_el_h = CALLN (Fmake_hash_table, QCtest, Qequal);
- DEFVAR_LISP ("comp-eln-load-path", Vcomp_eln_load_path,
+ DEFVAR_LISP ("native-comp-eln-load-path", Vnative_comp_eln_load_path,
doc: /* List of eln cache directories.
If a directory is non absolute is assumed to be relative to
@@ -5380,7 +5382,7 @@ The last directory of this list is assumed to be the system one. */);
/* Temporary value in use for bootstrap. We can't do better as
`invocation-directory' is still unset, will be fixed up during
dump reload. */
- Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
+ Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines,
doc: /* If non-nil enable primitive trampoline synthesis.
diff --git a/src/doc.c b/src/doc.c
index e179a126184..6be023bb934 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -719,17 +719,19 @@ syms_of_doc (void)
DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
doc: /* Style to use for single quotes in help and messages.
-Its value should be a symbol. It works by substituting certain single
-quotes for grave accent and apostrophe. This is done in help output
-\(but not for display of Info manuals) and in functions like `message'
-and `format-message'. It is not done in `format'.
-
-`curve' means quote with curved single quotes ‘like this’.
-`straight' means quote with straight apostrophes \\='like this\\='.
-`grave' means quote with grave accent and apostrophe \\=`like this\\=';
-i.e., do not alter quote marks. The default value nil acts like
-`curve' if curved single quotes are displayable, and like `grave'
-otherwise. */);
+
+The value of this variable determines substitution of grave accents
+and apostrophes in help output (but not for display of Info
+manuals) and in functions like `message' and `format-message', but not
+in `format'.
+
+The value should be one of these symbols:
+ `curve': quote with curved single quotes ‘like this’.
+ `straight': quote with straight apostrophes \\='like this\\='.
+ `grave': quote with grave accent and apostrophe \\=`like this\\=';
+ i.e., do not alter the original quote marks.
+ nil: like `curve' if curved single quotes are displayable,
+ and like `grave' otherwise. This is the default. */);
Vtext_quoting_style = Qnil;
DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,
diff --git a/src/dynlib.c b/src/dynlib.c
index 1338e9109c9..a8c88439615 100644
--- a/src/dynlib.c
+++ b/src/dynlib.c
@@ -135,7 +135,7 @@ dynlib_addr (void (*funcptr) (void), const char **fname, const char **symname)
void *addr = (void *) funcptr;
/* Step 1: Find the handle of the module where ADDR lives. */
- if (os_subtype == OS_9X
+ if (os_subtype == OS_SUBTYPE_9X
/* Windows NT family version before XP (v5.1). */
|| ((w32_major_version + (w32_minor_version > 0)) < 6))
{
diff --git a/src/emacs.c b/src/emacs.c
index 645215b04cf..c8bc0ba4bec 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2309,6 +2309,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
Vdump_mode = build_string (dump_mode);
/* Enter editor command loop. This never returns. */
+ set_initial_minibuffer_mode ();
Frecursive_edit ();
eassume (false);
}
diff --git a/src/eval.c b/src/eval.c
index aeedcc50cc0..18faa0b9b15 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1370,7 +1370,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform,
|| CONSP (XCAR (tem))))))
error ("Invalid condition handler: %s",
SDATA (Fprin1_to_string (tem, Qt)));
- if (EQ (XCAR (tem), QCsuccess))
+ if (CONSP (tem) && EQ (XCAR (tem), QCsuccess))
success_handler = XCDR (tem);
else
clausenb++;
@@ -1387,8 +1387,11 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform,
Lisp_Object volatile *clauses = alloca (clausenb * sizeof *clauses);
clauses += clausenb;
for (Lisp_Object tail = handlers; CONSP (tail); tail = XCDR (tail))
- if (!EQ (XCAR (XCAR (tail)), QCsuccess))
- *--clauses = XCAR (tail);
+ {
+ Lisp_Object tem = XCAR (tail);
+ if (!(CONSP (tem) && EQ (XCAR (tem), QCsuccess)))
+ *--clauses = tem;
+ }
for (ptrdiff_t i = 0; i < clausenb; i++)
{
Lisp_Object clause = clauses[i];
diff --git a/src/frame.c b/src/frame.c
index eb5aed82f7d..40b8d2b06c1 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -973,6 +973,7 @@ make_frame (bool mini_p)
f->no_accept_focus = false;
f->z_group = z_group_none;
f->tooltip = false;
+ f->was_invisible = false;
f->child_frame_border_width = -1;
f->last_tab_bar_item = -1;
#ifndef HAVE_EXT_TOOL_BAR
@@ -5865,7 +5866,18 @@ selected frame. This is useful when `make-pointer-invisible' is set. */)
return decode_any_frame (frame)->pointer_invisible ? Qnil : Qt;
}
+DEFUN ("frame--set-was-invisible", Fframe__set_was_invisible,
+ Sframe__set_was_invisible, 2, 2, 0,
+ doc: /* Set FRAME's was-invisible flag if WAS-INVISIBLE is non-nil.
+This function is for internal use only. */)
+ (Lisp_Object frame, Lisp_Object was_invisible)
+{
+ struct frame *f = decode_live_frame (frame);
+ f->was_invisible = !NILP (was_invisible);
+
+ return f->was_invisible ? Qt : Qnil;
+}
/***********************************************************************
Multimonitor data
@@ -6518,6 +6530,7 @@ iconify the top level frame instead. */);
defsubr (&Sframe_position);
defsubr (&Sset_frame_position);
defsubr (&Sframe_pointer_visible_p);
+ defsubr (&Sframe__set_was_invisible);
defsubr (&Sframe_window_state_change);
defsubr (&Sset_frame_window_state_change);
defsubr (&Sframe_scale_factor);
diff --git a/src/frame.h b/src/frame.h
index 399948fa7ed..1aba1e3bc47 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -456,7 +456,11 @@ struct frame
/* True when new_width or new_height were set by change_frame_size,
false when they were set by adjust_frame_size internally or not
set. */
- bool_bf new_size_p;
+ bool_bf new_size_p : 1;
+
+ /* True when frame was invisible before first MapNotify event. Used
+ in X builds only. */
+ bool_bf was_invisible : 1;
/* Bitfield area ends here. */
diff --git a/src/image.c b/src/image.c
index a78674fed09..67c55ea9ea1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4191,6 +4191,7 @@ enum xpm_keyword_index
XPM_LAST
};
+#if defined HAVE_XPM || defined HAVE_NS
/* Vector of image_keyword structures describing the format
of valid XPM image specifications. */
@@ -4208,6 +4209,7 @@ static const struct image_keyword xpm_format[XPM_LAST] =
{":color-symbols", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
{":background", IMAGE_STRING_OR_NIL_VALUE, 0}
};
+#endif /* HAVE_XPM || HAVE_NS */
#if defined HAVE_X_WINDOWS && !defined USE_CAIRO
@@ -4431,6 +4433,7 @@ init_xpm_functions (void)
#endif /* WINDOWSNT */
+#if defined HAVE_XPM || defined HAVE_NS
/* Value is true if COLOR_SYMBOLS is a valid color symbols list
for XPM images. Such a list must consist of conses whose car and
cdr are strings. */
@@ -4451,7 +4454,6 @@ xpm_valid_color_symbols_p (Lisp_Object color_symbols)
return NILP (color_symbols);
}
-
/* Value is true if OBJECT is a valid XPM image specification. */
static bool
@@ -4467,6 +4469,7 @@ xpm_image_p (Lisp_Object object)
&& (! fmt[XPM_COLOR_SYMBOLS].count
|| xpm_valid_color_symbols_p (fmt[XPM_COLOR_SYMBOLS].value)));
}
+#endif /* HAVE_XPM || HAVE_NS */
#endif /* HAVE_XPM || USE_CAIRO || HAVE_NS */
@@ -4836,10 +4839,11 @@ xpm_load (struct frame *f, struct image *img)
#endif /* HAVE_XPM && !USE_CAIRO */
-#if defined USE_CAIRO || (defined HAVE_NS && !defined HAVE_XPM)
+#if (defined USE_CAIRO && defined HAVE_XPM) \
+ || (defined HAVE_NS && !defined HAVE_XPM)
-/* XPM support functions for NS where libxpm is not available.
- Only XPM version 3 (without any extensions) is supported. */
+/* XPM support functions for NS where libxpm is not available, and for
+ Cairo. Only XPM version 3 (without any extensions) is supported. */
static void xpm_put_color_table_v (Lisp_Object, const char *,
int, Lisp_Object);
diff --git a/src/lisp.h b/src/lisp.h
index f83c55f827d..91b7a89d0f5 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4377,6 +4377,7 @@ extern EMACS_INT this_minibuffer_depth (Lisp_Object);
extern EMACS_INT minibuf_level;
extern Lisp_Object get_minibuffer (EMACS_INT);
extern void init_minibuf_once (void);
+extern void set_initial_minibuffer_mode (void);
extern void syms_of_minibuf (void);
extern void barf_if_interaction_inhibited (void);
diff --git a/src/lread.c b/src/lread.c
index e53e1f65ab9..bca53a9a37a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1700,7 +1700,7 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
return;
/* Search eln in the eln-cache directories. */
- Lisp_Object eln_path_tail = Vcomp_eln_load_path;
+ Lisp_Object eln_path_tail = Vnative_comp_eln_load_path;
Lisp_Object src_name =
Fsubstring (*filename, Qnil, make_fixnum (-1));
if (NILP (Ffile_exists_p (src_name)))
@@ -1708,7 +1708,8 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
src_name = concat2 (src_name, build_string (".gz"));
if (NILP (Ffile_exists_p (src_name)))
{
- if (!NILP (find_symbol_value (Qcomp_warning_on_missing_source)))
+ if (!NILP (find_symbol_value (
+ Qnative_comp_warning_on_missing_source)))
call2 (intern_c_string ("display-warning"),
Qcomp,
CALLN (Fformat,
@@ -1944,7 +1945,17 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
}
else
{
- fd = emacs_open (pfn, O_RDONLY, 0);
+ /* In some systems (like Windows) finding out if a
+ file exists is cheaper to do than actually opening
+ it. Only open the file when we are sure that it
+ exists. */
+#ifdef WINDOWSNT
+ if (faccessat (AT_FDCWD, pfn, R_OK, AT_EACCESS))
+ fd = -1;
+ else
+#endif
+ fd = emacs_open (pfn, O_RDONLY, 0);
+
if (fd < 0)
{
if (! (errno == ENOENT || errno == ENOTDIR))
diff --git a/src/minibuf.c b/src/minibuf.c
index bc7d4393985..cffb7fe787c 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -157,16 +157,15 @@ zip_minibuffer_stacks (Lisp_Object dest_window, Lisp_Object source_window)
Fset_window_start (dest_window, Fwindow_start (source_window), Qnil);
Fset_window_point (dest_window, Fwindow_point (source_window));
dw->prev_buffers = sw->prev_buffers;
- set_window_buffer (source_window, get_minibuffer (0), 0, 0);
+ set_window_buffer (source_window, nth_minibuffer (0), 0, 0);
sw->prev_buffers = Qnil;
return;
}
if (live_minibuffer_p (dw->contents))
- call1 (Qrecord_window_buffer, dest_window);
+ call1 (Qpush_window_buffer_onto_prev, dest_window);
if (live_minibuffer_p (sw->contents))
- call1 (Qrecord_window_buffer, source_window);
-
+ call1 (Qpush_window_buffer_onto_prev, source_window);
acc = merge_c (dw->prev_buffers, sw->prev_buffers, minibuffer_ent_greater);
if (!NILP (acc))
@@ -179,7 +178,7 @@ zip_minibuffer_stacks (Lisp_Object dest_window, Lisp_Object source_window)
}
dw->prev_buffers = acc;
sw->prev_buffers = Qnil;
- set_window_buffer (source_window, get_minibuffer (0), 0, 0);
+ set_window_buffer (source_window, nth_minibuffer (0), 0, 0);
}
/* If `minibuffer_follows_selected_frame' is t, or we're about to
@@ -204,6 +203,14 @@ move_minibuffers_onto_frame (struct frame *of, bool for_deletion)
zip_minibuffer_stacks (f->minibuffer_window, of->minibuffer_window);
if (for_deletion && XFRAME (MB_frame) != of)
MB_frame = selected_frame;
+ if (!for_deletion
+ && MINI_WINDOW_P (XWINDOW (FRAME_SELECTED_WINDOW (of))))
+ {
+ Lisp_Object old_frame;
+ XSETFRAME (old_frame, of);
+ Fset_frame_selected_window (old_frame,
+ Fframe_first_window (old_frame), Qnil);
+ }
}
}
@@ -220,6 +227,8 @@ DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
return Qnil;
innermost_MB = nth_minibuffer (minibuf_level);
+ if (NILP (innermost_MB))
+ emacs_abort ();
FOR_EACH_FRAME (frames, frame)
{
f = XFRAME (frame);
@@ -644,7 +653,12 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
return unbind_to (count, val);
}
- minibuf_level++; /* Before calling choose_minibuf_frame. */
+ /* Ensure now that the latest minibuffer has been created and pushed
+ onto Vminibuffer_list before incrementing minibuf_level, in case
+ a hook called during the minibuffer creation calls
+ Factive_minibuffer_window. */
+ minibuffer = get_minibuffer (minibuf_level + 1);
+ minibuf_level++; /* Before calling choose_minibuf_frame. */
/* Choose the minibuffer window and frame, and take action on them. */
@@ -672,7 +686,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
}
MB_frame = XWINDOW (XFRAME (selected_frame)->minibuffer_window)->frame;
if (live_minibuffer_p (XWINDOW (minibuf_window)->contents))
- call1 (Qrecord_window_buffer, minibuf_window);
+ call1 (Qpush_window_buffer_onto_prev, minibuf_window);
record_unwind_protect_void (minibuffer_unwind);
record_unwind_protect (restore_window_configuration,
@@ -758,7 +772,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
/* Switch to the minibuffer. */
- minibuffer = get_minibuffer (minibuf_level);
set_minibuffer_mode (minibuffer, minibuf_level);
Fset_buffer (minibuffer);
@@ -799,7 +812,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
/* Empty out the minibuffers of all frames, except those frames
where there is an active minibuffer.
Set them to point to ` *Minibuf-0*', which is always empty. */
- empty_minibuf = get_minibuffer (0);
+ empty_minibuf = nth_minibuffer (0);
set_minibuffer_mode (empty_minibuf, 0);
/* Display this minibuffer in the proper window. */
@@ -961,7 +974,7 @@ static Lisp_Object
nth_minibuffer (EMACS_INT depth)
{
Lisp_Object tail = Fnthcdr (make_fixnum (depth), Vminibuffer_list);
- return XCAR (tail);
+ return Fcar (tail);
}
/* Set the major mode of the minibuffer BUF, depending on DEPTH, the
@@ -1066,9 +1079,13 @@ read_minibuf_unwind (void)
Lisp_Object future_mini_window;
Lisp_Object saved_selected_frame = selected_frame;
Lisp_Object window, frames;
+ Lisp_Object expired_MB = nth_minibuffer (minibuf_level);
struct window *w;
struct frame *f;
+ if (NILP (expired_MB))
+ emacs_abort ();
+
/* Locate the expired minibuffer. */
FOR_EACH_FRAME (frames, exp_MB_frame)
{
@@ -1078,7 +1095,7 @@ read_minibuf_unwind (void)
{
w = XWINDOW (window);
if (EQ (w->frame, exp_MB_frame)
- && EQ (w->contents, nth_minibuffer (minibuf_level)))
+ && EQ (w->contents, expired_MB))
goto found;
}
}
@@ -1094,7 +1111,7 @@ read_minibuf_unwind (void)
minibuffer when we reset the relevant variables. Don't depend on
`minibuf_window' here. This could by now be the mini-window of any
frame. */
- Fset_buffer (nth_minibuffer (minibuf_level));
+ Fset_buffer (expired_MB);
minibuf_level--;
/* Restore prompt, etc, from outer minibuffer level. */
@@ -2254,6 +2271,13 @@ If no minibuffer is active, return nil. */)
+void
+set_initial_minibuffer_mode (void)
+{
+ Lisp_Object minibuf = get_minibuffer (0);
+ set_minibuffer_mode (minibuf, 0);
+}
+
static void init_minibuf_once_for_pdumper (void);
void
@@ -2262,6 +2286,8 @@ init_minibuf_once (void)
staticpro (&Vminibuffer_list);
staticpro (&Vcommand_loop_level_list);
pdumper_do_now_and_after_load (init_minibuf_once_for_pdumper);
+ /* Ensure our inactive minibuffer exists. */
+ get_minibuffer (0);
}
static void
@@ -2327,6 +2353,7 @@ syms_of_minibuf (void)
DEFSYM (Qminibuffer_completing_file_name, "minibuffer-completing-file-name");
DEFSYM (Qselect_frame_set_input_focus, "select-frame-set-input-focus");
DEFSYM (Qadd_to_history, "add-to-history");
+ DEFSYM (Qpush_window_buffer_onto_prev, "push-window-buffer-onto-prev");
DEFVAR_LISP ("read-expression-history", Vread_expression_history,
doc: /* A history list for arguments that are Lisp expressions to evaluate.
diff --git a/src/nsfns.m b/src/nsfns.m
index 1f281f75fd4..d14f7b51eaf 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1404,6 +1404,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
else
{
/* Must have been Qnil. */
+ f->was_invisible = true;
}
}
diff --git a/src/process.c b/src/process.c
index 98a6dca8692..f3f4f09f740 100644
--- a/src/process.c
+++ b/src/process.c
@@ -473,8 +473,15 @@ add_read_fd (int fd, fd_callback func, void *data)
fd_callback_info[fd].data = data;
}
+void
+add_non_keyboard_read_fd (int fd, fd_callback func, void *data)
+{
+ add_read_fd(fd, func, data);
+ fd_callback_info[fd].flags &= ~KEYBOARD_FD;
+}
+
static void
-add_non_keyboard_read_fd (int fd)
+add_process_read_fd (int fd)
{
eassert (fd >= 0 && fd < FD_SETSIZE);
eassert (fd_callback_info[fd].func == NULL);
@@ -483,12 +490,6 @@ add_non_keyboard_read_fd (int fd)
fd_callback_info[fd].flags |= FOR_READ;
if (fd > max_desc)
max_desc = fd;
-}
-
-static void
-add_process_read_fd (int fd)
-{
- add_non_keyboard_read_fd (fd);
eassert (0 <= fd && fd < FD_SETSIZE);
fd_callback_info[fd].flags |= PROCESS_FD;
}
diff --git a/src/process.h b/src/process.h
index d041ada5867..0890f253a40 100644
--- a/src/process.h
+++ b/src/process.h
@@ -284,6 +284,7 @@ extern bool kbd_on_hold_p (void);
typedef void (*fd_callback) (int fd, void *data);
extern void add_read_fd (int fd, fd_callback func, void *data);
+extern void add_non_keyboard_read_fd (int fd, fd_callback func, void *data);
extern void delete_read_fd (int fd);
extern void add_write_fd (int fd, fd_callback func, void *data);
extern void delete_write_fd (int fd);
diff --git a/src/search.c b/src/search.c
index c757bf3d1f2..df384e1dcff 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2723,7 +2723,6 @@ since only regular expressions have distinguished subexpressions. */)
}
newpoint = sub_start + SCHARS (newtext);
- ptrdiff_t newstart = sub_start == sub_end ? newpoint : sub_start;
/* Replace the old text with the new in the cleanest possible way. */
replace_range (sub_start, sub_end, newtext, 1, 0, 1, true);
@@ -2739,11 +2738,11 @@ since only regular expressions have distinguished subexpressions. */)
/* The replace_range etc. functions can trigger modification hooks
(see signal_before_change and signal_after_change). Try to error
out if these hooks clobber the match data since clobbering can
- result in confusing bugs. Although this sanity check does not
- catch all possible clobberings, it should catch many of them. */
- if (! (search_regs.num_regs == num_regs
- && search_regs.start[sub] == newstart
- && search_regs.end[sub] == newpoint))
+ result in confusing bugs. We used to check for changes in
+ search_regs start and end, but that fails if modification hooks
+ remove or add text earlier in the buffer, so just check num_regs
+ now. */
+ if (search_regs.num_regs != num_regs)
error ("Match data clobbered by buffer modification hooks");
/* Put point back where it was in the text, if possible. */
diff --git a/src/w32.c b/src/w32.c
index 467e6cb4271..26cc28f877c 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -4747,7 +4747,7 @@ sys_rename_replace (const char *oldname, const char *newname, BOOL force)
/* volume_info is set indirectly by map_w32_filename. */
oldname_dev = volume_info.serialnum;
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
char * o;
char * p;
@@ -10468,7 +10468,7 @@ shutdown_handler (DWORD type)
HANDLE
maybe_load_unicows_dll (void)
{
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
HANDLE ret = LoadLibrary ("Unicows.dll");
if (ret)
diff --git a/src/w32common.h b/src/w32common.h
index cbe05c5d8d1..6493b9c88d5 100644
--- a/src/w32common.h
+++ b/src/w32common.h
@@ -41,8 +41,8 @@ extern int w32_minor_version;
extern int w32_build_number;
enum {
- OS_9X = 1,
- OS_NT
+ OS_SUBTYPE_9X = 1,
+ OS_SUBTYPE_NT
};
extern int os_subtype;
diff --git a/src/w32console.c b/src/w32console.c
index cb9e288e880..99546c2d754 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -803,7 +803,7 @@ initialize_w32_display (struct terminal *term, int *width, int *height)
ceol_initialized = FALSE;
}
- if (os_subtype == OS_NT)
+ if (os_subtype == OS_SUBTYPE_NT)
w32_console_unicode_input = 1;
else
w32_console_unicode_input = 0;
diff --git a/src/w32fns.c b/src/w32fns.c
index 66baeaecbdb..14d1154a2bc 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -6107,6 +6107,8 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
if (!NILP (visibility))
w32_make_frame_visible (f);
+ else
+ f->was_invisible = true;
}
store_frame_param (f, Qvisibility, visibility);
@@ -7991,7 +7993,7 @@ DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash,
/* The Unicode version of SHFileOperation is not supported on
Windows 9X. */
- if (w32_unicode_filenames && os_subtype != OS_9X)
+ if (w32_unicode_filenames && os_subtype != OS_SUBTYPE_9X)
{
SHFILEOPSTRUCTW file_op_w;
/* We need one more element beyond MAX_PATH because this is
@@ -9120,7 +9122,7 @@ The coordinates X and Y are interpreted in pixels relative to a position
/* When "mouse trails" are in effect, moving the mouse cursor
sometimes leaves behind an annoying "ghost" of the pointer.
Avoid that by momentarily switching off mouse trails. */
- if (os_subtype == OS_NT
+ if (os_subtype == OS_SUBTYPE_NT
&& w32_major_version + w32_minor_version >= 6)
ret = SystemParametersInfo (SPI_GETMOUSETRAILS, 0, &trail_num, 0);
SetCursorPos (xval, yval);
@@ -9295,7 +9297,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
if (!OpenPrinter (pname_buf, &hPrn, NULL))
return Qnil;
/* GetPrinterW is not supported by unicows.dll. */
- if (w32_unicode_filenames && os_subtype != OS_9X)
+ if (w32_unicode_filenames && os_subtype != OS_SUBTYPE_9X)
GetPrinterW (hPrn, 2, NULL, 0, &dwNeeded);
else
GetPrinterA (hPrn, 2, NULL, 0, &dwNeeded);
@@ -9305,7 +9307,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
return Qnil;
}
/* Call GetPrinter again with big enough memory block. */
- if (w32_unicode_filenames && os_subtype != OS_9X)
+ if (w32_unicode_filenames && os_subtype != OS_SUBTYPE_9X)
{
/* Allocate memory for the PRINTER_INFO_2 struct. */
ppi2w = xmalloc (dwNeeded);
@@ -9441,9 +9443,9 @@ cache_system_info (void)
w32_minor_version = version.info.minor;
if (version.info.platform & 0x8000)
- os_subtype = OS_9X;
+ os_subtype = OS_SUBTYPE_9X;
else
- os_subtype = OS_NT;
+ os_subtype = OS_SUBTYPE_NT;
/* Cache page size, allocation unit, processor type, etc. */
GetSystemInfo (&sysinfo_cache);
@@ -9454,7 +9456,7 @@ cache_system_info (void)
GetVersionEx (&osinfo_cache);
w32_build_number = osinfo_cache.dwBuildNumber;
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
w32_build_number &= 0xffff;
w32_num_mouse_buttons = GetSystemMetrics (SM_CMOUSEBUTTONS);
@@ -9633,7 +9635,7 @@ w32_kbd_patch_key (KEY_EVENT_RECORD *event, int cpId)
/* On NT, call ToUnicode instead and then convert to the current
console input codepage. */
- if (os_subtype == OS_NT)
+ if (os_subtype == OS_SUBTYPE_NT)
{
WCHAR buf[128];
@@ -11047,7 +11049,7 @@ see `w32-ansi-code-page'. */);
w32_multibyte_code_page = _getmbcp ();
#endif
- if (os_subtype == OS_NT)
+ if (os_subtype == OS_SUBTYPE_NT)
w32_unicode_gui = 1;
else
w32_unicode_gui = 0;
diff --git a/src/w32heap.c b/src/w32heap.c
index e002f72608a..0f228bfb221 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -269,7 +269,7 @@ init_heap (bool use_dynamic_heap)
}
#endif
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
the_malloc_fn = malloc_after_dump_9x;
the_realloc_fn = realloc_after_dump_9x;
@@ -312,7 +312,7 @@ init_heap (bool use_dynamic_heap)
}
heap = s_pfn_Rtl_Create_Heap (0, data_region_base, 0, 0, NULL, &params);
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
fprintf (stderr, "Cannot dump Emacs on Windows 9X; exiting.\n");
exit (-1);
diff --git a/src/w32notify.c b/src/w32notify.c
index b9e90633923..889fd9f3c9f 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -566,7 +566,7 @@ generate notifications correctly, though. */)
CHECK_LIST (filter);
/* The underlying features are available only since XP. */
- if (os_subtype == OS_9X
+ if (os_subtype == OS_SUBTYPE_9X
|| (w32_major_version == 5 && w32_minor_version < 1))
{
errno = ENOSYS;
diff --git a/src/w32proc.c b/src/w32proc.c
index ffa56e135d0..702ea122e65 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -623,7 +623,7 @@ init_timers (void)
need to probe for its availability dynamically, and call it
through a pointer. */
s_pfn_Get_Thread_Times = NULL; /* in case dumped Emacs comes with a value */
- if (os_subtype != OS_9X)
+ if (os_subtype != OS_SUBTYPE_9X)
s_pfn_Get_Thread_Times = (GetThreadTimes_Proc)
get_proc_addr (GetModuleHandle ("kernel32.dll"), "GetThreadTimes");
@@ -2654,7 +2654,7 @@ find_child_console (HWND hwnd, LPARAM arg)
GetClassName (hwnd, window_class, sizeof (window_class));
if (strcmp (window_class,
- (os_subtype == OS_9X)
+ (os_subtype == OS_SUBTYPE_9X)
? "tty"
: "ConsoleWindowClass") == 0)
{
@@ -2878,7 +2878,7 @@ sys_kill (pid_t pid, int sig)
if (NILP (Vw32_start_process_share_console) && cp && cp->hwnd)
{
#if 1
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
/*
Another possibility is to try terminating the VDM out-right by
@@ -3793,7 +3793,7 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
if (!g_b_init_compare_string_w)
{
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
pCompareStringW = (CompareStringW_Proc)
get_proc_addr (LoadLibrary ("Unicows.dll"),
diff --git a/src/w32select.c b/src/w32select.c
index 85f8e5556a2..f19b85a2aec 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1207,7 +1207,7 @@ globals_of_w32select (void)
QANSICP = coding_from_cp (ANSICP);
QOEMCP = coding_from_cp (OEMCP);
- if (os_subtype == OS_NT)
+ if (os_subtype == OS_SUBTYPE_NT)
Vselection_coding_system = Qutf_16le_dos;
else if (inhibit_window_system)
Vselection_coding_system = QOEMCP;
diff --git a/src/w32term.c b/src/w32term.c
index 4f910296ecc..ad4d1a32829 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1916,7 +1916,7 @@ w32_draw_image_foreground (struct glyph_string *s)
/* HALFTONE produces better results, especially when
scaling to a larger size, but Windows 9X doesn't
support HALFTONE. */
- if (os_subtype == OS_NT
+ if (os_subtype == OS_SUBTYPE_NT
&& (pmode = SetStretchBltMode (s->hdc, HALFTONE)) != 0)
SetBrushOrgEx (s->hdc, 0, 0, NULL);
StretchBlt (s->hdc, x, y, s->slice.width, s->slice.height,
@@ -1952,7 +1952,7 @@ w32_draw_image_foreground (struct glyph_string *s)
{
int pmode = 0;
/* Windows 9X doesn't support HALFTONE. */
- if (os_subtype == OS_NT
+ if (os_subtype == OS_SUBTYPE_NT
&& (pmode = SetStretchBltMode (s->hdc, HALFTONE)) != 0)
SetBrushOrgEx (s->hdc, 0, 0, NULL);
StretchBlt (s->hdc, x, y, s->slice.width, s->slice.height,
@@ -6644,7 +6644,7 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
/* When "mouse trails" are in effect, moving the mouse cursor
sometimes leaves behind an annoying "ghost" of the pointer.
Avoid that by momentarily switching off mouse trails. */
- if (os_subtype == OS_NT
+ if (os_subtype == OS_SUBTYPE_NT
&& w32_major_version + w32_minor_version >= 6)
ret = SystemParametersInfo (SPI_GETMOUSETRAILS, 0, &trail_num, 0);
SetCursorPos (pt.x, pt.y);
@@ -7638,7 +7638,7 @@ specified by `file-name-coding-system'.
This variable is set to non-nil by default when Emacs runs on Windows
systems of the NT family, including W2K, XP, Vista, Windows 7 and
Windows 8. It is set to nil on Windows 9X. */);
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
w32_unicode_filenames = 0;
else
w32_unicode_filenames = 1;
diff --git a/src/w32term.h b/src/w32term.h
index 7d351df871d..160be357821 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -761,7 +761,7 @@ extern bool w32_image_rotations_p (void);
extern void setup_w32_kbdhook (void);
extern void remove_w32_kbdhook (void);
extern int check_w32_winkey_state (int);
-#define w32_kbdhook_active (os_subtype != OS_9X)
+#define w32_kbdhook_active (os_subtype != OS_SUBTYPE_9X)
#else
#define w32_kbdhook_active 0
#endif
diff --git a/src/window.c b/src/window.c
index 0a14eca58fb..9961c54161d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7264,8 +7264,8 @@ restore_window_configuration (Lisp_Object configuration)
{
if (CONSP (configuration))
Fset_window_configuration (XCAR (configuration),
- XCAR (XCDR (configuration)),
- XCAR (XCDR (XCDR (configuration))));
+ Fcar_safe (XCDR (configuration)),
+ Fcar_safe (Fcdr_safe (XCDR (configuration))));
else
Fset_window_configuration (configuration, Qnil, Qnil);
}
diff --git a/src/xdisp.c b/src/xdisp.c
index eea3f81dfa9..74fa0a57e44 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10838,6 +10838,47 @@ include the height of both, if present, in the return value. */)
return Fcons (make_fixnum (x - start_x), make_fixnum (y));
}
+
+DEFUN ("display--line-is-continued-p", Fdisplay__line_is_continued_p,
+ Sdisplay__line_is_continued_p, 0, 0, 0,
+ doc: /* Return non-nil if the current screen line is continued on display. */)
+ (void)
+{
+ struct buffer *oldb = current_buffer;
+ struct window *w = XWINDOW (selected_window);
+ enum move_it_result rc = MOVE_POS_MATCH_OR_ZV;
+
+ set_buffer_internal_1 (XBUFFER (w->contents));
+
+ if (PT < ZV)
+ {
+ struct text_pos startpos;
+ struct it it;
+ void *itdata;
+ /* Use a marker, since vertical-motion enters redisplay, which can
+ trigger fontifications, which in turn could modify buffer text. */
+ Lisp_Object opoint = Fpoint_marker ();
+
+ /* Make sure to start from the beginning of the current screen
+ line, so that move_it_in_display_line_to counts pixels correctly. */
+ Fvertical_motion (make_fixnum (0), selected_window, Qnil);
+ SET_TEXT_POS (startpos, PT, PT_BYTE);
+ itdata = bidi_shelve_cache ();
+ start_display (&it, w, startpos);
+ /* If lines are truncated, no line is continued. */
+ if (it.line_wrap != TRUNCATE)
+ {
+ it.glyph_row = NULL;
+ rc = move_it_in_display_line_to (&it, ZV, -1, MOVE_TO_POS);
+ }
+ SET_PT_BOTH (marker_position (opoint), marker_byte_position (opoint));
+ bidi_unshelve_cache (itdata, false);
+ }
+ set_buffer_internal_1 (oldb);
+
+ return rc == MOVE_LINE_CONTINUED ? Qt : Qnil;
+}
+
/***********************************************************************
Messages
@@ -34754,6 +34795,7 @@ be let-bound around code that needs to disable messages temporarily. */);
defsubr (&Swindow_text_pixel_size);
defsubr (&Smove_point_visually);
defsubr (&Sbidi_find_overridden_directionality);
+ defsubr (&Sdisplay__line_is_continued_p);
DEFSYM (Qmenu_bar_update_hook, "menu-bar-update-hook");
DEFSYM (Qoverriding_terminal_local_map, "overriding-terminal-local-map");
diff --git a/src/xfns.c b/src/xfns.c
index 782e0a483c4..e46616e6d66 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4127,12 +4127,21 @@ This function is an internal primitive--use `make-frame' instead. */)
cannot control visibility, so don't try. */
if (!f->output_data.x->explicit_parent)
{
+ /* When called from `x-create-frame-with-faces' visibility is
+ always explicitly nil. */
Lisp_Object visibility
= gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
RES_TYPE_SYMBOL);
+ Lisp_Object height
+ = gui_display_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
+ Lisp_Object width
+ = gui_display_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
if (EQ (visibility, Qicon))
- x_iconify_frame (f);
+ {
+ f->was_invisible = true;
+ x_iconify_frame (f);
+ }
else
{
if (EQ (visibility, Qunbound))
@@ -4140,8 +4149,17 @@ This function is an internal primitive--use `make-frame' instead. */)
if (!NILP (visibility))
x_make_frame_visible (f);
+ else
+ f->was_invisible = true;
}
+ /* Leave f->was_invisible true only if height or width were
+ specified too. This takes effect only when we are not called
+ from `x-create-frame-with-faces' (see above comment). */
+ f->was_invisible
+ = (f->was_invisible
+ && (!EQ (height, Qunbound) || !EQ (width, Qunbound)));
+
store_frame_param (f, Qvisibility, visibility);
}
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 10565a4b25f..ddb86d82fe1 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -357,7 +357,7 @@ ice_conn_watch_CB (IceConn iceConn, IcePointer clientData,
}
ice_fd = IceConnectionNumber (iceConn);
- add_read_fd (ice_fd, x_session_check_input, NULL);
+ add_non_keyboard_read_fd (ice_fd, x_session_check_input, NULL);
}
/* Create the client leader window. */
diff --git a/src/xterm.c b/src/xterm.c
index 9edaed9a34b..1887c3255d4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8181,8 +8181,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#if defined USE_GTK && defined HAVE_GTK3
/* If GTK3 wants to impose some old size here (Bug#24526),
tell it that the current size is what we want. */
- xg_frame_set_char_size
- (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+ if (f->was_invisible)
+ {
+ xg_frame_set_char_size
+ (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+ f->was_invisible = false;
+ }
#endif
XSETFRAME (inev.ie.frame_or_window, f);
}
@@ -8443,8 +8447,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#if defined USE_GTK && defined HAVE_GTK3
/* If GTK3 wants to impose some old size here (Bug#24526),
tell it that the current size is what we want. */
- xg_frame_set_char_size
- (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+ if (f->was_invisible)
+ {
+ xg_frame_set_char_size
+ (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+ f->was_invisible = false;
+ }
#endif
f->output_data.x->has_been_visible = true;
}
@@ -9335,6 +9343,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
goto OTHER;
case VisibilityNotify:
+ f = x_top_window_to_frame (dpyinfo, event->xvisibility.window);
+ if (f && (event->xvisibility.state == VisibilityUnobscured
+ || event->xvisibility.state == VisibilityPartiallyObscured))
+ SET_FRAME_VISIBLE (f, 1);
+
goto OTHER;
case MappingNotify:
@@ -9591,11 +9604,12 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
/* The foreground of cursor_gc is typically the same as the normal
background color, which can cause the cursor box to be invisible. */
xgcv.foreground = f->output_data.x->cursor_pixel;
+ xgcv.line_width = 1;
if (dpyinfo->scratch_cursor_gc)
- XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground, &xgcv);
+ XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground | GCLineWidth, &xgcv);
else
dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_X_DRAWABLE (f),
- GCForeground, &xgcv);
+ GCForeground | GCLineWidth, &xgcv);
gc = dpyinfo->scratch_cursor_gc;
/* When on R2L character, show cursor at the right edge of the