I use Ubuntu 14.04 on my laptop at my desk with a second monitor. When I disconnect from the second monitor---without fail---my window for Emacs moves off screen.
I can Alt-TAB to make Emacs the active window, and, working blindly, stop Emacs so I can restart it, which causes it to reappear on the screen. But, it seems to me there should be a way in Ubuntu to get an off-screen window back onto the screen. Is there?
Of course, a better solution would be to prevent the windows from going off screen in response to monitor disconnection, and I would accept a solution to that problem.
UPDATE:
The output of xrandr
while connected to a second monitor:
Screen 0: minimum 320 x 200, current 3200 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+1280+0 (normal left inverted right x axis y axis) 382mm x 215mm
1920x1080 60.0*+ 59.9
1680x1050 60.0 59.9
1600x1024 60.2
1400x1050 60.0
1280x1024 60.0
1440x900 59.9
1280x960 60.0
1360x768 59.8 60.0
1152x864 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
1280x1024 60.0*+ 75.0
1280x960 60.0
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 75.0 72.8 66.7 60.0
720x400 70.1
HDMI1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
The output of xrandr
after disconnecting from the second monitor:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 382mm x 215mm
1920x1080 60.0*+ 59.9
1680x1050 60.0 59.9
1600x1024 60.2
1400x1050 60.0
1280x1024 60.0
1440x900 59.9
1280x960 60.0
1360x768 59.8 60.0
1152x864 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
Also, I tried swapping the left-right positions of my Terminal window and my Emacs window and then disconnecting. This allows the Emacs window to remain on-screen after disconnecting from the second monitor. And the Terminal window survives in the position that eliminated Emacs. So, it seems as if the application has something to do with this.