diff options
| author | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-04 11:51:31 +0200 |
|---|---|---|
| committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-11-01 13:10:05 +0100 |
| commit | 35c9e0a5c2804b94d1a452a0a9a12d7a893b5318 (patch) | |
| tree | d9a1feb4bdd33e8f2e43411742e992a1c4c51483 /console.h | |
| parent | 87e487a14bd9f3fb4a2b27179377e011bdda7c51 (diff) | |
| download | focaccia-qemu-35c9e0a5c2804b94d1a452a0a9a12d7a893b5318.tar.gz focaccia-qemu-35c9e0a5c2804b94d1a452a0a9a12d7a893b5318.zip | |
console: add unregister_displaychangelistener
Also change the way the gui_timer is initialized: each time a displaychangelistener is registered or unregistered we'll check whether we need a timer (due to dpy_refresh callback being present) and if so setup a timer, otherwise zap it. This way the gui timer works correctly with displaychangelisteners coming and going. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'console.h')
| -rw-r--r-- | console.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/console.h b/console.h index 4239eb346c..f476ac810d 100644 --- a/console.h +++ b/console.h @@ -229,9 +229,19 @@ static inline int is_buffer_shared(DisplaySurface *surface) !(surface->flags & QEMU_REALPIXELS_FLAG)); } +void gui_setup_refresh(DisplayState *ds); + static inline void register_displaychangelistener(DisplayState *ds, DisplayChangeListener *dcl) { QLIST_INSERT_HEAD(&ds->listeners, dcl, next); + gui_setup_refresh(ds); +} + +static inline void unregister_displaychangelistener(DisplayState *ds, + DisplayChangeListener *dcl) +{ + QLIST_REMOVE(dcl, next); + gui_setup_refresh(ds); } static inline void dpy_update(DisplayState *s, int x, int y, int w, int h) |