Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not dimming in certain cases #22

Closed
haji-ali opened this issue Jul 3, 2020 · 2 comments
Closed

Not dimming in certain cases #22

haji-ali opened this issue Jul 3, 2020 · 2 comments

Comments

@haji-ali
Copy link

haji-ali commented Jul 3, 2020

I have the following code to enable auto-dim-other-buffers

(add-hook 'after-init-hook (lambda ()
  (when (fboundp 'auto-dim-other-buffers-mode)
    (auto-dim-other-buffers-mode t))))

(set-face-attribute 'auto-dim-other-buffers-face nil :background "#111111")

I noticed two cases where the inactive windows are not dimmed (assume my Emacs has two open windows):

  • When Emacs loses focus, both windows are dimmed, but when I return to Emacs none of the windows is dimmed until I call other-window.
  • If I have two open windows Win1 and Win2. Start with focus in Win1, then call, for example, decribe-variable to describe some variable. Win2 then shows the variable description and is focused while Win1 is correctly dimmed. However, if I kill the buffer by pressing q then the focus returns to Win1 but Win2 is not dimmed.

I am running Emacs 26.3 and version 2.0.1 of auto-dim-other-buffers.

mina86 added a commit that referenced this issue Jul 4, 2020
When a buffer is killed or buried at the same time as when window is
changed, the buffer shown in the previously selected window may remain
undimmed in Emacs prior to version 27.

For example, having two windows run ‘M-x describe-function RET defun
RET’ (which will show help in one of the windows), navigate to the
window showing *Help* buffer and quit the help by pressing ‘q’.  This
will select the other window and leave the new buffer in the remaining
window won’t be dimmed.

This happens because when we update state of buffers, we undim the
newly selected buffer and dim the old buffer.  Unfortunately, the old
buffer is no longer the one shown in the old window so that latter
operation doesn’t do anything useful.

Change the code to keep track of the last window (just like it keeps
track of last buffer) even outside of adow-mode.  With that new
information, whenever window changes, make sure that whatever is
displayed in the old window is dimmed.

Issue: #22
@mina86
Copy link
Owner

mina86 commented Jul 4, 2020

The second issue should now be resolved with the 2.0.2 which I’ve just pushed.

The first issue, however, I am unable to reproduce. Does it always happen?
This may be related to focus management fixes which I don’t believe made it to 26.3 but are only included in 27.

@haji-ali
Copy link
Author

haji-ali commented Jul 4, 2020

I just pulled and the second issue seems fixed. Thanks!

For the first issue, it is pretty consistent on my setup. I will update to Emacs 27 to check if it persists.

EDIT: Just checked Emacs 27 and it seems to be working there.

@haji-ali haji-ali closed this as completed Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants