]> git.proxmox.com Git - qemu.git/blobdiff - console.h
janitor: do not include qemu-char everywhere
[qemu.git] / console.h
index 50a0512f3211c6603704f872a7f380eeaa7dcdd6..33354e437a6c02761636a929bfbb2d160f0f6423 100644 (file)
--- a/console.h
+++ b/console.h
@@ -1,7 +1,6 @@
 #ifndef CONSOLE_H
 #define CONSOLE_H
 
-#include "qemu-char.h"
 #include "qemu-pixman.h"
 #include "qdict.h"
 #include "notify.h"
@@ -229,6 +228,16 @@ static inline void unregister_displaychangelistener(DisplayState *ds,
 static inline void dpy_gfx_update(DisplayState *s, int x, int y, int w, int h)
 {
     struct DisplayChangeListener *dcl;
+    int width = pixman_image_get_width(s->surface->image);
+    int height = pixman_image_get_height(s->surface->image);
+
+    x = MAX(x, 0);
+    y = MAX(y, 0);
+    x = MIN(x, width);
+    y = MIN(y, height);
+    w = MIN(w, width - x);
+    h = MIN(h, height - y);
+
     QLIST_FOREACH(dcl, &s->listeners, next) {
         if (dcl->dpy_gfx_update) {
             dcl->dpy_gfx_update(s, x, y, w, h);