【问题标题】:Kivy App Stuck in Full Screen with no cursorKivy App卡在全屏没有光标
【发布时间】:2018-11-04 22:09:48
【问题描述】:

今天早上我从 Kivy 1.8 升级到了 1.9.1,因为升级后所有应用都全屏打开了。我也没有光标,这使得很难找到我的“退出”按钮。我能够始终退出应用程序的唯一方法是重新启动 pi。 (树莓派 2,kivy 1.9.1)

我已经尝试过所有普通的键盘选项,我已经尝试过编辑配置文件等。如下代码没有任何区别:

from kivy.config import Config
Config.set('graphics', 'fullscreen', 0)
Config.write()

我跑了:

import kivy help(kivy)

并找到配置文件的位置。它确实设置为全屏“0”,尝试将其更改为 1、自动和假,但没有任何选项有任何区别。

我的问题反映了另一个人的问题,我已经尝试了这里建议的所有内容:

Can't close Kivy app or avoid fullscreen

非常感谢您的帮助!

【问题讨论】:

    标签: python cursor kivy fullscreen raspberry-pi2


    【解决方案1】:

    我遇到了同样的问题。 opengl 的版本绕过了 xserver 和窗口管理。它绘制了“全部”。

    还有另一个实验性 opengl 驱动程序可用。做备份!激活它:

    更新你的包:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    

    安装驱动:

    sudo apt-get install xcompmgr libgl1-mesa-dri
    

    使用 raspi-config 激活它:

    sudo raspi-config
    

    选择:7 高级选项/A6 GL 驱动程序

    现在选择:具有完整 KMS 的 G1 GL(完整 KMS)OpenGL 桌面驱动程序 我建议将内存量(A3 内存拆分)增加到 128 或类似的东西。 重新启动后,新驱动程序将处于活动状态。

    【讨论】:

    • 这样不仅解决了问题,还让整个桌面分辨率更高了!
    【解决方案2】:

    我找到了这个https://groups.google.com/d/msg/kivy-users/qxZLUQShp0s/Xqv2uTTuAwAJ(谢谢 Myster D.)

    也许这不是您想要的,但它对我的情况有所帮助。

    打开您的 Kivy 配置文件:

    nano ~/.kivy/config.ini
    

    向下滚动到

    [Modules]
    

    并添加一行

    touchring = show_cursor=true
    

    保存并运行您的应用。希望对您有所帮助。

    【讨论】:

      【解决方案3】:

      我在使用 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 文件中被注释掉了。希望这会有所帮助,我没有足够的信心在没有指导的情况下编辑配置文件中的内容,所以我希望有人可以使用这些信息来解决如何将窗口大小写入我们的应用程序

      【讨论】:

      • 这不是问题的答案。请考虑将此添加为评论。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-26
      • 1970-01-01
      相关资源
      最近更新 更多