RGFW icon indicating copy to clipboard operation
RGFW copied to clipboard

Vulkan on wayland native progress

Open lczyk opened this issue 1 month ago • 3 comments

i've played around with trying to get a window working with vulkan in wayland-native mode and, at least on my setup (see below), it somewhat works with one small patch:

Index: vendor/RGFW.h
===================================================================
--- vendor.orig/RGFW.h
+++ vendor/RGFW.h
@@ -8007,6 +8007,7 @@ static void RGFW_wl_global_registry_hand
 		RGFW_wl_create_outputs(registry, id);
 	} else if (RGFW_STRNCMP(interface,"wl_data_device_manager", 23) == 0) {
 		RGFW->data_device_manager = wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
+		if (RGFW->seat == NULL) return; // cannot create data device without seat
 		RGFW->data_device = wl_data_device_manager_get_data_device(RGFW->data_device_manager, RGFW->seat);
 		wl_data_device_add_listener(RGFW->data_device, &wl_data_device_listener, NULL);
 	}

i'm not familiar enough with Vulkan to really understand the actual implications of this yet (i am, in fact, learning Vulkan rn ;) ), so this is just a small heads up.


the one thing which at the moment does not work is window scaling through the window manager (sway):

Image

( it's supposed to fill the space, but remains at 500x500 size )

but i have gotten these vulkan examples to fully work (with cmake -S . -B build -G Ninja -DUSE_WAYLAND_WSI=ON; cmake --build build) and they behave correctly (window updates when resized too). will poke at some more next i get some time 👍

hardware

OS: Ubuntu 25.10 aarch64
Host: XPS 13 9345
Kernel: Linux 6.17.0-8-qcom-x1e
Display (LGD0778): 2880x1800 @ 60 Hz (as 1920x1200) in 13" [Built-in]
CPU: Qualcomm Snapdragon X Elite 1E80100 (12) @ 3.42 GHz
GPU: Qualcomm Adreno X1-85 [Integrated]

lczyk avatar Nov 18 '25 08:11 lczyk

i'm not familiar enough with Vulkan to really understand the actual implications of this yet (i am, in fact, learning Vulkan rn ;) ), so this is just a small heads up.

I think this would have more of an impact on the rest of the Wayland backend rather than on Vulkan. As doing this will prevent wl_data_device from being used. Which will impact the wayland backend's clipboard support

ColleagueRiley avatar Nov 18 '25 20:11 ColleagueRiley

Is the window scaling issue a vulkan issue or does it happen for OpenGL as well?

ColleagueRiley avatar Nov 18 '25 20:11 ColleagueRiley

Is the window scaling issue a vulkan issue or does it happen for OpenGL as well?

just Vulkan

Which will impact the wayland backend's clipboard support

on the other hand side i do get a window, even if a partially working one..

i've looked at the example i've referenced and in some the keyboard (not to mention clipboard) is not working (imgui) and in some it it (radialblur + ESC key), but maybe that's handled on the application layer. will look into more when i have some time :)

lczyk avatar Nov 19 '25 12:11 lczyk

https://github.com/ColleagueRiley/RGFW/pull/401

This should properly fix the first issue addressed.

ColleagueRiley avatar Nov 25 '25 06:11 ColleagueRiley

yep. i confirm it does 👍

i've looked at the example i've referenced and in some the keyboard (not to mention clipboard) is not working ...

i've looked into that more, and it's a separate issue. will submit a PR there

have not had time to look at the window scaling yet.

lczyk avatar Nov 25 '25 11:11 lczyk

Great! I think the rest of this issue is about the actual implementation then rather than RGFW's internal code then.

ColleagueRiley avatar Nov 26 '25 22:11 ColleagueRiley