File Browser: Back button doesn't go back to first folder (in the new Video Editor > Video Editor workspace) #124771

Open
opened 2024-07-16 11:22:58 +02:00 by Dalai Felinto · 5 comments

System Information
Operating system: Linux-6.8.0-36-generic-x86_64-with-glibc2.39 64 Bits, X11 UI

Blender Version
Broken: 2.8
Broken: 2.9
Broken: 3.0
Broken: 4.0
Broken: 4.3.0 Alpha, branch: main, commit date: 2024-07-16 08:11, hash: c3f79ee250ee
Worked: 2.79 ♡

Short description of error
Back button doesn't go back to first folder in the Video Sequencer workspace.

Exact steps for others to reproduce the error

  • Create a new workspace: + > Video Editor > Video Editor
  • On the File Browser editor click on any folder.
  • Try to use ¨Back" to go back to the previous folder, it doens't.
**System Information** Operating system: Linux-6.8.0-36-generic-x86_64-with-glibc2.39 64 Bits, X11 UI **Blender Version** Broken: 2.8 Broken: 2.9 Broken: 3.0 Broken: 4.0 Broken: 4.3.0 Alpha, branch: main, commit date: 2024-07-16 08:11, hash: `c3f79ee250ee` Worked: 2.79 ♡ **Short description of error** Back button doesn't go back to first folder in the Video Sequencer workspace. **Exact steps for others to reproduce the error** * Create a new workspace: + > Video Editor > Video Editor * On the File Browser editor click on any folder. * Try to use ¨Back" to go back to the previous folder, it doens't.
Dalai Felinto added the
Severity
Low
Type
Bug
Meta
Good First Issue
Status
Confirmed
labels 2024-07-16 11:22:59 +02:00
Dalai Felinto added this to the Module: User Interface project 2024-07-16 11:23:00 +02:00
Iliya Katushenock added the
Module
User Interface
label 2024-07-16 11:33:38 +02:00
Member

I'm seeing more errors than reported, so expanding the steps to recreate to make sure it all gets tested:

  • Create a new workspace: + > Video Editor > Video Editor
  • On the File Browser editor click on any folder.
  • Try to use ¨Back" to go back to the previous folder, it doesn't (problem 1).
  • Click the "parent directory" button to return to the previous list.
  • Click the ¨Back" button now and get an exception in BLI_strcasecmp.

The last error is because in folderlist_pushdir the "previous_folder" (folderlist->last) is deallocated ram ("dddddd"). Note that if you skip the first use of "back" in the list above (the problem 1) line then the last error does not occur.

I'm seeing more errors than reported, so expanding the steps to recreate to make sure it all gets tested: * Create a new workspace: + > Video Editor > Video Editor * On the File Browser editor click on any folder. * Try to use ¨Back" to go back to the previous folder, **it doesn't** (problem 1). * Click the "parent directory" button to return to the previous list. * Click the ¨Back" button now and get an exception in BLI_strcasecmp. The last error is because in `folderlist_pushdir` the "previous_folder" (folderlist->last) is deallocated ram ("dddddd"). Note that if you skip the first use of "back" in the list above (the problem 1) line then the last error does not occur.
Member

In a nutshell, when we File / Open to view the File Browser in a window we are going from wm_handler_fileselect_do to ED_fileselect_set_params_from_userdef, fileselect_ensure_updated_file_params, to fileselect_initialize_params_common

In that last step the current starting folder is pushed to the sfile->folders_prev list. That way you can go somewhere else, hit "back" and come back to the first folder. That works great.

But open Blender with default layout. Change the 3D view to a File Browser. At that point we also get a call to fileselect_ensure_updated_file_params, then fileselect_initialize_params_common` which pushes the current folder to the previous list. Yeah. But do this: Double-click on a folder, hit back. It works. But then close Blender and get an exception in MEM_lockfree_freeN.

However, follow the instructions in this complaint and we see that there is no call that pushes the current folder to the previous list. So when we change to the new folder, then hit "back" the only thing on the previous list is the folder you are in, so it does nothing. We need to call fileselect_ensure_updated_file_params somewhere.

In a nutshell, when we File / Open to view the File Browser in a window we are going from `wm_handler_fileselect_do` to `ED_fileselect_set_params_from_userdef`, `fileselect_ensure_updated_file_params`, to `fileselect_initialize_params_common` In that last step the current starting folder is pushed to the sfile->folders_prev list. That way you can go somewhere else, hit "back" and come back to the first folder. That works great. But open Blender with default layout. Change the 3D view to a File Browser. At that point we also get a call to `fileselect_ensure_updated_file_params`, then fileselect_initialize_params_common` which pushes the current folder to the previous list. Yeah. But do this: Double-click on a folder, hit back. It works. But then close Blender and get an exception in MEM_lockfree_freeN. However, follow the instructions in this complaint and we see that there is no call that pushes the current folder to the previous list. So when we change to the new folder, then hit "back" the only thing on the previous list is the folder you are in, so it does nothing. We need to call `fileselect_ensure_updated_file_params` somewhere.
Member

Yikes, I think there are two different errors here.

I think this report is "fixed" by just doing this:

diff --git a/source/blender/editors/space_file/filesel.cc b/source/blender/editors/space_file/filesel.cc
index 1b4dd5afa35..94548bc3f2c 100644
--- a/source/blender/editors/space_file/filesel.cc
+++ b/source/blender/editors/space_file/filesel.cc
@@ -457,6 +457,7 @@ void fileselect_refresh_params(SpaceFile *sfile)
   if (asset_params) {
     fileselect_refresh_asset_params(asset_params);
   }
+  ED_fileselect_set_params_from_userdef(sfile);
 }
 
 bool ED_fileselect_is_file_browser(const SpaceFile *sfile)

Basically just ensure that everything is in a nice state, including pushing the current directory to the previous list, in file browser init.

However, you can then quickly run into the other error, which I believe is not related. Using current main, open Blender with default layout. Select File / Open. In this case the previous list is populate correctly. Click "Parent" and then "back" and you will be back where you started. repeat this, clicking "parent", then "back" and either get an exception in BLI_strcasecmp or in MEM_freeN. As mentioned this is with unchanged main and not in the Video Editor workspace.

Yikes, I think there are two different errors here. I think this report is "fixed" by just doing this: ``` diff --git a/source/blender/editors/space_file/filesel.cc b/source/blender/editors/space_file/filesel.cc index 1b4dd5afa35..94548bc3f2c 100644 --- a/source/blender/editors/space_file/filesel.cc +++ b/source/blender/editors/space_file/filesel.cc @@ -457,6 +457,7 @@ void fileselect_refresh_params(SpaceFile *sfile) if (asset_params) { fileselect_refresh_asset_params(asset_params); } + ED_fileselect_set_params_from_userdef(sfile); } bool ED_fileselect_is_file_browser(const SpaceFile *sfile) ``` Basically just ensure that everything is in a nice state, including pushing the current directory to the previous list, in file browser init. However, you can then quickly run into the other error, which I believe is not related. Using current main, open Blender with default layout. Select File / Open. In this case the previous list is populate correctly. Click "Parent" and then "back" and you will be back where you started. repeat this, clicking "parent", then "back" and either get an exception in `BLI_strcasecmp` or in MEM_freeN. As mentioned this is with unchanged main and not in the Video Editor workspace.
Member

Yup, two different errors, will make two separate PRs

Yup, two different errors, will make two separate PRs
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-07-17 17:54:34 +02:00
Member

Reopening after reverting my changes. I have not found reliable place to ensure that the previous_dir contains the current directory (in cases where File Browser is part of a workspace) that does not have unintended consequence.

Reopening after reverting my changes. I have not found reliable place to ensure that the previous_dir contains the current directory (in cases where File Browser is part of a workspace) that does not have unintended consequence.
Blender Bot added
Status
Confirmed
and removed
Status
Resolved
labels 2024-07-18 22:29:17 +02:00
Julian Eisel removed the
Meta
Good First Issue
label 2024-07-19 11:31:09 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 Assignees
2 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#124771
No description provided.