qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: [PATCH] Fix display breakage when resizing the screen
Date: Sun, 05 Apr 2009 18:35:33 +0300	[thread overview]
Message-ID: <49D8CFC5.2070203@redhat.com> (raw)
In-Reply-To: <49D8B5C2.4090901@codemonkey.ws>

[-- Attachment #1: Type: text/plain, Size: 269 bytes --]

Anthony Liguori wrote:
>
> This patch breaks VC switching with -curses.
>

The attached incremental fixes it, by basically replicating the previous 
behaviour.  I'll follow up with a new combined patch.

-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: delta.patch --]
[-- Type: text/x-patch, Size: 1643 bytes --]

diff --git a/hw/vga.c b/hw/vga.c
index 404450f..54d0246 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1631,6 +1631,9 @@ static void vga_update_resolution_graphics(VGAState *s)
         s->multi_run != multi_run ||
         s->multi_scan != multi_scan ||
         s->want_full_update) {
+        if (s->ds->surface->pf.depth == 0) {
+            goto dont_touch_display_surface;
+        }
 #if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
         if (depth == 16 || depth == 32) {
 #else
@@ -1647,6 +1650,7 @@ static void vga_update_resolution_graphics(VGAState *s)
         } else {
             qemu_console_resize(s->ds, disp_width, height);
         }
+    dont_touch_display_surface:
         s->last_scr_width = disp_width;
         s->last_scr_height = height;
         s->last_width = disp_width;
@@ -1668,7 +1672,17 @@ static void vga_update_resolution_text(VGAState *s)
         cw != s->last_cw || cheight != s->last_ch || s->last_depth) {
         s->last_scr_width = width * cw;
         s->last_scr_height = height * cheight;
-        qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
+        if (s->ds->surface->pf.depth != 0) {
+            qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
+        } else {
+            /*
+             * curses expects width and height to be in character cell
+             * dimensions, not pixels.
+             */
+            s->ds->surface->width = width;
+            s->ds->surface->height = height;
+            dpy_resize(s->ds);
+        }
         s->last_depth = 0;
         s->last_width = width;
         s->last_height = height;

      parent reply	other threads:[~2009-04-05 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-04 10:48 [Qemu-devel] [PATCH] Fix display breakage when resizing the screen Avi Kivity
2009-04-05 13:44 ` [Qemu-devel] " Anthony Liguori
2009-04-05 15:28   ` Avi Kivity
2009-04-05 15:35   ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49D8CFC5.2070203@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).