Closed matthieu-lapeyre closed 6 months ago
Thank you for the report!
Unfortunately, I do not have a Mac, so I cannot reproduce this bug.
It would be helpful if there were an engineer who has a Mac...
I chatgpted it. I hope this helps you.
There are several potential reasons why a Kivy application might be displaying at a quarter size of the window on a Mac, as shown in the attachment, while it operates normally on Windows:
To troubleshoot this issue, it's recommended to start by checking Kivy's settings and examining the application's log output for any clues. Additionally, searching the Kivy documentation and forums for solutions to Mac-specific issues could also be effective.
Thank you for your insights. The Retina display might indeed be the source of the problem, given its 4x ratio of physical pixels to logical points.
I tested the application on an external non-Retina screen, and it displayed correctly, which confirms that the issue is likely related to the Retina display on my Mac.
I'm an engineer with a Mac but without much experience in Kivy. If you could provide more guidance on where in the code I should look to resolve this, I'd be glad to investigate and try to implement a fix.
To address this, I'm planning to investigate Kivy's handling of Retina displays. Are there any specific configurations or common pitfalls related to Retina displays in Kivy that I should be aware of? Could you suggest any documentation or resources that might help me resolve this issue?
Thank you for your assistance; I'm eager to contribute on a solution.
That's great!
Yes, I can provide guidance on where in the code you should look to resolve this: First, in the initial 10 lines of GUI.py, the window size is specified. Next, from line 787 of GUI.py (https://github.com/sugiyama2718/Quoridor/blob/d949d83ea752e95ce99260aca82740b95579d287/GUI.py#L787 ), the sizes and positions of each element are hardcoded. These are not separated into a .kv file because doing so did not work well when creating an executable with pyinstaller. For other parts of the code, the implementation describes the operation of the app, so probably no modifications are needed there.
Additionally, there is also a game_analyzer.py file that I would ideally like to revise as well.
Are there any specific configurations or common pitfalls related to Retina displays in Kivy that I should be aware of? Could you suggest any documentation or resources that might help me resolve this issue?
I'm sorry but I don't know about these. Please refer to the official Kivy website etc.
I chatgpted again.
When investigating Kivy’s handling of Retina displays, there are a few key considerations and configurations you might want to look into:
- Configuration File: Kivy has a configuration file which sets the default behavior of applications. You might need to adjust settings related to graphics or window size, for example. Changes to the configuration should ideally be made before importing other Kivy modules, as they control the initialization of the application.
- Environment Variables: Since version 1.11.0 of Kivy, you can alter the configuration using environment variables, which will take precedence over the settings in config.ini. This could be a convenient way to adjust settings for Retina display support on a per-application basis.
- Graphics Settings: In the graphics section of the configuration, there are tokens that might affect how Kivy behaves on Retina displays. For instance, settings related to borderless windows or custom_titlebar may impact how your app looks on a high-resolution screen.
- Scaling Issues: On Retina displays, you may encounter UI scaling issues, such as inconsistent sizing when moving windows between Retina and non-Retina displays. This is something to keep in mind as you test and configure your application.
For detailed guidance and the full list of available configuration tokens, you can refer to the Kivy documentation on their official website, specifically the sections related to configuration and graphics. Additionally, common issues and questions about Kivy, including those related to Retina displays, may be addressed in the FAQ section.
By adjusting these configurations and understanding how they affect your app, you should be able to better manage how your Kivy app runs on Retina displays.
I have made some progress, it seems using https://kivy.org/doc/stable/api-kivy.metrics.html help dealing with higher dpi screen. So adding dp(xx) on all absolute pixel value modify it accordingly to the pixel density.
I started adding dp() everywhere, it's kind of working, the display is filling the window. But it is not yet working properly, you may have forgotten few numbers somewhere and maybe sometimes we should keep the value in physical pixel ... For exemple the selection is not done where my cursor is.
Still work to do
By the way what is root ?
I do not see how i can turn a root.Bx value in dp
Sounds good.
You can reference the class variable values of the class Quoridor(Widget) through root. For example, if you assign a value to self.Bx like https://github.com/sugiyama2718/Quoridor/blob/12c27f855b0e6f2ef979cef8d282538a32fad9fd/GUI.py#L639 , it means that this value will go into root.Bx as shown in the image you attached.
For, example, changing self.Bx = int(15 + (stateBx + 0.5) / 9 (BOARD_LEN - 30)) into self.Bx = dp(int(15 + (stateBx + 0.5) / 9 (BOARD_LEN - 30))) may work?
I merged the pull request. Thank you for your contribution!
Hello,
Excellent AI you have trained here !
But unfortunately, I have a display issue when executing gui.py from the repo (branch master 46d3ed317cc63b92ecc02ef3cf059581c49fdf6c).
Bug Description
There appears to be an issue (on my computer, check system information below) with how the game board and the information panel are displayed within the application window. The game board is displayed correctly, but the information panel does not extend to fill the window, resulting in the UI occupying only about a quarter of the space.
I am attaching a screenshot of the issue for reference.
Any help in resolving this would be greatly appreciated as it impacts the user experience significantly.
Thank you!
System information