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

Handle display driver preferences consistently between editor and projects #88065

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

Riteo
Copy link
Contributor

@Riteo Riteo commented Feb 7, 2024

The way that it was implemented before allowed for the project property to spill over to the editor if the prefer_wayland property is not present which, while not completely likely, is still a possibility. This specific part is thus more of a correctness change, ensuring that we always enforce the default display server when not running a project.

This commit also removes the restart requirement for the relative display driver project settings as they're independent and a restart would do nothing useful.

…jects

The way that it was implemented before allowed for the project property
to spill over to the editor if the `prefer_wayland` property is not
present which, while not completely likely, is still a possibility. This
specific part is thus more of a correctness change, ensuring that we
always enforce the default display server when not running a project.

This commit also removes the restart requirement for the relative
display driver project settings as they're independent and a restart
would do nothing useful.
@Riteo Riteo added this to the 4.3 milestone Feb 7, 2024
@Riteo Riteo requested a review from a team as a code owner February 7, 2024 16:22
@akien-mga akien-mga merged commit 84af5c1 into godotengine:master Jul 22, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@mihe
Copy link
Contributor

mihe commented Jul 25, 2024

@akien-mga This resulted in a regression it seems: #94755

@Riteo
Copy link
Contributor Author

Riteo commented Jul 26, 2024

ok all right, stared at it for a solid minute and remembered why stuff is the way it is.

Basically, since projects can run with wayland and project settings carry over into the editor, if prefer_wayland is not found, it will still run as wayland instead of whatever was the default.

I'm quite sure that the proper solution here is checking for an empty display_setting before setting anything, like this:

diff --git a/main/main.cpp b/main/main.cpp
index e1d53e7f1b..059172b14e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -2631,10 +2631,12 @@ Error Main::setup2(bool p_show_boot_logo) {
                                                }
                                        }
 
-                                       if (prefer_wayland) {
-                                               display_driver = "wayland";
-                                       } else {
-                                               display_driver = "default";
+                                       if (display_driver.is_empty()) {
+                                               if (prefer_wayland) {
+                                                       display_driver = "wayland";
+                                               } else {
+                                                       display_driver = "default";
+                                               }
                                        }
                                }
                        }

I'll test it further and if that's indeed the solution I'll make a PR ASAP, sorry for the inconvenience.

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.

3 participants