black7375 / BlaCk-Void-Zsh

🔮 Awesome, Customable Zsh Starter Kit 🌠🌠
MIT License
338 stars 38 forks source link

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

Closed whitehander closed 4 years ago

whitehander commented 4 years ago

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
black7375 commented 4 years ago

It seems to be a problem with xdotool.

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

black7375 commented 4 years ago

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?

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?

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

https://github.com/black7375/BlaCk-Void-Zsh/blob/01380450ac3756afedcd78629e1324447d408507/BlaCk-Void.zshrc#L214

whitehander commented 4 years ago

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
black7375 commented 4 years ago

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.

whitehander commented 4 years ago

Already tried that solution, but still showing.

Can't open display: (null)

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

Thank you.

ygm521 commented 6 months ago

The resolution of this issue??? image

black7375 commented 6 months ago

@whitehander How about disabling marzocchi/zsh-notify?

whitehander commented 6 months ago

Hello! @black7375 😀 It's been a while! I used to write a lot, but I haven't been doing it lately. I can't remember much, but it seems like things were going well back then.

black7375 commented 6 months ago

Thanks!!


@ygm521 Consider disabling marzocchi/zsh-notify. If you're still having trouble afterward, I'll open a new issue.