diff options
| author | Alan Mackenzie | 2011-11-03 22:03:18 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2011-11-03 22:03:18 +0000 |
| commit | 85ba4cded3ef5a834c880edfdb6cf7ec3a747e9b (patch) | |
| tree | 2a207d6e9e906119087ad357c892414db01211cb /src | |
| parent | a6ba2ab9277496b66f6939766a3470c1f0a84287 (diff) | |
| parent | 14e1d9eab9f4b7341f92397a0a9a2706f7b26ee9 (diff) | |
| download | emacs-85ba4cded3ef5a834c880edfdb6cf7ec3a747e9b.tar.gz emacs-85ba4cded3ef5a834c880edfdb6cf7ec3a747e9b.zip | |
Merge.
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 28 | ||||
| -rw-r--r-- | src/ChangeLog | 81 | ||||
| -rw-r--r-- | src/alloc.c | 50 | ||||
| -rw-r--r-- | src/frame.h | 74 | ||||
| -rw-r--r-- | src/gtkutil.c | 2 | ||||
| -rw-r--r-- | src/minibuf.c | 4 | ||||
| -rw-r--r-- | src/process.c | 13 | ||||
| -rw-r--r-- | src/w32fns.c | 1 | ||||
| -rw-r--r-- | src/window.c | 15 | ||||
| -rw-r--r-- | src/xdisp.c | 57 | ||||
| -rw-r--r-- | src/xterm.c | 54 | ||||
| -rw-r--r-- | src/xterm.h | 3 |
12 files changed, 272 insertions, 110 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index b908ef005d6..80415abe40d 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -1245,20 +1245,36 @@ document xbacktrace | |||
| 1245 | an error was signaled. | 1245 | an error was signaled. |
| 1246 | end | 1246 | end |
| 1247 | 1247 | ||
| 1248 | define which | 1248 | define xprintbytestr |
| 1249 | set debug_print (which_symbols ($arg0)) | 1249 | set $data = (char *) $arg0->data |
| 1250 | printf "Bytecode: " | ||
| 1251 | output/u ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) | ||
| 1252 | end | ||
| 1253 | document xprintbytestr | ||
| 1254 | Print a string of byte code. | ||
| 1255 | end | ||
| 1256 | |||
| 1257 | define xwhichsymbols | ||
| 1258 | set $output_debug = print_output_debug_flag | ||
| 1259 | set print_output_debug_flag = 0 | ||
| 1260 | set safe_debug_print (which_symbols ($arg0, $arg1)) | ||
| 1261 | set print_output_debug_flag = $output_debug | ||
| 1250 | end | 1262 | end |
| 1251 | document which | 1263 | document xwhichsymbols |
| 1252 | Print symbols which references a given lisp object | 1264 | Print symbols which references a given lisp object |
| 1253 | either as its symbol value or symbol function. | 1265 | either as its symbol value or symbol function. |
| 1266 | Call with two arguments: the lisp object and the | ||
| 1267 | maximum number of symbols referencing it to produce. | ||
| 1254 | end | 1268 | end |
| 1255 | 1269 | ||
| 1256 | define xbytecode | 1270 | define xbytecode |
| 1257 | set $bt = byte_stack_list | 1271 | set $bt = byte_stack_list |
| 1258 | while $bt | 1272 | while $bt |
| 1259 | xgettype ($bt->byte_string) | 1273 | xgetptr $bt->byte_string |
| 1260 | printf "0x%x => ", $bt->byte_string | 1274 | set $ptr = (struct Lisp_String *) $ptr |
| 1261 | which $bt->byte_string | 1275 | xprintbytestr $ptr |
| 1276 | printf "\n0x%x => ", $bt->byte_string | ||
| 1277 | xwhichsymbols $bt->byte_string 5 | ||
| 1262 | set $bt = $bt->next | 1278 | set $bt = $bt->next |
| 1263 | end | 1279 | end |
| 1264 | end | 1280 | end |
diff --git a/src/ChangeLog b/src/ChangeLog index da0ba4b11f2..67f8507a26b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,84 @@ | |||
| 1 | 2011-11-03 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (unwind_create_frame): If needed, free the glyph | ||
| 4 | matrices of the partially constructed frame. (Bug#9943) | ||
| 5 | |||
| 6 | 2011-11-01 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 8 | * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment. | ||
| 9 | Don't stop backward scan on the continuation glyph, even though | ||
| 10 | its CHARPOS is positive. | ||
| 11 | (mouse_face_from_buffer_pos, note_mouse_highlight): Rename | ||
| 12 | cover_string to disp_string. | ||
| 13 | |||
| 14 | 2011-11-01 Martin Rudalics <rudalics@gmx.at> | ||
| 15 | |||
| 16 | * window.c (temp_output_buffer_show): Don't use | ||
| 17 | Vtemp_buffer_show_specifiers. | ||
| 18 | (Vtemp_buffer_show_specifiers): Remove unused variable. | ||
| 19 | |||
| 20 | 2011-10-30 Eli Zaretskii <eliz@gnu.org> | ||
| 21 | |||
| 22 | * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented | ||
| 23 | past the beginning of the current glyph matrix. | ||
| 24 | |||
| 25 | 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change) | ||
| 26 | |||
| 27 | * xterm.c: Include X11/Xproto.h if HAVE_GTK3. | ||
| 28 | (x_error_handler): Ignore BadMatch for X_SetInputFocus for | ||
| 29 | HAVE_GTK3 (Bug#9869). | ||
| 30 | |||
| 31 | * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize | ||
| 32 | type to GDK_NOTHING so valgrind does not complain (Bug#9901). | ||
| 33 | |||
| 34 | * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893). | ||
| 35 | |||
| 36 | * xterm.c: Declare x_handle_net_wm_state to return int. | ||
| 37 | (handle_one_xevent): Check if we are iconified but don't have | ||
| 38 | _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893). | ||
| 39 | (get_current_wm_state): Return non-zero if not hidden, | ||
| 40 | check for _NET_WM_STATE_HIDDEN (Bug#9893). | ||
| 41 | (do_ewmh_fullscreen): Ignore return value from get_current_wm_state. | ||
| 42 | (x_handle_net_wm_state): Return what get_current_wm_state returns. | ||
| 43 | (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden. | ||
| 44 | |||
| 45 | 2011-10-29 Paul Eggert <eggert@cs.ucla.edu> | ||
| 46 | |||
| 47 | * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE, | ||
| 48 | so that this new function doesn't get optimized away by a | ||
| 49 | whole-program optimizer. Make the 2nd arg EMACS_INT, not int. | ||
| 50 | |||
| 51 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 52 | |||
| 53 | * frame.h (MOUSE_HL_INFO): Remove excess parens. | ||
| 54 | |||
| 55 | 2011-10-29 Eli Zaretskii <eliz@gnu.org> | ||
| 56 | |||
| 57 | Fix the `xbytecode' command. | ||
| 58 | * .gdbinit (xprintbytestr): New command. | ||
| 59 | (xwhichsymbols): Renamed from `which'; all callers changed. | ||
| 60 | (xbytecode): Print the byte-code string as well. | ||
| 61 | |||
| 62 | 2011-10-29 Kim Storm <storm@cua.dk> | ||
| 63 | |||
| 64 | * alloc.c (which_symbols): New function. | ||
| 65 | |||
| 66 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 67 | |||
| 68 | * minibuf.c (read_minibuf_noninteractive): Allow reading empty | ||
| 69 | line. (Bug#9903) | ||
| 70 | |||
| 71 | 2011-10-29 Glenn Morris <rgm@gnu.org> | ||
| 72 | |||
| 73 | * process.c (wait_reading_process_output): Revert 2009-08-30 change. | ||
| 74 | Not clear what it was for, and it causes various bugs. (Bug#9839) | ||
| 75 | |||
| 76 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 77 | |||
| 78 | * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a | ||
| 79 | possible random value that matches one of those tested as | ||
| 80 | condition to clear the mouse face. | ||
| 81 | |||
| 1 | 2011-10-28 Chong Yidong <cyd@gnu.org> | 82 | 2011-10-28 Chong Yidong <cyd@gnu.org> |
| 2 | 83 | ||
| 3 | * xdisp.c (note_mouse_highlight): Fix use of uninitialized var. | 84 | * xdisp.c (note_mouse_highlight): Fix use of uninitialized var. |
diff --git a/src/alloc.c b/src/alloc.c index 6e999a0ba6d..210dd7d1687 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -279,6 +279,7 @@ static void compact_small_strings (void); | |||
| 279 | static void free_large_strings (void); | 279 | static void free_large_strings (void); |
| 280 | static void sweep_strings (void); | 280 | static void sweep_strings (void); |
| 281 | static void free_misc (Lisp_Object); | 281 | static void free_misc (Lisp_Object); |
| 282 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; | ||
| 282 | 283 | ||
| 283 | /* When scanning the C stack for live Lisp objects, Emacs keeps track | 284 | /* When scanning the C stack for live Lisp objects, Emacs keeps track |
| 284 | of what memory allocated via lisp_malloc is intended for what | 285 | of what memory allocated via lisp_malloc is intended for what |
| @@ -6250,6 +6251,55 @@ Frames, windows, buffers, and subprocesses count as vectors | |||
| 6250 | return Flist (8, consed); | 6251 | return Flist (8, consed); |
| 6251 | } | 6252 | } |
| 6252 | 6253 | ||
| 6254 | /* Find at most FIND_MAX symbols which have OBJ as their value or | ||
| 6255 | function. This is used in gdbinit's `xwhichsymbols' command. */ | ||
| 6256 | |||
| 6257 | Lisp_Object | ||
| 6258 | which_symbols (Lisp_Object obj, EMACS_INT find_max) | ||
| 6259 | { | ||
| 6260 | struct symbol_block *sblk; | ||
| 6261 | int gc_count = inhibit_garbage_collection (); | ||
| 6262 | Lisp_Object found = Qnil; | ||
| 6263 | |||
| 6264 | if (!EQ (obj, Vdead)) | ||
| 6265 | { | ||
| 6266 | for (sblk = symbol_block; sblk; sblk = sblk->next) | ||
| 6267 | { | ||
| 6268 | struct Lisp_Symbol *sym = sblk->symbols; | ||
| 6269 | int bn; | ||
| 6270 | |||
| 6271 | for (bn = 0; bn < SYMBOL_BLOCK_SIZE; bn++, sym++) | ||
| 6272 | { | ||
| 6273 | Lisp_Object val; | ||
| 6274 | Lisp_Object tem; | ||
| 6275 | |||
| 6276 | if (sblk == symbol_block && bn >= symbol_block_index) | ||
| 6277 | break; | ||
| 6278 | |||
| 6279 | XSETSYMBOL (tem, sym); | ||
| 6280 | val = find_symbol_value (tem); | ||
| 6281 | if (EQ (val, obj) | ||
| 6282 | || EQ (sym->function, obj) | ||
| 6283 | || (!NILP (sym->function) | ||
| 6284 | && COMPILEDP (sym->function) | ||
| 6285 | && EQ (AREF (sym->function, COMPILED_BYTECODE), obj)) | ||
| 6286 | || (!NILP (val) | ||
| 6287 | && COMPILEDP (val) | ||
| 6288 | && EQ (AREF (val, COMPILED_BYTECODE), obj))) | ||
| 6289 | { | ||
| 6290 | found = Fcons (tem, found); | ||
| 6291 | if (--find_max == 0) | ||
| 6292 | goto out; | ||
| 6293 | } | ||
| 6294 | } | ||
| 6295 | } | ||
| 6296 | } | ||
| 6297 | |||
| 6298 | out: | ||
| 6299 | unbind_to (gc_count, Qnil); | ||
| 6300 | return found; | ||
| 6301 | } | ||
| 6302 | |||
| 6253 | #ifdef ENABLE_CHECKING | 6303 | #ifdef ENABLE_CHECKING |
| 6254 | int suppress_checking; | 6304 | int suppress_checking; |
| 6255 | 6305 | ||
diff --git a/src/frame.h b/src/frame.h index 3775403810f..e096807b02e 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -538,12 +538,12 @@ typedef struct frame *FRAME_PTR; | |||
| 538 | does not have FRAME_X_DISPLAY_INFO. */ | 538 | does not have FRAME_X_DISPLAY_INFO. */ |
| 539 | #ifdef HAVE_WINDOW_SYSTEM | 539 | #ifdef HAVE_WINDOW_SYSTEM |
| 540 | # define MOUSE_HL_INFO(F) \ | 540 | # define MOUSE_HL_INFO(F) \ |
| 541 | (FRAME_WINDOW_P(F) \ | 541 | (FRAME_WINDOW_P(F) \ |
| 542 | ? &(FRAME_X_DISPLAY_INFO(F)->mouse_highlight) \ | 542 | ? &FRAME_X_DISPLAY_INFO(F)->mouse_highlight \ |
| 543 | : &(((F)->output_data.tty->display_info)->mouse_highlight)) | 543 | : &(F)->output_data.tty->display_info->mouse_highlight) |
| 544 | #else | 544 | #else |
| 545 | # define MOUSE_HL_INFO(F) \ | 545 | # define MOUSE_HL_INFO(F) \ |
| 546 | (&(((F)->output_data.tty->display_info)->mouse_highlight)) | 546 | (&(F)->output_data.tty->display_info->mouse_highlight) |
| 547 | #endif | 547 | #endif |
| 548 | 548 | ||
| 549 | /* Nonzero if frame F is still alive (not deleted). */ | 549 | /* Nonzero if frame F is still alive (not deleted). */ |
| @@ -594,7 +594,7 @@ typedef struct frame *FRAME_PTR; | |||
| 594 | /* Lines above the top-most window in frame F. */ | 594 | /* Lines above the top-most window in frame F. */ |
| 595 | 595 | ||
| 596 | #define FRAME_TOP_MARGIN(F) \ | 596 | #define FRAME_TOP_MARGIN(F) \ |
| 597 | (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F)) | 597 | (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F)) |
| 598 | 598 | ||
| 599 | /* Pixel height of the top margin above. */ | 599 | /* Pixel height of the top margin above. */ |
| 600 | 600 | ||
| @@ -659,11 +659,11 @@ typedef struct frame *FRAME_PTR; | |||
| 659 | and which side they are on. */ | 659 | and which side they are on. */ |
| 660 | #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type) | 660 | #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type) |
| 661 | #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ | 661 | #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ |
| 662 | ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none) | 662 | ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none) |
| 663 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \ | 663 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \ |
| 664 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left) | 664 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left) |
| 665 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \ | 665 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \ |
| 666 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right) | 666 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right) |
| 667 | 667 | ||
| 668 | /* Width that a scroll bar in frame F should have, if there is one. | 668 | /* Width that a scroll bar in frame F should have, if there is one. |
| 669 | Measured in pixels. | 669 | Measured in pixels. |
| @@ -680,13 +680,13 @@ typedef struct frame *FRAME_PTR; | |||
| 680 | the right in this frame, or there are no scroll bars, value is 0. */ | 680 | the right in this frame, or there are no scroll bars, value is 0. */ |
| 681 | 681 | ||
| 682 | #define FRAME_LEFT_SCROLL_BAR_COLS(f) \ | 682 | #define FRAME_LEFT_SCROLL_BAR_COLS(f) \ |
| 683 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ | 683 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ |
| 684 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 684 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 685 | : 0) | 685 | : 0) |
| 686 | 686 | ||
| 687 | /* Width of a left scroll bar in frame F, measured in pixels */ | 687 | /* Width of a left scroll bar in frame F, measured in pixels */ |
| 688 | 688 | ||
| 689 | #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \ | 689 | #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \ |
| 690 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ | 690 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ |
| 691 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ | 691 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ |
| 692 | : 0) | 692 | : 0) |
| @@ -696,13 +696,13 @@ typedef struct frame *FRAME_PTR; | |||
| 696 | the left in this frame, or there are no scroll bars, value is 0. */ | 696 | the left in this frame, or there are no scroll bars, value is 0. */ |
| 697 | 697 | ||
| 698 | #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \ | 698 | #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \ |
| 699 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ | 699 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ |
| 700 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 700 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 701 | : 0) | 701 | : 0) |
| 702 | 702 | ||
| 703 | /* Width of a right scroll bar area in frame F, measured in pixels */ | 703 | /* Width of a right scroll bar area in frame F, measured in pixels */ |
| 704 | 704 | ||
| 705 | #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \ | 705 | #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \ |
| 706 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ | 706 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ |
| 707 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ | 707 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ |
| 708 | : 0) | 708 | : 0) |
| @@ -710,9 +710,9 @@ typedef struct frame *FRAME_PTR; | |||
| 710 | /* Actual width of a scroll bar in frame F, measured in columns. */ | 710 | /* Actual width of a scroll bar in frame F, measured in columns. */ |
| 711 | 711 | ||
| 712 | #define FRAME_SCROLL_BAR_COLS(f) \ | 712 | #define FRAME_SCROLL_BAR_COLS(f) \ |
| 713 | (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ | 713 | (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ |
| 714 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 714 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 715 | : 0) | 715 | : 0) |
| 716 | 716 | ||
| 717 | /* Actual width of a scroll bar area in frame F, measured in pixels. */ | 717 | /* Actual width of a scroll bar area in frame F, measured in pixels. */ |
| 718 | 718 | ||
| @@ -731,21 +731,21 @@ typedef struct frame *FRAME_PTR; | |||
| 731 | not including scroll bars and fringes. */ | 731 | not including scroll bars and fringes. */ |
| 732 | 732 | ||
| 733 | #define SET_FRAME_COLS(f, val) \ | 733 | #define SET_FRAME_COLS(f, val) \ |
| 734 | (FRAME_COLS (f) = (val), \ | 734 | (FRAME_COLS (f) = (val), \ |
| 735 | (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) | 735 | (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) |
| 736 | 736 | ||
| 737 | /* Given a value WIDTH for frame F's nominal width, | 737 | /* Given a value WIDTH for frame F's nominal width, |
| 738 | return the value that FRAME_TOTAL_COLS should have. */ | 738 | return the value that FRAME_TOTAL_COLS should have. */ |
| 739 | 739 | ||
| 740 | #define FRAME_TOTAL_COLS_ARG(f, width) \ | 740 | #define FRAME_TOTAL_COLS_ARG(f, width) \ |
| 741 | ((width) \ | 741 | ((width) \ |
| 742 | + FRAME_SCROLL_BAR_COLS (f) \ | 742 | + FRAME_SCROLL_BAR_COLS (f) \ |
| 743 | + FRAME_FRINGE_COLS (f)) | 743 | + FRAME_FRINGE_COLS (f)) |
| 744 | 744 | ||
| 745 | /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */ | 745 | /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */ |
| 746 | 746 | ||
| 747 | #define FRAME_CURSOR_X_LIMIT(f) \ | 747 | #define FRAME_CURSOR_X_LIMIT(f) \ |
| 748 | (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) | 748 | (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) |
| 749 | 749 | ||
| 750 | /* Nonzero if frame F has scroll bars. */ | 750 | /* Nonzero if frame F has scroll bars. */ |
| 751 | 751 | ||
| @@ -938,18 +938,18 @@ extern Lisp_Object selected_frame; | |||
| 938 | float. Value is a C integer. */ | 938 | float. Value is a C integer. */ |
| 939 | 939 | ||
| 940 | #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \ | 940 | #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \ |
| 941 | (INTEGERP (X) \ | 941 | (INTEGERP (X) \ |
| 942 | ? XINT (X) * FRAME_COLUMN_WIDTH (F) \ | 942 | ? XINT (X) * FRAME_COLUMN_WIDTH (F) \ |
| 943 | : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F))) | 943 | : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F))) |
| 944 | 944 | ||
| 945 | /* Convert canonical value Y to pixels. F is the frame whose | 945 | /* Convert canonical value Y to pixels. F is the frame whose |
| 946 | canonical character height is to be used. X must be a Lisp integer | 946 | canonical character height is to be used. X must be a Lisp integer |
| 947 | or float. Value is a C integer. */ | 947 | or float. Value is a C integer. */ |
| 948 | 948 | ||
| 949 | #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \ | 949 | #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \ |
| 950 | (INTEGERP (Y) \ | 950 | (INTEGERP (Y) \ |
| 951 | ? XINT (Y) * FRAME_LINE_HEIGHT (F) \ | 951 | ? XINT (Y) * FRAME_LINE_HEIGHT (F) \ |
| 952 | : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F))) | 952 | : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F))) |
| 953 | 953 | ||
| 954 | /* Convert pixel-value X to canonical units. F is the frame whose | 954 | /* Convert pixel-value X to canonical units. F is the frame whose |
| 955 | canonical character width is to be used. X is a C integer. Result | 955 | canonical character width is to be used. X is a C integer. Result |
| @@ -957,9 +957,9 @@ extern Lisp_Object selected_frame; | |||
| 957 | otherwise it's a Lisp integer. */ | 957 | otherwise it's a Lisp integer. */ |
| 958 | 958 | ||
| 959 | #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \ | 959 | #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \ |
| 960 | ((X) % FRAME_COLUMN_WIDTH (F) != 0 \ | 960 | ((X) % FRAME_COLUMN_WIDTH (F) != 0 \ |
| 961 | ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \ | 961 | ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \ |
| 962 | : make_number ((X) / FRAME_COLUMN_WIDTH (F))) | 962 | : make_number ((X) / FRAME_COLUMN_WIDTH (F))) |
| 963 | 963 | ||
| 964 | /* Convert pixel-value Y to canonical units. F is the frame whose | 964 | /* Convert pixel-value Y to canonical units. F is the frame whose |
| 965 | canonical character height is to be used. Y is a C integer. | 965 | canonical character height is to be used. Y is a C integer. |
| @@ -967,9 +967,9 @@ extern Lisp_Object selected_frame; | |||
| 967 | otherwise it's a Lisp integer. */ | 967 | otherwise it's a Lisp integer. */ |
| 968 | 968 | ||
| 969 | #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \ | 969 | #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \ |
| 970 | ((Y) % FRAME_LINE_HEIGHT (F) \ | 970 | ((Y) % FRAME_LINE_HEIGHT (F) \ |
| 971 | ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \ | 971 | ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \ |
| 972 | : make_number ((Y) / FRAME_LINE_HEIGHT (F))) | 972 | : make_number ((Y) / FRAME_LINE_HEIGHT (F))) |
| 973 | 973 | ||
| 974 | 974 | ||
| 975 | 975 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 3cac8084dea..26959d57d4b 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -987,6 +987,7 @@ xg_win_to_widget (Display *dpy, Window wdesc) | |||
| 987 | { | 987 | { |
| 988 | GdkEvent event; | 988 | GdkEvent event; |
| 989 | event.any.window = gdkwin; | 989 | event.any.window = gdkwin; |
| 990 | event.any.type = GDK_NOTHING; | ||
| 990 | gwdesc = gtk_get_event_widget (&event); | 991 | gwdesc = gtk_get_event_widget (&event); |
| 991 | } | 992 | } |
| 992 | 993 | ||
| @@ -3254,6 +3255,7 @@ xg_event_is_for_menubar (FRAME_PTR f, XEvent *event) | |||
| 3254 | gw = gdk_x11_window_lookup_for_display (gdpy, event->xbutton.window); | 3255 | gw = gdk_x11_window_lookup_for_display (gdpy, event->xbutton.window); |
| 3255 | if (! gw) return 0; | 3256 | if (! gw) return 0; |
| 3256 | gevent.any.window = gw; | 3257 | gevent.any.window = gw; |
| 3258 | gevent.any.type = GDK_NOTHING; | ||
| 3257 | gwdesc = gtk_get_event_widget (&gevent); | 3259 | gwdesc = gtk_get_event_widget (&gevent); |
| 3258 | if (! gwdesc) return 0; | 3260 | if (! gwdesc) return 0; |
| 3259 | if (! GTK_IS_MENU_BAR (gwdesc) | 3261 | if (! GTK_IS_MENU_BAR (gwdesc) |
diff --git a/src/minibuf.c b/src/minibuf.c index a44a6376472..7ece5764203 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -251,7 +251,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 251 | 251 | ||
| 252 | while ((c = getchar ()) != '\n') | 252 | while ((c = getchar ()) != '\n') |
| 253 | { | 253 | { |
| 254 | if (c < 0) | 254 | if (c == EOF) |
| 255 | { | 255 | { |
| 256 | if (errno != EINTR) | 256 | if (errno != EINTR) |
| 257 | break; | 257 | break; |
| @@ -269,7 +269,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 269 | } | 269 | } |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | if (len) | 272 | if (len || c == '\n') |
| 273 | { | 273 | { |
| 274 | val = make_string (line, len); | 274 | val = make_string (line, len); |
| 275 | xfree (line); | 275 | xfree (line); |
diff --git a/src/process.c b/src/process.c index dc37ec5f961..c316139a713 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4856,16 +4856,11 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 4856 | It can't hurt. */ | 4856 | It can't hurt. */ |
| 4857 | else if (nread == -1 && errno == EIO) | 4857 | else if (nread == -1 && errno == EIO) |
| 4858 | { | 4858 | { |
| 4859 | /* Clear the descriptor now, so we only raise the | 4859 | /* Clear the descriptor now, so we only raise the signal once. */ |
| 4860 | signal once. Don't do this if `process' is only | 4860 | FD_CLR (channel, &input_wait_mask); |
| 4861 | a pty. */ | 4861 | FD_CLR (channel, &non_keyboard_wait_mask); |
| 4862 | if (XPROCESS (proc)->pid != -2) | ||
| 4863 | { | ||
| 4864 | FD_CLR (channel, &input_wait_mask); | ||
| 4865 | FD_CLR (channel, &non_keyboard_wait_mask); | ||
| 4866 | 4862 | ||
| 4867 | kill (getpid (), SIGCHLD); | 4863 | kill (getpid (), SIGCHLD); |
| 4868 | } | ||
| 4869 | } | 4864 | } |
| 4870 | #endif /* HAVE_PTYS */ | 4865 | #endif /* HAVE_PTYS */ |
| 4871 | /* If we can detect process termination, don't consider the process | 4866 | /* If we can detect process termination, don't consider the process |
diff --git a/src/w32fns.c b/src/w32fns.c index 2ecd6e91533..f7ba1c59e7b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3993,6 +3993,7 @@ unwind_create_frame (Lisp_Object frame) | |||
| 3993 | #endif | 3993 | #endif |
| 3994 | 3994 | ||
| 3995 | x_free_frame_resources (f); | 3995 | x_free_frame_resources (f); |
| 3996 | free_glyphs (f); | ||
| 3996 | 3997 | ||
| 3997 | #if GLYPH_DEBUG | 3998 | #if GLYPH_DEBUG |
| 3998 | /* Check that reference counts are indeed correct. */ | 3999 | /* Check that reference counts are indeed correct. */ |
diff --git a/src/window.c b/src/window.c index 38f16c91f34..422073b1bd3 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3185,10 +3185,7 @@ temp_output_buffer_show (register Lisp_Object buf) | |||
| 3185 | call1 (Vtemp_buffer_show_function, buf); | 3185 | call1 (Vtemp_buffer_show_function, buf); |
| 3186 | else | 3186 | else |
| 3187 | { | 3187 | { |
| 3188 | window = display_buffer (buf, Vtemp_buffer_show_specifiers, Qnil); | 3188 | window = display_buffer (buf, Qnil, Qnil); |
| 3189 | /* Reset Vtemp_buffer_show_specifiers immediately so it won't | ||
| 3190 | affect subsequent calls. */ | ||
| 3191 | Vtemp_buffer_show_specifiers = Qnil; | ||
| 3192 | 3189 | ||
| 3193 | if (!EQ (XWINDOW (window)->frame, selected_frame)) | 3190 | if (!EQ (XWINDOW (window)->frame, selected_frame)) |
| 3194 | Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); | 3191 | Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); |
| @@ -6460,16 +6457,6 @@ If this function is used, then it must do the entire job of showing | |||
| 6460 | the buffer; `temp-buffer-show-hook' is not run unless this function runs it. */); | 6457 | the buffer; `temp-buffer-show-hook' is not run unless this function runs it. */); |
| 6461 | Vtemp_buffer_show_function = Qnil; | 6458 | Vtemp_buffer_show_function = Qnil; |
| 6462 | 6459 | ||
| 6463 | DEFVAR_LISP ("temp-buffer-show-specifiers", Vtemp_buffer_show_specifiers, | ||
| 6464 | doc: /* Buffer display specifiers used by `with-output-to-temp-buffer'. | ||
| 6465 | These specifiers are passed by `with-output-to-temp-buffer' as second | ||
| 6466 | argument to `display-buffer'. Applications should only let-bind this | ||
| 6467 | around a call to `with-output-to-temp-buffer'. | ||
| 6468 | |||
| 6469 | For a description of buffer display specifiers see the variable | ||
| 6470 | `display-buffer-alist'. */); | ||
| 6471 | Vtemp_buffer_show_specifiers = Qnil; | ||
| 6472 | |||
| 6473 | DEFVAR_LISP ("minibuffer-scroll-window", Vminibuf_scroll_window, | 6460 | DEFVAR_LISP ("minibuffer-scroll-window", Vminibuf_scroll_window, |
| 6474 | doc: /* Non-nil means it is the window that C-M-v in minibuffer should scroll. */); | 6461 | doc: /* Non-nil means it is the window that C-M-v in minibuffer should scroll. */); |
| 6475 | Vminibuf_scroll_window = Qnil; | 6462 | Vminibuf_scroll_window = Qnil; |
diff --git a/src/xdisp.c b/src/xdisp.c index 296b2d13219..97687f8975b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -14829,8 +14829,6 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14829 | bidi-reordered rows. */ | 14829 | bidi-reordered rows. */ |
| 14830 | while (MATRIX_ROW_CONTINUATION_LINE_P (row)) | 14830 | while (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
| 14831 | { | 14831 | { |
| 14832 | xassert (row->enabled_p); | ||
| 14833 | --row; | ||
| 14834 | /* If we hit the beginning of the displayed portion | 14832 | /* If we hit the beginning of the displayed portion |
| 14835 | without finding the first row of a continued | 14833 | without finding the first row of a continued |
| 14836 | line, give up. */ | 14834 | line, give up. */ |
| @@ -14839,7 +14837,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14839 | rc = CURSOR_MOVEMENT_MUST_SCROLL; | 14837 | rc = CURSOR_MOVEMENT_MUST_SCROLL; |
| 14840 | break; | 14838 | break; |
| 14841 | } | 14839 | } |
| 14842 | 14840 | xassert (row->enabled_p); | |
| 14841 | --row; | ||
| 14843 | } | 14842 | } |
| 14844 | } | 14843 | } |
| 14845 | if (must_scroll) | 14844 | if (must_scroll) |
| @@ -25809,7 +25808,7 @@ rows_from_pos_range (struct window *w, | |||
| 25809 | for the overlay or run of text properties specifying the mouse | 25808 | for the overlay or run of text properties specifying the mouse |
| 25810 | face. BEFORE_STRING and AFTER_STRING, if non-nil, are a | 25809 | face. BEFORE_STRING and AFTER_STRING, if non-nil, are a |
| 25811 | before-string and after-string that must also be highlighted. | 25810 | before-string and after-string that must also be highlighted. |
| 25812 | COVER_STRING, if non-nil, is a display string that may cover some | 25811 | DISP_STRING, if non-nil, is a display string that may cover some |
| 25813 | or all of the highlighted text. */ | 25812 | or all of the highlighted text. */ |
| 25814 | 25813 | ||
| 25815 | static void | 25814 | static void |
| @@ -25820,7 +25819,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25820 | EMACS_INT end_charpos, | 25819 | EMACS_INT end_charpos, |
| 25821 | Lisp_Object before_string, | 25820 | Lisp_Object before_string, |
| 25822 | Lisp_Object after_string, | 25821 | Lisp_Object after_string, |
| 25823 | Lisp_Object cover_string) | 25822 | Lisp_Object disp_string) |
| 25824 | { | 25823 | { |
| 25825 | struct window *w = XWINDOW (window); | 25824 | struct window *w = XWINDOW (window); |
| 25826 | struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); | 25825 | struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
| @@ -25829,7 +25828,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25829 | EMACS_INT ignore, pos; | 25828 | EMACS_INT ignore, pos; |
| 25830 | int x; | 25829 | int x; |
| 25831 | 25830 | ||
| 25832 | xassert (NILP (cover_string) || STRINGP (cover_string)); | 25831 | xassert (NILP (disp_string) || STRINGP (disp_string)); |
| 25833 | xassert (NILP (before_string) || STRINGP (before_string)); | 25832 | xassert (NILP (before_string) || STRINGP (before_string)); |
| 25834 | xassert (NILP (after_string) || STRINGP (after_string)); | 25833 | xassert (NILP (after_string) || STRINGP (after_string)); |
| 25835 | 25834 | ||
| @@ -25839,7 +25838,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25839 | r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); | 25838 | r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); |
| 25840 | /* If the before-string or display-string contains newlines, | 25839 | /* If the before-string or display-string contains newlines, |
| 25841 | rows_from_pos_range skips to its last row. Move back. */ | 25840 | rows_from_pos_range skips to its last row. Move back. */ |
| 25842 | if (!NILP (before_string) || !NILP (cover_string)) | 25841 | if (!NILP (before_string) || !NILP (disp_string)) |
| 25843 | { | 25842 | { |
| 25844 | struct glyph_row *prev; | 25843 | struct glyph_row *prev; |
| 25845 | while ((prev = r1 - 1, prev >= first) | 25844 | while ((prev = r1 - 1, prev >= first) |
| @@ -25851,7 +25850,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25851 | while (--glyph >= beg && INTEGERP (glyph->object)); | 25850 | while (--glyph >= beg && INTEGERP (glyph->object)); |
| 25852 | if (glyph < beg | 25851 | if (glyph < beg |
| 25853 | || !(EQ (glyph->object, before_string) | 25852 | || !(EQ (glyph->object, before_string) |
| 25854 | || EQ (glyph->object, cover_string))) | 25853 | || EQ (glyph->object, disp_string))) |
| 25855 | break; | 25854 | break; |
| 25856 | r1 = prev; | 25855 | r1 = prev; |
| 25857 | } | 25856 | } |
| @@ -25876,10 +25875,10 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25876 | r2 = next; | 25875 | r2 = next; |
| 25877 | } | 25876 | } |
| 25878 | /* The rest of the display engine assumes that mouse_face_beg_row is | 25877 | /* The rest of the display engine assumes that mouse_face_beg_row is |
| 25879 | either above below mouse_face_end_row or identical to it. But | 25878 | either above mouse_face_end_row or identical to it. But with |
| 25880 | with bidi-reordered continued lines, the row for START_CHARPOS | 25879 | bidi-reordered continued lines, the row for START_CHARPOS could |
| 25881 | could be below the row for END_CHARPOS. If so, swap the rows and | 25880 | be below the row for END_CHARPOS. If so, swap the rows and store |
| 25882 | store them in correct order. */ | 25881 | them in correct order. */ |
| 25883 | if (r1->y > r2->y) | 25882 | if (r1->y > r2->y) |
| 25884 | { | 25883 | { |
| 25885 | struct glyph_row *tem = r2; | 25884 | struct glyph_row *tem = r2; |
| @@ -25894,7 +25893,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25894 | hlinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix); | 25893 | hlinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix); |
| 25895 | 25894 | ||
| 25896 | /* For a bidi-reordered row, the positions of BEFORE_STRING, | 25895 | /* For a bidi-reordered row, the positions of BEFORE_STRING, |
| 25897 | AFTER_STRING, COVER_STRING, START_CHARPOS, and END_CHARPOS | 25896 | AFTER_STRING, DISP_STRING, START_CHARPOS, and END_CHARPOS |
| 25898 | could be anywhere in the row and in any order. The strategy | 25897 | could be anywhere in the row and in any order. The strategy |
| 25899 | below is to find the leftmost and the rightmost glyph that | 25898 | below is to find the leftmost and the rightmost glyph that |
| 25900 | belongs to either of these 3 strings, or whose position is | 25899 | belongs to either of these 3 strings, or whose position is |
| @@ -25920,11 +25919,11 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25920 | x += glyph->pixel_width; | 25919 | x += glyph->pixel_width; |
| 25921 | 25920 | ||
| 25922 | /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, | 25921 | /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, |
| 25923 | or COVER_STRING, and the first glyph from buffer whose | 25922 | or DISP_STRING, and the first glyph from buffer whose |
| 25924 | position is between START_CHARPOS and END_CHARPOS. */ | 25923 | position is between START_CHARPOS and END_CHARPOS. */ |
| 25925 | for (; glyph < end | 25924 | for (; glyph < end |
| 25926 | && !INTEGERP (glyph->object) | 25925 | && !INTEGERP (glyph->object) |
| 25927 | && !EQ (glyph->object, cover_string) | 25926 | && !EQ (glyph->object, disp_string) |
| 25928 | && !(BUFFERP (glyph->object) | 25927 | && !(BUFFERP (glyph->object) |
| 25929 | && (glyph->charpos >= start_charpos | 25928 | && (glyph->charpos >= start_charpos |
| 25930 | && glyph->charpos < end_charpos)); | 25929 | && glyph->charpos < end_charpos)); |
| @@ -25971,11 +25970,11 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25971 | ; | 25970 | ; |
| 25972 | 25971 | ||
| 25973 | /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, | 25972 | /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, |
| 25974 | or COVER_STRING, and the first glyph from buffer whose | 25973 | or DISP_STRING, and the first glyph from buffer whose |
| 25975 | position is between START_CHARPOS and END_CHARPOS. */ | 25974 | position is between START_CHARPOS and END_CHARPOS. */ |
| 25976 | for (; glyph > end | 25975 | for (; glyph > end |
| 25977 | && !INTEGERP (glyph->object) | 25976 | && !INTEGERP (glyph->object) |
| 25978 | && !EQ (glyph->object, cover_string) | 25977 | && !EQ (glyph->object, disp_string) |
| 25979 | && !(BUFFERP (glyph->object) | 25978 | && !(BUFFERP (glyph->object) |
| 25980 | && (glyph->charpos >= start_charpos | 25979 | && (glyph->charpos >= start_charpos |
| 25981 | && glyph->charpos < end_charpos)); | 25980 | && glyph->charpos < end_charpos)); |
| @@ -26031,17 +26030,16 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 26031 | row, and also blanks and stretch glyphs inserted by | 26030 | row, and also blanks and stretch glyphs inserted by |
| 26032 | extend_face_to_end_of_line. */ | 26031 | extend_face_to_end_of_line. */ |
| 26033 | while (end > glyph | 26032 | while (end > glyph |
| 26034 | && INTEGERP ((end - 1)->object) | 26033 | && INTEGERP ((end - 1)->object)) |
| 26035 | && (end - 1)->charpos <= 0) | ||
| 26036 | --end; | 26034 | --end; |
| 26037 | /* Scan the rest of the glyph row from the end, looking for the | 26035 | /* Scan the rest of the glyph row from the end, looking for the |
| 26038 | first glyph that comes from BEFORE_STRING, AFTER_STRING, or | 26036 | first glyph that comes from BEFORE_STRING, AFTER_STRING, or |
| 26039 | COVER_STRING, or whose position is between START_CHARPOS | 26037 | DISP_STRING, or whose position is between START_CHARPOS |
| 26040 | and END_CHARPOS */ | 26038 | and END_CHARPOS */ |
| 26041 | for (--end; | 26039 | for (--end; |
| 26042 | end > glyph | 26040 | end > glyph |
| 26043 | && !INTEGERP (end->object) | 26041 | && !INTEGERP (end->object) |
| 26044 | && !EQ (end->object, cover_string) | 26042 | && !EQ (end->object, disp_string) |
| 26045 | && !(BUFFERP (end->object) | 26043 | && !(BUFFERP (end->object) |
| 26046 | && (end->charpos >= start_charpos | 26044 | && (end->charpos >= start_charpos |
| 26047 | && end->charpos < end_charpos)); | 26045 | && end->charpos < end_charpos)); |
| @@ -26078,20 +26076,19 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 26078 | x = r2->x; | 26076 | x = r2->x; |
| 26079 | end++; | 26077 | end++; |
| 26080 | while (end < glyph | 26078 | while (end < glyph |
| 26081 | && INTEGERP (end->object) | 26079 | && INTEGERP (end->object)) |
| 26082 | && end->charpos <= 0) | ||
| 26083 | { | 26080 | { |
| 26084 | x += end->pixel_width; | 26081 | x += end->pixel_width; |
| 26085 | ++end; | 26082 | ++end; |
| 26086 | } | 26083 | } |
| 26087 | /* Scan the rest of the glyph row from the end, looking for the | 26084 | /* Scan the rest of the glyph row from the end, looking for the |
| 26088 | first glyph that comes from BEFORE_STRING, AFTER_STRING, or | 26085 | first glyph that comes from BEFORE_STRING, AFTER_STRING, or |
| 26089 | COVER_STRING, or whose position is between START_CHARPOS | 26086 | DISP_STRING, or whose position is between START_CHARPOS |
| 26090 | and END_CHARPOS */ | 26087 | and END_CHARPOS */ |
| 26091 | for ( ; | 26088 | for ( ; |
| 26092 | end < glyph | 26089 | end < glyph |
| 26093 | && !INTEGERP (end->object) | 26090 | && !INTEGERP (end->object) |
| 26094 | && !EQ (end->object, cover_string) | 26091 | && !EQ (end->object, disp_string) |
| 26095 | && !(BUFFERP (end->object) | 26092 | && !(BUFFERP (end->object) |
| 26096 | && (end->charpos >= start_charpos | 26093 | && (end->charpos >= start_charpos |
| 26097 | && end->charpos < end_charpos)); | 26094 | && end->charpos < end_charpos)); |
| @@ -26801,7 +26798,7 @@ void | |||
| 26801 | note_mouse_highlight (struct frame *f, int x, int y) | 26798 | note_mouse_highlight (struct frame *f, int x, int y) |
| 26802 | { | 26799 | { |
| 26803 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | 26800 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 26804 | enum window_part part; | 26801 | enum window_part part = ON_NOTHING; |
| 26805 | Lisp_Object window; | 26802 | Lisp_Object window; |
| 26806 | struct window *w; | 26803 | struct window *w; |
| 26807 | Cursor cursor = No_Cursor; | 26804 | Cursor cursor = No_Cursor; |
| @@ -27086,7 +27083,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 27086 | /* The mouse-highlighting, if any, comes from an overlay | 27083 | /* The mouse-highlighting, if any, comes from an overlay |
| 27087 | or text property in the buffer. */ | 27084 | or text property in the buffer. */ |
| 27088 | Lisp_Object buffer IF_LINT (= Qnil); | 27085 | Lisp_Object buffer IF_LINT (= Qnil); |
| 27089 | Lisp_Object cover_string IF_LINT (= Qnil); | 27086 | Lisp_Object disp_string IF_LINT (= Qnil); |
| 27090 | 27087 | ||
| 27091 | if (STRINGP (object)) | 27088 | if (STRINGP (object)) |
| 27092 | { | 27089 | { |
| @@ -27100,13 +27097,13 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 27100 | mouse_face = get_char_property_and_overlay | 27097 | mouse_face = get_char_property_and_overlay |
| 27101 | (make_number (pos), Qmouse_face, w->buffer, &overlay); | 27098 | (make_number (pos), Qmouse_face, w->buffer, &overlay); |
| 27102 | buffer = w->buffer; | 27099 | buffer = w->buffer; |
| 27103 | cover_string = object; | 27100 | disp_string = object; |
| 27104 | } | 27101 | } |
| 27105 | } | 27102 | } |
| 27106 | else | 27103 | else |
| 27107 | { | 27104 | { |
| 27108 | buffer = object; | 27105 | buffer = object; |
| 27109 | cover_string = Qnil; | 27106 | disp_string = Qnil; |
| 27110 | } | 27107 | } |
| 27111 | 27108 | ||
| 27112 | if (!NILP (mouse_face)) | 27109 | if (!NILP (mouse_face)) |
| @@ -27158,7 +27155,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 27158 | XFASTINT (before), | 27155 | XFASTINT (before), |
| 27159 | XFASTINT (after), | 27156 | XFASTINT (after), |
| 27160 | before_string, after_string, | 27157 | before_string, after_string, |
| 27161 | cover_string); | 27158 | disp_string); |
| 27162 | cursor = No_Cursor; | 27159 | cursor = No_Cursor; |
| 27163 | } | 27160 | } |
| 27164 | } | 27161 | } |
diff --git a/src/xterm.c b/src/xterm.c index 333132b92cb..fb77faa75fe 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -93,6 +93,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 93 | 93 | ||
| 94 | #ifdef USE_GTK | 94 | #ifdef USE_GTK |
| 95 | #include "gtkutil.h" | 95 | #include "gtkutil.h" |
| 96 | #ifdef HAVE_GTK3 | ||
| 97 | #include <X11/Xproto.h> | ||
| 98 | #endif | ||
| 96 | #endif | 99 | #endif |
| 97 | 100 | ||
| 98 | #ifdef USE_LUCID | 101 | #ifdef USE_LUCID |
| @@ -343,7 +346,7 @@ static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, | |||
| 343 | enum scroll_bar_part *, | 346 | enum scroll_bar_part *, |
| 344 | Lisp_Object *, Lisp_Object *, | 347 | Lisp_Object *, Lisp_Object *, |
| 345 | Time *); | 348 | Time *); |
| 346 | static void x_handle_net_wm_state (struct frame *, XPropertyEvent *); | 349 | static int x_handle_net_wm_state (struct frame *, XPropertyEvent *); |
| 347 | static void x_check_fullscreen (struct frame *); | 350 | static void x_check_fullscreen (struct frame *); |
| 348 | static void x_check_expected_move (struct frame *, int, int); | 351 | static void x_check_expected_move (struct frame *, int, int); |
| 349 | static void x_sync_with_move (struct frame *, int, int, int); | 352 | static void x_sync_with_move (struct frame *, int, int, int); |
| @@ -6113,7 +6116,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6113 | last_user_time = event.xproperty.time; | 6116 | last_user_time = event.xproperty.time; |
| 6114 | f = x_top_window_to_frame (dpyinfo, event.xproperty.window); | 6117 | f = x_top_window_to_frame (dpyinfo, event.xproperty.window); |
| 6115 | if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) | 6118 | if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) |
| 6116 | x_handle_net_wm_state (f, &event.xproperty); | 6119 | if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified) |
| 6120 | { | ||
| 6121 | /* Gnome shell does not iconify us when C-z is pressed. It hides | ||
| 6122 | the frame. So if our state says we aren't hidden anymore, | ||
| 6123 | treat is as deiconfied. */ | ||
| 6124 | if (! f->async_iconified) | ||
| 6125 | SET_FRAME_GARBAGED (f); | ||
| 6126 | f->async_visible = 1; | ||
| 6127 | f->async_iconified = 0; | ||
| 6128 | f->output_data.x->has_been_visible = 1; | ||
| 6129 | inev.ie.kind = DEICONIFY_EVENT; | ||
| 6130 | XSETFRAME (inev.ie.frame_or_window, f); | ||
| 6131 | } | ||
| 6117 | 6132 | ||
| 6118 | x_handle_property_notify (&event.xproperty); | 6133 | x_handle_property_notify (&event.xproperty); |
| 6119 | xft_settings_event (dpyinfo, &event); | 6134 | xft_settings_event (dpyinfo, &event); |
| @@ -7857,6 +7872,15 @@ static void x_error_quitter (Display *, XErrorEvent *); | |||
| 7857 | static int | 7872 | static int |
| 7858 | x_error_handler (Display *display, XErrorEvent *event) | 7873 | x_error_handler (Display *display, XErrorEvent *event) |
| 7859 | { | 7874 | { |
| 7875 | #ifdef HAVE_GTK3 | ||
| 7876 | if (event->error_code == BadMatch | ||
| 7877 | && event->request_code == X_SetInputFocus | ||
| 7878 | && event->minor_code == 0) | ||
| 7879 | { | ||
| 7880 | return 0; | ||
| 7881 | } | ||
| 7882 | #endif | ||
| 7883 | |||
| 7860 | if (x_error_message) | 7884 | if (x_error_message) |
| 7861 | x_error_catcher (display, event); | 7885 | x_error_catcher (display, event); |
| 7862 | else | 7886 | else |
| @@ -8415,9 +8439,11 @@ x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) | |||
| 8415 | 8439 | ||
| 8416 | /* Return the current _NET_WM_STATE. | 8440 | /* Return the current _NET_WM_STATE. |
| 8417 | SIZE_STATE is set to one of the FULLSCREEN_* values. | 8441 | SIZE_STATE is set to one of the FULLSCREEN_* values. |
| 8418 | STICKY is set to 1 if the sticky state is set, 0 if not. */ | 8442 | STICKY is set to 1 if the sticky state is set, 0 if not. |
| 8419 | 8443 | ||
| 8420 | static void | 8444 | Return non-zero if we are not hidden, zero if we are. */ |
| 8445 | |||
| 8446 | static int | ||
| 8421 | get_current_wm_state (struct frame *f, | 8447 | get_current_wm_state (struct frame *f, |
| 8422 | Window window, | 8448 | Window window, |
| 8423 | int *size_state, | 8449 | int *size_state, |
| @@ -8425,7 +8451,7 @@ get_current_wm_state (struct frame *f, | |||
| 8425 | { | 8451 | { |
| 8426 | Atom actual_type; | 8452 | Atom actual_type; |
| 8427 | unsigned long actual_size, bytes_remaining; | 8453 | unsigned long actual_size, bytes_remaining; |
| 8428 | int i, rc, actual_format; | 8454 | int i, rc, actual_format, is_hidden = 0; |
| 8429 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 8455 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 8430 | long max_len = 65536; | 8456 | long max_len = 65536; |
| 8431 | Display *dpy = FRAME_X_DISPLAY (f); | 8457 | Display *dpy = FRAME_X_DISPLAY (f); |
| @@ -8447,7 +8473,7 @@ get_current_wm_state (struct frame *f, | |||
| 8447 | if (tmp_data) XFree (tmp_data); | 8473 | if (tmp_data) XFree (tmp_data); |
| 8448 | x_uncatch_errors (); | 8474 | x_uncatch_errors (); |
| 8449 | UNBLOCK_INPUT; | 8475 | UNBLOCK_INPUT; |
| 8450 | return; | 8476 | return ! f->iconified; |
| 8451 | } | 8477 | } |
| 8452 | 8478 | ||
| 8453 | x_uncatch_errors (); | 8479 | x_uncatch_errors (); |
| @@ -8455,7 +8481,9 @@ get_current_wm_state (struct frame *f, | |||
| 8455 | for (i = 0; i < actual_size; ++i) | 8481 | for (i = 0; i < actual_size; ++i) |
| 8456 | { | 8482 | { |
| 8457 | Atom a = ((Atom*)tmp_data)[i]; | 8483 | Atom a = ((Atom*)tmp_data)[i]; |
| 8458 | if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) | 8484 | if (a == dpyinfo->Xatom_net_wm_state_hidden) |
| 8485 | is_hidden = 1; | ||
| 8486 | else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) | ||
| 8459 | { | 8487 | { |
| 8460 | if (*size_state == FULLSCREEN_HEIGHT) | 8488 | if (*size_state == FULLSCREEN_HEIGHT) |
| 8461 | *size_state = FULLSCREEN_MAXIMIZED; | 8489 | *size_state = FULLSCREEN_MAXIMIZED; |
| @@ -8477,6 +8505,7 @@ get_current_wm_state (struct frame *f, | |||
| 8477 | 8505 | ||
| 8478 | if (tmp_data) XFree (tmp_data); | 8506 | if (tmp_data) XFree (tmp_data); |
| 8479 | UNBLOCK_INPUT; | 8507 | UNBLOCK_INPUT; |
| 8508 | return ! is_hidden; | ||
| 8480 | } | 8509 | } |
| 8481 | 8510 | ||
| 8482 | /* Do fullscreen as specified in extended window manager hints */ | 8511 | /* Do fullscreen as specified in extended window manager hints */ |
| @@ -8488,7 +8517,7 @@ do_ewmh_fullscreen (struct frame *f) | |||
| 8488 | int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); | 8517 | int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); |
| 8489 | int cur, dummy; | 8518 | int cur, dummy; |
| 8490 | 8519 | ||
| 8491 | get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); | 8520 | (void)get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); |
| 8492 | 8521 | ||
| 8493 | /* Some window managers don't say they support _NET_WM_STATE, but they do say | 8522 | /* Some window managers don't say they support _NET_WM_STATE, but they do say |
| 8494 | they support _NET_WM_STATE_FULLSCREEN. Try that also. */ | 8523 | they support _NET_WM_STATE_FULLSCREEN. Try that also. */ |
| @@ -8563,14 +8592,14 @@ XTfullscreen_hook (FRAME_PTR f) | |||
| 8563 | } | 8592 | } |
| 8564 | 8593 | ||
| 8565 | 8594 | ||
| 8566 | static void | 8595 | static int |
| 8567 | x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) | 8596 | x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) |
| 8568 | { | 8597 | { |
| 8569 | int value = FULLSCREEN_NONE; | 8598 | int value = FULLSCREEN_NONE; |
| 8570 | Lisp_Object lval; | 8599 | Lisp_Object lval; |
| 8571 | int sticky = 0; | 8600 | int sticky = 0; |
| 8601 | int not_hidden = get_current_wm_state (f, event->window, &value, &sticky); | ||
| 8572 | 8602 | ||
| 8573 | get_current_wm_state (f, event->window, &value, &sticky); | ||
| 8574 | lval = Qnil; | 8603 | lval = Qnil; |
| 8575 | switch (value) | 8604 | switch (value) |
| 8576 | { | 8605 | { |
| @@ -8590,6 +8619,8 @@ x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) | |||
| 8590 | 8619 | ||
| 8591 | store_frame_param (f, Qfullscreen, lval); | 8620 | store_frame_param (f, Qfullscreen, lval); |
| 8592 | store_frame_param (f, Qsticky, sticky ? Qt : Qnil); | 8621 | store_frame_param (f, Qsticky, sticky ? Qt : Qnil); |
| 8622 | |||
| 8623 | return not_hidden; | ||
| 8593 | } | 8624 | } |
| 8594 | 8625 | ||
| 8595 | /* Check if we need to resize the frame due to a fullscreen request. | 8626 | /* Check if we need to resize the frame due to a fullscreen request. |
| @@ -9273,7 +9304,7 @@ x_iconify_frame (struct frame *f) | |||
| 9273 | if (!NILP (type)) | 9304 | if (!NILP (type)) |
| 9274 | x_bitmap_icon (f, type); | 9305 | x_bitmap_icon (f, type); |
| 9275 | 9306 | ||
| 9276 | #ifdef USE_GTK | 9307 | #if defined (USE_GTK) |
| 9277 | if (FRAME_GTK_OUTER_WIDGET (f)) | 9308 | if (FRAME_GTK_OUTER_WIDGET (f)) |
| 9278 | { | 9309 | { |
| 9279 | if (! FRAME_VISIBLE_P (f)) | 9310 | if (! FRAME_VISIBLE_P (f)) |
| @@ -10253,6 +10284,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 10253 | { "_NET_WM_STATE_MAXIMIZED_VERT", | 10284 | { "_NET_WM_STATE_MAXIMIZED_VERT", |
| 10254 | &dpyinfo->Xatom_net_wm_state_maximized_vert }, | 10285 | &dpyinfo->Xatom_net_wm_state_maximized_vert }, |
| 10255 | { "_NET_WM_STATE_STICKY", &dpyinfo->Xatom_net_wm_state_sticky }, | 10286 | { "_NET_WM_STATE_STICKY", &dpyinfo->Xatom_net_wm_state_sticky }, |
| 10287 | { "_NET_WM_STATE_HIDDEN", &dpyinfo->Xatom_net_wm_state_hidden }, | ||
| 10256 | { "_NET_WM_WINDOW_TYPE", &dpyinfo->Xatom_net_window_type }, | 10288 | { "_NET_WM_WINDOW_TYPE", &dpyinfo->Xatom_net_window_type }, |
| 10257 | { "_NET_WM_WINDOW_TYPE_TOOLTIP", | 10289 | { "_NET_WM_WINDOW_TYPE_TOOLTIP", |
| 10258 | &dpyinfo->Xatom_net_window_type_tooltip }, | 10290 | &dpyinfo->Xatom_net_window_type_tooltip }, |
diff --git a/src/xterm.h b/src/xterm.h index 11d5d50d952..e10a6bc34f0 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -341,7 +341,8 @@ struct x_display_info | |||
| 341 | /* Atoms dealing with EWMH (i.e. _NET_...) */ | 341 | /* Atoms dealing with EWMH (i.e. _NET_...) */ |
| 342 | Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen, | 342 | Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen, |
| 343 | Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, | 343 | Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, |
| 344 | Xatom_net_wm_state_sticky, Xatom_net_frame_extents; | 344 | Xatom_net_wm_state_sticky, Xatom_net_wm_state_hidden, |
| 345 | Xatom_net_frame_extents; | ||
| 345 | 346 | ||
| 346 | /* XSettings atoms and windows. */ | 347 | /* XSettings atoms and windows. */ |
| 347 | Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; | 348 | Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; |