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> 2014-03-20 Glenn Morris <rgm@gnu.org>
* charset.c (init_charset): When we cannot find the charsets directory, * charset.c (init_charset): When we cannot find the charsets directory,
...@@ -74,8 +80,8 @@ ...@@ -74,8 +80,8 @@
we eventually back up the iterator to the wrap point. This avoids we eventually back up the iterator to the wrap point. This avoids
delusional behavior of move_it_to, whereby it proceeds to the next 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 display line, but sets current_x to zero for all the glyphs that
without word-wrap would fit on the previous display line. One without word-wrap would fit on the previous display line.
result was that visual-order cursor movement behaved erratically One result was that visual-order cursor movement behaved erratically
under word-wrap. under word-wrap.
(Fmove_point_visually): Add code to find the x coordinate of the (Fmove_point_visually): Add code to find the x coordinate of the
last character before wrap point, under word-wrap on a TTY. last character before wrap point, under word-wrap on a TTY.
...@@ -107,8 +113,8 @@ ...@@ -107,8 +113,8 @@
SSDATA (Vx_resource_name), which may be changed from Lisp. SSDATA (Vx_resource_name), which may be changed from Lisp.
(xim_close_display): For XUnregisterIMInstantiateCallback, (xim_close_display): For XUnregisterIMInstantiateCallback,
always eassert return value and pass exactly the same values always eassert return value and pass exactly the same values
as were used for XRegisterIMInstantiateCallback. Otherwise as were used for XRegisterIMInstantiateCallback.
XUnregisterIMInstantiateCallback will always fail. See Xlib Otherwise XUnregisterIMInstantiateCallback will always fail. See Xlib
sources to check why if you are interested. sources to check why if you are interested.
2014-03-05 Martin Rudalics <rudalics@gmx.at> 2014-03-05 Martin Rudalics <rudalics@gmx.at>
......
...@@ -1138,8 +1138,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type) ...@@ -1138,8 +1138,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
} }
abase = ABLOCK_ABASE (free_ablock); abase = ABLOCK_ABASE (free_ablock);
ABLOCKS_BUSY (abase) = ABLOCKS_BUSY (abase)
(struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); = (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
val = free_ablock; val = free_ablock;
free_ablock = free_ablock->x.next_free; free_ablock = free_ablock->x.next_free;
......
...@@ -125,8 +125,7 @@ Lisp_Object selected_frame; ...@@ -125,8 +125,7 @@ Lisp_Object selected_frame;
static struct frame *last_nonminibuf_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; bool frame_garbaged;
#ifdef HAVE_WINDOW_SYSTEM #ifdef HAVE_WINDOW_SYSTEM
...@@ -621,7 +620,7 @@ make_terminal_frame (struct terminal *terminal) ...@@ -621,7 +620,7 @@ make_terminal_frame (struct terminal *terminal)
FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1; 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); 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) if (FRAMEP (FRAME_TTY (f)->top_frame)
&& FRAME_LIVE_P (XFRAME (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 */ SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */
......
...@@ -439,7 +439,7 @@ struct frame ...@@ -439,7 +439,7 @@ struct frame
/* The baud rate that was used to calculate costs for this frame. */ /* The baud rate that was used to calculate costs for this frame. */
int cost_calculation_baud_rate; int cost_calculation_baud_rate;
/* frame opacity /* Frame opacity
alpha[0]: alpha transparency of the active frame alpha[0]: alpha transparency of the active frame
alpha[1]: alpha transparency of inactive frames alpha[1]: alpha transparency of inactive frames
Negative values mean not to change alpha. */ Negative values mean not to change alpha. */
...@@ -453,7 +453,7 @@ struct frame ...@@ -453,7 +453,7 @@ struct frame
/* Additional space to put between text lines on this frame. */ /* Additional space to put between text lines on this frame. */
int extra_line_spacing; 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 background_pixel;
unsigned long foreground_pixel; unsigned long foreground_pixel;
}; };
...@@ -946,6 +946,9 @@ default_pixels_per_inch_y (void) ...@@ -946,6 +946,9 @@ default_pixels_per_inch_y (void)
} \ } \
} while (false) } while (false)
/* False means there are no visible garbaged frames. */
extern bool frame_garbaged;
/* Set visibility of frame F. /* Set visibility of frame F.
We call redisplay_other_windows to make sure the frame gets redisplayed 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 if some changes were applied to it while it wasn't visible (and hence
...@@ -955,8 +958,13 @@ INLINE void ...@@ -955,8 +958,13 @@ INLINE void
SET_FRAME_VISIBLE (struct frame *f, int v) SET_FRAME_VISIBLE (struct frame *f, int v)
{ {
eassert (0 <= v && v <= 2); eassert (0 <= v && v <= 2);
if (v == 1 && f->visible != 1) if (v)
redisplay_other_windows (); {
if (v == 1 && f->visible != 1)
redisplay_other_windows ();
if (FRAME_GARBAGED_P (f))
frame_garbaged = true;
}
f->visible = v; f->visible = v;
} }
...@@ -972,9 +980,6 @@ extern Lisp_Object Qtty_color_mode; ...@@ -972,9 +980,6 @@ extern Lisp_Object Qtty_color_mode;
extern Lisp_Object Qterminal; extern Lisp_Object Qterminal;
extern Lisp_Object Qnoelisp; 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 void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
extern struct frame *decode_window_system_frame (Lisp_Object); extern struct frame *decode_window_system_frame (Lisp_Object);
extern struct frame *decode_live_frame (Lisp_Object); extern struct frame *decode_live_frame (Lisp_Object);
......
...@@ -3054,7 +3054,7 @@ free_saved_screen (struct glyph_matrix *saved) ...@@ -3054,7 +3054,7 @@ free_saved_screen (struct glyph_matrix *saved)
int i; int i;
if (!saved) if (!saved)
return; /* already freed */ return; /* Already freed! */
for (i = 0; i < saved->nrows; ++i) for (i = 0; i < saved->nrows; ++i)
{ {
...@@ -3170,7 +3170,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, ...@@ -3170,7 +3170,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
int statecount, x, y, i; int statecount, x, y, i;
bool leave, onepane; bool leave, onepane;
int result IF_LINT (= 0); 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; int faces[4], buffers_num_deleted = 0;
struct frame *sf = SELECTED_FRAME (); struct frame *sf = SELECTED_FRAME ();
struct tty_display_info *tty = FRAME_TTY (sf); struct tty_display_info *tty = FRAME_TTY (sf);
...@@ -3332,7 +3332,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, ...@@ -3332,7 +3332,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
have been opened. That does not include an open and have been opened. That does not include an open and
active submenu. */ active submenu. */
if (i != statecount - 2 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) while (i != statecount - 1)
{ {
statecount--; statecount--;
...@@ -3383,7 +3383,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, ...@@ -3383,7 +3383,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
screen_update (sf, state[0].screen_behind); screen_update (sf, state[0].screen_behind);
while (statecount--) while (statecount--)
free_saved_screen (state[statecount].screen_behind); 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); fflush (tty->output);
/* Clean up any mouse events that are waiting inside Emacs event queue. /* Clean up any mouse events that are waiting inside Emacs event queue.
...@@ -3474,7 +3474,7 @@ tty_menu_last_menubar_item (struct frame *f) ...@@ -3474,7 +3474,7 @@ tty_menu_last_menubar_item (struct frame *f)
break; break;
i += 4; i += 4;
} }
i -= 4; /* went one too far */ i -= 4; /* Went one too far! */
} }
return i; return i;
} }
...@@ -3519,7 +3519,7 @@ tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y) ...@@ -3519,7 +3519,7 @@ tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y)
if (i < last_i) if (i < last_i)
*x = XINT (AREF (items, i + 4 + 3)); *x = XINT (AREF (items, i + 4 + 3));
else else
*x = 0; /* wrap around to the first item */ *x = 0; /* Wrap around to the first item. */
} }
else if (prev_x < 0) else if (prev_x < 0)
{ {
...@@ -3647,7 +3647,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps, ...@@ -3647,7 +3647,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
if (!NILP (descrip)) 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. */ to reduce gc needs. */
item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1); item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1);
memcpy (item_data, SSDATA (item_name), SBYTES (item_name)); 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, ...@@ -3694,7 +3694,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
uly = dispheight - height; 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 /* Move the menu away of the echo area, to avoid overwriting the
menu with help echo messages or vice versa. */ 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, ...@@ -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 /* 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 corner of the menu as a whole ends up at given coordinates. This
is what x-popup-menu says in its documentation. */ is what x-popup-menu says in its documentation. */
x += width/2; x += width / 2;
y += 1.5*height/(maxlines+2); y += 1.5 * height / (maxlines + 2);
} }
#endif #endif
......
...@@ -27253,7 +27253,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) ...@@ -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 if (/* If window is in the process of being destroyed, don't bother
to do anything. */ to do anything. */
w->current_matrix != NULL 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) && (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden)
/* Recognize when we are called to operate on rows that don't exist /* Recognize when we are called to operate on rows that don't exist
anymore. This can happen when a window is split. */ anymore. This can happen when a window is split. */
......
...@@ -5667,7 +5667,7 @@ static struct input_event *current_hold_quit; ...@@ -5667,7 +5667,7 @@ static struct input_event *current_hold_quit;
/* This is the filter function invoked by the GTK event loop. /* This is the filter function invoked by the GTK event loop.
It is invoked before the XEvent is translated to a GdkEvent, 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 static GdkFilterReturn
event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data) event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
{ {
...@@ -5696,9 +5696,9 @@ event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data) ...@@ -5696,9 +5696,9 @@ event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
if (! dpyinfo) if (! dpyinfo)
current_finish = X_EVENT_NORMAL; current_finish = X_EVENT_NORMAL;
else else
current_count += current_count
handle_one_xevent (dpyinfo, xev, &current_finish, += handle_one_xevent (dpyinfo, xev, &current_finish,
current_hold_quit); current_hold_quit);
} }
else else
current_finish = x_dispatch_event (xev, xev->xany.display); current_finish = x_dispatch_event (xev, xev->xany.display);
...@@ -6142,14 +6142,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, ...@@ -6142,14 +6142,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (f) if (f)
{ {
bool iconified = FRAME_ICONIFIED_P (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 /* Check if fullscreen was specified before we where mapped the
first time, i.e. from the command line. */ first time, i.e. from the command line. */
...@@ -6700,7 +6692,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, ...@@ -6700,7 +6692,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#ifdef USE_GTK #ifdef USE_GTK
/* GTK creates windows but doesn't map them. /* 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) if (FRAME_GTK_OUTER_WIDGET (f)
&& gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f))) && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f)))
#endif #endif
......
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