Sixtyfive
Sixtyfive

Reputation: 1486

Wayland and Kivy: how to set window position?

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()

Upvotes: 0

Views: 1706

Answers (1)

Sixtyfive
Sixtyfive

Reputation: 1486

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

Upvotes: 0

Related Questions