wayland: don't do parent draws on every event when we do'nt need to
This commit is contained in:
parent
d340c64ca3
commit
32f09a9af2
2 changed files with 6 additions and 17 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
#ifndef __MW_LOWLEVEL_WAYLAND_H__
|
#ifndef __MW_LOWLEVEL_WAYLAND_H__
|
||||||
#define __MW_LOWLEVEL_WAYLAND_H__
|
#define __MW_LOWLEVEL_WAYLAND_H__
|
||||||
|
|
||||||
|
#include "Mw/BaseTypes.h"
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
#include <Mw/LowLevel.h>
|
#include <Mw/LowLevel.h>
|
||||||
|
|
|
||||||
|
|
@ -412,17 +412,14 @@ static void pointer_motion(void* data, struct wl_pointer* wl_pointer, MwU32 time
|
||||||
p.point = self->wayland.cur_mouse_pos;
|
p.point = self->wayland.cur_mouse_pos;
|
||||||
MwLLDispatch(self, move, &p);
|
MwLLDispatch(self, move, &p);
|
||||||
|
|
||||||
self->wayland.events_pending += 1;
|
/* Only draw once every 50 milliseconds */
|
||||||
|
if((self->wayland.last_time + 50) <= time) {
|
||||||
/* Only draw once every 10 milliseconds */
|
MwLLDispatch(self, draw, NULL);
|
||||||
if((self->wayland.last_time + 10) <= time) {
|
|
||||||
if(!self->wayland.always_render) {
|
|
||||||
MwLLDispatch(self, draw, NULL);
|
|
||||||
self->wayland.events_pending += 1;
|
|
||||||
}
|
|
||||||
self->wayland.last_time = time;
|
self->wayland.last_time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self->wayland.events_pending += 1;
|
||||||
|
|
||||||
WAYLAND_EVENT_OP_END(self);
|
WAYLAND_EVENT_OP_END(self);
|
||||||
|
|
||||||
/*timed_redraw(self, time, 50, &self->wayland.cooldown_timer);*/
|
/*timed_redraw(self, time, 50, &self->wayland.cooldown_timer);*/
|
||||||
|
|
@ -474,10 +471,6 @@ static void pointer_button(void* data, struct wl_pointer* wl_pointer, MwU32 seri
|
||||||
|
|
||||||
if(!self->wayland.always_render) {
|
if(!self->wayland.always_render) {
|
||||||
MwLLDispatch(self, draw, NULL);
|
MwLLDispatch(self, draw, NULL);
|
||||||
if(self->wayland.parent != NULL) {
|
|
||||||
MwLLDispatch(self->wayland.parent, draw, NULL);
|
|
||||||
self->wayland.parent->wayland.events_pending += 1;
|
|
||||||
}
|
|
||||||
self->wayland.events_pending += 1;
|
self->wayland.events_pending += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -655,9 +648,6 @@ static void keyboard_key(void* data,
|
||||||
|
|
||||||
if(!self->wayland.always_render) {
|
if(!self->wayland.always_render) {
|
||||||
MwLLDispatch(self, draw, NULL);
|
MwLLDispatch(self, draw, NULL);
|
||||||
if(self->wayland.parent != NULL) {
|
|
||||||
MwLLDispatch(self->wayland.parent, draw, NULL);
|
|
||||||
}
|
|
||||||
self->wayland.events_pending += 1;
|
self->wayland.events_pending += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -943,8 +933,6 @@ static void wl_shm_interface_destroy(struct _MwLLWayland* wayland, wayland_proto
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_buffer(struct _MwLLWaylandShmBuffer* buffer) {
|
static void update_buffer(struct _MwLLWaylandShmBuffer* buffer) {
|
||||||
fsync(buffer->fd);
|
|
||||||
|
|
||||||
wl_surface_attach(buffer->surface, buffer->shm_buffer, 0, 0);
|
wl_surface_attach(buffer->surface, buffer->shm_buffer, 0, 0);
|
||||||
wl_surface_commit(buffer->surface);
|
wl_surface_commit(buffer->surface);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue