jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.17k stars 316 forks source link

Cannot focus a window (openbox) #184

Open singpolyma opened 7 years ago

singpolyma commented 7 years ago

Running this:

./xdotool search --all --limit 1 --class firefox windowactivate

Gives me:

XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)

Trying:

./xdotool search --all --limit 1 --class firefox windowfocus

Gives me:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  42 (X_SetInputFocus)
  Serial number of failed request:  112
  Current serial number in output stream:  114
singpolyma commented 7 years ago

Hmm, it seems that

./xdotool search --all --limit 1 --class firefox

Emits a decimal number. Feeding that decimal number to windowactivate gives the same error. BUT if I use xwininfo on the Firefox window I get a different (hex) number... and not the hex conversion of what the search returned either. But feeding that to windowactivate seems to work...

FascinatedBox commented 3 years ago

@singpolyma Your search is probably picking up one of firefox's invisible helper windows. Try adding --onlyvisible to your search criteria.