#include "launcher-util.h"
#include "log.h"
+enum {
+ WESTON_PLANE_DRM_CURSOR = 0x100
+};
+
struct drm_compositor {
struct weston_compositor base;
pixman_region32_t *overlap)
{
pixman_region32_t cursor_region;
- int prior_was_hardware;
if (seat->sprite == NULL)
return;
goto out;
}
- prior_was_hardware = seat->hw_cursor;
if (pixman_region32_not_empty(overlap) ||
drm_output_set_cursor(output, seat) < 0) {
- if (prior_was_hardware) {
+ if (seat->sprite->plane == WESTON_PLANE_DRM_CURSOR) {
weston_surface_damage(seat->sprite);
drm_output_set_cursor(output, NULL);
}
- seat->hw_cursor = 0;
+ seat->sprite->plane = WESTON_PLANE_PRIMARY;
} else {
- if (!prior_was_hardware)
+ if (seat->sprite->plane == WESTON_PLANE_PRIMARY)
weston_surface_damage_below(seat->sprite);
wl_list_remove(&seat->sprite->link);
- seat->hw_cursor = 1;
+ seat->sprite->plane = WESTON_PLANE_DRM_CURSOR;
}
out:
weston_output_set_cursor(output, seat,
&surface_overlap);
- if (!seat->hw_cursor)
+ if (seat->sprite->plane == WESTON_PLANE_PRIMARY)
pixman_region32_union(&overlap, &overlap,
&es->transform.boundingbox);
} else if (!drm_output_prepare_overlay_surface(output, es,
struct weston_compositor *compositor = surface->compositor;
pixman_region32_t damage;
+ if (surface->plane != WESTON_PLANE_PRIMARY)
+ return;
+
pixman_region32_init(&damage);
pixman_region32_subtract(&damage, &surface->transform.boundingbox,
&surface->clip);
int32_t hotspot_x, hotspot_y;
struct wl_list link;
enum weston_keyboard_modifier modifier_state;
- int hw_cursor;
struct wl_surface *saved_kbd_focus;
struct wl_listener saved_kbd_focus_listener;
* transformation in global coordinates, add it to the tail of the list.
*/
+enum {
+ WESTON_PLANE_PRIMARY
+};
+
struct weston_surface {
struct wl_surface surface;
struct weston_compositor *compositor;
GLfloat opaque_rect[4];
GLfloat alpha;
int blend;
+ int plane;
/* Surface geometry state, mutable.
* If you change anything, set dirty = 1.