black7375/BlaCk-Void-Zsh

XGetInputFocus returned the focused window of 1. This is likely a bug in the X server.

whitehander opened this issue · 9 comments

Hi, I appreciate your work.
I using iMac at home and Macbook pro at office.
Both of MacOS version is Catalina.
On iMac, it works. But on a MacBook, below error occurs from every command.
And XQuartz app is showing on Dock.
Could you like to help me?

XGetInputFocus returned the focused window of 1. This is likely a bug in the X server.
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x1
  Serial number of failed request:  20
  Current serial number in output stream:  20

It seems to be a problem with xdotool.

I'm sorry but I'm busy right now.. 😂
I will check it next week.

First of all, the error seems to occur here.
https://github.com/jordansissel/xdotool/blob/a7903d0fdad57e12209b77d9126587a6f9aa87dc/xdo.c#L1137

Are the following packages installed correctly?

  • xquartz, wmctrl, xdotool

If not, install it with the following command:

brew cask install xquartz
brew install wmctrl xdotool

If they are installed, can you execute the following command?

  • xdotool getactivewindow getwindowname

Then tell me the results.


If this doesn't work, the problem is a bit complicated because it's different from the outside or the environment. So it can be hard to fix early.
The temporarily workaround is to disable the notification feature.

Comment out the following line:

zplugin ice wait"2" atload"_zsh-notify-setting" lucid
zplugin light marzocchi/zsh-notify

zplugin ice wait"2" atload"_zsh-notify-setting" lucid

Thanks for your kind answer.

After reinstall xquartz, wmctrl, xdotool, change error messages.
And XQuartz app was not showing.

Here are that error messages.

~/Pictures ❯ xdotool getactivewindow getwindowname
Error: Can't open display: (null)
Failed creating new xdo instance
Error: Can't open display: (null)
Failed creating new xdo instance
zsh-notify: Error: Can't open display: (null)                                                                                
zsh-notify: Failed creating new xdo instance

As far as I know, the general solution is this:

export DISPLAY=':0.0'
export XAUTHORITY=~/.Xauthority

(Add to ~/.zshrc && restart terminal)

If that doesn't work, let's find another solution.

Already tried that solution, but still showing.

Can't open display: (null)

So, I just disabled zsh-notify plugin that you said.

Thank you.