0

Somehow, I managed to crash my window manager, dwm. Upon restarting dwm (within the same X session), over half of the 90+ windows I had open vanished. lsw reflects what dwm is showing (i.e. half of the 90+ windows are missing), so dwm isn't hiding anything. However, the processes that manage those windows still exist, according to ps. ps shows zero stopped processes and the missing windows aren't showing a zombie status (they are showing S and S+).

Is there any way to "reattach" these processes to the X server so that I can get my windows back? Normally, this is where I would show what I have tried, but I have literally no idea how such a thing would be done, and Google comes up with nothing except windows going off-screen on OS X.

To reiterate, what I want to do is take the still-running GUI processes and get them back on the X server (display :1) so that I can save my work. Is this even possible?

Update 1

Here is the output of lsw, xlsclients and xwininfo -tree -root:

$ lsw
0x0600001 braden@braden-Leopard-WS: ~
0xa800041 Edit - Unix & Linux Stack Exchange - Chromium
0x2200001 [No Name] + - VIM
0xa80142c New Tab - Chromium
0xa800078 New Tab - Chromium
0xa80144e New Tab - Chromium
0x7000001 [No Name] + - VIM
0xa80138b New Tab - Chromium

$ xlsclients
braden-Leopard-WS  gnome-screensaver
braden-Leopard-WS  kded4
braden-Leopard-WS  kded4
braden-Leopard-WS  /usr/bin/kglobalaccel
braden-Leopard-WS  /usr/bin/kglobalaccel
braden-Leopard-WS  /usr/bin/knotify4
braden-Leopard-WS  /usr/bin/knotify4
braden-Leopard-WS  chromium-browser
braden-Leopard-WS  notify-osd

$ xwininfo -tree -root
xwininfo: Window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.04 | T 14:31:16"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.04 | T 14:31:16"
  Parent window id: 0x0 (none)
     38 children:
     0x600001 "braden@braden-Leopard-WS: ~": ("xterm-256color" "xterm-256color")  1138x1040+1071+248  +1071+248
     0xa800048 (has no name): ()  60x26+470+153  +470+153
     0xa80142e (has no name): ()  147x26+1056+66  +1056+66
     0xa80007a (has no name): ()  156x26+1275+356  +1275+356
     0x40000e (has no name): ()  1920x22+0+-22  +0+-22
     0x40000d (has no name): ()  1920x22+0+0  +0+0
     0xa800041 "Edit - Unix & Linux Stack Exchange - Chromium": ("chromium-browser" "Chromium-browser")  1912x1050+0+22  +0+22
     0x2200001 "[No Name] + - VIM": ("xterm-256color" "xterm-256color")  1912x1050+-3840+22  +-3840+22
     0xa80142c "New Tab - Chromium": ("chromium-browser" "Chromium-browser")  1144x1050+-2304+22  +-2304+22
     0xa800078 "New Tab - Chromium": ("chromium-browser" "Chromium-browser")  760x256+-1536+286  +-1536+286
     0xa80144e "New Tab - Chromium": ("chromium-browser" "Chromium-browser")  760x257+-1536+550  +-1536+550
     0x7000001 "[No Name] + - VIM": ("xterm-256color" "xterm-256color")  760x257+-1536+815  +-1536+815
     0xa80138b "New Tab - Chromium": ("chromium-browser" "Chromium-browser")  760x256+-1536+22  +-1536+22
     0x2600001 "VIM": ("VIM" "Vim_xterm")  1x1+0+0  +0+0
     0x1800008 (has no name): ()  1x1+-1+-1  +-1+-1
     0x1800001 "notify-osd": ("notify-osd" "Notify-osd")  10x10+10+10  +10+10
     0xa801454 (has no name): ()  409x215+1006+773  +1006+773
     0x9a00001 "VIM": ("VIM" "Vim_xterm")  1x1+0+0  +0+0
     0x980000f (has no name): ()  1x1+-1+-1  +-1+-1
     0xa80138d (has no name): ()  140x26+707+837  +707+837
     0x9800002 "chromium-browser": ()  10x10+-100+-100  +-100+-100
     0xa800015 "Chromium clipboard": ()  10x10+-100+-100  +-100+-100
     0xb000001 (has no name): ()  1x1+0+0  +0+0
     0xa800005 (has no name): ()  1x1+0+0  +0+0
     0x9800001 "chromium-browser": ("chromium-browser" "Chromium-browser")  10x10+10+10  +10+10
     0x920000a "knotify4": ("knotify4" "Knotify4")  960x432+0+0  +0+0
     0x9200004 (has no name): ()  1x1+0+0  +0+0
     0x9200002 "knotify4": ("knotify4" "Knotify4")  960x432+0+0  +0+0
     0x8e00001 (has no name): ()  1x1+0+0  +0+0
     0x900000a "kglobalaccel": ("kglobalaccel" "Kglobalaccel")  960x432+0+0  +0+0
     0x9000004 (has no name): ()  1x1+0+0  +0+0
     0x9000002 "kglobalaccel": ("kglobalaccel" "Kglobalaccel")  960x432+0+0  +0+0
     0x840000a "kded4": ("kded4" "Kded4")  960x432+0+0  +0+0
     0x8400004 (has no name): ()  1x1+0+0  +0+0
     0x8400002 "kded4": ("kded4" "Kded4")  960x432+0+0  +0+0
     0x1000002 "gnome-screensaver": ()  10x10+-100+-100  +-100+-100
     0x1000001 "gnome-screensaver": ("gnome-screensaver" "Gnome-screensaver")  10x10+10+10  +10+10
     0x800001 (has no name): ()  10x10+-20+-20  +-20+-20

$ xwininfo -tree -root | grep "has no name"
     0xa800048 (has no name): ()  60x26+470+153  +470+153
     0xa80142e (has no name): ()  147x26+1056+66  +1056+66
     0xa80007a (has no name): ()  156x26+1275+356  +1275+356
     0x40000e (has no name): ()  1920x22+0+-22  +0+-22
     0x40000d (has no name): ()  1920x22+0+0  +0+0
     0x1800008 (has no name): ()  1x1+-1+-1  +-1+-1
     0xa801454 (has no name): ()  409x215+1006+773  +1006+773
     0x980000f (has no name): ()  1x1+-1+-1  +-1+-1
     0xa80138d (has no name): ()  140x26+707+837  +707+837
     0xb000001 (has no name): ()  1x1+0+0  +0+0
     0xa800005 (has no name): ()  1x1+0+0  +0+0
     0x9200004 (has no name): ()  1x1+0+0  +0+0
     0x8e00001 (has no name): ()  1x1+0+0  +0+0
     0x9000004 (has no name): ()  1x1+0+0  +0+0
     0x8400004 (has no name): ()  1x1+0+0  +0+0
     0x800001 (has no name): ()  10x10+-20+-20  +-20+-20

The number of "has no name" windows seems to be roughly equivalent to the number of windows I lost, so I'm pretty sure these are them. Now: how to reattach these to the server. That is the real question.

Update 2

Here is the output of xwininfo for every child of root:

$ xwininfo -tree -root | egrep "^ +0x" | while read line; do xwininfo -tree -id $(echo $line | awk '{print $1}'); done
xwininfo: Window id: 0xa800048 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xc0000c (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xc00002 "Terminal"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xc00001 "Terminal"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xa80142e (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xa80007a (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x40000e (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x40000d (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xa800041 "Edit - Unix & Linux Stack Exchange - Chromium"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x600001 "braden@braden-Leopard-WS: ~"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xc00006 "Terminal"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     1 child:
     0xc00007 (has no name): ()  1x1+-1+-1  +-3837+25

xwininfo: Window id: 0xc00007 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0xc00006 "Terminal"
     0 children.

xwininfo: Window id: 0xa80144e "New Tab - Chromium"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xa800078 "New Tab - Chromium"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xa80138b "New Tab - Chromium"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0xa80142c "New Tab - Chromium"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x7000001 "[No Name] + - VIM"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x2200001 "[No Name] + - VIM"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x2600001 "VIM"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x1800008 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:06"
     0 children.

xwininfo: Window id: 0x1800001 "notify-osd"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0xa801454 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9a00001 "VIM"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x980000f (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0xa80138d (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9800002 "chromium-browser"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0xa800015 "Chromium clipboard"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0xb000001 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0xa800005 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9800001 "chromium-browser"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x920000a "knotify4"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9200004 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9200002 "knotify4"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x8e00001 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x900000a "kglobalaccel"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9000004 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x9000002 "kglobalaccel"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x840000a "kded4"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x8400004 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x8400002 "kded4"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x1000002 "gnome-screensaver"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x1000001 "gnome-screensaver"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

xwininfo: Window id: 0x800001 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 09:42:07"
     0 children.

Few of them have children. In fact, only one:

$ ... | grep child: -A 1 -B 4
xwininfo: Window id: 0xc00006 "Terminal"

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 10:02:55"
  Parent window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 10:02:55"
     1 child:
     0xc00007 (has no name): ()  1x1+-1+-1  +-3837+25

$ xwininfo -tree -id 0xc00007
xwininfo: Window id: 0xc00007 (has no name)

  Root window id: 0x1df (the root window) "/:94 . ~:53 . V:11 | D 2017.10.05 | T 10:04:07"
  Parent window id: 0xc00006 "Terminal"
     0 children.

None of this is all that helpful. By using xwininfo without arguments and clicking around, I found out 0xc00006 is a gnome-terminal -e ranger, which I opened after the window loss event.

Further, the other "has no name" windows, the ones with dimensions other than 1x1, the ones that are most likely my lost windows, are direct children of the root window.

Is there any possibility of me getting my windows back?

  • Are the processes with the missing windows still attached to the X server (xlsclients)? Possible the X server has crashed and those processes are in a state where they can't communicate with the X server? What about xwininfo -tree -root, does it find windows not shown in lsw? – dirkt Oct 4 '17 at 10:50
  • I'm getting one or more entries of the following: notify-osd, chromium-browser, knotify, kglobalaccel, kded4, and gnome-screensaver. The missing windows include st terminals, among other things. – Braden Best Oct 4 '17 at 13:58
  • To clarify: All of the missing windows are not listed under xlsclients, and they are not listed in xwininfo -tree -root? If yes, I suspect an X problem - nothing the WM can do about that. – dirkt Oct 4 '17 at 18:37
  • Okay, now we're getting somewhere. I ran xwininfo -tree -root, which I previously hadn't seen, and removed windows accounted for by lsw (and the WM itself), this leaves me with almost 30 processes. Here is a pastebin...pastebin is down. Okay, outside of the irrelevant stuff like knotify4, notify-osd, et al, I'm getting a lot of windows with what I assume to be a null title ((has no name)). So yes, the server is somewhat aware of their existence. A beacon of hope? paste.ee/p/o1b4i – Braden Best Oct 4 '17 at 19:39
  • grep "has no name" is worthless unless you look into the tree and find out what application they belong too. Lots of applications allocate windows (especially those 1x1 sized ones) that they don't necessarily use all the time. Menus, pop-help etc. usually has no name. Once again: Can you find a single application that is visible in ps and which has still windows registered with X, or is listed as an X client? If yes, restarting the WM should pick up this application. If not, there's nothing you can do except restart the application. – dirkt Oct 5 '17 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.