diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 28 | ||||
| -rw-r--r-- | src/ChangeLog | 56 | ||||
| -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/xdisp.c | 5 | ||||
| -rw-r--r-- | src/xterm.c | 54 | ||||
| -rw-r--r-- | src/xterm.h | 3 |
10 files changed, 220 insertions, 69 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 fad9b4f9e46..0bb16514b58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,59 @@ | |||
| 1 | 2011-10-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented | ||
| 4 | past the beginning of the current glyph matrix. | ||
| 5 | |||
| 6 | 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change) | ||
| 7 | |||
| 8 | * xterm.c: Include X11/Xproto.h if HAVE_GTK3. | ||
| 9 | (x_error_handler): Ignore BadMatch for X_SetInputFocus for | ||
| 10 | HAVE_GTK3 (Bug#9869). | ||
| 11 | |||
| 12 | * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize | ||
| 13 | type to GDK_NOTHING so valgrind does not complain (Bug#9901). | ||
| 14 | |||
| 15 | * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893). | ||
| 16 | |||
| 17 | * xterm.c: Declare x_handle_net_wm_state to return int. | ||
| 18 | (handle_one_xevent): Check if we are iconified but don't have | ||
| 19 | _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893). | ||
| 20 | (get_current_wm_state): Return non-zero if not hidden, | ||
| 21 | check for _NET_WM_STATE_HIDDEN (Bug#9893). | ||
| 22 | (do_ewmh_fullscreen): Ignore return value from get_current_wm_state. | ||
| 23 | (x_handle_net_wm_state): Return what get_current_wm_state returns. | ||
| 24 | (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden. | ||
| 25 | |||
| 26 | 2011-10-29 Paul Eggert <eggert@cs.ucla.edu> | ||
| 27 | |||
| 28 | * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE, | ||
| 29 | so that this new function doesn't get optimized away by a | ||
| 30 | whole-program optimizer. Make the 2nd arg EMACS_INT, not int. | ||
| 31 | |||
| 32 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 33 | |||
| 34 | * frame.h (MOUSE_HL_INFO): Remove excess parens. | ||
| 35 | |||
| 36 | 2011-10-29 Eli Zaretskii <eliz@gnu.org> | ||
| 37 | |||
| 38 | Fix the `xbytecode' command. | ||
| 39 | * .gdbinit (xprintbytestr): New command. | ||
| 40 | (xwhichsymbols): Renamed from `which'; all callers changed. | ||
| 41 | (xbytecode): Print the byte-code string as well. | ||
| 42 | |||
| 43 | 2011-10-29 Kim Storm <storm@cua.dk> | ||
| 44 | |||
| 45 | * alloc.c (which_symbols): New function. | ||
| 46 | |||
| 47 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 48 | |||
| 49 | * minibuf.c (read_minibuf_noninteractive): Allow reading empty | ||
| 50 | line. (Bug#9903) | ||
| 51 | |||
| 52 | 2011-10-29 Glenn Morris <rgm@gnu.org> | ||
| 53 | |||
| 54 | * process.c (wait_reading_process_output): Revert 2009-08-30 change. | ||
| 55 | Not clear what it was for, and it causes various bugs. (Bug#9839) | ||
| 56 | |||
| 1 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | 57 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> |
| 2 | 58 | ||
| 3 | * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a | 59 | * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a |
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/xdisp.c b/src/xdisp.c index c3a924d10d4..4362d2dc7a9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -14890,8 +14890,6 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14890 | bidi-reordered rows. */ | 14890 | bidi-reordered rows. */ |
| 14891 | while (MATRIX_ROW_CONTINUATION_LINE_P (row)) | 14891 | while (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
| 14892 | { | 14892 | { |
| 14893 | xassert (row->enabled_p); | ||
| 14894 | --row; | ||
| 14895 | /* If we hit the beginning of the displayed portion | 14893 | /* If we hit the beginning of the displayed portion |
| 14896 | without finding the first row of a continued | 14894 | without finding the first row of a continued |
| 14897 | line, give up. */ | 14895 | line, give up. */ |
| @@ -14900,7 +14898,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14900 | rc = CURSOR_MOVEMENT_MUST_SCROLL; | 14898 | rc = CURSOR_MOVEMENT_MUST_SCROLL; |
| 14901 | break; | 14899 | break; |
| 14902 | } | 14900 | } |
| 14903 | 14901 | xassert (row->enabled_p); | |
| 14902 | --row; | ||
| 14904 | } | 14903 | } |
| 14905 | } | 14904 | } |
| 14906 | if (must_scroll) | 14905 | if (must_scroll) |
diff --git a/src/xterm.c b/src/xterm.c index 128a274ff10..49a21d683d4 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -96,6 +96,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 96 | 96 | ||
| 97 | #ifdef USE_GTK | 97 | #ifdef USE_GTK |
| 98 | #include "gtkutil.h" | 98 | #include "gtkutil.h" |
| 99 | #ifdef HAVE_GTK3 | ||
| 100 | #include <X11/Xproto.h> | ||
| 101 | #endif | ||
| 99 | #endif | 102 | #endif |
| 100 | 103 | ||
| 101 | #ifdef USE_LUCID | 104 | #ifdef USE_LUCID |
| @@ -346,7 +349,7 @@ static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, | |||
| 346 | enum scroll_bar_part *, | 349 | enum scroll_bar_part *, |
| 347 | Lisp_Object *, Lisp_Object *, | 350 | Lisp_Object *, Lisp_Object *, |
| 348 | Time *); | 351 | Time *); |
| 349 | static void x_handle_net_wm_state (struct frame *, XPropertyEvent *); | 352 | static int x_handle_net_wm_state (struct frame *, XPropertyEvent *); |
| 350 | static void x_check_fullscreen (struct frame *); | 353 | static void x_check_fullscreen (struct frame *); |
| 351 | static void x_check_expected_move (struct frame *, int, int); | 354 | static void x_check_expected_move (struct frame *, int, int); |
| 352 | static void x_sync_with_move (struct frame *, int, int, int); | 355 | static void x_sync_with_move (struct frame *, int, int, int); |
| @@ -6122,7 +6125,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6122 | last_user_time = event.xproperty.time; | 6125 | last_user_time = event.xproperty.time; |
| 6123 | f = x_top_window_to_frame (dpyinfo, event.xproperty.window); | 6126 | f = x_top_window_to_frame (dpyinfo, event.xproperty.window); |
| 6124 | if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) | 6127 | if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) |
| 6125 | x_handle_net_wm_state (f, &event.xproperty); | 6128 | if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified) |
| 6129 | { | ||
| 6130 | /* Gnome shell does not iconify us when C-z is pressed. It hides | ||
| 6131 | the frame. So if our state says we aren't hidden anymore, | ||
| 6132 | treat is as deiconfied. */ | ||
| 6133 | if (! f->async_iconified) | ||
| 6134 | SET_FRAME_GARBAGED (f); | ||
| 6135 | f->async_visible = 1; | ||
| 6136 | f->async_iconified = 0; | ||
| 6137 | f->output_data.x->has_been_visible = 1; | ||
| 6138 | inev.ie.kind = DEICONIFY_EVENT; | ||
| 6139 | XSETFRAME (inev.ie.frame_or_window, f); | ||
| 6140 | } | ||
| 6126 | 6141 | ||
| 6127 | x_handle_property_notify (&event.xproperty); | 6142 | x_handle_property_notify (&event.xproperty); |
| 6128 | xft_settings_event (dpyinfo, &event); | 6143 | xft_settings_event (dpyinfo, &event); |
| @@ -7871,6 +7886,15 @@ static void x_error_quitter (Display *, XErrorEvent *); | |||
| 7871 | static int | 7886 | static int |
| 7872 | x_error_handler (Display *display, XErrorEvent *event) | 7887 | x_error_handler (Display *display, XErrorEvent *event) |
| 7873 | { | 7888 | { |
| 7889 | #ifdef HAVE_GTK3 | ||
| 7890 | if (event->error_code == BadMatch | ||
| 7891 | && event->request_code == X_SetInputFocus | ||
| 7892 | && event->minor_code == 0) | ||
| 7893 | { | ||
| 7894 | return 0; | ||
| 7895 | } | ||
| 7896 | #endif | ||
| 7897 | |||
| 7874 | if (x_error_message) | 7898 | if (x_error_message) |
| 7875 | x_error_catcher (display, event); | 7899 | x_error_catcher (display, event); |
| 7876 | else | 7900 | else |
| @@ -8429,9 +8453,11 @@ x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) | |||
| 8429 | 8453 | ||
| 8430 | /* Return the current _NET_WM_STATE. | 8454 | /* Return the current _NET_WM_STATE. |
| 8431 | SIZE_STATE is set to one of the FULLSCREEN_* values. | 8455 | SIZE_STATE is set to one of the FULLSCREEN_* values. |
| 8432 | STICKY is set to 1 if the sticky state is set, 0 if not. */ | 8456 | STICKY is set to 1 if the sticky state is set, 0 if not. |
| 8433 | 8457 | ||
| 8434 | static void | 8458 | Return non-zero if we are not hidden, zero if we are. */ |
| 8459 | |||
| 8460 | static int | ||
| 8435 | get_current_wm_state (struct frame *f, | 8461 | get_current_wm_state (struct frame *f, |
| 8436 | Window window, | 8462 | Window window, |
| 8437 | int *size_state, | 8463 | int *size_state, |
| @@ -8439,7 +8465,7 @@ get_current_wm_state (struct frame *f, | |||
| 8439 | { | 8465 | { |
| 8440 | Atom actual_type; | 8466 | Atom actual_type; |
| 8441 | unsigned long actual_size, bytes_remaining; | 8467 | unsigned long actual_size, bytes_remaining; |
| 8442 | int i, rc, actual_format; | 8468 | int i, rc, actual_format, is_hidden = 0; |
| 8443 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 8469 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 8444 | long max_len = 65536; | 8470 | long max_len = 65536; |
| 8445 | Display *dpy = FRAME_X_DISPLAY (f); | 8471 | Display *dpy = FRAME_X_DISPLAY (f); |
| @@ -8461,7 +8487,7 @@ get_current_wm_state (struct frame *f, | |||
| 8461 | if (tmp_data) XFree (tmp_data); | 8487 | if (tmp_data) XFree (tmp_data); |
| 8462 | x_uncatch_errors (); | 8488 | x_uncatch_errors (); |
| 8463 | UNBLOCK_INPUT; | 8489 | UNBLOCK_INPUT; |
| 8464 | return; | 8490 | return ! f->iconified; |
| 8465 | } | 8491 | } |
| 8466 | 8492 | ||
| 8467 | x_uncatch_errors (); | 8493 | x_uncatch_errors (); |
| @@ -8469,7 +8495,9 @@ get_current_wm_state (struct frame *f, | |||
| 8469 | for (i = 0; i < actual_size; ++i) | 8495 | for (i = 0; i < actual_size; ++i) |
| 8470 | { | 8496 | { |
| 8471 | Atom a = ((Atom*)tmp_data)[i]; | 8497 | Atom a = ((Atom*)tmp_data)[i]; |
| 8472 | if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) | 8498 | if (a == dpyinfo->Xatom_net_wm_state_hidden) |
| 8499 | is_hidden = 1; | ||
| 8500 | else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) | ||
| 8473 | { | 8501 | { |
| 8474 | if (*size_state == FULLSCREEN_HEIGHT) | 8502 | if (*size_state == FULLSCREEN_HEIGHT) |
| 8475 | *size_state = FULLSCREEN_MAXIMIZED; | 8503 | *size_state = FULLSCREEN_MAXIMIZED; |
| @@ -8491,6 +8519,7 @@ get_current_wm_state (struct frame *f, | |||
| 8491 | 8519 | ||
| 8492 | if (tmp_data) XFree (tmp_data); | 8520 | if (tmp_data) XFree (tmp_data); |
| 8493 | UNBLOCK_INPUT; | 8521 | UNBLOCK_INPUT; |
| 8522 | return ! is_hidden; | ||
| 8494 | } | 8523 | } |
| 8495 | 8524 | ||
| 8496 | /* Do fullscreen as specified in extended window manager hints */ | 8525 | /* Do fullscreen as specified in extended window manager hints */ |
| @@ -8502,7 +8531,7 @@ do_ewmh_fullscreen (struct frame *f) | |||
| 8502 | int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); | 8531 | int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); |
| 8503 | int cur, dummy; | 8532 | int cur, dummy; |
| 8504 | 8533 | ||
| 8505 | get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); | 8534 | (void)get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); |
| 8506 | 8535 | ||
| 8507 | /* Some window managers don't say they support _NET_WM_STATE, but they do say | 8536 | /* Some window managers don't say they support _NET_WM_STATE, but they do say |
| 8508 | they support _NET_WM_STATE_FULLSCREEN. Try that also. */ | 8537 | they support _NET_WM_STATE_FULLSCREEN. Try that also. */ |
| @@ -8577,14 +8606,14 @@ XTfullscreen_hook (FRAME_PTR f) | |||
| 8577 | } | 8606 | } |
| 8578 | 8607 | ||
| 8579 | 8608 | ||
| 8580 | static void | 8609 | static int |
| 8581 | x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) | 8610 | x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) |
| 8582 | { | 8611 | { |
| 8583 | int value = FULLSCREEN_NONE; | 8612 | int value = FULLSCREEN_NONE; |
| 8584 | Lisp_Object lval; | 8613 | Lisp_Object lval; |
| 8585 | int sticky = 0; | 8614 | int sticky = 0; |
| 8615 | int not_hidden = get_current_wm_state (f, event->window, &value, &sticky); | ||
| 8586 | 8616 | ||
| 8587 | get_current_wm_state (f, event->window, &value, &sticky); | ||
| 8588 | lval = Qnil; | 8617 | lval = Qnil; |
| 8589 | switch (value) | 8618 | switch (value) |
| 8590 | { | 8619 | { |
| @@ -8604,6 +8633,8 @@ x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) | |||
| 8604 | 8633 | ||
| 8605 | store_frame_param (f, Qfullscreen, lval); | 8634 | store_frame_param (f, Qfullscreen, lval); |
| 8606 | store_frame_param (f, Qsticky, sticky ? Qt : Qnil); | 8635 | store_frame_param (f, Qsticky, sticky ? Qt : Qnil); |
| 8636 | |||
| 8637 | return not_hidden; | ||
| 8607 | } | 8638 | } |
| 8608 | 8639 | ||
| 8609 | /* Check if we need to resize the frame due to a fullscreen request. | 8640 | /* Check if we need to resize the frame due to a fullscreen request. |
| @@ -9287,7 +9318,7 @@ x_iconify_frame (struct frame *f) | |||
| 9287 | if (!NILP (type)) | 9318 | if (!NILP (type)) |
| 9288 | x_bitmap_icon (f, type); | 9319 | x_bitmap_icon (f, type); |
| 9289 | 9320 | ||
| 9290 | #ifdef USE_GTK | 9321 | #if defined (USE_GTK) |
| 9291 | if (FRAME_GTK_OUTER_WIDGET (f)) | 9322 | if (FRAME_GTK_OUTER_WIDGET (f)) |
| 9292 | { | 9323 | { |
| 9293 | if (! FRAME_VISIBLE_P (f)) | 9324 | if (! FRAME_VISIBLE_P (f)) |
| @@ -10271,6 +10302,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 10271 | { "_NET_WM_STATE_MAXIMIZED_VERT", | 10302 | { "_NET_WM_STATE_MAXIMIZED_VERT", |
| 10272 | &dpyinfo->Xatom_net_wm_state_maximized_vert }, | 10303 | &dpyinfo->Xatom_net_wm_state_maximized_vert }, |
| 10273 | { "_NET_WM_STATE_STICKY", &dpyinfo->Xatom_net_wm_state_sticky }, | 10304 | { "_NET_WM_STATE_STICKY", &dpyinfo->Xatom_net_wm_state_sticky }, |
| 10305 | { "_NET_WM_STATE_HIDDEN", &dpyinfo->Xatom_net_wm_state_hidden }, | ||
| 10274 | { "_NET_WM_WINDOW_TYPE", &dpyinfo->Xatom_net_window_type }, | 10306 | { "_NET_WM_WINDOW_TYPE", &dpyinfo->Xatom_net_window_type }, |
| 10275 | { "_NET_WM_WINDOW_TYPE_TOOLTIP", | 10307 | { "_NET_WM_WINDOW_TYPE_TOOLTIP", |
| 10276 | &dpyinfo->Xatom_net_window_type_tooltip }, | 10308 | &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; |