简体   繁体   中英

Kivy App Stuck in Full Screen with no cursor

This morning I upgraded from Kivy 1.8 to 1.9.1 since the upgrade all apps are opening full screen. I also have no cursor which makes finding my "exit" button extremely difficult to find. The only way I'm able to consistently get out of an app is to restart the pi. (raspberry pi 2, kivy 1.9.1)

I have tried all the normal keyboard options, I have tried editing the config file, etc. Code such as the below makes no difference:

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

I ran:

import kivy help(kivy)

and found the location of the config file. It is indeed set as fullscreen '0', tried changing it to 1, auto, and fake but no option made any difference.

My problem mirrors another person's and I've tried everything suggested here:

Can't close Kivy app or avoid fullscreen

Help is much appreciated!

I had the same problem. The version of opengl bypass the xserver and the window management. It draws "over all".

There is another experimental opengl driver available. Do a backup! To activate it:

Update your packages:

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

Install the driver:

sudo apt-get install xcompmgr libgl1-mesa-dri

Activate it with raspi-config:

sudo raspi-config

Select: 7 Advanced Options/A6 GL Driver

Now Select: G1 GL (Full KMS) OpenGL desktop driver with full KMS I recommend to increase the amount of memory (A3 Memory Split) to 128 or something like that. After a reboot the new driver will be active.

I found this https://groups.google.com/d/msg/kivy-users/qxZLUQShp0s/Xqv2uTTuAwAJ (thank you Myster D.)

Maybe it's not what you looking for but it helped me in my case.

Open your Kivy config file:

nano ~/.kivy/config.ini

Scroll down to the

[Modules]

and add a line

touchring = show_cursor=true

Save and run your app. Hope it helps.

I am having this issue as well on a Raspberry Pi3 running Kivy with Python 2.7.9. So every App I run gets sent to Fullscreen, with no clickable borderline or icons in the corner. Some seem to be killable with esc or CTRL-C depending on what I'm running and if I'm running them via terminal or by hitting F5 in an editor.

Firstly, a workaround was suggested in a similar problem, whereby an exit button is written in, this kind of help, but this doesn't really solve the screen size problem for desktop screens.

A previous comment suggests editing the kivy/config.ini file which got me searching around, and I may have found something useful. On my system there is no:

kivy/config.ini

But there is a:

kivy/config.py

inside it I found information relating to the screen size (Starting from line 137 in the above filename):`

#: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.

I don't know why the code shading messed up, I simply copy-&-pasted it, and the syntax highlighting doesn't apply because this whole section was commented out in the .py file. Hope this helps, I am not really confident enough to go editing things in config files without guidance so I am hoping someone can use this info to work out how to write the window sizing into our Apps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM