Necronomicron
Necronomicron

Reputation: 1310

How do I turn off fullscreen in Kivy?

All Kivy (1.8.0) applications run fullscreen on my PC by default. I need to turn fullscreen off for only one (not for each) Kivy application. Strange, but I haven't found the answer for this simple question. Probably, that's not Kivy, but Pygame, but anyway I don't know how to trun it off. Kivy and Pygame were taken from here.

Upvotes: 9

Views: 7347

Answers (2)

Eric MacLeod
Eric MacLeod

Reputation: 461

I know this is an old question but if anyone runs in to this problem again and you want to set the config options as default.

In a terminal.

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

Upvotes: 10

Nykakin
Nykakin

Reputation: 8747

You can configure the way window will be displayed using kivy.config.Config before importing any Kivy module. For example, to have fullscreen application (this shouldn't be enabled by default):

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

In your case you can try to set it explicitly:

#!/usr/bin/python
# -*- coding: utf-8 -*-

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

from kivy.app import App

class TestApp(App):
    pass

if __name__ == '__main__':
    TestApp().run()

You can find details about graphics:fullscreen option in documentation.

Upvotes: 9

Related Questions