How it works on Wayland

How it works on Wayland
The app published here uses my own GUI library mlk.
This library (the newly published version) supports X11 and Wayland.

There are a few things to note if you want to run the app on a Wayland desktop.

  • In Wayland, applications cannot obtain window positions or move to arbitrary window positions, so window positions cannot be saved or restored.
  • HiDPI is not currently supported.
    If you increase the display scale, the image will be enlarged to the original size, causing the screen to become blurry.
  • Decorations such as window title bars are created by the library.
  • Some protocols are used that are not stable, so if the protocol becomes stable or there is a change in the implementation of the protocol on the desktop side, some functions may not work until the library is updated.
    (Japanese input, etc.)
  • If the following protocols are not implemented on the desktop side, the application will not start.
    - wl_data_device_manager ver 3 or later
    - xdg_wm_base ver 3 or later
    - wp_viewporter ver 1 or later
Window position
Currently, Wayland does not allow apps to get the current window position or move the window to an arbitrary position.
As a result, there are problems with window positioning.
Restore window position
First, you cannot save the current window position when you close the app and restore it the next time you start it (this is possible with X11).

With Wayland, the desktop decides the position every time a window is displayed.
Therefore, if there are settings related to window position on the desktop side, you may be able to do something with them.
Panel Window
In Wayland, the desktop determines the position each time a window is displayed/hidden, so for a "panel" widget that can be stored in the main window or separated into a separate window, the position of the panel window is reset each time the window is separated and stored, or switched between displayed and hidden.

If you separate a panel into a window and use it, the window position from the last time it was closed cannot be restored, so you have to move the window position every time you start it, and the position changes every time you switch the window state while it is running, which is quite inconvenient.

In Wayland, you basically store the panel, but if you really want to use a panel window, start it as an X11 client.

If you use an X11 desktop and start it there, or start it as X11 on Wayland using XWayland, it will work without any problems.

If you want to start an app as an X11 client on Wayland, use the environment variable MLK_BACKEND.

$ env MLK_BACKEND=x11 <app_exe>

Specify the environment variables like this before your app's executable file.