! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Wrong keyboard navigation after using rubberband in exo-icon-view
Status:
RESOLVED: FIXED

Comments

Description Alexander Kurakin 2019-12-19 20:53:11 CET
Say I have two columns of files on my desktop. Say coordinates are (row, column).

Issue I:

1. Select (via mouse's rectangle) file at (1, 2).
2. Press <Down>.
3. Expected: selected file at (2, 2). Actual: selected file at (1, 1).

Issue 2:

1. Select (via mouse's rectangle) a file.
2. Press <Down> multiple to get right bottom file.
3. Press <Down>.
4. Expected: selected the same file or file at (1, 1). Actual: selected file at (1, 2).

Thanks.
Comment 1 alexxcons editbugs 2019-12-19 21:05:28 CET
Thanks for reporting, I can reproduce the bug.
Further observations:
- The bug only shows when the selection is done via mouse rectangle (aka rubberband). When the selection is done via "click", everything is fine.
- Only the first up/down/left/right key behaves wrong ... all later up/down/left/right are correct
- It looks like after a rubberband selection, the file used for keyboard navigation is still the old one, which was selected before, niot the actually selected one.
Comment 2 alexxcons editbugs 2019-12-19 21:37:29 CET
presumption:
"exo-icon-view.c:exo_icon_view_set_cursor_item"  only is called when a file is clicked, it's not called when rubberband is used for selection.
Comment 3 alexxcons editbugs 2019-12-19 22:18:36 CET
I assume exo_icon_view_set_cursor or exo_icon_view_set_cursor_item should be called either in "exo_icon_view_update_rubberband_selection" or in "exo_icon_view_stop_rubberbanding".

So far I failed to figure out where to find the correct cell to pass .. please feel free to continue the debugging, I will not have much time for it in the next days.
Comment 4 alexxcons editbugs 2019-12-27 19:08:49 CET
*** Bug 16306 has been marked as a duplicate of this bug. ***
Comment 5 Theo Linkspfeifer editbugs 2020-03-21 20:46:38 CET
Created attachment 9626 
quick diff

How about this?
Comment 6 alexxcons editbugs 2020-03-23 10:16:38 CET
(In reply to Theo Linkspfeifer from comment #5)
> Created attachment 9626 
> quick diff
> 
> How about this?

Looks very good to me, thanks Theo!

I tried to move it up, inside the other if(..), to save some CPU cycles, but than some border-cases are not correct (e.g. when first opening a bigger rubberband, but than make it smaller)

If ok for you, I would ask Sean for his ok  & push the patch as it is.
Comment 7 Theo Linkspfeifer editbugs 2020-03-23 11:31:02 CET
I tried to look for an optimized variant, but then just went with this simple code instead.
Comment 8 Alexander Kurakin 2020-03-23 13:47:10 CET
Sorry. row == 0 and col == 0 ever?
Comment 9 alexxcons editbugs 2020-03-23 17:20:11 CET
(In reply to Alexander Kurakin from comment #8)
> Sorry. row == 0 and col == 0 ever?

Haha, cant belive I did not see that one. Yes, looks like "row" and "col" are always 0. Thanks Alex !

@Theo
 Possibly some optimizsation is missing? It works nicely ..  should we just check against 0, and drop the variables?
Comment 10 Theo Linkspfeifer editbugs 2020-03-23 19:54:34 CET
My bad. That check can be removed.
Comment 11 alexxcons editbugs 2020-03-23 22:46:35 CET
Created attachment 9632 
patch

Ok like this ?
Comment 12 Theo Linkspfeifer editbugs 2020-03-24 00:46:29 CET
Yes.
Comment 13 Git Bot editbugs 2020-03-25 00:35:04 CET
Theo Linkspfeifer referenced this bugreport in commit dba8f1478251119974b5849e3f93730fded5d090

Wrong keyboard navigation after using rubberband in exo-icon-view (Bug #16286)

https://git.xfce.org/xfce/exo/commit?id=dba8f1478251119974b5849e3f93730fded5d090
Comment 14 alexxcons editbugs 2020-03-25 00:37:27 CET
pushed to master.
Thanks alot for the patch Theo !

Bug #16286

Reported by:
Alexander Kurakin
Reported on: 2019-12-19
Last modified on: 2020-03-25
Duplicates (1):
  • 16306 beep while at middle of files list

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Version:
0.12.8

Attachments

quick diff (851 bytes, patch)
2020-03-21 20:46 CET , Theo Linkspfeifer
no flags
patch (789 bytes, patch)
2020-03-23 22:46 CET , alexxcons
no flags

Additional information