Commit caecb91c authored by Stefan Monnier's avatar Stefan Monnier

* src/frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date.

* src/xterm.c (handle_one_xevent) <MapNotify>: Don't garbage the frame.
* src/frame.c (frame_garbaged): Make "docstring" more precise.
parent 7b9cb544
2014-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
* frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date.
* xterm.c (handle_one_xevent) <MapNotify>: Don't garbage the frame.
* frame.c (frame_garbaged): Make "docstring" more precise.
2014-03-20 Glenn Morris <rgm@gnu.org>
* charset.c (init_charset): When we cannot find the charsets directory,
......@@ -74,8 +80,8 @@
we eventually back up the iterator to the wrap point. This avoids
delusional behavior of move_it_to, whereby it proceeds to the next
display line, but sets current_x to zero for all the glyphs that
without word-wrap would fit on the previous display line. One
result was that visual-order cursor movement behaved erratically
without word-wrap would fit on the previous display line.
One result was that visual-order cursor movement behaved erratically
under word-wrap.
(Fmove_point_visually): Add code to find the x coordinate of the
last character before wrap point, under word-wrap on a TTY.
......@@ -107,8 +113,8 @@
SSDATA (Vx_resource_name), which may be changed from Lisp.
(xim_close_display): For XUnregisterIMInstantiateCallback,
always eassert return value and pass exactly the same values
as were used for XRegisterIMInstantiateCallback. Otherwise
XUnregisterIMInstantiateCallback will always fail. See Xlib
as were used for XRegisterIMInstantiateCallback.
Otherwise XUnregisterIMInstantiateCallback will always fail. See Xlib
sources to check why if you are interested.
2014-03-05 Martin Rudalics <rudalics@gmx.at>
......
......@@ -1138,8 +1138,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
}
abase = ABLOCK_ABASE (free_ablock);
ABLOCKS_BUSY (abase) =
(struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
ABLOCKS_BUSY (abase)
= (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
val = free_ablock;
free_ablock = free_ablock->x.next_free;
......
......@@ -125,8 +125,7 @@ Lisp_Object selected_frame;
static struct frame *last_nonminibuf_frame;
/* Nonzero means there is at least one garbaged frame. */
/* False means there are no visible garbaged frames. */
bool frame_garbaged;
#ifdef HAVE_WINDOW_SYSTEM
......
......@@ -439,7 +439,7 @@ struct frame
/* The baud rate that was used to calculate costs for this frame. */
int cost_calculation_baud_rate;
/* frame opacity
/* Frame opacity
alpha[0]: alpha transparency of the active frame
alpha[1]: alpha transparency of inactive frames
Negative values mean not to change alpha. */
......@@ -946,6 +946,9 @@ default_pixels_per_inch_y (void)
} \
} while (false)
/* False means there are no visible garbaged frames. */
extern bool frame_garbaged;
/* Set visibility of frame F.
We call redisplay_other_windows to make sure the frame gets redisplayed
if some changes were applied to it while it wasn't visible (and hence
......@@ -955,8 +958,13 @@ INLINE void
SET_FRAME_VISIBLE (struct frame *f, int v)
{
eassert (0 <= v && v <= 2);
if (v)
{
if (v == 1 && f->visible != 1)
redisplay_other_windows ();
if (FRAME_GARBAGED_P (f))
frame_garbaged = true;
}
f->visible = v;
}
......@@ -972,9 +980,6 @@ extern Lisp_Object Qtty_color_mode;
extern Lisp_Object Qterminal;
extern Lisp_Object Qnoelisp;
/* True means there is at least one garbaged frame. */
extern bool frame_garbaged;
extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
extern struct frame *decode_window_system_frame (Lisp_Object);
extern struct frame *decode_live_frame (Lisp_Object);
......
......@@ -3054,7 +3054,7 @@ free_saved_screen (struct glyph_matrix *saved)
int i;
if (!saved)
return; /* already freed */
return; /* Already freed! */
for (i = 0; i < saved->nrows; ++i)
{
......@@ -3170,7 +3170,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
int statecount, x, y, i;
bool leave, onepane;
int result IF_LINT (= 0);
int title_faces[4]; /* face to display the menu title */
int title_faces[4]; /* Face to display the menu title. */
int faces[4], buffers_num_deleted = 0;
struct frame *sf = SELECTED_FRAME ();
struct tty_display_info *tty = FRAME_TTY (sf);
......@@ -3332,7 +3332,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
have been opened. That does not include an open and
active submenu. */
if (i != statecount - 2
|| state[i].menu->submenu[dy] != state[i+1].menu)
|| state[i].menu->submenu[dy] != state[i + 1].menu)
while (i != statecount - 1)
{
statecount--;
......@@ -3383,7 +3383,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
screen_update (sf, state[0].screen_behind);
while (statecount--)
free_saved_screen (state[statecount].screen_behind);
tty_show_cursor (tty); /* turn cursor back on */
tty_show_cursor (tty); /* Turn cursor back on. */
fflush (tty->output);
/* Clean up any mouse events that are waiting inside Emacs event queue.
......@@ -3474,7 +3474,7 @@ tty_menu_last_menubar_item (struct frame *f)
break;
i += 4;
}
i -= 4; /* went one too far */
i -= 4; /* Went one too far! */
}
return i;
}
......@@ -3519,7 +3519,7 @@ tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y)
if (i < last_i)
*x = XINT (AREF (items, i + 4 + 3));
else
*x = 0; /* wrap around to the first item */
*x = 0; /* Wrap around to the first item. */
}
else if (prev_x < 0)
{
......@@ -3647,7 +3647,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
if (!NILP (descrip))
{
/* if alloca is fast, use that to make the space,
/* If alloca is fast, use that to make the space,
to reduce gc needs. */
item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1);
memcpy (item_data, SSDATA (item_name), SBYTES (item_name));
......@@ -3694,7 +3694,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
uly = dispheight - height;
}
if (FRAME_HAS_MINIBUF_P (f) && uly+height > dispheight - 2)
if (FRAME_HAS_MINIBUF_P (f) && uly + height > dispheight - 2)
{
/* Move the menu away of the echo area, to avoid overwriting the
menu with help echo messages or vice versa. */
......@@ -3723,8 +3723,8 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
/* If position was not given by a mouse click, adjust so upper left
corner of the menu as a whole ends up at given coordinates. This
is what x-popup-menu says in its documentation. */
x += width/2;
y += 1.5*height/(maxlines+2);
x += width / 2;
y += 1.5 * height / (maxlines + 2);
}
#endif
......
......@@ -27253,7 +27253,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
if (/* If window is in the process of being destroyed, don't bother
to do anything. */
w->current_matrix != NULL
/* Don't update mouse highlight if hidden */
/* Don't update mouse highlight if hidden. */
&& (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden)
/* Recognize when we are called to operate on rows that don't exist
anymore. This can happen when a window is split. */
......
......@@ -5696,8 +5696,8 @@ event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
if (! dpyinfo)
current_finish = X_EVENT_NORMAL;
else
current_count +=
handle_one_xevent (dpyinfo, xev, &current_finish,
current_count
+= handle_one_xevent (dpyinfo, xev, &current_finish,
current_hold_quit);
}
else
......@@ -6142,14 +6142,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (f)
{
bool iconified = FRAME_ICONIFIED_P (f);
/* wait_reading_process_output will notice this and update
the frame's display structures.
If we where iconified, we should not set garbaged,
because that stops redrawing on Expose events. This looks
bad if we are called from a recursive event loop
(x_dispatch_event), for example when a dialog is up. */
if (!iconified)
SET_FRAME_GARBAGED (f);
/* Check if fullscreen was specified before we where mapped the
first time, i.e. from the command line. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment