aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-17 09:22:43 -0400
committerGitHub <noreply@github.com>2017-10-17 09:22:43 -0400
commit62371a9974c5c86f151a702042d67cc73dcb4708 (patch)
treec1b7350ea8bc1644c301d22514071d57155c30c5 /backend/drm
parent703a37bb9fae876bd5ec8d1781353c57708c0cf6 (diff)
parent786f4bdd4d79f5aaa9fd4f7872553a5f3afe98f9 (diff)
Merge pull request #257 from emersion/fix-client-cursors
[WIP] Fix client cursors
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 9e5346a1..ff4dc7f6 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -470,7 +470,7 @@ static void wlr_drm_connector_transform(struct wlr_output *output,
static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height,
- int32_t hotspot_x, int32_t hotspot_y) {
+ int32_t hotspot_x, int32_t hotspot_y, bool update_pixels) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = conn->drm;
struct wlr_drm_renderer *renderer = &drm->renderer;
@@ -478,7 +478,8 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
struct wlr_drm_crtc *crtc = conn->crtc;
struct wlr_drm_plane *plane = crtc->cursor;
- if (!buf) {
+ if (!buf && update_pixels) {
+ // Hide the cursor
return drm->iface->crtc_set_cursor(drm, crtc, NULL);
}
@@ -566,6 +567,11 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
break;
}
+ if (!update_pixels) {
+ // Only update the cursor hotspot
+ return true;
+ }
+
struct gbm_bo *bo = plane->cursor_bo;
uint32_t bo_width = gbm_bo_get_width(bo);
uint32_t bo_height = gbm_bo_get_height(bo);