aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2014-03-20 10:09:37 -0400
committerStefan Monnier2014-03-20 10:09:37 -0400
commitcaecb91c581d4ec0fc008a35005d8009f43087ee (patch)
treea1ec19db2c583f3dfea1c53b26c6936f978bbad9 /src
parent7b9cb5448748b75a15840b7fba080cdcb341d0f7 (diff)
downloademacs-caecb91c581d4ec0fc008a35005d8009f43087ee.tar.gz
emacs-caecb91c581d4ec0fc008a35005d8009f43087ee.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/alloc.c4
-rw-r--r--src/frame.c5
-rw-r--r--src/frame.h19
-rw-r--r--src/term.c20
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xterm.c18
7 files changed, 42 insertions, 40 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3256a92e37a..93d1ba247b1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date.
4 * xterm.c (handle_one_xevent) <MapNotify>: Don't garbage the frame.
5 * frame.c (frame_garbaged): Make "docstring" more precise.
6
12014-03-20 Glenn Morris <rgm@gnu.org> 72014-03-20 Glenn Morris <rgm@gnu.org>
2 8
3 * charset.c (init_charset): When we cannot find the charsets directory, 9 * charset.c (init_charset): When we cannot find the charsets directory,
@@ -74,8 +80,8 @@
74 we eventually back up the iterator to the wrap point. This avoids 80 we eventually back up the iterator to the wrap point. This avoids
75 delusional behavior of move_it_to, whereby it proceeds to the next 81 delusional behavior of move_it_to, whereby it proceeds to the next
76 display line, but sets current_x to zero for all the glyphs that 82 display line, but sets current_x to zero for all the glyphs that
77 without word-wrap would fit on the previous display line. One 83 without word-wrap would fit on the previous display line.
78 result was that visual-order cursor movement behaved erratically 84 One result was that visual-order cursor movement behaved erratically
79 under word-wrap. 85 under word-wrap.
80 (Fmove_point_visually): Add code to find the x coordinate of the 86 (Fmove_point_visually): Add code to find the x coordinate of the
81 last character before wrap point, under word-wrap on a TTY. 87 last character before wrap point, under word-wrap on a TTY.
@@ -107,8 +113,8 @@
107 SSDATA (Vx_resource_name), which may be changed from Lisp. 113 SSDATA (Vx_resource_name), which may be changed from Lisp.
108 (xim_close_display): For XUnregisterIMInstantiateCallback, 114 (xim_close_display): For XUnregisterIMInstantiateCallback,
109 always eassert return value and pass exactly the same values 115 always eassert return value and pass exactly the same values
110 as were used for XRegisterIMInstantiateCallback. Otherwise 116 as were used for XRegisterIMInstantiateCallback.
111 XUnregisterIMInstantiateCallback will always fail. See Xlib 117 Otherwise XUnregisterIMInstantiateCallback will always fail. See Xlib
112 sources to check why if you are interested. 118 sources to check why if you are interested.
113 119
1142014-03-05 Martin Rudalics <rudalics@gmx.at> 1202014-03-05 Martin Rudalics <rudalics@gmx.at>
diff --git a/src/alloc.c b/src/alloc.c
index 7c671e25cfc..62c3beec1d2 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1138,8 +1138,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
1138 } 1138 }
1139 1139
1140 abase = ABLOCK_ABASE (free_ablock); 1140 abase = ABLOCK_ABASE (free_ablock);
1141 ABLOCKS_BUSY (abase) = 1141 ABLOCKS_BUSY (abase)
1142 (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); 1142 = (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
1143 val = free_ablock; 1143 val = free_ablock;
1144 free_ablock = free_ablock->x.next_free; 1144 free_ablock = free_ablock->x.next_free;
1145 1145
diff --git a/src/frame.c b/src/frame.c
index 3d0c9d057c6..055ce36ff4f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -125,8 +125,7 @@ Lisp_Object selected_frame;
125 125
126static struct frame *last_nonminibuf_frame; 126static struct frame *last_nonminibuf_frame;
127 127
128/* Nonzero means there is at least one garbaged frame. */ 128/* False means there are no visible garbaged frames. */
129
130bool frame_garbaged; 129bool frame_garbaged;
131 130
132#ifdef HAVE_WINDOW_SYSTEM 131#ifdef HAVE_WINDOW_SYSTEM
@@ -621,7 +620,7 @@ make_terminal_frame (struct terminal *terminal)
621 FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1; 620 FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1;
622 FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); 621 FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
623 622
624 /* Set the top frame to the newly created frame. */ 623 /* Set the top frame to the newly created frame. */
625 if (FRAMEP (FRAME_TTY (f)->top_frame) 624 if (FRAMEP (FRAME_TTY (f)->top_frame)
626 && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame))) 625 && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
627 SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */ 626 SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */
diff --git a/src/frame.h b/src/frame.h
index 1230e97f04d..62dc33511b5 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -439,7 +439,7 @@ struct frame
439 /* The baud rate that was used to calculate costs for this frame. */ 439 /* The baud rate that was used to calculate costs for this frame. */
440 int cost_calculation_baud_rate; 440 int cost_calculation_baud_rate;
441 441
442 /* frame opacity 442 /* Frame opacity
443 alpha[0]: alpha transparency of the active frame 443 alpha[0]: alpha transparency of the active frame
444 alpha[1]: alpha transparency of inactive frames 444 alpha[1]: alpha transparency of inactive frames
445 Negative values mean not to change alpha. */ 445 Negative values mean not to change alpha. */
@@ -453,7 +453,7 @@ struct frame
453 /* Additional space to put between text lines on this frame. */ 453 /* Additional space to put between text lines on this frame. */
454 int extra_line_spacing; 454 int extra_line_spacing;
455 455
456 /* All display backends seem to need these two pixel values. */ 456 /* All display backends seem to need these two pixel values. */
457 unsigned long background_pixel; 457 unsigned long background_pixel;
458 unsigned long foreground_pixel; 458 unsigned long foreground_pixel;
459}; 459};
@@ -946,6 +946,9 @@ default_pixels_per_inch_y (void)
946 } \ 946 } \
947 } while (false) 947 } while (false)
948 948
949/* False means there are no visible garbaged frames. */
950extern bool frame_garbaged;
951
949/* Set visibility of frame F. 952/* Set visibility of frame F.
950 We call redisplay_other_windows to make sure the frame gets redisplayed 953 We call redisplay_other_windows to make sure the frame gets redisplayed
951 if some changes were applied to it while it wasn't visible (and hence 954 if some changes were applied to it while it wasn't visible (and hence
@@ -955,8 +958,13 @@ INLINE void
955SET_FRAME_VISIBLE (struct frame *f, int v) 958SET_FRAME_VISIBLE (struct frame *f, int v)
956{ 959{
957 eassert (0 <= v && v <= 2); 960 eassert (0 <= v && v <= 2);
958 if (v == 1 && f->visible != 1) 961 if (v)
959 redisplay_other_windows (); 962 {
963 if (v == 1 && f->visible != 1)
964 redisplay_other_windows ();
965 if (FRAME_GARBAGED_P (f))
966 frame_garbaged = true;
967 }
960 f->visible = v; 968 f->visible = v;
961} 969}
962 970
@@ -972,9 +980,6 @@ extern Lisp_Object Qtty_color_mode;
972extern Lisp_Object Qterminal; 980extern Lisp_Object Qterminal;
973extern Lisp_Object Qnoelisp; 981extern Lisp_Object Qnoelisp;
974 982
975/* True means there is at least one garbaged frame. */
976extern bool frame_garbaged;
977
978extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); 983extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
979extern struct frame *decode_window_system_frame (Lisp_Object); 984extern struct frame *decode_window_system_frame (Lisp_Object);
980extern struct frame *decode_live_frame (Lisp_Object); 985extern struct frame *decode_live_frame (Lisp_Object);
diff --git a/src/term.c b/src/term.c
index 61a8d39d971..773e85faabc 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3054,7 +3054,7 @@ free_saved_screen (struct glyph_matrix *saved)
3054 int i; 3054 int i;
3055 3055
3056 if (!saved) 3056 if (!saved)
3057 return; /* already freed */ 3057 return; /* Already freed! */
3058 3058
3059 for (i = 0; i < saved->nrows; ++i) 3059 for (i = 0; i < saved->nrows; ++i)
3060 { 3060 {
@@ -3170,7 +3170,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3170 int statecount, x, y, i; 3170 int statecount, x, y, i;
3171 bool leave, onepane; 3171 bool leave, onepane;
3172 int result IF_LINT (= 0); 3172 int result IF_LINT (= 0);
3173 int title_faces[4]; /* face to display the menu title */ 3173 int title_faces[4]; /* Face to display the menu title. */
3174 int faces[4], buffers_num_deleted = 0; 3174 int faces[4], buffers_num_deleted = 0;
3175 struct frame *sf = SELECTED_FRAME (); 3175 struct frame *sf = SELECTED_FRAME ();
3176 struct tty_display_info *tty = FRAME_TTY (sf); 3176 struct tty_display_info *tty = FRAME_TTY (sf);
@@ -3332,7 +3332,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3332 have been opened. That does not include an open and 3332 have been opened. That does not include an open and
3333 active submenu. */ 3333 active submenu. */
3334 if (i != statecount - 2 3334 if (i != statecount - 2
3335 || state[i].menu->submenu[dy] != state[i+1].menu) 3335 || state[i].menu->submenu[dy] != state[i + 1].menu)
3336 while (i != statecount - 1) 3336 while (i != statecount - 1)
3337 { 3337 {
3338 statecount--; 3338 statecount--;
@@ -3383,7 +3383,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3383 screen_update (sf, state[0].screen_behind); 3383 screen_update (sf, state[0].screen_behind);
3384 while (statecount--) 3384 while (statecount--)
3385 free_saved_screen (state[statecount].screen_behind); 3385 free_saved_screen (state[statecount].screen_behind);
3386 tty_show_cursor (tty); /* turn cursor back on */ 3386 tty_show_cursor (tty); /* Turn cursor back on. */
3387 fflush (tty->output); 3387 fflush (tty->output);
3388 3388
3389/* Clean up any mouse events that are waiting inside Emacs event queue. 3389/* 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 break; 3474 break;
3475 i += 4; 3475 i += 4;
3476 } 3476 }
3477 i -= 4; /* went one too far */ 3477 i -= 4; /* Went one too far! */
3478 } 3478 }
3479 return i; 3479 return i;
3480} 3480}
@@ -3519,7 +3519,7 @@ tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y)
3519 if (i < last_i) 3519 if (i < last_i)
3520 *x = XINT (AREF (items, i + 4 + 3)); 3520 *x = XINT (AREF (items, i + 4 + 3));
3521 else 3521 else
3522 *x = 0; /* wrap around to the first item */ 3522 *x = 0; /* Wrap around to the first item. */
3523 } 3523 }
3524 else if (prev_x < 0) 3524 else if (prev_x < 0)
3525 { 3525 {
@@ -3647,7 +3647,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
3647 3647
3648 if (!NILP (descrip)) 3648 if (!NILP (descrip))
3649 { 3649 {
3650 /* if alloca is fast, use that to make the space, 3650 /* If alloca is fast, use that to make the space,
3651 to reduce gc needs. */ 3651 to reduce gc needs. */
3652 item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1); 3652 item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1);
3653 memcpy (item_data, SSDATA (item_name), SBYTES (item_name)); 3653 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 uly = dispheight - height; 3694 uly = dispheight - height;
3695 } 3695 }
3696 3696
3697 if (FRAME_HAS_MINIBUF_P (f) && uly+height > dispheight - 2) 3697 if (FRAME_HAS_MINIBUF_P (f) && uly + height > dispheight - 2)
3698 { 3698 {
3699 /* Move the menu away of the echo area, to avoid overwriting the 3699 /* Move the menu away of the echo area, to avoid overwriting the
3700 menu with help echo messages or vice versa. */ 3700 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 /* If position was not given by a mouse click, adjust so upper left 3723 /* If position was not given by a mouse click, adjust so upper left
3724 corner of the menu as a whole ends up at given coordinates. This 3724 corner of the menu as a whole ends up at given coordinates. This
3725 is what x-popup-menu says in its documentation. */ 3725 is what x-popup-menu says in its documentation. */
3726 x += width/2; 3726 x += width / 2;
3727 y += 1.5*height/(maxlines+2); 3727 y += 1.5 * height / (maxlines + 2);
3728 } 3728 }
3729#endif 3729#endif
3730 3730
diff --git a/src/xdisp.c b/src/xdisp.c
index b7821eb5048..6f39324d2f0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -27253,7 +27253,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
27253 if (/* If window is in the process of being destroyed, don't bother 27253 if (/* If window is in the process of being destroyed, don't bother
27254 to do anything. */ 27254 to do anything. */
27255 w->current_matrix != NULL 27255 w->current_matrix != NULL
27256 /* Don't update mouse highlight if hidden */ 27256 /* Don't update mouse highlight if hidden. */
27257 && (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden) 27257 && (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden)
27258 /* Recognize when we are called to operate on rows that don't exist 27258 /* Recognize when we are called to operate on rows that don't exist
27259 anymore. This can happen when a window is split. */ 27259 anymore. This can happen when a window is split. */
diff --git a/src/xterm.c b/src/xterm.c
index 8ae26344f95..1136b671822 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5667,7 +5667,7 @@ static struct input_event *current_hold_quit;
5667 5667
5668/* This is the filter function invoked by the GTK event loop. 5668/* This is the filter function invoked by the GTK event loop.
5669 It is invoked before the XEvent is translated to a GdkEvent, 5669 It is invoked before the XEvent is translated to a GdkEvent,
5670 so we have a chance to act on the event before GTK. */ 5670 so we have a chance to act on the event before GTK. */
5671static GdkFilterReturn 5671static GdkFilterReturn
5672event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data) 5672event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
5673{ 5673{
@@ -5696,9 +5696,9 @@ event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
5696 if (! dpyinfo) 5696 if (! dpyinfo)
5697 current_finish = X_EVENT_NORMAL; 5697 current_finish = X_EVENT_NORMAL;
5698 else 5698 else
5699 current_count += 5699 current_count
5700 handle_one_xevent (dpyinfo, xev, &current_finish, 5700 += handle_one_xevent (dpyinfo, xev, &current_finish,
5701 current_hold_quit); 5701 current_hold_quit);
5702 } 5702 }
5703 else 5703 else
5704 current_finish = x_dispatch_event (xev, xev->xany.display); 5704 current_finish = x_dispatch_event (xev, xev->xany.display);
@@ -6142,14 +6142,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6142 if (f) 6142 if (f)
6143 { 6143 {
6144 bool iconified = FRAME_ICONIFIED_P (f); 6144 bool iconified = FRAME_ICONIFIED_P (f);
6145 /* wait_reading_process_output will notice this and update
6146 the frame's display structures.
6147 If we where iconified, we should not set garbaged,
6148 because that stops redrawing on Expose events. This looks
6149 bad if we are called from a recursive event loop
6150 (x_dispatch_event), for example when a dialog is up. */
6151 if (!iconified)
6152 SET_FRAME_GARBAGED (f);
6153 6145
6154 /* Check if fullscreen was specified before we where mapped the 6146 /* Check if fullscreen was specified before we where mapped the
6155 first time, i.e. from the command line. */ 6147 first time, i.e. from the command line. */
@@ -6700,7 +6692,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6700 6692
6701#ifdef USE_GTK 6693#ifdef USE_GTK
6702 /* GTK creates windows but doesn't map them. 6694 /* GTK creates windows but doesn't map them.
6703 Only get real positions when mapped. */ 6695 Only get real positions when mapped. */
6704 if (FRAME_GTK_OUTER_WIDGET (f) 6696 if (FRAME_GTK_OUTER_WIDGET (f)
6705 && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f))) 6697 && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f)))
6706#endif 6698#endif