Header/footer scroll resets itself upon many actions #28298

Closed
opened 2011-08-18 23:54:57 +02:00 by Chris Want · 7 comments

%%%I'm taking a lot of screen shots these days, and
after scrolling the header of a space to the way I
want it, I take my screen shot, and then I discover
that the header scroll has been reset to zero.
If I save my blend file, the header scroll resets to
zero. If I move the Blender window, the scroll resets
to zero.

Thanks,
Chris
%%%

%%%I'm taking a lot of screen shots these days, and after scrolling the header of a space to the way I want it, I take my screen shot, and then I discover that the header scroll has been reset to zero. If I save my blend file, the header scroll resets to zero. If I move the Blender window, the scroll resets to zero. Thanks, Chris %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%needs small tweak in re-calculate of header view...%%%

%%%needs small tweak in re-calculate of header view...%%%

%%%I've added a patch to the patch tracker that fixes this bug.

http://projects.blender.org/tracker/index.php?func=detail&aid=30023&group_id=9&atid=127%%%

%%%I've added a patch to the patch tracker that fixes this bug. http://projects.blender.org/tracker/index.php?func=detail&aid=30023&group_id=9&atid=127%%%
Member

%%%Doing a full reinit (clearing V2D_IS_INITIALISED) was added for by Ton a reason in r37206, to make sure dpi changes work correctly. So simply removing this is not a good idea. Also it only solves part of the problem, by avoiding reinit on move and resize of the main window.

It looks like the root of the problem is that when initializing the View2D tot rect size, it uses the initial area width. The actual, full width of the header is only known when the layout is resolved. So in that reinit the cur rect size is clamped to the visible area, which also resets any possible scrolling. This could be solved by somewhat releasing the strict scrolling requirements in headers.

However, in most of the cases described above (screenshots, saving to new file) what happens is that the active (mouse-over) area is made full screen, which temporarily enlarges the tot rect size. That in turn also resets the scrolling. So in order to really resolve this issue reliably this behavior of using the active area for file selection dialogs would need to be changed as well. I doubt that making such major design changes for this minor inconvenience would be a good idea.%%%

%%%Doing a full reinit (clearing V2D_IS_INITIALISED) was added for by Ton a reason in r37206, to make sure dpi changes work correctly. So simply removing this is not a good idea. Also it only solves part of the problem, by avoiding reinit on move and resize of the main window. It looks like the root of the problem is that when initializing the View2D tot rect size, it uses the initial area width. The actual, full width of the header is only known when the layout is resolved. So in that reinit the cur rect size is clamped to the visible area, which also resets any possible scrolling. This could be solved by somewhat releasing the strict scrolling requirements in headers. However, in most of the cases described above (screenshots, saving to new file) what happens is that the active (mouse-over) area is made full screen, which temporarily enlarges the tot rect size. That in turn also resets the scrolling. So in order to really resolve this issue reliably this behavior of using the active area for file selection dialogs would need to be changed as well. I doubt that making such major design changes for this minor inconvenience would be a good idea.%%%

%%%You are correct it only solves part of the problem, it doesn't solve resetting on fullscreen, saving to new file, etc. All this patch really does is allow the dpi changing to work without haveing to clear V2D_IS_INITIALIZED. I don't agree that you can't just remove doing a full reinit, especially when you write a patch that fixes the reason for doing the reset. When Ton first did the dpi changes he actually reset every region not just headers, and all regions were resetting alot (on region resize, etc). Then he removed resetting on non-header regions because it wasn't needed.

The problem with header regions was that when you changed the dpi it changed the size of the region and the size of the cur rect without changing the size of the tot rect. This would work if the height was increased, but if the height was decreased it would always adjust the cur rect upwards (note this is ok for other regions because they use V2D_ALIGN_NO_POS_Y). The header draw code would begin, and once you called UI_view2d_view_ortho and initialized the blocks any later changes to cur or tot don't matter because you saved the projection matrix into the blocks.

There are several ways to fix this, I chose to simply adjust the cur rect downwards if the area uses V2D_ALIGN_NO_NEG_Y as it seemed the least intrusive. Clearing V2D_IS_INITIALIZED is basically an indirect and confusing way of just calling UI_view2d_totRect_set, so you could just directly call it someplace before the header drawing code begins for the same effect. You could also change the way blocks are drawn so you could initialize them, resolve the layout, adjust them if needed, then finally draw them after you set the tot rect for the view (this is actually the approach used by Bastien Montagne in a patch to fix this other bug: http://projects.blender.org/tracker/index.php?func=detail&aid=24343&group_id=9&atid=498)%%%

%%%You are correct it only solves part of the problem, it doesn't solve resetting on fullscreen, saving to new file, etc. All this patch really does is allow the dpi changing to work without haveing to clear V2D_IS_INITIALIZED. I don't agree that you can't just remove doing a full reinit, especially when you write a patch that fixes the reason for doing the reset. When Ton first did the dpi changes he actually reset every region not just headers, and all regions were resetting alot (on region resize, etc). Then he removed resetting on non-header regions because it wasn't needed. The problem with header regions was that when you changed the dpi it changed the size of the region and the size of the cur rect without changing the size of the tot rect. This would work if the height was increased, but if the height was decreased it would always adjust the cur rect upwards (note this is ok for other regions because they use V2D_ALIGN_NO_POS_Y). The header draw code would begin, and once you called UI_view2d_view_ortho and initialized the blocks any later changes to cur or tot don't matter because you saved the projection matrix into the blocks. There are several ways to fix this, I chose to simply adjust the cur rect downwards if the area uses V2D_ALIGN_NO_NEG_Y as it seemed the least intrusive. Clearing V2D_IS_INITIALIZED is basically an indirect and confusing way of just calling UI_view2d_totRect_set, so you could just directly call it someplace before the header drawing code begins for the same effect. You could also change the way blocks are drawn so you could initialize them, resolve the layout, adjust them if needed, then finally draw them after you set the tot rect for the view (this is actually the approach used by Bastien Montagne in a patch to fix this other bug: http://projects.blender.org/tracker/index.php?func=detail&aid=24343&group_id=9&atid=498)%%%
Member

%%%Hi Anthony,

Sorry for ignoring this so long, I've been busy with a movie in the mean time :)

The patch in the tracker works fine for DPI changes, and code is much nicer, so I will add that.
However, the header scroll still resets on switching screens or using a fileselector - but only if you make that area 'full screen', which is correct for code (same area gets full and refreshes view).

This view2d code is flawed still. We ported too many things over from 2.4 in order to get things work quickly - resulting in code we can't manage well.

I hope you're still around, we can use people who like to dig in this part of our messy code :)%%%

%%%Hi Anthony, Sorry for ignoring this so long, I've been busy with a movie in the mean time :) The patch in the tracker works fine for DPI changes, and code is much nicer, so I will add that. However, the header scroll still resets on switching screens or using a fileselector - but only if you make that area 'full screen', which is correct for code (same area gets full and refreshes view). This view2d code is flawed still. We ported too many things over from 2.4 in order to get things work quickly - resulting in code we can't manage well. I hope you're still around, we can use people who like to dig in this part of our messy code :)%%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#28298
No description provided.