Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening any doc display it with incorrect theming #64997

Closed
Chaosus opened this issue Aug 28, 2022 · 8 comments · Fixed by #65025
Closed

Opening any doc display it with incorrect theming #64997

Chaosus opened this issue Aug 28, 2022 · 8 comments · Fixed by #65025

Comments

@Chaosus
Copy link
Member

Chaosus commented Aug 28, 2022

Godot version

006915b

System information

Windows 11

Issue description

image

Steps to reproduce

Open any doc item in the editor help

Minimal reproduction project

No response

@akien-mga
Copy link
Member

CC @AaronRecord

@AaronRecord
Copy link
Contributor

Good catch, I'll try and look into tomorrow

@faisal-alam09
Copy link
Contributor

Works fine on Ubuntu 22.04 LTS
Screenshot from 2022-08-29 00-48-57

@AaronRecord
Copy link
Contributor

I can reproduce the problem on my computer (also Win 11, although I'm guessing that's unrelated?)

@AaronRecord
Copy link
Contributor

AaronRecord commented Aug 28, 2022

Okay so this is weird, I can't reproduce with a debug build compiled with msvc, but I can reproduce with the release builds from the CI checks (both on commit cb62d31)

Edit: I've compiled with release_debug and now I can reproduce the issue
Edit 2: Actually, I think the reason I couldn't reproduce the issue was because my vscode launch.json was set to use ${workspaceFolder}/bin/godot.windows.tools.64.exe", not ${workspaceFolder}/bin/godot.windows.tools.x86_64.exe"

@Xwdit
Copy link
Contributor

Xwdit commented Aug 28, 2022

If I switch themes in the editor settings, everything goes back to normal, I think it's a regression related to themes or related notifications. It may be regression introduced by #62846 ?

@AaronRecord
Copy link
Contributor

If I switch themes in the editor settings, everything goes back to normal, I think it's a regression related to themes or related notifications. It may be regression introduced by #62846 ?

It is a regression from #62846

@JohanAR
Copy link
Contributor

JohanAR commented Aug 29, 2022

If I switch themes in the editor settings, everything goes back to normal, I think it's a regression related to themes or related notifications. It may be regression introduced by #62846 ?

It is a regression from #62846

Don't know if you want a new issue for it, but #62846 causes an infinite loop segfault when I try to open one of my current projects. I haven't been able to pin down exactly what's causing it, but EditorLog is asked to log an error, add_image fails due to the theme_cache not being properly initialised, which leads to a new error log, and so on. I added a couple of if (icon != nullptr) in around add_image EditorLog to avoid the loop, but instead it got stuck in some other loop instead..

akien-mga added a commit to akien-mga/godot that referenced this issue Aug 29, 2022
…THEME_CHANGED"

This reverts commit 4b817a5.

Fixes godotengine#64988.
Fixes godotengine#64997.

This caused several regressions (godotengine#64988, godotengine#64997,
godotengine#64997 (comment))
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in godotengine#62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants