#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
extern void set_frame_menubar ();
+extern int pending_menu_activation;
#endif
extern int interrupt_input;
mini_window = FRAME_MINIBUF_WINDOW (selected_frame);
f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
-#ifdef MULTI_FRAME
FRAME_SAMPLE_VISIBILITY (f);
if (FRAME_VISIBLE_P (selected_frame)
&& ! FRAME_VISIBLE_P (f))
Fmake_frame_visible (WINDOW_FRAME (XWINDOW (mini_window)));
-#endif
if (m)
{
a[2] = a3;
len = doprnt (FRAME_MESSAGE_BUF (f),
- FRAME_WIDTH (f), m, (char *)0, 3, a);
+ (int) FRAME_WIDTH (f), m, (char *)0, 3, a);
#else
len = doprnt (FRAME_MESSAGE_BUF (f),
- FRAME_WIDTH (f), m, (char *)0, 3, &a1);
+ (int) FRAME_WIDTH (f), m, (char *)0, 3, &a1);
#endif /* NO_ARG_ARRAY */
message2 (FRAME_MESSAGE_BUF (f), len);
}
else
update_menu_bar (selected_frame, 1);
+
+ /* Motif needs this. See comment in xmenu.c.
+ Turn it off when pending_menu_activation is not defined. */
+#ifdef USE_X_TOOLKIT
+ pending_menu_activation = 0;
+#endif
}
\f
/* Do a frame update, taking possible shortcuts into account.
return;
#endif
-#ifdef MULTI_FRAME
- if (FRAME_TERMCAP_P (selected_frame)
+ if (! FRAME_WINDOW_P (selected_frame)
&& previous_terminal_frame != selected_frame)
{
/* Since frames on an ASCII terminal share the same display area,
XSETFRAME (Vterminal_frame, selected_frame);
}
previous_terminal_frame = selected_frame;
-#endif
/* Set the visible flags for all frames.
Do this before checking for resized or garbaged frames; they want
if (windows_or_buffers_changed)
update_mode_lines++;
- /* Detect case that we need to write a star in the mode line. */
- if (XFASTINT (w->last_modified) < MODIFF
- && XFASTINT (w->last_modified) <= SAVE_MODIFF)
+ /* Detect case that we need to write or remove a star in the mode line. */
+ if ((SAVE_MODIFF < MODIFF) != !NILP (w->last_had_star))
{
w->update_mode_line = Qt;
if (buffer_shared > 1)
then we can't just move the cursor. */
else if (! (!NILP (Vtransient_mark_mode)
&& !NILP (current_buffer->mark_active))
+ && w == XWINDOW (current_buffer->last_selected_window)
&& NILP (w->region_showing)
&& !cursor_in_echo_area)
{
FOR_EACH_FRAME (tail, frame)
{
FRAME_PTR f = XFRAME (frame);
- if (! FRAME_TERMCAP_P (f) || f == selected_frame)
+ if (FRAME_WINDOW_P (f) || f == selected_frame)
{
/* Mark all the scroll bars to be removed; we'll redeem the ones
unrequest_sigio ();
stop_polling ();
-#ifdef MULTI_FRAME
if (all_windows)
{
Lisp_Object tail;
f = XFRAME (XCONS (tail)->car);
- if ((! FRAME_TERMCAP_P (f) || f == selected_frame)
+ if ((FRAME_WINDOW_P (f) || f == selected_frame)
&& FRAME_VISIBLE_P (f))
{
pause |= update_frame (f, 0, 0);
}
}
else
-#endif /* MULTI_FRAME */
{
if (FRAME_VISIBLE_P (selected_frame))
pause = update_frame (selected_frame, 0, 0);
mini_window = FRAME_MINIBUF_WINDOW (selected_frame);
mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
- if (mini_frame != selected_frame
- && ! FRAME_TERMCAP_P (mini_frame))
+ if (mini_frame != selected_frame && FRAME_WINDOW_P (mini_frame))
pause |= update_frame (mini_frame, 0, 0);
}
}
b->clip_changed = 0;
w->update_mode_line = Qnil;
XSETFASTINT (w->last_modified, BUF_MODIFF (b));
+ w->last_had_star
+ = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+ ? Qt : Qnil);
w->window_end_valid = w->buffer;
last_arrow_position = Voverlay_arrow_position;
last_arrow_string = Voverlay_arrow_string;
{
XSETFASTINT (w->last_modified,
!flag ? 0 : BUF_MODIFF (XBUFFER (w->buffer)));
+ w->last_had_star
+ = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+ ? Qt : Qnil);
/* Record if we are showing a region, so can make sure to
update it fully at next redisplay. */
w->region_showing = (!NILP (Vtransient_mark_mode)
+ && w == XWINDOW (current_buffer->last_selected_window)
&& !NILP (XBUFFER (w->buffer)->mark_active)
? Fmarker_position (XBUFFER (w->buffer)->mark)
: Qnil);
windows_or_buffers_changed anyway. */
if (windows_or_buffers_changed
|| !NILP (w->update_mode_line)
- || (XFASTINT (w->last_modified) < MODIFF
- && (XFASTINT (w->last_modified)
- <= BUF_SAVE_MODIFF (XBUFFER (w->buffer))))
+ || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+ < BUF_MODIFF (XBUFFER (w->buffer)))
+ != !NILP (w->last_had_star))
|| ((!NILP (Vtransient_mark_mode)
&& !NILP (XBUFFER (w->buffer)->mark_active))
!= !NILP (w->region_showing)))
call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
+ /* Redisplay the menu bar in case we changed it. */
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
if (FRAME_WINDOW_P (f))
set_frame_menubar (f, 0, 0);
-#endif /* USE_X_TOOLKIT || HAVE_NTGUI */
+ else
+ /* On a terminal screen, the menu bar is an ordinary screen
+ line, and this makes it get updated. */
+ w->update_mode_line = Qt;
+#else /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */
+ /* In the non-toolkit version, the menu bar is an ordinary screen
+ line, and this makes it get updated. */
+ w->update_mode_line = Qt;
+#endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */
unbind_to (count, Qnil);
set_buffer_internal_1 (prev);
/* 1 if we should highlight the region. */
int highlight_region
- = !NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active);
+ = (!NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active)
+ && XWINDOW (current_buffer->last_selected_window) == w);
int region_beg, region_end;
int selective = (INTEGERP (current_buffer->selective_display)
/* Did we hit a face change? Figure out what face we should
use now. We also hit this the first time through the
loop, to see what face we should start with. */
- if (pos >= next_face_change && (FRAME_WINDOW_P (f)))
+ if (pos >= next_face_change
+ && (FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f)))
current_face = compute_char_face (f, w, pos,
region_beg, region_end,
&next_face_change, pos + 50, 0);
int i;
#ifdef HAVE_NTGUI
- return;
+ if (!NILP (Vwindow_system))
+ return;
#endif
#ifdef USE_X_TOOLKIT
get_display_line (f, vpos, 0);
items = FRAME_MENU_BAR_ITEMS (f);
- for (i = 0; i < XVECTOR (items)->size; i += 3)
+ for (i = 0; i < XVECTOR (items)->size; i += 4)
{
Lisp_Object pos, string;
string = XVECTOR (items)->contents[i + 1];
if (NILP (string))
break;
- XSETFASTINT (XVECTOR (items)->contents[i + 2], hpos);
+ XSETFASTINT (XVECTOR (items)->contents[i + 3], hpos);
if (hpos < maxendcol)
hpos = display_string (XWINDOW (FRAME_ROOT_WINDOW (f)), vpos,
case 'F':
/* %F displays the frame name. */
-#ifdef MULTI_FRAME
- if (!NILP (selected_frame->title))
- return (char *) XSTRING (selected_frame->title)->data;
- if (selected_frame->explicit_name)
- return (char *) XSTRING (selected_frame->name)->data;
-#endif
+ if (!NILP (f->title))
+ return (char *) XSTRING (f->title)->data;
+ if (f->explicit_name || ! FRAME_WINDOW_P (f))
+ return (char *) XSTRING (f->name)->data;
return "Emacs";
case 'f':