mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-13 05:22:08 +01:00
some wlbg fixes
This commit is contained in:
parent
8a2e617f39
commit
f367b341a5
3 changed files with 7 additions and 8 deletions
|
@ -39,3 +39,7 @@ pub fn damage(self: *DrawTimerHandler, idx: usize) void {
|
|||
self.maybeWake();
|
||||
}
|
||||
|
||||
pub fn damageAll(self: *DrawTimerHandler) void {
|
||||
@memset(self.should_redraw, true);
|
||||
self.maybeWake();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ main_shader_program: c_uint,
|
|||
bg_bufs: std.MultiArrayList(BgBuf),
|
||||
time: i64,
|
||||
cursor_positions: [][2]c_int,
|
||||
should_redraw: []bool,
|
||||
|
||||
const Gfx = @This();
|
||||
|
||||
|
@ -70,10 +69,6 @@ pub fn init(egl_dpy: c.EGLDisplay, output_info: []const OutputInfo) !Gfx {
|
|||
errdefer std.heap.c_allocator.free(cursor_positions);
|
||||
@memset(cursor_positions, .{ 0, 0 });
|
||||
|
||||
const should_redraw = try std.heap.c_allocator.alloc(bool, output_info.len);
|
||||
errdefer std.heap.c_allocator.free(should_redraw);
|
||||
@memset(should_redraw, true);
|
||||
|
||||
var bg_bufs = std.MultiArrayList(BgBuf){};
|
||||
errdefer bg_bufs.deinit(std.heap.c_allocator);
|
||||
|
||||
|
@ -139,7 +134,6 @@ pub fn init(egl_dpy: c.EGLDisplay, output_info: []const OutputInfo) !Gfx {
|
|||
.bg_bufs = bg_bufs,
|
||||
.time = 0,
|
||||
.cursor_positions = cursor_positions,
|
||||
.should_redraw = should_redraw,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -154,7 +148,6 @@ pub fn deinit(self: *Gfx) void {
|
|||
c.glDeleteProgram(self.main_shader_program);
|
||||
|
||||
std.heap.c_allocator.free(self.cursor_positions);
|
||||
std.heap.c_allocator.free(self.should_redraw);
|
||||
|
||||
self.* = undefined;
|
||||
}
|
||||
|
|
|
@ -141,6 +141,7 @@ pub fn main() !void {
|
|||
.loop = &loop,
|
||||
};
|
||||
defer std.heap.c_allocator.free(dth.should_redraw);
|
||||
@memset(dth.should_redraw, true);
|
||||
|
||||
var pointer_state = PointerState{
|
||||
.surface = null,
|
||||
|
@ -328,9 +329,10 @@ fn renderBackgroundCb(
|
|||
loop.stop();
|
||||
return .disarm;
|
||||
};
|
||||
@memset(data.?.gfx.should_redraw, true);
|
||||
}
|
||||
|
||||
data.?.dth.damageAll();
|
||||
|
||||
return .rearm;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue