1
0
Fork 0
forked from wry/wry

render: render dnd icons for hardware cursors

This commit is contained in:
Julian Orth 2024-02-07 21:25:45 +01:00
parent d202712694
commit f68e2e6fd4

View file

@ -190,9 +190,6 @@ impl Framebuffer {
if let Some(rect) = cursor_rect { if let Some(rect) = cursor_rect {
let seats = state.globals.lock_seats(); let seats = state.globals.lock_seats();
for seat in seats.values() { for seat in seats.values() {
if !render_hardware_cursor && seat.hardware_cursor() {
continue;
}
if let Some(cursor) = seat.get_cursor() { if let Some(cursor) = seat.get_cursor() {
let (mut x, mut y) = seat.get_position(); let (mut x, mut y) = seat.get_position();
if let Some(dnd_icon) = seat.dnd_icon() { if let Some(dnd_icon) = seat.dnd_icon() {
@ -205,6 +202,7 @@ impl Framebuffer {
renderer.render_surface(&dnd_icon, x, y, i32::MAX, i32::MAX); renderer.render_surface(&dnd_icon, x, y, i32::MAX, i32::MAX);
} }
} }
if render_hardware_cursor || !seat.hardware_cursor() {
cursor.tick(); cursor.tick();
x -= Fixed::from_int(rect.x1()); x -= Fixed::from_int(rect.x1());
y -= Fixed::from_int(rect.y1()); y -= Fixed::from_int(rect.y1());
@ -212,6 +210,7 @@ impl Framebuffer {
} }
} }
} }
}
let _ = self.ctx.ctx.with_current(|| { let _ = self.ctx.ctx.with_current(|| {
let c = state.theme.colors.background.get(); let c = state.theme.colors.background.get();
unsafe { unsafe {