From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UNTnu-00043a-5Q for mharc-grub-devel@gnu.org; Wed, 03 Apr 2013 15:57:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTnm-0003oP-FA for grub-devel@gnu.org; Wed, 03 Apr 2013 15:57:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNTnj-0001mf-9f for grub-devel@gnu.org; Wed, 03 Apr 2013 15:56:58 -0400 Received: from mail-ea0-f170.google.com ([209.85.215.170]:59260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTlv-0001HW-Qe for grub-devel@gnu.org; Wed, 03 Apr 2013 15:55:04 -0400 Received: by mail-ea0-f170.google.com with SMTP id a15so771746eae.15 for ; Wed, 03 Apr 2013 12:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=sHBhKA9kdZGeK3NmlY1Ov4h6sYsH83XhYEKRgRJbx0Q=; b=F3hEmqFCBJ3oPAP7V0HqGINR5tR/CTMHRjyaOcEWj2YVOq4twYoVmdAH6iMdIImBzn 6OHhz8sI4/s1q8Xtynzwqf1qrbQsNtdkgX0fKJYHEvrlcnq9/REAyV1Td7FmT8FLS7tA BBe0fB1WrmmK4TAtrXrikHVjB1sypFtWFAKyoT7gAN6ULBKLv8TN49Yp3btZLzU/2hdg UnDOWSYLqfHxd+TX+DwC7iK+/eNWqirSqxg5nRHQi0qlBvu/L+6quV1zAdFHPLDaZSiQ 5jUs0X5bGZs6I9bzJwiL6MLUxECqtFvvGuuHSNeI5e4gRSIsPvhNZrmroYHazXF12Gr/ GZxQ== X-Received: by 10.14.179.5 with SMTP id g5mr5691259eem.41.1365018902596; Wed, 03 Apr 2013 12:55:02 -0700 (PDT) Received: from debian.x201.phnet (77-88.1-85.cust.bluewin.ch. [85.1.88.77]) by mx.google.com with ESMTPS id s3sm8995315eem.4.2013.04.03.12.55.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 12:55:01 -0700 (PDT) Message-ID: <515C2D17.2040800@gmail.com> Date: Wed, 03 Apr 2013 15:22:31 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] fix entry editor screen screen layout corruption in trunk References: <20130217191559.1de3c574@opensuse.site> In-Reply-To: <20130217191559.1de3c574@opensuse.site> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigDE27D9059C0D8C98BCF7AAA7" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.215.170 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 19:57:05 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDE27D9059C0D8C98BCF7AAA7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 17.02.2013 16:15, Andrey Borzenkov wrote: > See screenshot for what I get using current trunk. >=20 > I do not pretend to fully understand all this code so review is > appreciated. So far it does fix both gfxterm and console cases for me. I've fixed the same problem by much smaller logic change >=20 > Patch follows. >=20 > --- >=20 > From: Andrey Borzenkov > Subject: [PATCH] fix entry editor screen corruption >=20 > Fixes the following issues after rev 7137 >=20 > 1. right margines were erased on wrapped lines (with contibuation char)= >=20 > 2. left margines were erased on continuation lines >=20 > 3. max_lines was effectively ignored by gfxterm, so last line was print= ed > outside of editor window, overwriting bottom border and probably beyond= >=20 > 4. menu_entry:update_screen() unconditionally padded last line with > spaces, but print_ucs4_menu() would move to next screen position if > line was wrapped. This caused bottom border to be partially overwritten= > with spaces. The patch moves line padding to term.c. It also > makes behaviour consistent with print_ucs4_terminal which did padding > itself. >=20 > Signed-off-by: Andrey Borzenkov >=20 > --- > grub-core/normal/menu_entry.c | 10 ---------- > grub-core/normal/term.c | 29 +++++++++++++++++++++++------ > 2 files changed, 23 insertions(+), 16 deletions(-) >=20 > diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entr= y.c > index 7cd67f3..cc977b5 100644 > --- a/grub-core/normal/menu_entry.c > +++ b/grub-core/normal/menu_entry.c > @@ -256,7 +256,6 @@ update_screen (struct screen *screen, struct per_te= rm_screen *term_screen, > =20 > if (i =3D=3D region_start || linep =3D=3D screen->lines + screen->l= ine) > { > - int sp; > grub_term_gotoxy (term_screen->term, GRUB_TERM_LEFT_BORDER_X > + GRUB_TERM_MARGIN + 1, (y < 0 ? 0 : y) > + GRUB_TERM_FIRST_ENTRY_Y); > @@ -271,14 +270,9 @@ update_screen (struct screen *screen, struct per_t= erm_screen *term_screen, > term_screen->num_entries > - ((y > 0) ? y : 0), '\\', > *pos); > - sp =3D grub_term_entry_width (term_screen->term) > - - (*pos)[linep->len].x; > - if (sp > 0) > - grub_print_spaces (term_screen->term, sp); > } > else if (i > region_start && mode =3D=3D ALL_LINES) > { > - int sp; > grub_term_gotoxy (term_screen->term, GRUB_TERM_LEFT_BORDER_X > + GRUB_TERM_MARGIN + 1, (y < 0 ? 0 : y) > + GRUB_TERM_FIRST_ENTRY_Y); > @@ -293,10 +287,6 @@ update_screen (struct screen *screen, struct per_t= erm_screen *term_screen, > term_screen->num_entries > - ((y > 0) ? y : 0), '\\', > *pos); > - sp =3D grub_term_entry_width (term_screen->term) > - - (*pos)[linep->len].x; > - if (sp > 0) > - grub_print_spaces (term_screen->term, sp); > } > y +=3D get_logical_num_lines (linep, term_screen); > if (y >=3D term_screen->num_entries) > diff --git a/grub-core/normal/term.c b/grub-core/normal/term.c > index dc03268..0290968 100644 > --- a/grub-core/normal/term.c > +++ b/grub-core/normal/term.c > @@ -736,6 +736,8 @@ print_ucs4_terminal (const grub_uint32_t * str, > continue; > putcode_real (*ptr2, term, fixed_tab); > } > + if (contchar) > + fill_margin (term, margin_right); > } > return dry_run ? lines : 0; > } > @@ -767,13 +769,22 @@ put_glyphs_terminal (const struct grub_unicode_gl= yph *visual, > grub_ssize_t visual_len, > int margin_left, int margin_right, > struct grub_term_output *term, > - struct term_state *state, int fixed_tab) > + struct term_state *state, int fixed_tab, grub_uint32_t contchar= ) > { > const struct grub_unicode_glyph *visual_ptr; > + int wasn =3D 0; > + > for (visual_ptr =3D visual; visual_ptr < visual + visual_len; visual= _ptr++) > { > if (visual_ptr->base =3D=3D '\n') > - grub_print_spaces (term, margin_right); > + { > + wasn =3D 1; > + if (contchar) > + fill_margin (term, margin_right); > + } > + else > + wasn =3D 0; > +=20 > putglyph (visual_ptr, term, fixed_tab); > if (visual_ptr->base =3D=3D '\n') > { > @@ -786,10 +797,16 @@ put_glyphs_terminal (const struct grub_unicode_gl= yph *visual, > return 1; > } > =20 > - grub_print_spaces (term, margin_left); > + if (!contchar) > + grub_print_spaces (term, margin_left); > + else > + grub_term_gotoxy (term, margin_left, > + grub_term_getxy (term) & 0xff); > } > grub_free (visual_ptr->combining); > } > + if (!wasn && contchar) > + fill_margin (term, margin_right); > return 0; > } > =20 > @@ -826,7 +843,7 @@ print_backlog (struct grub_term_output *term, > ret =3D put_glyphs_terminal (state->backlog_glyphs, > state->backlog_len, > margin_left, margin_right, term, state, > - state->backlog_fixed_tab); > + state->backlog_fixed_tab, 0); > if (!ret) > { > grub_free (state->free); > @@ -908,7 +925,7 @@ print_ucs4_real (const grub_uint32_t * str, > { > for (vptr =3D visual_show; > max_lines && vptr < visual + visual_len; vptr++) > - if (visual_show->base =3D=3D '\n') > + if (vptr->base =3D=3D '\n') > max_lines--; > =20 > visual_len_show =3D vptr - visual_show; =20 > @@ -930,7 +947,7 @@ print_ucs4_real (const grub_uint32_t * str, > { > ret =3D put_glyphs_terminal (visual_show, visual_len_show, margin_l= eft, > contchar ? margin_right : 1, > - term, state, fixed_tab); > + term, state, fixed_tab, contchar); > =20 > if (!ret) > grub_free (visual); >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --------------enigDE27D9059C0D8C98BCF7AAA7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAlFcLRgACgkQNak7dOguQgnILAD+JVN+TTPeXWGCn3aXC11xRfYk LPBP+89mgDAXHmmF4UYA/2QgT2ZFA3X3r6JLEAal5tUAuAfVGHw0dOu6Xw9zSwgc =9SLP -----END PGP SIGNATURE----- --------------enigDE27D9059C0D8C98BCF7AAA7--