Skip to content

Instantly share code, notes, and snippets.

@nik012003
Created April 21, 2023 10:36
Show Gist options
  • Select an option

  • Save nik012003/ab11fa07ce8253d54ff13f8d108e69d4 to your computer and use it in GitHub Desktop.

Select an option

Save nik012003/ab11fa07ce8253d54ff13f8d108e69d4 to your computer and use it in GitHub Desktop.
Patch for nvidia screenshare in Hyprland's wlroots
From ac9f339e261306638267a4a31598ac37efa800d6 Mon Sep 17 00:00:00 2001
From: Nicola Guerrera <[email protected]>
Date: Thu, 20 Apr 2023 18:39:37 +0200
Subject: [PATCH] nvidia patches
---
types/output/render.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
diff --git a/types/output/render.c b/types/output/render.c
index ed1afa4a..ddc730c7 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -225,22 +225,7 @@ 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;
+ return DRM_FORMAT_XRGB8888;
}
bool output_is_direct_scanout(struct wlr_output *output,
--
2.40.0

Go inside the subprojects/wlroots folder, and apply the patch with

git apply --verbose 0001-nvidia-patches.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment