Giter Site home page Giter Site logo

Comments (18)

jiegec avatar jiegec commented on August 23, 2024 1

Still doesn't work here. The small snippet you proposed works well.

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024 1

With Alan Third's patch, I can confirm that his patch fixes it for me.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29953#8

from lsp-ui.

sebastiencs avatar sebastiencs commented on August 23, 2024

@jiegec I don't have a mac sorry.
How does your snippet look like ? Maybe I can help you to narrow it

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

I selectively C-M-x on some of the forms below, but can't reproduce the bug.

(defvar test-child-frame)

(let* ((params `((visibility . nil)
                 (minibuffer . ,(minibuffer-window))
                 (internal-border-width . 10)
                 (vertical-scroll-bars . nil)
                 (horizontal-scroll-bars . nil)
                 (left-fringe . 0)
                 (right-fringe . 0)
                 (menu-bar-lines . 0)
                 (tool-bar-lines . 0)
                 (min-width  . 0)
                 (width  . 0)
                 (min-height  . 0)
                 (height  . 0)
                 (line-spacing . 0)
                 (unsplittable . t)
                 (undecorated . t)
                 (left . -1)
                 (top . -1)
                 (no-accept-focus . t)
                 (no-special-glyphs . t)
                 (cursor-type . nil)
                 (default-minibuffer-frame . ,(selected-frame))))
       (child-frame (window-frame
                     (display-buffer-in-child-frame
                      (get-buffer-create "*test*")
                      `((child-frame-parameters . ,params))))))
  (setq test-child-frame child-frame))
(set-frame-parameter test-child-frame 'height 50)
(set-frame-parameter test-child-frame 'width 50)
(make-frame-visible test-child-frame)
(set-frame-parameter test-child-frame 'alpha '(85 . 50))
(delete-frame test-child-frame)

(make-thread (lambda ()
               (make-frame-invisible test-child-frame)))

(make-frame-visible test-child-frame)

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

What the hell:
image

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

One more snapshot:
image

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

The frame parameter after disappearing:

((tool-bar-position . top)
 (parent-id)
 (explicit-name)
 (display . "localhost")
 (visibility . t)
 (icon-name)
 (window-id . "20")
 (bottom-divider-width . 0)
 (right-divider-width . 0)
 (top . 372)
 (left + -694)
 (buried-buffer-list)
 (buffer-list #<buffer *lsp-ui-doc-13*>)
 (unsplittable . t)
 (modeline . t)
 (width . 53)
 (height . 24)
 (name . "*lsp-ui-doc-13*")
 (client . nowait)
 (cursor-color . "#839496")
 (background-mode . dark)
 (display-type . color)
 (default-minibuffer-frame . #<frame  *Minibuf-1* 0x1090b2d30>)
 (no-other-frame . t)
 (mouse-wheel-frame)
 (fullscreen)
 (alpha)
 (scroll-bar-height . 0)
 (scroll-bar-width . 0)
 (cursor-type)
 (auto-lower)
 (auto-raise)
 (icon-type)
 (title)
 (buffer-predicate)
 (tool-bar-lines . 0)
 (menu-bar-lines . 0)
 (no-accept-focus . t)
 (no-focus-on-map)
 (z-group)
 (parent-frame . #<frame  *Minibuf-1* 0x1090b2d30>)
 (ns-transparent-titlebar . unbound)
 (ns-appearance . unbound)
 (undecorated . t)
 (min-height . 0)
 (min-width . 0)
 (no-special-glyphs . t)
 (right-fringe . 0)
 (left-fringe . 0)
 (line-spacing . 0)
 (background-color . "#031A25")
 (foreground-color . "#839496")
 (horizontal-scroll-bars)
 (vertical-scroll-bars)
 (internal-border-width . 10)
 (border-width . 0)
 (font .
       "-*-Inconsolata for Powerline-normal-normal-normal-*-22-*-*-*-m-0-iso10646-1")
 (fontsize . 0)
 (font-backend mac-ct)
 (minibuffer . #<window 35 on  *Minibuf-0*>))

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

The top and left parameters somehow get corrupted, and setting them to zero has no effect.

from lsp-ui.

sebastiencs avatar sebastiencs commented on August 23, 2024

A child frame can't be outside of it's parent frame, otherwise it's not a child frame but a "normal" frame.
The bug appears only after a call to make-frame-invisible ?
Can you execute this function:

(defun test-child-frame-visible ()
  (interactive)
  (let* ((window (display-buffer-in-child-frame (get-buffer-create "test")
                                                '((child-frame-parameters . ((left . -10)
                                                                             (no-accept-focus . t)
                                                                             (width  . 50)
                                                                             (height  . 10)
                                                                             (vertical-scroll-bars . nil)
                                                                             (horizontal-scroll-bars . nil)
                                                                             (left-fringe . 0)
                                                                             (right-fringe . 0)
                                                                             (menu-bar-lines . 0)
                                                                             (tool-bar-lines . 0)
                                                                             (unsplittable . t)
                                                                             (undecorated . t)
                                                                             (background-color . "red")
                                                                             (top . 10)
                                                                             (visibility . nil)
                                                                             (mouse-wheel-frame . nil)
                                                                             (no-other-frame . t))))))
         (frame (window-frame window))
         (count 0))
    (while (< count 5)
      (if (oddp count)
          (make-frame-invisible frame)
        (make-frame-visible frame))
      (sit-for 1)
      (setq count (1+ count)))
    (delete-frame frame)))

The child frame should pop on the top right of your actual frame (still inside it), be invisible/visible every second at the exact same place.

from lsp-ui.

sebastiencs avatar sebastiencs commented on August 23, 2024

Also, does emacs on mac based on GTK or does it uses another toolkit ?

from lsp-ui.

fuxialexander avatar fuxialexander commented on August 23, 2024

@sebastiencs no it's not based on GTK. It's using Cocoa. I think the implementation detail is somehow different from the GTK one. See GNU manual: NS builds do not clip child frames at the parent frameโ€™s edges, allowing them to be positioned so they do not obscure the parent frame while still being visible themselves.

from lsp-ui.

fuxialexander avatar fuxialexander commented on August 23, 2024

image

It seems not determined by make-frame-invisible as I do see it disappear and appear again periodically. The positioning is bad though.

from lsp-ui.

sebastiencs avatar sebastiencs commented on August 23, 2024

@fuxialexander Thank for you feedback
IIRC there are 2 bugs ? The wrong position and the child frame staying invisible ?
Can you test if the last commit d050b4f fix the position ?

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

OMG I know the problem: if set the position of a invisible frame, the frame gets corrupted.
Should be fixed in pr #30.

Thanks for https://emacs-china.org/t/topic/4662/18

from lsp-ui.

sebastiencs avatar sebastiencs commented on August 23, 2024

If we move/resize the frame after making it visible, it makes a
flickering effect.
So we do it only on systems where the bug is present (os x)

Can you report the bug to bug-gnu-emacs ?

(let* ((window (display-buffer-in-child-frame
                (get-buffer-create "test")
                '((child-frame-parameters . ((left . 10)
                                             (no-accept-focus . t)
                                             (width  . 50)
                                             (height  . 10)
                                             (vertical-scroll-bars . nil)
                                             (horizontal-scroll-bars . nil)
                                             (left-fringe . 0)
                                             (right-fringe . 0)
                                             (menu-bar-lines . 0)
                                             (tool-bar-lines . 0)
                                             (unsplittable . t)
                                             (undecorated . t)
                                             (background-color . "red")
                                             (top . 10)
                                             (visibility . nil)
                                             (mouse-wheel-frame . nil)
                                             (no-other-frame . t))))))
       (frame (window-frame window))
       (count 0))
  (while (< count 5)
    (if (oddp count)
        (make-frame-invisible frame)
      (set-frame-parameter frame 'left (+ 10 (* count 100)))
      (set-frame-parameter frame 'top (+ 10 (* count 100)))
      (make-frame-visible frame))
    (sit-for 1)
    (setq count (1+ count)))
  (delete-frame frame))

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

Thanks, with this snippet, I can always reproduce the bug.

Just reported it to bug-gnu-emacs as BUG #29953. Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29953

from lsp-ui.

sebastiencs avatar sebastiencs commented on August 23, 2024

@jiegec So can I revert 651f935 and b6523db ?

from lsp-ui.

jiegec avatar jiegec commented on August 23, 2024

Yes, those are no longer needed with a upstream Emacs. Thank you.

from lsp-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.