bug#30796: 27.0.50; window-text-pixel-size returns wrong values

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#30796: 27.0.50; window-text-pixel-size returns wrong values

Sebastien Chapuis-2
Hi,

I'm using the function to size correctly a child frame in lsp-ui [1]
The commit 50e2c0fb5180a757d8d533518f68837ffe5909be introduced the bug.
I have tested with and without text properties in the buffer and the bug
still occurs. In my case the TO parameter is nil.

[1] https://github.com/emacs-lsp/lsp-ui


In GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-03-13 built on XPS13
Repository revision: 50e2c0fb5180a757d8d533518f68837ffe5909be
Windowing system distributor 'Fedora Project', version 11.0.11906000
System Description: Fedora 27 (Twenty Seven)

Configured using:
 'configure --prefix=/opt/emacs-git --with-modules --with-xwidgets
 --with-imagemagick CC=clang'

--
Sebastien Chapuis



Reply | Threaded
Open this post in threaded view
|

bug#30796: 27.0.50; window-text-pixel-size returns wrong values

Eli Zaretskii
> From: Sebastien Chapuis <[hidden email]>
> Date: Tue, 13 Mar 2018 15:26:54 +0100
>
> I'm using the function to size correctly a child frame in lsp-ui [1]
> The commit 50e2c0fb5180a757d8d533518f68837ffe5909be introduced the bug.
> I have tested with and without text properties in the buffer and the bug
> still occurs. In my case the TO parameter is nil.

Sorry about the bug.

Can you please provide a recipe to reproduce the problem in
"emacs -Q"?  Otherwise I'm afraid it's hard for me to know where to
look for the problem.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#30796: 27.0.50; window-text-pixel-size returns wrong values

Eli Zaretskii
> From: Sebastien Chapuis <[hidden email]>
> Date: Tue, 13 Mar 2018 23:36:59 +0000
>
> This code reproduces the issue:
>
> (let* ((buffer (with-current-buffer (get-buffer-create "*test-window*")
>                  (erase-buffer)
>                  (insert "hellooooooooo\na\nb\n")
>                  (goto-char 1)
>                  (setq mode-line-format nil)
>                  (current-buffer)))
>        (window (display-buffer-in-child-frame
>                 buffer
>                 `((child-frame-parameters . ((left . 10)
>                                              (no-accept-focus . t)
>                                              (no-focus-on-map . t)
>                                              (min-width  . 0)
>                                              (width  . 0)
>                                              (min-height  . 0)
>                                              (height  . 0)
>                                              (internal-border-width . 1)
>                                              (vertical-scroll-bars . nil)
>                                              (horizontal-scroll-bars . nil)
>                                              (left-fringe . 0)
>                                              (right-fringe . 0)
>                                              (menu-bar-lines . 0)
>                                              (tool-bar-lines . 0)
>                                              (line-spacing . 0)
>                                              (unsplittable . t)
>                                              (undecorated . t)
>                                              (top . 10)
>                                              (visibility . nil)
>                                              (mouse-wheel-frame . nil)
>                                              (no-other-frame . t)
>                                              (cursor-type . nil)
>                                              (inhibit-double-buffering . t)
>                                              (drag-internal-border . t)
>                                              (no-special-glyphs . t)
>                                              (default-minibuffer-frame . ,(selected-frame))
>                                              (minibuffer . ,(minibuffer-window))
>                                              (background-color . "red")
>                                              )))))
>        (frame (window-frame window))
>        (size (window-text-pixel-size window nil nil 10000 10000)))
>   (set-frame-size frame (car size) (cdr size) t)
>   size)

Thanks, this should be already fixed on master.  I found yesterday a
stupid omission in my original commit and fixed it.



Reply | Threaded
Open this post in threaded view
|

bug#30796: 27.0.50; window-text-pixel-size returns wrong values

Eli Zaretskii
> From: Sebastien Chapuis <[hidden email]>
> Date: Thu, 15 Mar 2018 11:09:46 +0000
>
> Alright thank you !

So I'm closing the bug report.