conformal / spectrwm

A small dynamic tiling window manager for X11.
ISC License
1.34k stars 97 forks source link

Chromium not regaining focus after window with same class closes #384

Closed smhmd closed 1 year ago

smhmd commented 4 years ago

Reproduce:

  1. Open chromium (new tab, for instance.)
  2. Ctrl+s to save webpage.
  3. Close the save dialogue (which has the same window class and instance but not name) through bind[quit] not cancel button.
  4. chromium will not regain focus and will require clicking or search_win to be focused.
masumhabib commented 3 years ago

Hi LordReg,

I was having the same problem and was able to narrow down the problem to commit # 73ad871291aaa51ed6993c9a01e6e8bcf0daee27 -- before this commit, everything was fine.

Also, I was able to reproduce the issue with other programs, e.g., xpdf. Here is how to reproduce:

  1. Open xpdf
  2. Click '?' button, the About window will appear
  3. Click 'Close' button
  4. Focus is changed to window # 1 instead of the last focused window

Hopefully, this helps a bit.

qsmodo commented 3 years ago

@masumhabib It seems that a workaround is to deactivate these four lines in the source:

https://github.com/conformal/spectrwm/blob/f20160fc106d6eb9ac3fc611653b7ef3c61ff00e/spectrwm.c#L11276-L11279

Thus transient windows are no longer handled in a special manner. The side-effect is that dialog windows become tiled, but it's definitely a deal to me while this issue is not solved.