Skip to content

Add edited scenes mouse forward / back navigation - #122715

Open
Linie3 wants to merge 1 commit into
godotengine:masterfrom
Linie3:scene-editor-navigation
Open

Add edited scenes mouse forward / back navigation#122715
Linie3 wants to merge 1 commit into
godotengine:masterfrom
Linie3:scene-editor-navigation

Conversation

@Linie3

@Linie3 Linie3 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

Adds navigation between recent opened scenes with mouse forward and back buttons

Additional information

I didn't manage to make keyboard shortcuts with alt+arrow work as in the script editor as various other UI parts consume any arrow key inputs beforehand. With some changes there this could be made possible. I also didn't add UI arrow buttons yet because of space considerations, but maybe it would be a a good thing.

The implementation could also be expanded in a separate pr to include node selections as history points, as e.g. seen in script editors with caret positions, if that would be desired..

Verification
scene_navigation_validation.mp4

@Linie3
Linie3 requested review from a team as code owners August 22, 2026 15:19
@vaner-org

Copy link
Copy Markdown
Contributor

Related #118837.

@Linie3

Linie3 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

That just reminded me that I haven't tested for double input handlings yet with e.g. the script editor, which probably is an issue right now. Will fix as soon as I have a mouse available again to test.

@Linie3
Linie3 marked this pull request as draft August 23, 2026 06:34
@AThousandShips AThousandShips added this to the 4.x milestone Aug 24, 2026
@KoBeWi

KoBeWi commented Aug 25, 2026

Copy link
Copy Markdown
Member

That just reminded me that I haven't tested for double input handlings yet with e.g. the script editor

I just tested and it doesn't work properly. Scene tabs hijack buttons from script editor.

@Linie3
Linie3 force-pushed the scene-editor-navigation branch from c3d0ee4 to cb923fb Compare September 3, 2026 18:44
@Linie3

Linie3 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Fixed it

@Linie3
Linie3 marked this pull request as ready for review September 3, 2026 18:45
@Linie3
Linie3 force-pushed the scene-editor-navigation branch from d56e290 to 494941e Compare September 3, 2026 21:03
Comment thread editor/editor_node.cpp
@Linie3
Linie3 force-pushed the scene-editor-navigation branch 2 times, most recently from 371738c to f5d6299 Compare September 4, 2026 12:20

@KoBeWi KoBeWi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works correctly now. Left some comments on the implementation.

Comment thread editor/editor_node.cpp Outdated
Comment thread editor/editor_node.cpp
block_input = p_block;
}

void EditorNode::input(const Ref<InputEvent> &p_event) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why not use unhandled_input() for the navigation? There would be no conflict with set_process_input() then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better, but I tried to stay close to the existing implementation for Script Editor which does it just like this. Ideally inputs should be set as handled and the code moved to _unhandled_input, but I would suggest only doing so in both locations simultaneously, as otherwise priority can't be resolved properly anymore because of different input loops.

Comment thread editor/editor_node.cpp Outdated
Comment thread editor/editor_node.cpp

// Discard old forward history by only keeping history until the current index
tab_history.resize(tab_history_pos + 1);
tab_history.push_back(p_history_id);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are doing resize, you could resize +1 more and set the last element instead of appending.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that, though existing codes seems to prefer this way, I tried to be consistent with it

Comment thread editor/editor_node.cpp Outdated
Comment thread editor/editor_node.h Outdated
@Linie3
Linie3 force-pushed the scene-editor-navigation branch from f5d6299 to d8e27d9 Compare September 5, 2026 11:06
@Linie3
Linie3 force-pushed the scene-editor-navigation branch from d8e27d9 to 7868872 Compare September 5, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants