* src/xterm.c (handle_one_xevent) <MapNotify>: Don't garbage the frame.
* src/frame.c (frame_garbaged): Make "docstring" more precise.
+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,
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.
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>
}
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;
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
FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1;
FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
- /* Set the top frame to the newly created frame. */
+ /* Set the top frame to the newly created frame. */
if (FRAMEP (FRAME_TTY (f)->top_frame)
&& FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */
/* 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. */
/* Additional space to put between text lines on this frame. */
int extra_line_spacing;
- /* All display backends seem to need these two pixel values. */
+ /* All display backends seem to need these two pixel values. */
unsigned long background_pixel;
unsigned long foreground_pixel;
};
} \
} 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
SET_FRAME_VISIBLE (struct frame *f, int v)
{
eassert (0 <= v && v <= 2);
- if (v == 1 && f->visible != 1)
- redisplay_other_windows ();
+ if (v)
+ {
+ if (v == 1 && f->visible != 1)
+ redisplay_other_windows ();
+ if (FRAME_GARBAGED_P (f))
+ frame_garbaged = true;
+ }
f->visible = v;
}
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);
int i;
if (!saved)
- return; /* already freed */
+ return; /* Already freed! */
for (i = 0; i < saved->nrows; ++i)
{
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);
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--;
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.
break;
i += 4;
}
- i -= 4; /* went one too far */
+ i -= 4; /* Went one too far! */
}
return i;
}
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)
{
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));
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. */
/* 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
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. */
/* This is the filter function invoked by the GTK event loop.
It is invoked before the XEvent is translated to a GdkEvent,
- so we have a chance to act on the event before GTK. */
+ so we have a chance to act on the event before GTK. */
static GdkFilterReturn
event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
{
if (! dpyinfo)
current_finish = X_EVENT_NORMAL;
else
- current_count +=
- handle_one_xevent (dpyinfo, xev, ¤t_finish,
- current_hold_quit);
+ current_count
+ += handle_one_xevent (dpyinfo, xev, ¤t_finish,
+ current_hold_quit);
}
else
current_finish = x_dispatch_event (xev, xev->xany.display);
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. */
#ifdef USE_GTK
/* GTK creates windows but doesn't map them.
- Only get real positions when mapped. */
+ Only get real positions when mapped. */
if (FRAME_GTK_OUTER_WIDGET (f)
&& gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f)))
#endif