我在使用 Python 2.7.9 运行 Kivy 的 Raspberry Pi3 上也遇到了这个问题。所以我运行的每个应用程序都会被发送到全屏,角落里没有可点击的边框或图标。有些似乎可以用 esc 或 CTRL-C 杀死,具体取决于我正在运行的内容以及我是通过终端运行它们还是通过在编辑器中按 F5 来运行它们。
首先,在类似问题中提出了一种解决方法,即写入退出按钮,这种帮助,但这并不能真正解决桌面屏幕的屏幕尺寸问题。
之前的评论建议编辑 kivy/config.ini 文件,这让我四处寻找,我可能发现了一些有用的东西。在我的系统上没有:
kivy/config.ini
但是有一个:
kivy/config.py
在里面我找到了与屏幕大小相关的信息(从上面文件名的第 137 行开始):`
#:graphics:
# borderless: int, one of 0 or 1
# If set to 1, removes the window border/decoration. Window resizing
# must also be disabled to hide the resizing border.
# window_state: string , one of 'visible', 'hidden', 'maximized' or 'minimized'
#
# Sets the window state, defaults to 'visible'. This option is available
# only for the SDL2 window provider and it should be used on desktop
# OSes.
# fbo: string, one of 'hardware', 'software' or 'force-hardware'
# Selects the FBO backend to use.
# fullscreen: int or string, one of 0, 1, 'fake' or 'auto'
# Activate fullscreen. If set to 1, a resolution of width
# times height pixels will be used.
# If set to auto, your current display's resolution will be
# used instead. This is most likely what you want.
# If you want to place the window in another display,
# use fake, or set the borderless option from the graphics section,
# then adjust width, height, top and left.
# height: int
# Height of the :class:~kivy.core.window.Window, not used if
# fullscreen is set to auto.
# left: int
# Left position of the :class:~kivy.core.window.Window.
# maxfps: int, defaults to 60
# Maximum FPS allowed.
# .. warning::
# Setting maxfps to 0 will lead to max CPU usage.
我不知道为什么代码阴影搞砸了,我只是复制粘贴它,语法高亮不适用,因为这整个部分在 .py 文件中被注释掉了。希望这会有所帮助,我没有足够的信心在没有指导的情况下编辑配置文件中的内容,所以我希望有人可以使用这些信息来解决如何将窗口大小写入我们的应用程序