After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 604558 - Cursor is lost or is placed in wrong position.
Cursor is lost or is placed in wrong position.
Status: RESOLVED FIXED
Product: gnome-commander
Classification: Other
Component: application
1.2.x
Other Linux
: Normal normal
: 1.2.9
Assigned To: epiotr
epiotr
Depends on:
Blocks:
 
 
Reported: 2009-12-14 17:01 UTC by dodamn
Modified: 2009-12-29 20:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix-a-bug-with-lost-cursor.diff.gz (461 bytes, patch)
2009-12-14 17:08 UTC, dodamn
needs-work Details | Review

Description dodamn 2009-12-14 17:01:34 UTC
Steps to reproduce:
1. Run gnome-commander.
2. Press TAB key to switch to left panel.
3. Open /etc directory(or Open a directory that has many files or directories like /bin, /dev and so on)
4. Position the cursor on a file that is in the lower part of file list.(For example, place the cursor on a file which starts with x, y, z or something if the file list is sorted in alphabetical order)
5. Press TAB key to switch to right panel.
6. Open /boot direcoty(or Open a directory that has few files or directories like /mnt, /media, /opt and so on. And the directory should be different from the directory that is opened in the left panel)
7. Press "Ctrl + ->" to copy the current working directory from the active right file list to the left one.
8. Press TAB key to switch to left panel.
9. Then you will see the cursor is lost or is placed in wrong position.


I tried to find why this problem occurs. And I found the reason.
Because the member variable cur_file of GnomeCmdFileList::Private is not reset to 0 when "Ctrl + ->" is pressed. The value of focus_row of GTK_CLIST is reset to -1, but old value of cur_file is reamined. So the cursur is placed in wrong position.

I think the value of cur_file needs to be 0 to resolve this bug.
In gnome-cmd-file-selector.cc:1023, the focus_row is set to -1. So also cur_file needs to be 0 in the same place like the focus_row. But, the cur_file is not accessible from out side of gnome-cmd-file-list.cc. Some function, which provides the cur_file accessibility to the out side of gnome-cmd-file-list.cc, can be made. But I think that this modification is not accompanied with the design policy of gnome-commander.

So I changed the GnomeCmdFileList::select_row() alternatively. I attached a patch. It is a very short patch. Please refer to the attached if you want to see in more detail.


Other informations
GNOME Commander version: 1.2.8.4
OS: Ubuntu januty
Comment 1 dodamn 2009-12-14 17:06:21 UTC
Sorry, I wrote something wrong.
I wrote 'left' and 'right' reversely.
So the right way to reproduce steps is like the followings...

1. Run gnome-commander.
2. Press TAB key to switch to right panel.
3. Open /etc directory(or Open a directory that has many files or directories
like /bin, /dev and so on)
4. Position the cursor on a file that is in the lower part of file list.(For
example, place the cursor on a file which starts with x, y, z or something if
the file list is sorted in alphabetical order)
5. Press TAB key to switch to left panel.
6. Open /boot direcoty(or Open a directory that has few files or directories
like /mnt, /media, /opt and so on. And the directory should be different from
the directory that is opened in the left panel)
7. Press "Ctrl + ->" to copy the current working directory from the active
left file list to the right one.
8. Press TAB key to switch to right panel.
9. Then you will see the cursor is lost or is placed in wrong position.
Comment 2 dodamn 2009-12-14 17:08:11 UTC
Created attachment 149711 [details] [review]
fix-a-bug-with-lost-cursor.diff.gz
Comment 3 epiotr 2009-12-16 17:51:46 UTC
Bug confirmed
Comment 4 epiotr 2009-12-16 17:57:16 UTC
Comment on attachment 149711 [details] [review]
fix-a-bug-with-lost-cursor.diff.gz

Unfortunately, the patch introduces regression: when CTRL+LEFT (RIGHT respectively) it always sets cursor to the file list top.
Comment 5 dodamn 2009-12-16 18:08:44 UTC
Yes. The patch makes cursor is always set to the file list top.
In my opinion, additionaly, the voffset of GnomeCmdDir should be always 0 when new directory is opened. Because it is more natural if the cursor is set to the top.

But I think that you want that GNOME Commander remembers where the cursor was. Is it true? If you intend to do it, the patch I made is not right.
Comment 6 epiotr 2009-12-29 20:21:32 UTC
Your patch does NOT introduce any regression - the problem with resetting cursor to file list top is present also without the patch. Sorry for the ado about nothing. The fix will go into the next, 1.2.8.5 release. 

Thank you for your bug report.