Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Wayland support #43

Open
pixelomer opened this issue Mar 16, 2025 · 19 comments
Open

Native Wayland support #43

pixelomer opened this issue Mar 16, 2025 · 19 comments
Labels
enhancement New feature or request

Comments

@pixelomer
Copy link
Owner

Running Shijima-Qt in XWayland to allow window repositioning is not ideal. A better alternative would be providing a separate backend for Wayland that uses the wlr-layer-shell protocol. wl_shimeji does this and it appears to work quite well with shimeji.

@pixelomer pixelomer added the enhancement New feature or request label Mar 16, 2025
@claymorwan
Copy link

Would that mean we won't have the app in the taskbar ? From what I've tried, wl_shimeji don't have it so it'd be nice if it'd the same for Shijimia

@os-guy
Copy link

os-guy commented Mar 21, 2025

Also, there's some bugs with the Compositors / Window Managers such as Hyprland.
The Shimeji frame is updating but not deleting the old frame.
Also, the Shimeji background is just dark.

recording_20250321_234005.mp4

@pixelomer
Copy link
Owner Author

Adding these lines to hyprland.conf seems to fix most of the issues related to Hyprland:

windowrulev2 = noblur,class:Shijima-Qt
windowrulev2 = noborder,class:Shijima-Qt
windowrulev2 = noshadow,class:Shijima-Qt
windowrulev2 = float,class:Shijima-Qt
windowrulev2 = nodim,class:Shijima-Qt
windowrulev2 = pin,class:Shijima-Qt

@os-guy
Copy link

os-guy commented Mar 22, 2025

Adding these lines to hyprland.conf seems to fix most of the issues related to Hyprland:

windowrulev2 = noblur,class:Shijima-Qt
windowrulev2 = noborder,class:Shijima-Qt
windowrulev2 = noshadow,class:Shijima-Qt
windowrulev2 = float,class:Shijima-Qt
windowrulev2 = nodim,class:Shijima-Qt
windowrulev2 = pin,class:Shijima-Qt

This is for the Flatpak Package right?
And nope, it didn't fixed.
Also, wl_shimeji works fine on Hyprland (Without this black screen and rendering issue)

@pixelomer
Copy link
Owner Author

pixelomer commented Mar 22, 2025

My understanding is that wl_shimeji creates an overlay above all other windows using a Wayland-specific protocol. Unlike Shijima-Qt, it doesn't create a separate window for each shimeji, so the shimeji aren't really managed by the desktop environment and wl_shimeji has more control over them.

The main goal of this issue is to use the same protocol wl_shimeji uses to make Shijima-Qt work better with Wayland compositors, while remaining compatible with X11 and other operating systems.

@claymorwan
Copy link

Adding these lines to hyprland.conf seems to fix most of the issues related to Hyprland:

windowrulev2 = noblur,class:Shijima-Qt
windowrulev2 = noborder,class:Shijima-Qt
windowrulev2 = noshadow,class:Shijima-Qt
windowrulev2 = float,class:Shijima-Qt
windowrulev2 = nodim,class:Shijima-Qt
windowrulev2 = pin,class:Shijima-Qt

This is for the Flatpak Package right? And nope, it didn't fixed. Also, wl_shimeji works fine on Hyprland (Without this black screen and rendering issue)

idk what distro u on, but if it's arch or arch based u can try with the aur package maybe it'll work

@pixelomer
Copy link
Owner Author

I use Fedora 41, both the binary and the Flatpak version work for me with this configuration

@os-guy
Copy link

os-guy commented Mar 23, 2025

Adding these lines to hyprland.conf seems to fix most of the issues related to Hyprland:

windowrulev2 = noblur,class:Shijima-Qt
windowrulev2 = noborder,class:Shijima-Qt
windowrulev2 = noshadow,class:Shijima-Qt
windowrulev2 = float,class:Shijima-Qt
windowrulev2 = nodim,class:Shijima-Qt
windowrulev2 = pin,class:Shijima-Qt

This is for the Flatpak Package right? And nope, it didn't fixed. Also, wl_shimeji works fine on Hyprland (Without this black screen and rendering issue)

idk what distro u on, but if it's arch or arch based u can try with the aur package maybe it'll work

I both tried AUR package and Flatpak package.

@pixelomer
Copy link
Owner Author

I managed to get a native Wayland backend working with Shijima-Qt! It relies on the wlr layer shell protocol and so far it seems to work great on Hyprland and KDE Plasma. I'll finish it up and try to get a new version out as soon as possible.

@pixelomer
Copy link
Owner Author

Preliminary native Wayland support through wlr-layer-shell is up on feature/wayland-layer-shell. It's very incomplete at the moment, but please give it a try if you're interested.

The program will still launch in X11/XWayland but when you choose Settings > Backend > Wayland, the app will create a Wayland overlay for showing shimeji. From my testing it seems to work as expected on Hyprland, KDE Plasma and other wlroots-based compositors. It doesn't work on GNOME since GNOME doesn't support wlr-layer-shell.

@claymorwan
Copy link

claymorwan commented Mar 24, 2025

Preliminary native Wayland support through wlr-layer-shell is up on feature/wayland-layer-shell. It's very incomplete at the moment, but please give it a try if you're interested.

Erm about that, I cloned, switch to theb ranch and pulled then tried to compile but I get an error saying that wayland-protocols/wlr-layer-shell.h is missing :c

@pixelomer
Copy link
Owner Author

pixelomer commented Mar 24, 2025

Preliminary native Wayland support through wlr-layer-shell is up on feature/wayland-layer-shell. It's very incomplete at the moment, but please give it a try if you're interested.

Erm about that, I cloned, switch to theb ranch and pulled then tried to compile but I get an error saying that wayland-protocols/wlr-layer-shell.h is missing :c

Try running make protocols-autogen before compiling, I may have forgotten to do that as a part of the build process.

@claymorwan
Copy link

Preliminary native Wayland support through wlr-layer-shell is up on feature/wayland-layer-shell. It's very incomplete at the moment, but please give it a try if you're interested.

Erm about that, I cloned, switch to theb ranch and pulled then tried to compile but I get an error saying that wayland-protocols/wlr-layer-shell.h is missing :c

Try running make protocols-autogen before compiling, I may have forgotten to do that as a part of the build process.

Erm, error again apparently

$ make protocols-autogen
mkdir -p //usr/share/wayland-protocols
/usr/bin/wayland-scanner client-header //usr/share/wayland-protocols/staging/cursor-shape/cursor-shape-v1.xml         wayland-protocols/cursor-shape-v1.h
Could not open output file: No such file or directory
make: *** [Makefile:92: protocols-autogen] Error 1

@pixelomer
Copy link
Owner Author

pixelomer commented Mar 24, 2025

...great, I messed up the last commit

  • Remove the line after protocols-autogen: in the Makefile (line 91 starting with mkdir)
  • Run mkdir wayland-protocols
  • Run make protocols-autogen

If it fails after that, you're probably missing a dependency. Try installing the development packages for wayland-protocols, wayland-client and wayland-cursor. You can run make protocols-autogen again afterwards. Once that succeeds you should be able to build normally.

@claymorwan
Copy link

It compiled ! Tho like yea as u said there's a bunch of weird stuff going one when activating the Wayland backend

@pixelomer
Copy link
Owner Author

pixelomer commented Mar 24, 2025

The Wayland backend should be mostly working:

  • Dragging/throwing should work as expected
  • It might be hard/impossible to catch shimeji while they are falling (?)
  • Transparent areas are not passthrough. It is possible to make them passthrough but the current method I have for doing so causes really high CPU usage in the compositor
  • Right click menus do appear but they may not be interactive/usable depending on your compositor (?)
  • The overlay has a white tint, this is intentional and used for testing, I'll remove it once the changes are finalized

@claymorwan
Copy link

Well for what I've noticed when activating the Wayland backend (on KDE) :

  • Shijemejis have a weird outline
  • Hovering shemjis disable the cursor theme for some reason
  • If 2 shimejis interact with each others (for example these in the screenshot can hug), the app just crashes

Image

here's the log btw if that can help (with the crash at end happening when the interact together)

$ ./shijima-qt
Detected KDE
Mascots path: /home/claymorwan/.local/share/Shijima-Qt/mascots
Loaded mascot: Default Mascot
Loaded mascot: Neuron
Loaded mascot: Sayori
Loaded mascot: Asriel
Loaded mascot: HatlessKofiRalsei
Loaded mascot: Evil Neuroling
Loaded mascot: Vedaling
Loaded mascot: Paipai
Loaded mascot: Mirage Shimeji
Loaded mascot: Yuri
Loaded mascot: Jenny
Loaded mascot: selenjiee
Loaded mascot: Broken Neuron
Loaded mascot: shimemiku
Loaded mascot: nechaos_shim
Loaded mascot: Eviling
Loaded mascot: niko
Loaded mascot: Neuroling
Loaded mascot: burenyuu_shim
Loaded mascot: Tuteling
Loaded mascot: HatlessRalsei
Loaded mascot: Weuron
Loaded mascot: Natsuki
Loaded mascot: Monika
interface: 'wl_compositor', version: 6, name: 1
interface: 'zwp_tablet_manager_v2', version: 1, name: 3
interface: 'zwp_keyboard_shortcuts_inhibit_manager_v1', version: 1, name: 4
interface: 'zxdg_decoration_manager_v1', version: 1, name: 5
interface: 'wp_viewporter', version: 1, name: 6
interface: 'wp_security_context_manager_v1', version: 1, name: 7
interface: 'wp_fractional_scale_manager_v1', version: 1, name: 8
interface: 'wl_shm', version: 1, name: 9
interface: 'wl_seat', version: 9, name: 10
interface: 'zwp_pointer_gestures_v1', version: 3, name: 11
interface: 'zwp_pointer_constraints_v1', version: 1, name: 12
interface: 'zwp_relative_pointer_manager_v1', version: 1, name: 13
interface: 'wl_data_device_manager', version: 3, name: 14
interface: 'zwlr_data_control_manager_v1', version: 2, name: 15
interface: 'wp_cursor_shape_manager_v1', version: 1, name: 16
interface: 'zwp_primary_selection_device_manager_v1', version: 1, name: 17
interface: 'org_kde_kwin_idle', version: 1, name: 18
interface: 'zwp_idle_inhibit_manager_v1', version: 1, name: 19
interface: 'ext_idle_notifier_v1', version: 1, name: 20
interface: 'org_kde_plasma_shell', version: 8, name: 21
interface: 'org_kde_kwin_appmenu_manager', version: 2, name: 22
interface: 'org_kde_kwin_server_decoration_palette_manager', version: 1, name: 23
interface: 'org_kde_plasma_virtual_desktop_management', version: 2, name: 25
interface: 'org_kde_kwin_shadow_manager', version: 2, name: 27
interface: 'org_kde_kwin_dpms_manager', version: 1, name: 28
interface: 'org_kde_kwin_server_decoration_manager', version: 1, name: 29
interface: 'kde_output_management_v2', version: 12, name: 30
interface: 'zxdg_output_manager_v1', version: 3, name: 31
interface: 'wl_subcompositor', version: 1, name: 32
interface: 'zxdg_exporter_v2', version: 1, name: 33
interface: 'zxdg_importer_v2', version: 1, name: 34
interface: 'xdg_activation_v1', version: 1, name: 37
interface: 'wp_content_type_manager_v1', version: 1, name: 39
interface: 'wp_tearing_control_manager_v1', version: 1, name: 40
interface: 'xdg_toplevel_drag_manager_v1', version: 1, name: 41
interface: 'xdg_toplevel_icon_manager_v1', version: 1, name: 42
interface: 'kde_screen_edge_manager_v1', version: 1, name: 43
interface: 'frog_color_management_factory_v1', version: 1, name: 44
interface: 'wp_presentation', version: 2, name: 45
interface: 'wp_color_manager_v1', version: 1, name: 46
interface: 'xdg_wm_dialog_v1', version: 1, name: 47
interface: 'kde_external_brightness_v1', version: 2, name: 48
interface: 'wp_alpha_modifier_v1', version: 1, name: 49
interface: 'wl_drm', version: 2, name: 51
interface: 'zwp_linux_dmabuf_v1', version: 4, name: 52
interface: 'wp_linux_drm_syncobj_manager_v1', version: 1, name: 53
interface: 'xdg_wm_base', version: 6, name: 55
interface: 'zwlr_layer_shell_v1', version: 5, name: 56
interface: 'kde_output_device_v2', version: 11, name: 58
interface: 'wl_output', version: 4, name: 59
interface: 'wp_drm_lease_device_v1', version: 1, name: 60
interface: 'kde_output_order_v1', version: 1, name: 61
interface: 'zwp_text_input_manager_v1', version: 1, name: 62
interface: 'zwp_text_input_manager_v2', version: 1, name: 63
interface: 'zwp_text_input_manager_v3', version: 1, name: 64
interface: 'org_kde_kwin_blur_manager', version: 1, name: 66
interface: 'org_kde_kwin_contrast_manager', version: 2, name: 67
interface: 'org_kde_kwin_slide_manager', version: 1, name: 68
interface: 'xdg_system_bell_v1', version: 1, name: 69
output 0x60ff7cc55fb0: w=1920, h=1080, r=74973
output 0x60ff7cc55fb0: x=0, y=0, pw=477, ph=268, make=Iiyama North America
layer-surface width=1920 height=1080
mmap failed!
[1]    116980 segmentation fault (core dumped)  ./shijima-qt

Btw I see another backend called Qt Widgets, what is it ?

@pixelomer
Copy link
Owner Author

  • I haven't noticed any outlines in my testing, I'll see if I can reproduce that
  • The cursor is provided by wayland-cursor, I don't know how cursor themes work so I can't comment on that
  • I haven't tested interactions but I don't think that should cause any problems (?) I'll look into it

@claymorwan
Copy link

For the cursors I just tried with multiple different ones but all of them just return to the black one, not really sure what to do qwq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants