diff options
author | Nalin Dahyabhai <nalin@src.gnome.org> | 2003-01-09 06:56:01 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@src.gnome.org> | 2003-01-09 06:56:01 +0000 |
commit | 9820448f044cce4cb85b877d250dc6181772c830 (patch) | |
tree | 648674564fe4f1d940c365a2c456b7891fab2065 /src | |
parent | 41a9d6abe0b47ca8461e41afa1ad957e92368b3d (diff) |
Only suppress meta-sends-escape on Backspace if backspace is mapped to the
* src/vte.c(vte_terminal_key_press): Only suppress meta-sends-escape on
Backspace if backspace is mapped to the delete sequence.
* src/vte.c: don't just skip reading data if selection is in progress -- we
wedge if we do that (#101739). Instead, temporarily stop reading from
the child pty.
* src/vte.c(vte_terminal_open_font_xft): if we get NULL when matching fonts,
use the desired pattern's name when displaying an error, preventing a
NULL dereference (#96769).
* configure.in: make building of python modules depend on configure having been
run with --enable-python. make --enable-python the default. Fix an
indentation error in the version check which chokes Python 2.2.2.
* src/vte.h, src/vte.c: add new signals to VteTerminalClass (NOTE: may break
ABI, so might as well add some padding)
* src/vteaccess.c: be more precise about locations in text_changed signals
(part of #95901)
* src/vte.c: get more selective about when we consider it necessary to emit
text-insert and text-delete events.
Diffstat (limited to 'src')
-rw-r--r-- | src/marshal.list | 1 | ||||
-rw-r--r-- | src/vte.c | 406 | ||||
-rw-r--r-- | src/vte.h | 20 | ||||
-rw-r--r-- | src/vteaccess.c | 277 |
4 files changed, 583 insertions, 121 deletions
diff --git a/src/marshal.list b/src/marshal.list index 6f0c62c..5cc212a 100644 --- a/src/marshal.list +++ b/src/marshal.list @@ -1,6 +1,7 @@ VOID:VOID VOID:STRING VOID:STRING,UINT +VOID:INT VOID:INT,INT VOID:UINT,UINT VOID:OBJECT,OBJECT @@ -117,6 +117,7 @@ typedef gunichar wint_t; #define VTE_REGCOMP_FLAGS REG_EXTENDED #define VTE_REGEXEC_FLAGS 0 #define VTE_INPUT_CHUNK_SIZE 0x1000 +#define VTE_INVALID_SOURCE -1 /* The structure we use to hold characters we're supposed to display -- this * includes any supported visible attributes. */ @@ -286,7 +287,9 @@ struct _VteTerminalPrivate { gboolean nrc_mode; gboolean smooth_scroll; GHashTable *tabstops; - gboolean modified_flag; + gboolean text_modified_flag; + glong text_inserted_count; + glong text_deleted_count; /* Scrolling options. */ gboolean scroll_on_output; @@ -373,6 +376,7 @@ struct _VteTerminalPrivate { /* Our accessible peer. */ AtkObject *accessible; + gboolean accessible_exists; /* Adjustment updates pending. */ gboolean adjustment_changed_tag; @@ -1139,6 +1143,66 @@ vte_terminal_emit_decrease_font_size(VteTerminal *terminal) g_signal_emit_by_name(terminal, "decrease-font-size"); } +/* Emit a "text-inserted" signal. */ +static void +vte_terminal_emit_text_inserted(VteTerminal *terminal) +{ + if (!terminal->pvt->accessible_exists) { + return; + } +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting `text-inserted'.\n"); + } +#endif + g_signal_emit_by_name(terminal, "text-inserted"); +} + +/* Emit a "text-deleted" signal. */ +static void +vte_terminal_emit_text_deleted(VteTerminal *terminal) +{ + if (!terminal->pvt->accessible_exists) { + return; + } +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting `text-deleted'.\n"); + } +#endif + g_signal_emit_by_name(terminal, "text-deleted"); +} + +/* Emit a "text-modified" signal. */ +static void +vte_terminal_emit_text_modified(VteTerminal *terminal) +{ + if (!terminal->pvt->accessible_exists) { + return; + } +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting `text-modified'.\n"); + } +#endif + g_signal_emit_by_name(terminal, "text-modified"); +} + +/* Emit a "text-scrolled" signal. */ +static void +vte_terminal_emit_text_scrolled(VteTerminal *terminal, gint delta) +{ + if (!terminal->pvt->accessible_exists) { + return; + } +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting `text-scrolled'(%d).\n", delta); + } +#endif + g_signal_emit_by_name(terminal, "text-scrolled", delta); +} + /* Deselect anything which is selected and refresh the screen if needed. */ static void vte_terminal_deselect_all(VteTerminal *terminal) @@ -1577,7 +1641,7 @@ vte_terminal_emit_adjustment_changed(gpointer data) terminal = VTE_TERMINAL(data); if (terminal->pvt->adjustment_changed_tag) { #ifdef VTE_DEBUG - if (_vte_debug_on(VTE_DEBUG_EVENTS)) { + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { fprintf(stderr, "Emitting adjustment_changed.\n"); } #endif @@ -1743,11 +1807,12 @@ vte_terminal_maybe_scroll_to_top(VteTerminal *terminal) static void vte_terminal_maybe_scroll_to_bottom(VteTerminal *terminal) { + glong delta; g_return_if_fail(VTE_IS_TERMINAL(terminal)); if (floor(gtk_adjustment_get_value(terminal->adjustment)) != terminal->pvt->screen->insert_delta) { - gtk_adjustment_set_value(terminal->adjustment, - terminal->pvt->screen->insert_delta); + delta = terminal->pvt->screen->insert_delta; + gtk_adjustment_set_value(terminal->adjustment, delta); } } @@ -2054,7 +2119,7 @@ vte_sequence_handler_al(VteTerminal *terminal, vte_terminal_scroll_region(terminal, start, end - start + 1, param); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Add N lines at the current cursor position. */ @@ -2171,7 +2236,7 @@ vte_sequence_handler_cb(VteTerminal *terminal, screen->cursor_current.row, 1); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Clear to the right of the cursor and below the current line. */ @@ -2232,7 +2297,7 @@ vte_sequence_handler_cd(VteTerminal *terminal, } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Clear from the cursor position to the end of the line. */ @@ -2265,7 +2330,7 @@ vte_sequence_handler_ce(VteTerminal *terminal, screen->cursor_current.row, 1); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Move the cursor to the given column (horizontal position). */ @@ -2304,7 +2369,7 @@ vte_sequence_handler_cl(VteTerminal *terminal, vte_sequence_handler_ho(terminal, NULL, 0, NULL); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Move the cursor to the given position. */ @@ -2371,7 +2436,7 @@ vte_sequence_handler_clear_current_line(VteTerminal *terminal, } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Carriage return. */ @@ -2559,7 +2624,7 @@ vte_sequence_handler_dc(VteTerminal *terminal, } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Delete N characters at the current cursor position. */ @@ -2614,7 +2679,7 @@ vte_sequence_handler_dl(VteTerminal *terminal, vte_terminal_scroll_region(terminal, start, end - start + 1, -param); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Delete N lines at the current cursor position. */ @@ -2808,7 +2873,7 @@ vte_sequence_handler_ec(VteTerminal *terminal, } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* End insert mode. */ @@ -3534,8 +3599,9 @@ vte_sequence_handler_uc(VteTerminal *terminal, vte_sequence_handler_nd(terminal, match, match_quark, params); } - /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + /* We've modified the display without changing the text. Make a note + * of it. */ + terminal->pvt->text_modified_flag = TRUE; } /* Underline end. */ @@ -3836,7 +3902,7 @@ vte_sequence_handler_clear_above_current(VteTerminal *terminal, } } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Clear the entire screen. */ @@ -3868,7 +3934,7 @@ vte_sequence_handler_clear_screen(VteTerminal *terminal, /* Redraw everything. */ vte_invalidate_all(terminal); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Move the cursor to the given column, 1-based. */ @@ -4706,7 +4772,7 @@ vte_sequence_handler_erase_in_display(VteTerminal *terminal, break; } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Erase certain parts of the current line in the display. */ @@ -4748,7 +4814,7 @@ vte_sequence_handler_erase_in_line(VteTerminal *terminal, break; } /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Perform a full-bore reset. */ @@ -4816,7 +4882,7 @@ vte_sequence_handler_insert_lines(VteTerminal *terminal, /* Adjust the scrollbars if necessary. */ vte_terminal_adjust_adjustments(terminal, FALSE); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_inserted_count++; } /* Delete certain lines from the scrolling region. */ @@ -4865,7 +4931,7 @@ vte_sequence_handler_delete_lines(VteTerminal *terminal, /* Adjust the scrollbars if necessary. */ vte_terminal_adjust_adjustments(terminal, FALSE); /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + terminal->pvt->text_deleted_count++; } /* Set the terminal encoding. */ @@ -5060,15 +5126,18 @@ vte_sequence_handler_screen_alignment_test(VteTerminal *terminal, if (rowdata->len > 0) { g_array_set_size(rowdata, 0); } + vte_terminal_emit_text_deleted(terminal); /* Fill this row. */ cell = screen->basic_defaults; cell.c = 'E'; cell.columns = 1; vte_g_array_fill(rowdata, &cell, terminal->column_count); + vte_terminal_emit_text_inserted(terminal); } vte_invalidate_all(terminal); - /* We've modified the display. Make a note of it. */ - terminal->pvt->modified_flag = TRUE; + + /* We modified the display, so make a note of it for completeness. */ + terminal->pvt->text_modified_flag = TRUE; } /* Perform a soft reset. */ @@ -6371,6 +6440,9 @@ vte_terminal_insert_char(VteTerminal *terminal, gunichar c, /* Make sure the location the cursor is on exists. */ vte_terminal_ensure_cursor(terminal, FALSE); + /* We added text, so make a note of it. */ + terminal->pvt->text_inserted_count++; + #ifdef VTE_DEBUG if (_vte_debug_on(VTE_DEBUG_IO) && _vte_debug_on(VTE_DEBUG_PARSE)) { fprintf(stderr, "insertion delta => %ld.\n", @@ -6476,6 +6548,80 @@ vte_terminal_catch_child_exited(VteReaper *reaper, int pid, int status, } } +static void +_vte_terminal_connect_pty_read(VteTerminal *terminal) +{ + if (terminal->pvt->pty_master == -1) { + return; + } + if (terminal->pvt->pty_input == NULL) { + terminal->pvt->pty_input = + g_io_channel_unix_new(terminal->pvt->pty_master); + } + if (terminal->pvt->pty_input_source == VTE_INVALID_SOURCE) { + terminal->pvt->pty_input_source = + g_io_add_watch_full(terminal->pvt->pty_input, + VTE_CHILD_INPUT_PRIORITY, + G_IO_IN | G_IO_HUP, + vte_terminal_io_read, + terminal, + NULL); + } +} + +static void +_vte_terminal_connect_pty_write(VteTerminal *terminal) +{ + if (terminal->pvt->pty_master == -1) { + return; + } + if (terminal->pvt->pty_output == NULL) { + terminal->pvt->pty_output = + g_io_channel_unix_new(terminal->pvt->pty_master); + } + if (terminal->pvt->pty_output_source == VTE_INVALID_SOURCE) { + terminal->pvt->pty_output_source = + g_io_add_watch_full(terminal->pvt->pty_output, + VTE_CHILD_OUTPUT_PRIORITY, + G_IO_OUT, + vte_terminal_io_write, + terminal, + NULL); + } +} + +static void +_vte_terminal_disconnect_pty_read(VteTerminal *terminal) +{ + if (terminal->pvt->pty_master == -1) { + return; + } + if (terminal->pvt->pty_input != NULL) { + g_io_channel_unref(terminal->pvt->pty_input); + terminal->pvt->pty_input = NULL; + } + if (terminal->pvt->pty_input_source != VTE_INVALID_SOURCE) { + g_source_remove(terminal->pvt->pty_input_source); + terminal->pvt->pty_input_source = VTE_INVALID_SOURCE; + } +} + +static void +_vte_terminal_disconnect_pty_write(VteTerminal *terminal) +{ + if (terminal->pvt->pty_master == -1) { + return; + } + if (terminal->pvt->pty_output != NULL) { + g_io_channel_unref(terminal->pvt->pty_output); + terminal->pvt->pty_output = NULL; + } + if (terminal->pvt->pty_output_source != VTE_INVALID_SOURCE) { + g_source_remove(terminal->pvt->pty_output_source); + terminal->pvt->pty_output_source = VTE_INVALID_SOURCE; + } +} + /** * vte_terminal_fork_command: * @terminal: a #VteTerminal @@ -6564,15 +6710,7 @@ vte_terminal_fork_command(VteTerminal *terminal, const char *command, } /* Open a channel to listen for input on. */ - terminal->pvt->pty_input = - g_io_channel_unix_new(terminal->pvt->pty_master); - terminal->pvt->pty_input_source = - g_io_add_watch_full(terminal->pvt->pty_input, - VTE_CHILD_INPUT_PRIORITY, - G_IO_IN | G_IO_HUP, - vte_terminal_io_read, - terminal, - NULL); + _vte_terminal_connect_pty_read(terminal); } /* Return the pid to the caller. */ @@ -6591,10 +6729,7 @@ vte_terminal_eof(GIOChannel *channel, gpointer data) /* Close the connections to the child -- note that the source channel * has already been dereferenced. */ if (channel == terminal->pvt->pty_input) { - g_io_channel_unref(terminal->pvt->pty_input); - terminal->pvt->pty_input = NULL; - g_source_remove(terminal->pvt->pty_input_source); - terminal->pvt->pty_input_source = -1; + _vte_terminal_disconnect_pty_read(terminal); } /* Emit a signal that we read an EOF. */ @@ -6639,6 +6774,69 @@ free_params_array(GValueArray *params) } } +/* Emit whichever signals are called for here. */ +static void +vte_terminal_emit_pending_text_signals(VteTerminal *terminal, GQuark quark) +{ + static struct { + const char *name; + GQuark quark; + } non_visual_quarks[] = { + {"mb", 0}, + {"md", 0}, + {"mr", 0}, + {"mu", 0}, + {"se", 0}, + {"so", 0}, + {"ta", 0}, + {"character-attributes", 0}, + }; + GQuark tmp; + int i; + + if (quark != 0) { + for (i = 0; i < G_N_ELEMENTS(non_visual_quarks); i++) { + if (non_visual_quarks[i].quark == 0) { + tmp = g_quark_from_string(non_visual_quarks[i].name); + non_visual_quarks[i].quark = tmp; + } + if (quark == non_visual_quarks[i].quark) { + return; + } + } + } + + if (terminal->pvt->text_modified_flag) { +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting buffered `text-modified'.\n"); + } +#endif + vte_terminal_emit_text_modified(terminal); + terminal->pvt->text_modified_flag = FALSE; + } + if (terminal->pvt->text_inserted_count) { +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting buffered `text-inserted' " + "(%ld).\n", terminal->pvt->text_inserted_count); + } +#endif + vte_terminal_emit_text_inserted(terminal); + terminal->pvt->text_inserted_count = 0; + } + if (terminal->pvt->text_deleted_count) { +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Emitting buffered `text-deleted' " + "(%ld).\n", terminal->pvt->text_deleted_count); + } +#endif + vte_terminal_emit_text_deleted(terminal); + terminal->pvt->text_deleted_count = 0; + } +} + /* Process incoming data, first converting it to unicode characters, and then * processing control sequences. */ static gboolean @@ -6772,7 +6970,9 @@ vte_terminal_process_incoming(gpointer data) bbox_bottomright.y = cursor.row; /* We're going to check if the text was modified, so keep a flag. */ - terminal->pvt->modified_flag = FALSE; + terminal->pvt->text_modified_flag = FALSE; + terminal->pvt->text_inserted_count = 0; + terminal->pvt->text_deleted_count = 0; /* Try initial substrings. */ while ((start < wcount) && !leftovers) { @@ -6789,6 +6989,8 @@ vte_terminal_process_incoming(gpointer data) * points to the first character which isn't part of this * sequence. */ if ((match != NULL) && (match[0] != '\0')) { + /* Flush any pending "inserted" signals. */ + vte_terminal_emit_pending_text_signals(terminal, quark); /* Call the right sequence handler for the requested * behavior. */ vte_terminal_handle_sequence(GTK_WIDGET(terminal), @@ -6803,6 +7005,8 @@ vte_terminal_process_incoming(gpointer data) if (strcmp(encoding, terminal->pvt->encoding)) { leftovers = TRUE; } + /* Flush any pending signals. */ + vte_terminal_emit_pending_text_signals(terminal, quark); modified = TRUE; } else /* Second, we have a NULL match, and next points the very @@ -6835,6 +7039,7 @@ vte_terminal_process_incoming(gpointer data) FALSE, FALSE, TRUE, -1); } + /* We *don't* emit flush pending signals here. */ modified = TRUE; start++; } else { @@ -6884,6 +7089,8 @@ vte_terminal_process_incoming(gpointer data) free_params_array(params); params = NULL; } + /* Flush any pending "inserted" signals. */ + vte_terminal_emit_pending_text_signals(terminal, 0); /* Clip off any part of the box which isn't already on-screen. */ bbox_topleft.x = MAX(bbox_topleft.x, 0); @@ -6962,18 +7169,11 @@ vte_terminal_process_incoming(gpointer data) vte_terminal_deselect_all(terminal); } - if (modified || - terminal->pvt->modified_flag || - (screen != terminal->pvt->screen)) { + if (modified || (screen != terminal->pvt->screen)) { /* Signal that the visible contents changed. */ vte_terminal_match_contents_clear(terminal); - /* Notify viewers that the contents have changed. */ - vte_terminal_emit_contents_changed(terminal); } - /* Reset the text-modified flag. */ - terminal->pvt->modified_flag = FALSE; - if ((cursor.col != terminal->pvt->screen->cursor_current.col) || (cursor.row != terminal->pvt->screen->cursor_current.row)) { /* Signal that the cursor moved. */ @@ -7037,7 +7237,7 @@ vte_terminal_io_read(GIOChannel *channel, * (for at least a moment) to keep data from scrolling off the top of * our backscroll buffer, but come back later. */ if (terminal->pvt->selecting) { - return TRUE; + // return TRUE; } /* Check that the channel is still open. */ @@ -7192,12 +7392,7 @@ vte_terminal_io_write(GIOChannel *channel, } if (_vte_buffer_length(terminal->pvt->outgoing) == 0) { - if (channel == terminal->pvt->pty_output) { - g_io_channel_unref(terminal->pvt->pty_output); - terminal->pvt->pty_output = NULL; - g_source_remove(terminal->pvt->pty_output_source); - terminal->pvt->pty_output_source = -1; - } + _vte_terminal_disconnect_pty_write(terminal); leave_open = FALSE; } else { leave_open = TRUE; @@ -7270,17 +7465,7 @@ vte_terminal_send(VteTerminal *terminal, const char *encoding, #endif /* If we need to start waiting for the child pty to * become available for writing, set that up here. */ - if (terminal->pvt->pty_output == NULL) { - terminal->pvt->pty_output = - g_io_channel_unix_new(terminal->pvt->pty_master); - terminal->pvt->pty_output_source = - g_io_add_watch_full(terminal->pvt->pty_output, - VTE_CHILD_OUTPUT_PRIORITY, - G_IO_OUT, - vte_terminal_io_write, - terminal, - NULL); - } + _vte_terminal_connect_pty_write(terminal); } } return; @@ -7588,13 +7773,16 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event) case VTE_ERASE_ASCII_BACKSPACE: normal = g_strdup(""); normal_length = 1; + suppress_meta_esc = FALSE; break; case VTE_ERASE_ASCII_DELETE: normal = g_strdup(""); normal_length = 1; + suppress_meta_esc = FALSE; break; case VTE_ERASE_DELETE_SEQUENCE: special = "kD"; + suppress_meta_esc = TRUE; break; /* Use the tty's erase character. */ case VTE_ERASE_AUTO: @@ -7607,10 +7795,10 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event) normal_length = 1; } } + suppress_meta_esc = FALSE; break; } handled = TRUE; - suppress_meta_esc = TRUE; break; case GDK_KP_Delete: case GDK_Delete: @@ -8696,6 +8884,9 @@ vte_terminal_start_selection(GtkWidget *widget, GdkEventButton *event, } #endif vte_terminal_emit_selection_changed(terminal); + + /* Temporarily stop caring about input from the child. */ + _vte_terminal_disconnect_pty_read(terminal); } /* Extend selection to include the given event coordinates. */ @@ -8963,14 +9154,14 @@ vte_terminal_extend_selection(GtkWidget *widget, double x, double y, sc->x = 0; /* Now back up as far as we can go. */ j = sc->y; - while (_vte_ring_contains(screen->row_data, j - 1) && + while (_vte_ring_contains(screen->row_data, j - 1) && vte_line_is_wrappable(terminal, j - 1)) { j--; sc->y = j; } /* And move forward as far as we can go. */ j = ec->y; - while (_vte_ring_contains(screen->row_data, j) && + while (_vte_ring_contains(screen->row_data, j) && vte_line_is_wrappable(terminal, j)) { j++; ec->y = j; @@ -9048,7 +9239,7 @@ vte_terminal_autoscroll(gpointer data) GtkWidget *widget; gboolean extend = FALSE; gdouble x, y, xmax, ymax; - double adj; + glong adj; terminal = VTE_TERMINAL(data); widget = GTK_WIDGET(terminal); @@ -9449,6 +9640,8 @@ vte_terminal_button_release(GtkWidget *widget, GdkEventButton *event) terminal->pvt->selecting = FALSE; handled = TRUE; } + /* Reconnect to input from the child if we paused it. */ + _vte_terminal_connect_pty_read(terminal); break; case 2: case 3: @@ -10159,8 +10352,8 @@ vte_terminal_open_font_xft(VteTerminal *terminal) new_font = NULL; } - if (new_font == NULL) { - name = vte_unparse_xft_pattern(matched_pattern); + if ((new_font == NULL) || (matched_pattern == NULL)) { + name = vte_unparse_xft_pattern(pattern); g_warning(_("Failed to load Xft font pattern \"%s\", " "falling back to default font."), name); free(name); @@ -10606,12 +10799,13 @@ vte_terminal_handle_scroll(VteTerminal *terminal) /* Read the new adjustment value and save the difference. */ adj = floor(gtk_adjustment_get_value(terminal->adjustment)); - dy = screen->scroll_delta - adj; + dy = adj - screen->scroll_delta; screen->scroll_delta = adj; if (dy != 0) { vte_terminal_match_contents_clear(terminal); vte_terminal_scroll_region(terminal, screen->scroll_delta, - terminal->row_count, dy); + terminal->row_count, -dy); + vte_terminal_emit_text_scrolled(terminal, dy); vte_terminal_emit_contents_changed(terminal); } @@ -10966,9 +11160,9 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass) pvt->shell = g_quark_to_string(g_quark_from_string(pvt->shell)); pvt->pty_master = -1; pvt->pty_input = NULL; - pvt->pty_input_source = -1; + pvt->pty_input_source = VTE_INVALID_SOURCE; pvt->pty_output = NULL; - pvt->pty_output_source = -1; + pvt->pty_output_source = VTE_INVALID_SOURCE; pvt->pty_pid = -1; /* Set up I/O encodings. */ @@ -11046,7 +11240,9 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass) pvt->nrc_mode = TRUE; pvt->smooth_scroll = FALSE; pvt->tabstops = NULL; - pvt->modified_flag = FALSE; + pvt->text_modified_flag = FALSE; + pvt->text_inserted_count = 0; + pvt->text_deleted_count = 0; vte_terminal_set_default_tabstops(terminal); /* Scrolling options. */ @@ -11174,6 +11370,11 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass) /* Our accessible peer. */ pvt->accessible = NULL; + pvt->accessible_exists = FALSE; +#ifdef VTE_DEBUG + /* In maintainer mode, we always do this. */ + pvt->accessible_exists = TRUE; +#endif /* Settings we're monitoring. */ pvt->connected_settings = NULL; @@ -11571,7 +11772,9 @@ vte_terminal_finalize(GObject *object) g_hash_table_destroy(terminal->pvt->tabstops); terminal->pvt->tabstops = NULL; } - terminal->pvt->modified_flag = FALSE; + terminal->pvt->text_modified_flag = FALSE; + terminal->pvt->text_inserted_count = 0; + terminal->pvt->text_deleted_count = 0; /* Free any selected text, but if we currently own the selection, * throw the text onto the clipboard without an owner so that it @@ -11649,18 +11852,8 @@ vte_terminal_finalize(GObject *object) kill(-terminal->pvt->pty_pid, SIGHUP); } terminal->pvt->pty_pid = 0; - if (terminal->pvt->pty_input != NULL) { - g_io_channel_unref(terminal->pvt->pty_input); - terminal->pvt->pty_input = NULL; - g_source_remove(terminal->pvt->pty_input_source); - terminal->pvt->pty_input_source = -1; - } - if (terminal->pvt->pty_output != NULL) { - g_io_channel_unref(terminal->pvt->pty_output); - terminal->pvt->pty_output = NULL; - g_source_remove(terminal->pvt->pty_output_source); - terminal->pvt->pty_output_source = -1; - } + _vte_terminal_disconnect_pty_read(terminal); + _vte_terminal_disconnect_pty_write(terminal); if (terminal->pvt->pty_master != -1) { _vte_pty_close(terminal->pvt->pty_master); terminal->pvt->pty_master = -1; @@ -13325,7 +13518,7 @@ vte_terminal_draw_row(VteTerminal *terminal, break; } nstrikethrough = (cell != NULL) ? - (cell->strikethrough != 0) : + (cell->strikethrough != 0) : FALSE; if (nstrikethrough != strikethrough) { break; @@ -13837,6 +14030,7 @@ vte_terminal_get_accessible(GtkWidget *widget) access = vte_terminal_accessible_new(terminal); terminal->pvt->accessible = access; } + terminal->pvt->accessible_exists = TRUE; return access; } @@ -14086,6 +14280,42 @@ vte_terminal_class_init(VteTerminalClass *klass, gconstpointer data) NULL, _vte_marshal_VOID__VOID, G_TYPE_NONE, 0); + klass->text_modified_signal = + g_signal_new("text-modified", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + _vte_marshal_VOID__VOID, + G_TYPE_NONE, 0); + klass->text_inserted_signal = + g_signal_new("text-inserted", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + _vte_marshal_VOID__VOID, + G_TYPE_NONE, 0); + klass->text_deleted_signal = + g_signal_new("text-deleted", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + _vte_marshal_VOID__VOID, + G_TYPE_NONE, 0); + klass->text_scrolled_signal = + g_signal_new("text-scrolled", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + _vte_marshal_VOID__INT, + G_TYPE_NONE, 1); /* Try to determine some acceptable encoding names. */ if (_vte_matcher_narrow_encoding() == NULL) { @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001,2002 Red Hat, Inc. + * Copyright (C) 2001,2002,2003 Red Hat, Inc. * * This is free software; you can redistribute it and/or modify it under * the terms of the GNU Library General Public License as published by @@ -75,6 +75,8 @@ struct _VteTerminalClass { guint selection_changed_signal; guint contents_changed_signal; guint cursor_moved_signal; + guint status_line_changed_signal; + guint commit_signal; guint deiconify_window_signal; guint iconify_window_signal; @@ -85,13 +87,21 @@ struct _VteTerminalClass { guint maximize_window_signal; guint resize_window_signal; guint move_window_signal; - guint status_line_changed_signal; - guint commit_signal; guint increase_font_size_signal; guint decrease_font_size_signal; - gpointer reserved3; - gpointer reserved4; + + guint text_modified_signal; + guint text_inserted_signal; + guint text_deleted_signal; + guint text_scrolled_signal; + + guint reserved1; + guint reserved2; + guint reserved3; + guint reserved4; + guint reserved5; + guint reserved6; }; /* Values for "what should happen when the user hits backspace/delete". Use diff --git a/src/vteaccess.c b/src/vteaccess.c index bf82aff..18167f9 100644 --- a/src/vteaccess.c +++ b/src/vteaccess.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 Red Hat, Inc. + * Copyright (C) 2002,2003 Red Hat, Inc. * * This is free software; you can redistribute it and/or modify it under * the terms of the GNU Library General Public License as published by @@ -23,6 +23,7 @@ #include "../config.h" #include <atk/atk.h> #include <gtk/gtk.h> +#include <string.h> #include "debug.h" #include "vte.h" #include "vteaccess.h" @@ -74,13 +75,86 @@ vte_terminal_accessible_new_private_data(void) /* "Oh yeah, that's selected. Sure." */ static gboolean -all_selected(VteTerminal *terminal, glong column, glong row) +all_selected(VteTerminal *terminal, glong column, glong row, gpointer data) { return TRUE; } static void -vte_terminal_accessible_update_private_data_if_needed(AtkObject *text) +emit_text_caret_moved(GObject *object, glong caret) +{ +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Accessibility peer emitting " + "`text-caret-moved'.\n"); + } +#endif + g_signal_emit_by_name(object, "text-caret-moved", caret); +} + +static void +emit_text_changed_insert(GObject *object, + const char *text, glong offset, glong len) +{ + const char *p; + glong start, count; + if (len == 0) { + return; + } +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Accessibility peer emitting " + "`text-changed::insert' (%ld, %ld).\n", + offset, len); + } +#endif + /* Convert the byte offsets to characters. */ + for (p = text, start = 0; + p < text + offset; + p = g_utf8_next_char(p)) { + start++; + } + for (p = text + offset, count = 0; + p < text + offset + len; + p = g_utf8_next_char(p)) { + count++; + } + g_signal_emit_by_name(object, "text-changed::insert", start, count); +} + +static void +emit_text_changed_delete(GObject *object, + const char *text, glong offset, glong len) +{ + const char *p; + glong start, count; + if (len == 0) { + return; + } +#ifdef VTE_DEBUG + if (_vte_debug_on(VTE_DEBUG_SIGNALS)) { + fprintf(stderr, "Accessibility peer emitting " + "`text-changed::delete' (%ld, %ld).\n", + offset, len); + } +#endif + /* Convert the byte offsets to characters. */ + for (p = text, start = 0; + p < text + offset; + p = g_utf8_next_char(p)) { + start++; + } + for (p = text + offset, count = 0; + p < text + offset + len; + p = g_utf8_next_char(p)) { + count++; + } + g_signal_emit_by_name(object, "text-changed::delete", start, count); +} + +static void +vte_terminal_accessible_update_private_data_if_needed(AtkObject *text, + char **old) { VteTerminal *terminal; VteTerminalAccessiblePrivate *priv; @@ -99,6 +173,13 @@ vte_terminal_accessible_update_private_data_if_needed(AtkObject *text) /* If nothing's changed, just return immediately. */ if ((priv->snapshot_contents_invalid == FALSE) && (priv->snapshot_caret_invalid == FALSE)) { + if (old) { + if (priv->snapshot_text) { + *old = g_strdup(priv->snapshot_text); + } else { + *old = g_strdup(""); + } + } return; } @@ -106,11 +187,18 @@ vte_terminal_accessible_update_private_data_if_needed(AtkObject *text) /* Re-read the contents of the widget if the contents have changed. */ if (priv->snapshot_contents_invalid) { - /* Free the outdated snapshot data. */ - if (priv->snapshot_text != NULL) { + /* Free the outdated snapshot data, unless the caller + * wants it. */ + if (old) { + if (priv->snapshot_text != NULL) { + *old = priv->snapshot_text; + } else { + *old = g_strdup(""); + } + } else { g_free(priv->snapshot_text); - priv->snapshot_text = NULL; } + priv->snapshot_text = NULL; /* Free the character offsets and allocate a new array to hold * them. */ @@ -219,8 +307,7 @@ vte_terminal_accessible_update_private_data_if_needed(AtkObject *text) /* The caret may have moved. */ if (caret != priv->snapshot_caret) { priv->snapshot_caret = caret; - g_signal_emit_by_name(G_OBJECT(text), "text_caret_moved", - caret); + emit_text_caret_moved(G_OBJECT(text), caret); } /* Done updating the caret position, too. */ priv->snapshot_caret_invalid = FALSE; @@ -257,6 +344,105 @@ vte_terminal_accessible_free_private_data(VteTerminalAccessiblePrivate *priv) g_free(priv); } +/* A signal handler to catch "text-inserted/deleted/modified" signals. */ +static void +vte_terminal_accessible_text_modified(VteTerminal *terminal, gpointer data) +{ + VteTerminalAccessiblePrivate *priv; + char *old; + glong offset, olen, nlen; + + g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data)); + + priv = g_object_get_data(G_OBJECT(data), + VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); + g_return_if_fail(priv != NULL); + + priv->snapshot_contents_invalid = TRUE; + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(data), + &old); + g_return_if_fail(old != NULL); + + olen = strlen(old); + nlen = strlen(priv->snapshot_text); + + /* Find the offset where they don't match. */ + offset = 0; + while ((offset < olen) && (offset < nlen)) { + if (old[offset] != priv->snapshot_text[offset]) { + break; + } + offset++; + } + + /* At least one of them had better have more data, right? */ + if ((offset < olen) || (offset < nlen)) { + /* Back up both end points until we find the *last* point + * where they differed. */ + while ((olen > offset) && (nlen > offset)) { + if (old[olen - 1] != + priv->snapshot_text[nlen - 1]) { + break; + } + olen--; + nlen--; + } + /* At least one of them has to have text the other + * doesn't. */ + g_assert((nlen > offset) || (olen > offset)); + /* Now emit a deleted signal for text that was in the old + * string but isn't in the new one... */ + emit_text_changed_delete(G_OBJECT(data), + old, + offset, olen - offset); + /* .. and an inserted signal for text that wasn't in the old + * string but is in the new one. */ + emit_text_changed_insert(G_OBJECT(data), + priv->snapshot_text, + offset, nlen - offset); + } + + g_free(old); +} + +/* A signal handler to catch "text-scrolled" signals. */ +static void +vte_terminal_accessible_text_scrolled(VteTerminal *terminal, + gint howmuch, + gpointer data) +{ + VteTerminalAccessiblePrivate *priv; + + g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data)); + + priv = g_object_get_data(G_OBJECT(data), + VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); + g_return_if_fail(priv != NULL); + + /* FIXME: don't wuss out here, be more specific if it the delta is + * less than the terminal's vertical height. */ + + if (priv->snapshot_text != NULL) { + if (priv->snapshot_text) { + emit_text_changed_delete(G_OBJECT(data), + priv->snapshot_text, + 0, + strlen(priv->snapshot_text)); + } + } + priv->snapshot_contents_invalid = TRUE; + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(data), + NULL); + if (priv->snapshot_text != NULL) { + if (priv->snapshot_text) { + emit_text_changed_insert(G_OBJECT(data), + priv->snapshot_text, + 0, + strlen(priv->snapshot_text)); + } + } +} + /* A signal handler to catch "contents_changed" signals. */ static void vte_terminal_accessible_invalidate_contents(VteTerminal *terminal, @@ -297,7 +483,8 @@ vte_terminal_accessible_invalidate_cursor(VteTerminal *terminal, gpointer data) } #endif priv->snapshot_caret_invalid = TRUE; - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(data)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(data), + NULL); } /* Handle title changes by resetting the parent object. */ @@ -337,6 +524,19 @@ vte_terminal_accessible_new(VteTerminal *terminal) g_object_set_data(G_OBJECT(access), VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA, vte_terminal_accessible_new_private_data()); + + g_signal_connect(G_OBJECT(terminal), "text-inserted", + GTK_SIGNAL_FUNC(vte_terminal_accessible_text_modified), + object); + g_signal_connect(G_OBJECT(terminal), "text-deleted", + GTK_SIGNAL_FUNC(vte_terminal_accessible_text_modified), + object); + g_signal_connect(G_OBJECT(terminal), "text-modified", + GTK_SIGNAL_FUNC(vte_terminal_accessible_text_modified), + object); + g_signal_connect(G_OBJECT(terminal), "text-scrolled", + GTK_SIGNAL_FUNC(vte_terminal_accessible_text_scrolled), + object); g_signal_connect(G_OBJECT(terminal), "contents-changed", GTK_SIGNAL_FUNC(vte_terminal_accessible_invalidate_contents), object); @@ -353,7 +553,10 @@ vte_terminal_accessible_new(VteTerminal *terminal) } atk_object_set_name(ATK_OBJECT(access), "Terminal"); - atk_object_set_description(ATK_OBJECT(access), terminal->window_title ? terminal->window_title : ""); + atk_object_set_description(ATK_OBJECT(access), + terminal->window_title ? + terminal->window_title : + ""); return ATK_OBJECT(access); } @@ -395,7 +598,8 @@ vte_terminal_accessible_get_text(AtkText *text, g_return_val_if_fail((start_offset >= 0) && (end_offset >= -1), g_strdup("")); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); priv = g_object_get_data(G_OBJECT(text), VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); @@ -443,7 +647,8 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text, gunichar current, prev, next; int line; - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); priv = g_object_get_data(G_OBJECT(text), VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); @@ -610,7 +815,8 @@ vte_terminal_accessible_get_text_before_offset(AtkText *text, gint offset, gint *end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); return vte_terminal_accessible_get_text_somewhere(text, offset, boundary_type, @@ -626,7 +832,8 @@ vte_terminal_accessible_get_text_after_offset(AtkText *text, gint offset, gint *end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); return vte_terminal_accessible_get_text_somewhere(text, offset, boundary_type, @@ -642,7 +849,8 @@ vte_terminal_accessible_get_text_at_offset(AtkText *text, gint offset, gint *end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); return vte_terminal_accessible_get_text_somewhere(text, offset, boundary_type, @@ -659,7 +867,8 @@ vte_terminal_accessible_get_character_at_offset(AtkText *text, gint offset) char *unichar; gunichar ret; - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); priv = g_object_get_data(G_OBJECT(text), VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); @@ -680,7 +889,8 @@ vte_terminal_accessible_get_caret_offset(AtkText *text) { VteTerminalAccessiblePrivate *priv; - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); priv = g_object_get_data(G_OBJECT(text), VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); @@ -693,7 +903,8 @@ vte_terminal_accessible_get_run_attributes(AtkText *text, gint offset, gint *start_offset, gint *end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME */ return NULL; } @@ -702,7 +913,8 @@ static AtkAttributeSet * vte_terminal_accessible_get_default_attributes(AtkText *text) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME */ return NULL; } @@ -714,7 +926,8 @@ vte_terminal_accessible_get_character_extents(AtkText *text, gint offset, AtkCoordType coords) { g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text)); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME */ } @@ -723,7 +936,8 @@ vte_terminal_accessible_get_character_count(AtkText *text) { VteTerminalAccessiblePrivate *priv; - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); priv = g_object_get_data(G_OBJECT(text), VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA); @@ -737,7 +951,8 @@ vte_terminal_accessible_get_offset_at_point(AtkText *text, AtkCoordType coords) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), 0); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME */ return 0; } @@ -746,7 +961,8 @@ static gint vte_terminal_accessible_get_n_selections(AtkText *text) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), 0); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME? */ return 0; } @@ -756,7 +972,8 @@ vte_terminal_accessible_get_selection(AtkText *text, gint selection_number, gint *start_offset, gint *end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME? */ return NULL; } @@ -766,7 +983,8 @@ vte_terminal_accessible_add_selection(AtkText *text, gint start_offset, gint end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME? */ return FALSE; } @@ -776,7 +994,8 @@ vte_terminal_accessible_remove_selection(AtkText *text, gint selection_number) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME? */ return FALSE; } @@ -786,7 +1005,8 @@ vte_terminal_accessible_set_selection(AtkText *text, gint selection_number, gint start_offset, gint end_offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* FIXME? */ return FALSE; } @@ -795,7 +1015,8 @@ static gboolean vte_terminal_accessible_set_caret_offset(AtkText *text, gint offset) { g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE); - vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text)); + vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text), + NULL); /* Whoa, very not allowed. */ return FALSE; } |