unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: 61948@debbugs.gnu.org
Subject: bug#61948: 29.0.60; window-at returns nil when tab-bar-mode is on
Date: Sat, 04 Mar 2023 10:50:00 +0200	[thread overview]
Message-ID: <835ybgc347.fsf@gnu.org> (raw)
In-Reply-To: <DEA6C50D-BC0A-4A40-A6DA-46E9E48BAB47@gmail.com> (message from Yuan Fu on Fri, 3 Mar 2023 19:02:06 -0800)

> From: Yuan Fu <casouri@gmail.com>
> Date: Fri, 3 Mar 2023 19:02:06 -0800
> 
> To reproduce:
> 
> 1. Type C-x t 2 to turn on tab-bar-mode
> 2. Evaluate (window-at 0 0), it returns nil
> 3. Evaluating (window-at 50 50) also returns nil
> 4. Turn off tab-bar-mode, and (window-at 0 0) returns a live window
> 
> window-at-x-y is the same

What did you expect the function to return instead in these cases?

Both of these functions ignore the tool-bar and the tab-bar
pseudo-windows, so as long as the coordinates are inside those two
windows, both functions return nil.  (This was not called out in their
doc strings; I've now added this caveat to the doc strings of these
two functions.)

So the call with both X and Y zero returns nil because that point is
within the area of the frame where these functions always return nil.

As for the call with X and Y being 50, it returns nil for different
reasons:

  . for window-at, X and Y are measured in columns and rows, so likely
    Y = 50 is outside of the frame created by "emacs -Q";
  . for window-at-x-y, Y = 50 is still inside the tab-bar
    pseudo-window; on my system using Y = 53 or larger returns the
    window showing *scratch*; it could be that the threshold value on
    your system is a bit different

Given the above, do you still think there's a bug here?  If so, please
describe the real use case where you needed this.

Thanks.





  reply	other threads:[~2023-03-04  8:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04  3:02 bug#61948: 29.0.60; window-at returns nil when tab-bar-mode is on Yuan Fu
2023-03-04  8:50 ` Eli Zaretskii [this message]
2023-03-04  9:18   ` Yuan Fu

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=835ybgc347.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=61948@debbugs.gnu.org \
    --cc=casouri@gmail.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.
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).