summaryrefslogtreecommitdiff
path: root/src/managers/PointerManager.cpp
diff options
context:
space:
mode:
authorthejch <66577496+thejch@users.noreply.github.com>2024-05-24 11:50:22 -0700
committerGitHub <noreply@github.com>2024-05-24 20:50:22 +0200
commit0d6eae052352dfa39a2442f252133988ecfb28ba (patch)
tree77863dfa83bd3d67afffeabde137fc572c0a97e4 /src/managers/PointerManager.cpp
parent52684b7d90de509c66f4f9a81c54a985123315b6 (diff)
pointer: add back nvidia hardware cursor quirks (#6220)
Diffstat (limited to 'src/managers/PointerManager.cpp')
-rw-r--r--src/managers/PointerManager.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp
index 636eab1d..b199881e 100644
--- a/src/managers/PointerManager.cpp
+++ b/src/managers/PointerManager.cpp
@@ -119,7 +119,17 @@ static bool output_pick_cursor_format(struct wlr_output* output, struct wlr_drm_
}
}
- return output_pick_format(output, display_formats, format, DRM_FORMAT_ARGB8888);
+ // Note: taken from https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4596/diffs#diff-content-e3ea164da86650995728d70bd118f6aa8c386797
+ // If this fails to find a shared modifier try to use a linear
+ // modifier. This avoids a scenario where the hardware cannot render to
+ // linear textures but only linear textures are supported for cursors,
+ // as is the case with Nvidia and VmWare GPUs
+ if (!output_pick_format(output, display_formats, format, DRM_FORMAT_ARGB8888)) {
+ // Clear the format as output_pick_format doesn't zero it
+ memset(format, 0, sizeof(*format));
+ return output_pick_format(output, NULL, format, DRM_FORMAT_ARGB8888);
+ }
+ return true;
}
CPointerManager::CPointerManager() {