@@ -217,10 +217,10 @@ drag_scroll(Window *w, OSWindow *frame) {
217217}
218218
219219static inline void
220- extend_selection (Window * w ) {
220+ extend_selection (Window * w , bool ended ) {
221221 Screen * screen = w -> render_data .screen ;
222222 if (screen_has_selection (screen )) {
223- screen_update_selection (screen , w -> mouse_pos .cell_x , w -> mouse_pos .cell_y , w -> mouse_pos .in_left_half_of_cell , true , false);
223+ screen_update_selection (screen , w -> mouse_pos .cell_x , w -> mouse_pos .cell_y , w -> mouse_pos .in_left_half_of_cell , ended , false);
224224 }
225225}
226226
@@ -304,7 +304,7 @@ detect_url(Screen *screen, unsigned int x, unsigned int y) {
304304static inline void
305305handle_mouse_movement_in_kitty (Window * w , int button , bool mouse_cell_changed ) {
306306 Screen * screen = w -> render_data .screen ;
307- if (screen -> selection .in_progress && button == GLFW_MOUSE_BUTTON_LEFT ) {
307+ if (screen -> selection .in_progress && ( button == GLFW_MOUSE_BUTTON_LEFT || button == GLFW_MOUSE_BUTTON_RIGHT ) ) {
308308 monotonic_t now = monotonic ();
309309 if ((now - w -> last_drag_scroll_at ) >= ms_to_monotonic_t (20ll ) || mouse_cell_changed ) {
310310 update_drag (false, w , false, 0 );
@@ -427,7 +427,7 @@ handle_button_event_in_kitty(Window *w, int button, int modifiers, bool is_relea
427427 if (is_release ) { call_boss (paste_from_selection , NULL ); return ; }
428428 break ;
429429 case GLFW_MOUSE_BUTTON_RIGHT :
430- if ( is_release ) { extend_selection (w ); }
430+ extend_selection (w , is_release );
431431 break ;
432432 }
433433}
0 commit comments