summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Villenave <[email protected]>2021-10-13 17:55:37 +0200
committerraveit65 <[email protected]>2022-03-10 19:31:29 +0100
commit84b1bd2cdb55d1a293c7f19ee4585c1eeeac2879 (patch)
tree7e15d904e9c906039bad9e5d7fbfd67724ef711e
parent6f8f4c8b3f82af1f0aa811cf190bc4b74678e267 (diff)
downloadengrampa-84b1bd2cdb55d1a293c7f19ee4585c1eeeac2879.tar.bz2
engrampa-84b1bd2cdb55d1a293c7f19ee4585c1eeeac2879.tar.xz
Enable mouse-less navigation & reading for output dialogs
We actually want a cursor to be displayed in case a screen reader is used with visual tracking.
-rw-r--r--src/fr-window.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fr-window.c b/src/fr-window.c
index 6023336..dd68dca 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -7124,7 +7124,9 @@ fr_window_view_last_output (FrWindow *window,
dialog = gtk_dialog_new_with_buttons (title,
GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ /* Make this dialog modal, otherwise with most WMs
+ * the focus can’t be regained without the mouse. */
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
@@ -7147,7 +7149,9 @@ fr_window_view_last_output (FrWindow *window,
text_view = gtk_text_view_new_with_buffer (text_buffer);
g_object_unref (text_buffer);
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
+ /* Although this isn’t an editable text area, we do want the
+ * cursor for accessibility purposes. */
+ gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), TRUE);
/**/
@@ -7180,10 +7184,14 @@ fr_window_view_last_output (FrWindow *window,
fr_window_view_last_output_print(text_buffer, &iter, window->archive->process->out.raw);
/* Show STDERR of process */
fr_window_view_last_output_print(text_buffer, &iter, window->archive->process->err.raw);
+ /* place the cursor at the start */
+ gtk_text_buffer_get_iter_at_offset (text_buffer, &iter, 0);
+ gtk_text_buffer_place_cursor(text_buffer, &iter);
/**/
pref_util_restore_window_geometry (GTK_WINDOW (dialog), LAST_OUTPUT_DIALOG_NAME);
+ gtk_widget_grab_focus (text_view);
}
/* -- fr_window_rename_selection -- */