0

Working on a Raspberry Pi Model 3 B, running raspbian. Running Kivy v1.9.2-dev0 and Python v2.7.3

Trying out one of the Kivy examples but for some reason the application won't come up in "Windowed mode". Therefore the application comes out in a 'stretched' appearance.

The code being executed:

from kivy.config import Config
# seems to be ignoring all of the below config settings
#Config.set('graphics','fullscreen','0')
Config.set('graphics','fullscreen','auto')
#Config.set('graphics','show_cursor','0')
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput


class LoginScreen(GridLayout):


        def __init__(self, **kwargs):
                super(LoginScreen, self).__init__(**kwargs)
                self.cols = 4
                #self.rows = 4
                self.add_widget(Label(text='User Name'))
                self.username = TextInput(multiline=False)
                self.add_widget(self.username)
                self.add_widget(Label(text='password'))
                self.password = TextInput(password=True, multiline=False)
                self.add_widget(self.password)





class MyApp(App):


        def build(self):
                return LoginScreen()
                #return Label(text='Hello world')




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

I get the following output at the terminal when I execute 'python main.py:

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_16-11-12_2.txt
[INFO   ] [Kivy        ] v1.9.2-dev0
[INFO   ] [Python      ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO   ] [Factory     ] 193 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: pygame
[INFO   ] [Window      ] Provider: egl_rpi
[INFO   ] [GL          ] OpenGL version <OpenGL ES 2.0>
[INFO   ] [GL          ] OpenGL vendor <Broadcom>
[INFO   ] [GL          ] OpenGL renderer <VideoCore IV HW>
[INFO   ] [GL          ] OpenGL parsed version: 2, 0
[INFO   ] [GL          ] Shading version <OpenGL ES GLSL ES 1.00>
[INFO   ] [GL          ] Texture max size <2048>
[INFO   ] [GL          ] Texture max units <8>
[INFO   ] [Shader      ] fragment shader: <Compiled>
[INFO   ] [Shader      ] vertex shader: <Compiled>
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

** (main.py:3118): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-9tGlyRrjWv: Connection refused
[INFO   ] [Clipboard   ] Provider: gtk3(['clipboard_dbusklipper'] ignored)
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
[INFO   ] [Cutbuffer   ] Provider: xclip
[INFO   ] [CutBuffer   ] cut buffer support enabled
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event0
[INFO   ] [HIDInput    ] Read event from </dev/input/event0>
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event1
[INFO   ] [HIDInput    ] Read event from </dev/input/event1>
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event2
[INFO   ] [HIDInput    ] Read event from </dev/input/event2>
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event3
[INFO   ] [HIDInput    ] Read event from </dev/input/event3>
[INFO   ] [Base        ] Start application main loop
[INFO   ] [HIDMotionEvent] using <NOVATEK USB Keyboard>
[INFO   ] [HIDMotionEvent] using <NOVATEK USB Keyboard>
[INFO   ] [HIDMotionEvent] using <PixArt USB Optical Mouse>
[INFO   ] [HIDMotionEvent] using <FT5406 memory based driver>
[INFO   ] [HIDMotionEvent] <FT5406 memory based driver> range ABS X position is 0 - 800
[INFO   ] [HIDMotionEvent] <FT5406 memory based driver> range ABS Y position is 0 - 480
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [HIDMotionEvent] <FT5406 memory based driver> range position X is 0 - 800
[INFO   ] [HIDMotionEvent] <FT5406 memory based driver> range position Y is 0 - 480
0

The closed source GLES driver doesn't support rendering in a window, so the app is always forced fullscreen. For windowed rendering, you need to switch to the open source graphics driver (raspi-config's "OpenGL driver" option)

| improve this answer | |
0

I have managed to get the rid of those black strip by adding Config.set('graphics','window_state'_'maximized' just after the fullscreen call. the whole code looks like

if __name__ == "__main__":
Config.set('graphics', 'fullscreen', 'auto')
Config.set('graphics', 'window_state', 'maximized')
Config.write()
YourApp().run()
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.