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

Fix screenshares on yui #303

Merged
merged 2 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions nixos-config/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
src = prev.fetchFromGitHub {
owner = "emersion";
repo = old.pname;
rev = "b5f387821800e32d4f82001504668d819f02bb4b";
hash = "sha256-TeTDJVFW0NHZpmTm8PAXTzbzk6kolvY7Vd55YQfJV20=";
rev = "1eaa02eb18ab783b64dc89f1681909dc30baa805";
hash = "sha256-vRMNkMFidNmSQkhz5n+EBg7IkRjMYqrhdhM80G3K3WI=";
};
});
})
Expand All @@ -29,6 +29,14 @@

xdg.portal = {
enable = true;
wlr.enable = true;
wlr = {
enable = true;
settings.screencast = {
output_name = "DP-1";
max_fps = 30;
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -s '#99d1ce33'";
};
};
};
}
1 change: 1 addition & 0 deletions nixos-config/yui/nvidia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
wlroots_0_16 = final.wlroots_0_16.overrideAttrs (_: {
patches = [
./wlroots-nvidia.patch
./wlroots-screenshare.patch
];
});
})
Expand Down
29 changes: 29 additions & 0 deletions nixos-config/yui/nvidia/wlroots-screenshare.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/types/output/render.c b/types/output/render.c
index 5d4dccc1..7fea66e3 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -330,22 +330,8 @@ struct wlr_drm_format *output_pick_format(struct wlr_output *output,
}

uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
- struct wlr_renderer *renderer = output->renderer;
- assert(renderer != NULL);
-
- if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) {
- return DRM_FORMAT_INVALID;
- }
-
- if (!output_attach_back_buffer(output, &output->pending, NULL)) {
- return false;
- }
-
- uint32_t fmt = renderer->impl->preferred_read_format(renderer);
-
- output_clear_back_buffer(output);
-
- return fmt;
+ // Hack for Nvidia screen sharing, might break other gpus (and maybe even some stuff in nvidia itself)
+ return DRM_FORMAT_XRGB8888;
}

bool output_is_direct_scanout(struct wlr_output *output,
Loading