Bug 96654 - windows go off screen after disconnection/reconnection of an external screen.
Summary: windows go off screen after disconnection/reconnection of an external screen.
Status: RESOLVED MOVED
Alias: None
Product: XQuartz
Classification: Unclassified
Component: Other (show other bugs)
Version: 2.7.9 (xserver-1.17.4)
Hardware: Other Mac OS X (All)
: medium normal
Assignee: Jeremy Huddleston Sequoia
QA Contact: Jeremy Huddleston Sequoia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 12:44 UTC by Pascal Bourguignon
Modified: 2019-05-23 18:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Pascal Bourguignon 2016-06-23 12:44:32 UTC
On a MacBook Pro laptop (but I guess it could occur on a desk iMac with an external screen too), with an external screen arranged above the main screen.

- Launch Xquartz
- open the about dialog (move it to the external screen).
- create a xterm window (it opens on the main screen).
- create another xterm window, move it to the external screen.
- unplug the external screen.
--> the two xterm windows are moved to the main screen, as expected.
- plug again the external screen.
--> the two xterm windows disappear, which is bad!
They are still listed in the window menu, but selecting them don't make them re-appear.

Apparently, they move offscreen; Once, with an emacs window, I could type blindly and evaluate set-frame-position expression to move it back on screen.

The about dialog moves correctly to the main screen and back to its original position on the external screen.

[pjb@macbook-trustonic :0.0 ~]$ xwinlist 
0xc0000d "xterm": ("xterm" "XTerm")  1138x927+0+22  +165+22   # newly created
0x80000d "xterm": ("xterm" "XTerm")  484x316+0+22  +94+1102   # disappeared window
0xa0000d "xterm": ("xterm" "XTerm")  484x316+0+22  +0+22      # disappeared window

[pjb@macbook-trustonic :0.0 ~]$ xwininfo -root

xwininfo: Window id: 0x111 (the root window) (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1920
  Height: 2108
  Depth: 24
  Visual: 0x22
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 1920x2108+0+0

[pjb@macbook-trustonic :0.0 ~]$ xwininfo -id 0x80000d

xwininfo: Window id: 0x80000d "xterm"

  Absolute upper-left X:  94
  Absolute upper-left Y:  1102
  Relative upper-left X:  0
  Relative upper-left Y:  22
  Width: 484
  Height: 316
  Depth: 24
  Visual: 0x22
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +94+1102  -1342+1102  -1342-690  +94-690
  -geometry 80x24+94+1080

[pjb@macbook-trustonic :0.0 ~]$ xwininfo -id 0x80000d

xwininfo: Window id: 0x80000d "xterm"

  Absolute upper-left X:  94
  Absolute upper-left Y:  1102
  Relative upper-left X:  0
  Relative upper-left Y:  22
  Width: 484
  Height: 316
  Depth: 24
  Visual: 0x22
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +94+1102  -1342+1102  -1342-690  +94-690
  -geometry 80x24+94+1080

[pjb@macbook-trustonic :0.0 ~]$ xwininfo -id 0xa0000d

xwininfo: Window id: 0xa0000d "xterm"

  Absolute upper-left X:  0
  Absolute upper-left Y:  22
  Relative upper-left X:  0
  Relative upper-left Y:  22
  Width: 484
  Height: 316
  Depth: 24
  Visual: 0x22
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+22  -1436+22  -1436-1770  +0-1770
  -geometry 80x24+0+0
Comment 1 Pascal Bourguignon 2016-06-24 09:08:05 UTC
Probably unrelated, but it would have been nice if it had worked, I cannot move the window from another terminal apparently for lack of the XTEST extension:

$ xdotool windowmove --relative window=0x80000d 0 1000
Warning: XTEST extension unavailable on '(null)'. Some functionality may be disabled; See 'man xdotool' for more info.
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  3 (X_GetWindowAttributes)
  Resource id in failed request:  0x0
  Serial number of failed request:  14
  Current serial number in output stream:  15
[pjb@macbook-trustonic :0.0 THP_WB_SDK-v1.0-beta]$ xwinlist
0x80000d "xterm": ("xterm" "XTerm")  1714x958+0+22  +94+1102
$
Comment 2 Jeremy Huddleston Sequoia 2016-06-24 09:31:31 UTC
(In reply to Pascal Bourguignon from comment #1)
> Probably unrelated, but it would have been nice if it had worked, I cannot
> move the window from another terminal apparently for lack of the XTEST
> extension:
> 
> $ xdotool windowmove --relative window=0x80000d 0 1000
> Warning: XTEST extension unavailable on '(null)'. Some functionality may be
> disabled; See 'man xdotool' for more info.
> X Error of failed request:  BadWindow (invalid Window parameter)
>   Major opcode of failed request:  3 (X_GetWindowAttributes)
>   Resource id in failed request:  0x0
>   Serial number of failed request:  14
>   Current serial number in output stream:  15
> [pjb@macbook-trustonic :0.0 THP_WB_SDK-v1.0-beta]$ xwinlist
> 0x80000d "xterm": ("xterm" "XTerm")  1714x958+0+22  +94+1102
> $


As mentioned in the man page:

       defaults write org.macosforge.xquartz.X11 enable_test_extensions -boolean true
               This option defaults to false and is only accessible through the command line.  Enable this option to turn on  the
               DEC-XTRAP, RECORD, and XTEST extensions in the server.
Comment 3 Pascal Bourguignon 2016-06-24 12:03:13 UTC
I set this default and relaunched XQuartz.
Furthermore, I realized that my syntax was bad.

However using the windowmove --relative command shows that the Y coordinate is always incremented by 44, in addition to the given relative offset:

[pjb@macbook-trustonic :0.0 tmp]$ xwinlist ; for x in 10 -10 20 -20 ; do xdotool windowmove --relative 0x80000d= $x 0 ; xwinlist ; done
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+70
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +36+114
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+158
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +46+202
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+246
[pjb@macbook-trustonic :0.0 tmp]$ xwinlist ; for y in 10 -10 20 -20 ; do xdotool windowmove --relative 0x80000d= 0 $y ; xwinlist ; done
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+246
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+300
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+334
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+398
0x80000d "xterm": ("xterm" "XTerm")  644x388+0+22  +26+422
[pjb@macbook-trustonic :0.0 tmp]$

Playing with xdotool windowmove shows that moving it over to the coordinates of the other screen doesn't make the window switch to the other screen.  We have to manually move the window over to the other screen to then be able to xdotool windowmove it on the other screen.
Comment 4 GitLab Migration User 2019-05-23 18:28:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/749.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.