summaryrefslogtreecommitdiff
path: root/src/minibuf.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-04-30 18:54:34 +0800
committerPo Lu <luangruo@yahoo.com>2022-04-30 18:54:34 +0800
commit57447f5ce0a723f698d1515485860ca17ce93960 (patch)
tree68daa5ac0fcb26c26edb389d47285947d062737d /src/minibuf.c
parent5fd54723536efca5589f9b9ac64825e76f0d1360 (diff)
downloademacs-57447f5ce0a723f698d1515485860ca17ce93960.tar.gz
Fix display updating inside the minibuffer on MS Windows
* src/minibuf.c (read_minibuf): Call `w32_flip_buffers_if_dirty' after changing the cursor position and redisplaying instead of `flush_frame'. (bug#55193) * src/w32term.c (w32_flip_buffers_if_dirty): New function. * src/w32term.h: Update prototypes.
Diffstat (limited to 'src/minibuf.c')
-rw-r--r--src/minibuf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index dacfd1255ba..df82bcb121a 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -34,6 +34,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "systty.h"
#include "pdumper.h"
+#ifdef HAVE_NTGUI
+#include "w32term.h"
+#endif
+
/* List of buffers for use as minibuffers.
The first element of the list is used for the outermost minibuffer
invocation, the next element is used for a recursive minibuffer
@@ -916,7 +920,17 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
XWINDOW (minibuf_window)->cursor.x = 0;
XWINDOW (minibuf_window)->must_be_updated_p = true;
update_frame (XFRAME (selected_frame), true, true);
+#ifndef HAVE_NTGUI
flush_frame (XFRAME (XWINDOW (minibuf_window)->frame));
+#else
+ /* The reason this function isn't `flush_display' in the RIF is
+ that `flush_frame' is also called in many other circumstances
+ when some code wants X requests to be sent to the X server,
+ but there is no corresponding "flush" concept on MS Windows,
+ and flipping buffers every time `flush_frame' is called
+ causes flicker. */
+ w32_flip_buffers_if_dirty (XFRAME (XWINDOW (minibuf_window)->frame));
+#endif
}
/* Make minibuffer contents into a string. */