[PATCH weston] editor: Support shift-left/right for selecting text
Eoff, Ullysses A
ullysses.a.eoff at intel.com
Fri Jul 12 12:53:55 PDT 2013
This patches fixes <https://bugs.freedesktop.org/show_bug.cgi?id=66802> for me.
The bug "title" only indicates <shift>+<arrow> didn't work and this patch addresses that part. But as I read through the bug "description", there is the extra claim that <Ctrl> doesn't work as expected, either. The <Ctrl> stuff should probably be split out into its own bug/enhancement though. So I'd be ok closing this bug/enhancement as fixed by this patch based on the title.
U. Artie Eoff
> -----Original Message-----
> From: wayland-devel-bounces+ullysses.a.eoff=intel.com at lists.freedesktop.org [mailto:wayland-devel-
> bounces+ullysses.a.eoff=intel.com at lists.freedesktop.org] On Behalf Of Rob Bradford
> Sent: Thursday, July 11, 2013 8:00 AM
> To: wayland-devel at lists.freedesktop.org
> Cc: Rob Bradford
> Subject: [PATCH weston] editor: Support shift-left/right for selecting text
>
> From: Rob Bradford <rob at linux.intel.com>
>
> If the shift modifier is active then we don't make the cursor and the
> anchor the same and as a result we develop a selection in the direction
> that the arrow key gets pressed in.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=66802
> ---
> clients/editor.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/clients/editor.c b/clients/editor.c
> index 7e69403..1300ccf 100644
> --- a/clients/editor.c
> +++ b/clients/editor.c
> @@ -1141,7 +1141,8 @@ key_handler(struct window *window,
> new_char = utf8_prev_char(entry->text, entry->text + entry->cursor);
> if (new_char != NULL) {
> entry->cursor = new_char - entry->text;
> - entry->anchor = entry->cursor;
> + if (!(input_get_modifiers(input) & MOD_SHIFT_MASK))
> + entry->anchor = entry->cursor;
> widget_schedule_redraw(entry->widget);
> }
> break;
> @@ -1151,7 +1152,8 @@ key_handler(struct window *window,
> new_char = utf8_next_char(entry->text + entry->cursor);
> if (new_char != NULL) {
> entry->cursor = new_char - entry->text;
> - entry->anchor = entry->cursor;
> + if (!(input_get_modifiers(input) & MOD_SHIFT_MASK))
> + entry->anchor = entry->cursor;
> widget_schedule_redraw(entry->widget);
> }
> break;
> --
> 1.8.3.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list