Wayland 和 Kivy:如何设置 window 位置?

Wayland and Kivy: how to set window position?

按照 a previous Whosebug answer I made additions to one of the basic Kivy tutorial apps 将 window 定位在屏幕的左上角。这在 Xorg 下按预期工作,但在 Wayland/xwayland.

下不起作用

xwayland下运行时如何改变Kivy window的位置?

代码:

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

Kivy 确实支持 Wayland,但它可能没有被编译。参见 setup.py。另请注意,这还需要编译 SDL2 支持:

# change both to "True"
c_options['use_wayland'] = False
c_options['use_sdl2'] = False