Skip to content

Commit

Permalink
[bugfix] xdg wayland actually working now
Browse files Browse the repository at this point in the history
  • Loading branch information
nikp123 committed Sep 21, 2024
1 parent c7df5fe commit d0ccf97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/output/graphical_wayland/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,15 @@ EXP_FUNC int xavaInitOutput(XAVA *hand) {
xavaBailCondition(!wd.compositor, "Your compositor doesn't support wl_compositor, failing...");
xavaBailCondition(!xavaXDGWMBase, "Your compositor doesn't support xdg_wm_base, failing...");

if(xavaWLRLayerShell == NULL || xavaXDGOutputManager == NULL) {
if((xavaWLRLayerShell == NULL || xavaXDGOutputManager == NULL)
&& backgroundLayer) {
xavaWarn("Your compositor doesn't support some or any of the following:\n"
"zwlr_layer_shell_v1 and/or zwlr_output_manager_v1\n"
"This will DISABLE the ability to use the background layer for"
"safety reasons!");
backgroundLayer = 0;
}

// needed to be done twice for xdg_output to do it's frickin' job
wl_display_roundtrip(wd.display);

wd.surface = wl_compositor_create_surface(wd.compositor);

// The option carries the same functionality here to Wayland as well
Expand All @@ -100,8 +98,6 @@ EXP_FUNC int xavaInitOutput(XAVA *hand) {
xdg_init(&wd);
}

//wl_surface_set_buffer_scale(xavaWLSurface, 3);

// process all of this, FINALLY
wl_surface_commit(wd.surface);

Expand Down
4 changes: 3 additions & 1 deletion src/output/graphical_wayland/xdg.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ struct xdg_toplevel_listener xdg_toplevel_listener = {

static void xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
uint32_t serial) {
UNUSED(data);
struct waydata *wd = data;

// confirm that you exist to the compositor
xdg_surface_ack_configure(xdg_surface, serial);

wl_surface_commit(wd->surface);
}

const struct xdg_surface_listener xdg_surface_listener = {
Expand Down

0 comments on commit d0ccf97

Please sign in to comment.