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 665742 - Jumps back to cursor position when switching between programs
Jumps back to cursor position when switching between programs
Status: RESOLVED FIXED
Product: ghex
Classification: Applications
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: GHex maintainers
GHex maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-07 17:27 UTC by Edward Sheldrake
Modified: 2012-02-08 23:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix excessive scrolling back to cursor (3.06 KB, patch)
2011-12-07 17:38 UTC, Edward Sheldrake
committed Details | Review

Description Edward Sheldrake 2011-12-07 17:27:12 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.
Comment 1 Edward Sheldrake 2011-12-07 17:38:48 UTC
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.
Comment 2 Kalev Lember 2012-02-08 23:51:10 UTC
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.)