cursor-tracker: Don't assume we're a Wayland compositor

This commit is contained in:
Jasper St. Pierre 2013-12-05 15:36:46 -05:00
parent 29197d40c6
commit c36aa5e696

View File

@ -696,7 +696,6 @@ meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
return FALSE; return FALSE;
set_window_cursor (tracker, FALSE, NULL); set_window_cursor (tracker, FALSE, NULL);
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
return TRUE; return TRUE;
} }
@ -970,12 +969,15 @@ sync_displayed_cursor (MetaCursorTracker *tracker)
if (displayed_cursor) if (displayed_cursor)
tracker->displayed_cursor = meta_cursor_reference_ref (displayed_cursor); tracker->displayed_cursor = meta_cursor_reference_ref (displayed_cursor);
if (meta_is_wayland_compositor ())
{
if (displayed_cursor) if (displayed_cursor)
cogl_pipeline_set_layer_texture (tracker->pipeline, 0, COGL_TEXTURE (displayed_cursor->texture)); cogl_pipeline_set_layer_texture (tracker->pipeline, 0, COGL_TEXTURE (displayed_cursor->texture));
else else
cogl_pipeline_set_layer_texture (tracker->pipeline, 0, NULL); cogl_pipeline_set_layer_texture (tracker->pipeline, 0, NULL);
update_hw_cursor (tracker); update_hw_cursor (tracker);
}
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0); g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
} }
@ -1034,11 +1036,14 @@ sync_cursor (MetaCursorTracker *tracker)
tracker->current_rect.height = 0; tracker->current_rect.height = 0;
} }
if (meta_is_wayland_compositor ())
{
if (tracker->has_hw_cursor) if (tracker->has_hw_cursor)
move_hw_cursor (tracker); move_hw_cursor (tracker);
else else
meta_cursor_tracker_queue_redraw (tracker); meta_cursor_tracker_queue_redraw (tracker);
} }
}
void void
meta_cursor_tracker_update_position (MetaCursorTracker *tracker, meta_cursor_tracker_update_position (MetaCursorTracker *tracker,