unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "J. Scott Berg" <jsberg-bnl@outlook.com>
To: "44002@debbugs.gnu.org" <44002@debbugs.gnu.org>
Subject: bug#44002: 27.1; Small window height with VcXsrv X server when built with gtk3 toolkit
Date: Mon, 19 Oct 2020 14:02:02 +0000	[thread overview]
Message-ID: <MN2PR12MB46064D494EF75D302985CB559A1E0@MN2PR12MB4606.namprd12.prod.outlook.com> (raw)
In-Reply-To: <9ad655db-7735-fb80-4517-3e3aaec13ee1@gmx.at>

> -----Original Message-----
> From: martin rudalics <rudalics@gmx.at>
> Sent: Saturday, October 17, 2020 5:33 AM
> To: Eli Zaretskii <eliz@gnu.org>; J. Scott Berg <jsberg-bnl@outlook.com>
> Cc: 44002@debbugs.gnu.org
> Subject: Re: bug#44002: 27.1; Small window height with VcXsrv X server when
> built with gtk3 toolkit
> 
>  >> I did a bit more debugging. What seems to be happening is that we
>  >> receive a pair of ConfigureNotify events in rapid succession. The
>  >> first is for the top level window, and has a reasonable width and
>  >> height. The second is for the window associated with the frame, but
>  >> it has a width=1 height=1. This then leads to the resizing of the
>  >> frame. Presumably the frame's window is not yet mapped, and thus the
>  >> bogus width and height. Checking for visibility on the frame fixes
>  >> the problem. I've attached a patch that works for me, but I haven't
>  >> exhaustively tested all the various possible cases.
>  >
>  >
>  > Martin, any comments on the proposed patch?  Or on the problem in
>  > general?
> 
> I applied it here and didn't see any detrimental effects.  I suppose we
> should just install it and look whether it causes problems with any of
> our window managers.
> 
> For me the most interesting aspect is that it apparently works with
> GTK2.  Maybe comparing the traces of GTK2 and GTK3 runs could reveal
> more.  Or comparing a GTK3 trace with that of a Lucid build.
> 
>  > Btw, do we understand why this happens only with VcXsrv?
> 
> I never used VcXsrv so I don't know how it works.  As an example, I have
> no idea what the "top level window" is and why it is not the same as the
> "window associated with the frame".  Also, the fact that a "bogus
> height" is propagated while a "bogus width" is not, hints at yet another
> unresolved mystery.

I at least think I understand the width/height mystery. The bogus window size returned is 1x1. This gets turned into text_width and text_height with FRAME_PIXEL_TO_TEXT_WIDTH and FRAME_PIXEL_TO_TEXT_HEIGHT. Due to the fringe, text_width becomes a negative number, text_height is left at 1. Then the code in change_frame_size_1 resets the width to the correct number because it is negative, but leaves the height alone (with the value 1) because it is positive. 

I've included the output of xwininfo (on a properly running emacs) to help describe what I see in the configureNotify events: the two configureNotify events I see are for 2621579 followed by 2611763, where the latter is the window id in the frame structure.

$ xwininfo -all -int

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 2621759 "emacs@LAD-158343"

  Root window id: 203 (the root window) (has no name)
  Parent window id: 203 (the root window) (has no name)
     2 children:
     2621763 (has no name): ()  1x1+-1+-1  +306+351
     2621760 (has no name): ()  1x1+-1+-1  +306+351

  Absolute upper-left X:  307
  Absolute upper-left Y:  352
  Relative upper-left X:  307
  Relative upper-left Y:  352
  Width: 1312
  Height: 1251
  Depth: 24
  Visual: 0x8d
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x28013e (not installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +307+352  -2221+352  -2221-557  +307-557
  -geometry 1312x1251+307+352

  Bit gravity: NorthWestGravity
  Window gravity: NorthWestGravity
  Backing-store hint: NotUseful
  Backing-planes to be preserved: 0xffffffff
  Backing pixel: 0
  Save-unders: No

  Someone wants these events:
      KeyPress
      KeyRelease
      ButtonPress
      ButtonRelease
      EnterWindow
      LeaveWindow
      PointerMotion
      ButtonMotion
      Exposure
      VisibilityChange
      StructureNotify
      FocusChange
      PropertyChange
  Do not propagate these events:
  Override redirection?: No

  Window manager hints:
      Client accepts input or input focus: Yes
      Initial state is Normal State
      Window type:
          Normal
      Process id: 13793 on host LAD-158343

  Normal window size hints:
      Program supplied minimum size: 0 by 0
      Program supplied base size: 0 by 0
      Program supplied window gravity: NorthWestGravity
  No zoom window size hints defined

  No window shape defined
  No border shape defined 

      parent reply	other threads:[~2020-10-19 14:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  1:55 bug#44002: 27.1; Small window height with VcXsrv X server when built with gtk3 toolkit J. Scott Berg
2020-10-16  7:31 ` Eli Zaretskii
2020-10-16 14:47   ` J. Scott Berg
2020-10-16 19:08     ` Eli Zaretskii
2020-10-16 19:47       ` J. Scott Berg
2020-10-16 23:29         ` J. Scott Berg
2020-10-17  7:52           ` Eli Zaretskii
2020-10-17  9:32             ` martin rudalics
2020-10-17  9:34               ` Eli Zaretskii
2020-10-17  9:40                 ` martin rudalics
2020-10-17 17:32                   ` Eli Zaretskii
2020-10-18 17:52                     ` Robert Pluim
2020-10-18 17:56                       ` Eli Zaretskii
2020-10-19  8:15                         ` Robert Pluim
2021-02-25 20:04                   ` Glenn Morris
2021-02-25 20:28                     ` J. Scott Berg
2021-02-25 20:38                     ` Eli Zaretskii
2020-10-19 14:02               ` J. Scott Berg [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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=MN2PR12MB46064D494EF75D302985CB559A1E0@MN2PR12MB4606.namprd12.prod.outlook.com \
    --to=jsberg-bnl@outlook.com \
    --cc=44002@debbugs.gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).