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

Linux gnome crash workaround #91

Draft
wants to merge 21 commits into
base: mod
Choose a base branch
from
Draft

Linux gnome crash workaround #91

wants to merge 21 commits into from

Conversation

drojf
Copy link
Contributor

@drojf drojf commented Oct 15, 2022

This option adds a workaround for the "Linux Gnome Windowed Mode Crash" bug


For info on the Linux Gnome Windowed Mode Crash bug, see:

This PR does not fix crashing when entering Windowed mode, but makes sure that you can't get the game stuck in a state where it won't launch anymore due to being in Windowed mode (it should recover and enter fullscreen mode). The main things this PR does is:

  • Add a "full screen lock" option which prevents you accidnetally entering full screen mode., plus a setup menu to tell the user to configure it on Linux
  • On Linux, if the game crashes, will revert to fullscreen mode, and will re-display the "full screen lock" setup menu
    • Note that I can't detect crashes that well, so force closing the app is equivalent to a crash
  • Force the playerprefs "Screenmanager Is Fullscreen mode" to always be 1 (fullscreen) instead of 0 (windowed). We used to always force the value to 0.
  • Change how/when the playerprefs is saved
  • Refactor stuff internally so that the screen resolution and windowed/fullscreen mode boils down to exactly one function, rather being called differently from lots of different places

I've primarily tested on Windows and Manjaro Linux (The system which a user had reported these issues), but I should probably re-test Ubuntu to see if I have broken anything. Some of the changes I made are locked to Linux, to avoid changing working behavior on Windows, but the refactoring and stuff is across all OS's, so that could break things.

@drojf drojf changed the title F linux gnome workaround + "Currently playing BGM" feature Linux gnome crash workaround + "Currently playing BGM" feature Oct 15, 2022
@drojf drojf force-pushed the f-linux-gnome-workaround branch from a5e7fa1 to bdb860b Compare October 24, 2022 00:22
@drojf drojf changed the title Linux gnome crash workaround + "Currently playing BGM" feature Linux gnome crash workaround Oct 24, 2022
@drojf drojf marked this pull request as ready for review October 29, 2022 11:13
@drojf drojf force-pushed the f-linux-gnome-workaround branch from fd52ed6 to ed983fa Compare October 30, 2022 23:11
@drojf
Copy link
Contributor Author

drojf commented Oct 31, 2022

@TellowKrinkle reported that this resolution bug only happens on the 64-bit version of the game - the 32-bit version is unaffected.

For me to run the 32-bit version of the game on Manjaro (based on Arch Linux)I needed to install:

  • lib32-libxcursor
  • lib32-libxrandr

I think I'll keep the recovery menu/first time linux windowed mode setup menu, but add a note on the first-time setup to run the 32 bit version / link to the wiki with instructions on how to run the 32-bit version, if you have problems with crashes.

Should also update the fullscreen-lock button hover-over with this information.

@drojf drojf marked this pull request as draft October 31, 2022 04:34
@drojf
Copy link
Contributor Author

drojf commented Oct 31, 2022

More info from discord:

TellowKrinkle — Today at 5:41 PM
Okay never mind it's still kind of broken, just not as broken
Here's the broken function
Notice anything funny?
If the global variable is initialized, it doesn't call XGetWMNormalHints to initialize the stack variable
They probably meant to pass the global variable to XSetWMNormalHints
But they passed the uninitialized stack variable instead

image

The proper patch would be to pass global pointer
But the lazy patch is to nop out the assignment so the global pointer is just always null
Here's a patched Higurashi 05 exe

game.zip

Uhh actually before you add it to the installer, we should verify that there aren't multiple Higu05 exes around
The exe that's based off of has the sha 09f15d361d7556943dab3a1393ccf0ff7af42082
(Side note, I'm fairly sure exes are fixed unity things and not per-game, which means that's a unity bug that affects all unity games on that version. Changing the screen size more than once sends garbage to X11 on all Unity Linux builds of that version)

@drojf
Copy link
Contributor Author

drojf commented Nov 4, 2022

Note: this PR is superceeded by #93 (assuming all goes well)

However, there may be a couple commits I want to keep from this pR, so please don't close this PR yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant