GNOME Bugzilla – Bug 665742
Jumps back to cursor position when switching between programs
Last modified: 2012-02-08 23:51:32 UTC
ghex moves the scrollbar position so that the displayed part is where the cursor is. It does this when focus switches to another program, or when you resize the ghex window. This behaviour can be unwanted, especially when just viewing files without editing them e.g. 1. Open a file in ghex 2. Move scrollbar to display end of file 3. Switch focus to another program, using mouse or alt+tab At this point, ghex moves the scrollbar back to the start of the file, where the cursor is. I think it should either do that only if necessary to keep the cursor visible after resizing, or not at all. It definitely shouldn't change the scrollbar if you're not resizing the window, this part of the problem is new since the GTK 3 port.
Created attachment 203016 [details] [review] Fix excessive scrolling back to cursor This patch fixes it to only keep the cursor visible if it was visible before.
Review of attachment 203016 [details] [review]: Excellent, thank you for the patch! Pushed to master as 89f6c8e. (Sorry it took me so long to get to this.)