public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Wolff <towo@towo.net>
To: cygwin-patches@cygwin.com
Subject: [PATCH] Re: propagate font zoom via SIGWINCH
Date: Wed, 7 Jul 2021 11:43:44 +0200	[thread overview]
Message-ID: <b0dba327-4e00-f681-fcbf-db0da3890b89@towo.net> (raw)
In-Reply-To: <YORkHm5mUk1jfMtm@calimero.vinschen.de>

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

Update with more elaborate commit comment, hopefully formatted properly.

Am 06.07.2021 um 16:09 schrieb Corinna Vinschen:
> Hi Thomas,
>
> On Jul  3 18:19, Thomas Wolff wrote:
>> xterm 368 and mintty 3.5.1 implement a new feature to support notification
>> of terminal scaling via font zooming also if the terminal text dimensions
>> (rows/columns) stay unchanged, using ioctl(TIOCSWINSZ), raising SIGWINCH.
>> This does not work in cygwin currently. The attached patch fixes that.
>> Thomas
> Can you please put the describing text into the commit message?
>
>
> Thanks,
> Corinna


[-- Attachment #2: 0001-tty-pty-support-TIOCSWINSZ-pixel-size-only-change-no.patch --]
[-- Type: text/plain, Size: 2034 bytes --]

From b9795ed6ec3979f68173e54d01e681271eea4a9a Mon Sep 17 00:00:00 2001
From: Thomas Wolff <mined@users.noreply.github.com>
Date: Sat, 3 Jul 2021 00:00:00 +0200
Subject: [PATCH] tty/pty: support TIOCSWINSZ pixel-size-only change
 notification

xterm 368 and mintty 3.5.1 implement a new feature to support 
notification of terminal scaling via font zooming also if the terminal 
text dimensions (rows/columns) stay unchanged, using 
ioctl(TIOCSWINSZ), raising SIGWINCH;
this patches cygwin to support that scenario

---
 winsup/cygwin/fhandler_tty.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 1ed41d3b2..f2ac26892 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1687,7 +1687,10 @@ fhandler_pty_slave::ioctl (unsigned int cmd, void *arg)
       break;
     case TIOCSWINSZ:
       if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
-	  || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
+	  || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col
+	  || get_ttyp ()->winsize.ws_ypixel != ((struct winsize *) arg)->ws_ypixel
+	  || get_ttyp ()->winsize.ws_xpixel != ((struct winsize *) arg)->ws_xpixel
+	 )
 	{
 	  if (get_ttyp ()->pcon_activated && get_ttyp ()->pcon_pid)
 	    resize_pseudo_console ((struct winsize *) arg);
@@ -2279,7 +2282,10 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
       break;
     case TIOCSWINSZ:
       if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
-	  || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
+	  || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col
+	  || get_ttyp ()->winsize.ws_ypixel != ((struct winsize *) arg)->ws_ypixel
+	  || get_ttyp ()->winsize.ws_xpixel != ((struct winsize *) arg)->ws_xpixel
+	 )
 	{
 	  if (get_ttyp ()->pcon_activated && get_ttyp ()->pcon_pid)
 	    resize_pseudo_console ((struct winsize *) arg);
-- 
2.32.0


  reply	other threads:[~2021-07-07  9:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 16:19 Thomas Wolff
2021-07-06 14:09 ` Corinna Vinschen
2021-07-07  9:43   ` Thomas Wolff [this message]
2021-07-07 11:41     ` [PATCH] " Corinna Vinschen

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=b0dba327-4e00-f681-fcbf-db0da3890b89@towo.net \
    --to=towo@towo.net \
    --cc=cygwin-patches@cygwin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).