0

Following a previous StackOverflow answer I made additions to one of the basic Kivy tutorial apps to position the window at the top left corner of the screen. This works as expected under Xorg, but not under Wayland/xwayland.

How do you change the Kivy window position when running under xwayland?

Code:

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window

class MyPaintWidget(Widget):
    pass

class MyPaintApp(App):
    def build(self):

        # Works under Xorg, not under Wayland
        Window.top = 0
        Window.left = 0

        return MyPaintWidget()

if __name__ == '__main__':
    MyPaintApp().run()
Sixtyfive
  • 1,150
  • 8
  • 19
  • Kivy's behaviour here is probably platform independent, I would guess that the SDL2 backend is failing to do something under wayland. Presumably you're using a wayland compositor that you expect to listen for and act on window position events? – inclement Nov 20 '20 at 23:13
  • I was using Weston, yes. But getting deeper into the whole Wayland thing, it seems as though it might make much more sense to use Cage for this. Trying to see if that'll fit the bill (it's quite young still...) – Sixtyfive Nov 20 '20 at 23:47
  • If a kiosk-mode type thing is what you're after, that would make sense. I might also think trying to maximise the window is worth a shot, this code path may be implemented even if positioning isn't. – inclement Nov 20 '20 at 23:49

1 Answers1

0

Kivy does have Wayland support, but it may not be compiled-in. See setup.py. Also note that this will require SDL2 support to be compiled-in, as well:

# change both to "True"
c_options['use_wayland'] = False
c_options['use_sdl2'] = False
Sixtyfive
  • 1,150
  • 8
  • 19