flycheck / flycheck-pos-tip

Flycheck errors display in tooltip
GNU General Public License v3.0
122 stars 10 forks source link

Tool tip appears outside of emacs window #21

Open natsumi opened 7 years ago

natsumi commented 7 years ago

Image illustrates the problem:

tool-tip-pos

The tool tip never appears where the cursor is and instead appears outside of the emacs window at the edge of my monitor screen.

System Info :computer:

swsnr commented 7 years ago

@natsumi Please check whether the issue also occurs in emacs -Q, to rule out that it's a Spacemacs problem.

aguynamedben commented 6 years ago

I also have this problem using Emacs for OS X. I've found that the problem happens when I use ShiftIt and don't subsequently reposition the Emacs window by clicking and dragging it.

General Pattern

  1. Open Emacs.
  2. Move the window manually. flycheck-pos-tip works as expected (tooltip near the text).
  3. Hit a keyboard shortcut to move the window to the top left. flycheck-pos-tip's tooltip is still in the old position.
  4. Drag the Emacs window just a little bit. flycheck-pos-tip appears to get a callback that updates the window position, and the problem is fixed.
  5. Hit a keyboard shortcut to move the window to the bottom right. flycheck-pos-tip's tooltip is still in the old position.
  6. Drag the Emacs window just a little bit. flycheck-pos-tip appears to get a callback that updates the window position, and the problem is fixed.
  7. And so on...

It seems that manually dragging the window updates flycheck-pos-tip.

The painful part is that my Emacs config uses M-x toggle-frame-maximized to fullscreen Emacs. This similarly "magic" repositioning of the window causes the same problem. So I have to barely click and barely drag the window a tiny bit, then the problem is fixed.

It seems that flycheck-pos-tip isn't tuned into macOS "window changed position" callback as good as it could be. Manually repositioning the window updates the tooltip position, but when using keyboard shortcuts or toggle-frame-maximized to reposition Emacs, flycheck-pos-tip doesn't get the updated position, forcing you to manually reposition the window.

Screenshots

Manually drag the window with the mouse... works as expected

image

Manually drag the window with the mouse... works as expected again

image

Throw window to the right using ShiftIt... tooptip now out of position

image

Drag window down a little bit with the mouse... tooltip now back in position

image

Emacs for Mac OS X 25.3 macOS 10.13.5 flycheck-pos-tip 20180610.915 pos-tip 20150318.813

aguynamedben commented 6 years ago

It looks like this uses the pos-tip package... maybe it's a bug in there? More comments here: https://www.emacswiki.org/emacs/PosTip

aguynamedben commented 6 years ago

Oooo I upgraded to Emacs for Mac OS X 26.1 and now it all works as expected! Yay magical bug fix in Emacs 👏