mirror of
https://gitlab.com/marcandre.lureau/qemu-display.git
synced 2024-12-22 05:35:20 +00:00
console: render immediately when given an update
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
c07a48ad2c
commit
64a6569da7
@ -1,5 +1,6 @@
|
||||
use glib::clone;
|
||||
use glib::subclass::prelude::*;
|
||||
use gtk::glib::translate::FromGlibPtrBorrow;
|
||||
use gtk::prelude::*;
|
||||
use gtk::subclass::widget::WidgetImplExt;
|
||||
use gtk::{gdk, glib, CompositeTemplate};
|
||||
@ -162,7 +163,15 @@ impl QemuConsole {
|
||||
match t {
|
||||
Event::Update { .. } => {
|
||||
priv_.wait_rendering.set(priv_.wait_rendering.get() + 1);
|
||||
priv_.area.queue_render();
|
||||
// we don't simply queue_render, as we want a copy immediately
|
||||
priv_.area.make_current();
|
||||
priv_.area.attach_buffers();
|
||||
let _ = unsafe {
|
||||
glib::Object::from_glib_borrow(priv_.area.as_ptr() as *mut glib::gobject_ffi::GObject)
|
||||
.emit("render", &[&priv_.area.get_context().as_ref()])
|
||||
.unwrap()
|
||||
};
|
||||
priv_.area.queue_draw();
|
||||
}
|
||||
Event::Scanout(s) => {
|
||||
priv_.label.set_label(&format!("{:?}", s));
|
||||
|
Loading…
Reference in New Issue
Block a user