company-box icon indicating copy to clipboard operation
company-box copied to clipboard

Massive scroll bar

Open ar1a opened this issue 7 years ago • 23 comments

Picture

Not sure how to reproduce though

ar1a avatar Jul 05 '18 23:07 ar1a

Another image from someone else

ar1a avatar Jul 06 '18 06:07 ar1a

I have exactly same problem. I was unable to reproduce it in more vanilla emacs config, but changing this line https://github.com/sebastiencs/company-box/blob/6e047e6fd7226a1b8292a74985db82bbccc679c7/company-box.el#L580 to this

          '((side . right) (window-width . 0.1)))))

sets width of scrollbar reliably to 32 pixels. I can live with that.

AloisJanicek avatar Jul 06 '18 09:07 AloisJanicek

same issue here, @AloisJanicek changing "side window-width" to 0.1 doesn't help, but it seems harder to reproduce with 0.1 width. Now I totally remove the scrollbar...

smallzhan avatar May 16 '19 04:05 smallzhan

same issue here, @AloisJanicek changing "side window-width" to 0.1 doesn't help, but it seems harder to reproduce with 0.1 width. Now I totally remove the scrollbar...

How do you fully disable the scrollbar? Can you show the hack code? @smallzhan

forrestchang avatar May 16 '19 09:05 forrestchang

@forrestchang please refer to the gist here https://gist.github.com/smallzhan/4f8a558790133d269d5658ea85d50bf1

detailed modification:
in line 535, set the scrollbar width to 0 in fuction "company-box--update-width", then delete all the lines of calling to the function "company-box--update-scrollbar"

smallzhan avatar May 17 '19 14:05 smallzhan

I still have the scrollbar whereas I copied @smallzhan's gist company-box

I use doom and I replaced company-box.el in ~/.emacs.d/.local/packages/elpa/company-box-xxxxx/

My info:

  • OS: darwin (x86_64-apple-darwin18.2.0)
  • Emacs: 26.2 (Apr 29, 2019)
  • Doom: 2.0.9 (HEAD -> develop, _upgrade/develop febeed25 2019-05-22 17:11:24 -0400)
  • Graphic display: t (daemon: nil)
  • System features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2
  • Details:
    env bootstrapper: nil
    elc count: 171
    uname -a:  Darwin 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
    

Majenful avatar May 28 '19 08:05 Majenful

@Majenful you should remove the company-box.elc then use the gist code .i tried it ,it will remove the scrollbar. image

glepnir avatar Aug 29 '19 14:08 glepnir

I'm still got this issue. Seem no update on company-box anymore. Is there anyone want to maintain a fork?

stardiviner avatar Nov 01 '19 04:11 stardiviner

For me, setting window-resize-pixelwise to nil (that's the default value) fixed the issue.

geza-herman avatar Jul 12 '20 15:07 geza-herman

I think https://github.com/sebastiencs/company-box/commit/ce8f569f9449f9a1ec1e43ee5f3e5b72cd6b0b04 might fix the issue. If anyone can test

sebastiencs avatar Aug 09 '20 10:08 sebastiencs

https://github.com/sebastiencs/company-box/commit/7c05cfd1cb32f161c7de1efb168b597880500473 might fix that issue too

sebastiencs avatar Aug 25 '20 04:08 sebastiencs

I can confirm that the fix doesn't work for me. I also tried disabling golden-ratio-mode and when opening a company-box buffer I still see the issue.

graphcareful avatar Sep 16 '20 16:09 graphcareful

@graphcareful Can you please share some information about your configuration. Which OS are you using, window manager ? How did you configure company-box ? Is your .emacs.d public by any chance ?

sebastiencs avatar Sep 16 '20 18:09 sebastiencs

Hi , I am using spacemacs, on Fedora 32, default window manager gnome3. I am configuring company-box like this: (auto-completion :variables auto-completion-use-company-box t)

I am not sure how company-* and autocomplete-* are supposed to work together. At first I suspected maybe two packages had conflicting configurations, but then I came here and noticed others having the same exact problem. I will try to replicate with a base spacemacs configuration.

graphcareful avatar Sep 16 '20 19:09 graphcareful

@graphcareful I just installed spacemacs to test, the only modification I made is:

.spacemacs | 3 ++-
modified   .spacemacs
@@ -37,6 +37,7 @@ values."
      ;; <M-m f e R> (Emacs style) to install them.
      ;; ----------------------------------------------------------------
      helm
+     (auto-completion :variables auto-completion-use-company-box t)
      ;; auto-completion
      ;; better-defaults
      emacs-lisp
@@ -54,7 +55,7 @@ values."
    ;; wrapped in a layer. If you need some configuration for these
    ;; packages, then consider creating a layer. You can also put the
    ;; configuration in `dotspacemacs/user-config'.
-   dotspacemacs-additional-packages '()
+   dotspacemacs-additional-packages '(company-box)
    ;; A list of packages that cannot be updated.
    dotspacemacs-frozen-packages '()
    ;; A list of packages that will not be installed and loaded.

I then ran [M-x] company-box, and the scrollbar is correct:

image

So there is a package or customization that cause this issue. If you could try to disable some package/customization made to find the culprit, that would be great

sebastiencs avatar Sep 16 '20 20:09 sebastiencs

@graphcareful Can you please set company-box-debug-scrollbar to t, use company-box and post the logs in the *messages* buffer

(setq company-box-debug-scrollbar t)

sebastiencs avatar Sep 16 '20 21:09 sebastiencs

You beat me to it :) was about to do the same thing. Yes, i'll try to find the offending package and paste the logs when I find.

graphcareful avatar Sep 16 '20 21:09 graphcareful

So I tried to emulate your exact settings and I am still seeing the issue.

Screenshot from 2020-09-16 18-28-05

try scrolling down with page down when there are many items to replicate.

Here are some of the logs you requested. They appeared when I am seeing the issue:

`[SCROLL] SELECTION=0 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.0 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=0.0 HEIGHT-BLANK=0.0 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [2 times] [CHANGES] CURRENT-BUFFER= company-box-27263302-scrollbar MIN-WIDTH=2 SAFE-MIN-WIDTH=2 MIN-SIZE=2 MIN-SIZE-IGNORE=2 [CHANGES] MIN CURRENT-SIZE=2 WIN-MIN-SIZE=2 WIN-PARAMS=((quit-restore window window #<window 12 on company-box-27263302> company-box-27263302-scrollbar) (window-slot . 0) (window-side . right)) FRAME-PARAMS=((parent-id . 27263302) (explicit-name . t) (display . :0) (icon-name) (outer-window-id . 27264557) (window-id . 27264561) (top . 527) (left . 8) (buried-buffer-list) (buffer-list .spacemacs) (unsplittable) (modeline . t) (width . 38) (user-size . t) (user-position . t) (name . ) (desktop-dont-save . t) (cursor-color . SkyBlue2) (background-mode . dark) (display-type . color) (default-minibuffer-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (drag-internal-border . t) (no-other-frame . t) (mouse-wheel-frame) (z-group) (skip-taskbar) (visibility . t) (fullscreen) (no-accept-focus . t) (no-focus-on-map . t) (alpha) (scroll-bar-height . 16) (scroll-bar-width . 16) (cursor-type) (auto-lower) (auto-raise) (icon-type . t) (inhibit-double-buffering) (tool-bar-position . top) (wait-for-wm . t) (title) (buffer-predicate . spacemacs/useful-buffer-p) (tool-bar-lines . 0) (height . 10) (tab-bar-lines . 0) (menu-bar-lines . 0) (min-height . 0) (min-width . 0) (scroll-bar-background) (scroll-bar-foreground) (no-special-glyphs . t) (right-fringe . 0) (left-fringe . 0) (line-spacing . 0) (screen-gamma) (border-color . black) (mouse-color . black) (background-color . #34323e) (foreground-color . #b2b2b2) (horizontal-scroll-bars) (vertical-scroll-bars) (bottom-divider-width . 0) (right-divider-width . 0) (internal-border-width . 1) (border-width . 0) (font . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-parameter . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-backend ftcrhb x) (override-redirect) (undecorated . t) (parent-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (minibuffer . #<window 4 on Minibuf-0>)) HOOKS=(evil--jumps-window-configuration-hook t company-box--scrollbar-prevent-changes) [SCROLL] SELECTION=0 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.0 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=0.0 HEIGHT-BLANK=0.0 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661

[SCROLL] SELECTION=10 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.030120481927710843 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=4.96671370165346 HEIGHT-BLANK=0.2921596295090271 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [SCROLL] SELECTION=20 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.060240963855421686 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=9.93342740330692 HEIGHT-BLANK=0.5843192590180541 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [CHANGES] CURRENT-BUFFER= company-box-27263302-scrollbar MIN-WIDTH=2 SAFE-MIN-WIDTH=2 MIN-SIZE=2 MIN-SIZE-IGNORE=2 [CHANGES] MIN CURRENT-SIZE=3 WIN-MIN-SIZE=2 WIN-PARAMS=((quit-restore window window #<window 12 on company-box-27263302> company-box-27263302-scrollbar) (window-slot . 0) (window-side . right)) FRAME-PARAMS=((parent-id . 27263302) (explicit-name . t) (display . :0) (icon-name) (outer-window-id . 27264557) (window-id . 27264561) (top . 527) (left . 8) (buried-buffer-list) (buffer-list .spacemacs) (unsplittable) (modeline . t) (width . 55) (user-size . t) (user-position . t) (name . ) (desktop-dont-save . t) (cursor-color . SkyBlue2) (background-mode . dark) (display-type . color) (default-minibuffer-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (drag-internal-border . t) (no-other-frame . t) (mouse-wheel-frame) (z-group) (skip-taskbar) (visibility . t) (fullscreen) (no-accept-focus . t) (no-focus-on-map . t) (alpha) (scroll-bar-height . 16) (scroll-bar-width . 16) (cursor-type) (auto-lower) (auto-raise) (icon-type . t) (inhibit-double-buffering) (tool-bar-position . top) (wait-for-wm . t) (title) (buffer-predicate . spacemacs/useful-buffer-p) (tool-bar-lines . 0) (height . 10) (tab-bar-lines . 0) (menu-bar-lines . 0) (min-height . 0) (min-width . 0) (scroll-bar-background) (scroll-bar-foreground) (no-special-glyphs . t) (right-fringe . 0) (left-fringe . 0) (line-spacing . 0) (screen-gamma) (border-color . black) (mouse-color . black) (background-color . #34323e) (foreground-color . #b2b2b2) (horizontal-scroll-bars) (vertical-scroll-bars) (bottom-divider-width . 0) (right-divider-width . 0) (internal-border-width . 1) (border-width . 0) (font . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-parameter . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-backend ftcrhb x) (override-redirect) (undecorated . t) (parent-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (minibuffer . #<window 4 on Minibuf-0>)) HOOKS=(evil--jumps-window-configuration-hook t company-box--scrollbar-prevent-changes) [2 times] [SCROLL] SELECTION=30 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.09036144578313253 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=14.900141104960381 HEIGHT-BLANK=0.8764788885270812 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [CHANGES] CURRENT-BUFFER= company-box-27263302-scrollbar MIN-WIDTH=2 SAFE-MIN-WIDTH=2 MIN-SIZE=2 MIN-SIZE-IGNORE=2 [CHANGES] MIN CURRENT-SIZE=2 WIN-MIN-SIZE=2 WIN-PARAMS=((quit-restore window window #<window 12 on company-box-27263302> company-box-27263302-scrollbar) (window-slot . 0) (window-side . right)) FRAME-PARAMS=((parent-id . 27263302) (explicit-name . t) (display . :0) (icon-name) (outer-window-id . 27264557) (window-id . 27264561) (top . 527) (left . 8) (buried-buffer-list) (buffer-list .spacemacs) (unsplittable) (modeline . t) (width . 50) (user-size . t) (user-position . t) (name . ) (desktop-dont-save . t) (cursor-color . SkyBlue2) (background-mode . dark) (display-type . color) (default-minibuffer-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (drag-internal-border . t) (no-other-frame . t) (mouse-wheel-frame) (z-group) (skip-taskbar) (visibility . t) (fullscreen) (no-accept-focus . t) (no-focus-on-map . t) (alpha) (scroll-bar-height . 16) (scroll-bar-width . 16) (cursor-type) (auto-lower) (auto-raise) (icon-type . t) (inhibit-double-buffering) (tool-bar-position . top) (wait-for-wm . t) (title) (buffer-predicate . spacemacs/useful-buffer-p) (tool-bar-lines . 0) (height . 10) (tab-bar-lines . 0) (menu-bar-lines . 0) (min-height . 0) (min-width . 0) (scroll-bar-background) (scroll-bar-foreground) (no-special-glyphs . t) (right-fringe . 0) (left-fringe . 0) (line-spacing . 0) (screen-gamma) (border-color . black) (mouse-color . black) (background-color . #34323e) (foreground-color . #b2b2b2) (horizontal-scroll-bars) (vertical-scroll-bars) (bottom-divider-width . 0) (right-divider-width . 0) (internal-border-width . 1) (border-width . 0) (font . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-parameter . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-backend ftcrhb x) (override-redirect) (undecorated . t) (parent-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (minibuffer . #<window 4 on Minibuf-0>)) HOOKS=(evil--jumps-window-configuration-hook t company-box--scrollbar-prevent-changes)`

graphcareful avatar Sep 16 '20 22:09 graphcareful

@graphcareful Thanks !

Your issue seems different than the others

  • Does the scrollbar always have a wrong size ? If not, did you notice when it happens (after the frame is resized, when you make the scrollbar moving, ...)
  • When it has a wrong size, does it always have the same wrong size ? (width)
  • I see that the documentation frame is on top of the frame with candidates, is that always the case ?
  • Since the doc frame hides part of the other frame, I can't see the width of the scrollbar (the purple horizontal bar), does it go until the very end of the frame ? Could you post another screenshot with the scrollbar fully visible. A video/gif would be great
  • How did you install emacs ? With dnf or you compiled it. If compiled, what branch and commit are you on, and which flags did you use

The logs you shared seem correct so we probably need to dig a bit more

sebastiencs avatar Sep 17 '20 15:09 sebastiencs

In this stripped down config that only has autocomplete-mode and company-box installed...

  • The scrollbar size changes as I scroll down. Initially it always starts with the correct size. Eventually as I scroll down it becomes wider and changes, sometimes disappearing then reappearing with a different size, sometimes it just changes from wide to even wider, then back again.
  • Nope it changes like I described above
  • The doc frame seems to be always at the same y position however sometimes it appears further off to the right leaving a space between the end of the frame and the beginning of the docframe
  • Ok!
  • I compile emacs from scratch using the feature/nativecomp branch, I am currently on or near the tip of the master branch. I have a crude script that does it for me here: https://github.com/graphcareful/reimage/blob/master/scripts/install_emacs.bash#L72

Screencast from 09-18-2020 06_09_41 PM2

graphcareful avatar Sep 18 '20 22:09 graphcareful

@graphcareful Thank you for the detailed answer.

It looks like to be an emacs bugs, or an issue with your window manager and/or compositor: The frame is always keeping the same width, it should change. The frame for the documentation has a position which depends on the candidates frame width. The doc position is correct, so internally emacs has the correct width, but it doesn't update the display for the candidates frame.

Can you try to set company-box-debug-scrollbar to t with https://github.com/sebastiencs/company-box/commit/97475e4a989bfc52cdc1e4f86e5abf34c77b18be The logs will confirm if it's an emacs bug.

https://github.com/sebastiencs/company-box/commit/2c35a725682442034f9d180d1f543c508cab3fb4 might fix your issue, but I don't put much hope on it.

I tried the branch feature/nativecomp but I failed to used it with spacemacs, getting lots of errors like https://github.com/syl20bnr/spacemacs/issues/13957 Could you try on the master branch, without --with-nativecomp ?

sebastiencs avatar Sep 20 '20 16:09 sebastiencs

@sebastiencs ok i'll try without nativecomp as well

graphcareful avatar Sep 21 '20 15:09 graphcareful

For me it's the same issue as described here https://github.com/tumashu/company-posframe/issues/2. Setting x-gtk-resize-child-frames to 'hide or 'resize-mode fixes the issue.

akermu avatar Nov 16 '20 23:11 akermu