Hi Jon, Thanks for helping! On 2014-05-05 13:03, Jon TURNEY wrote: > On 04/05/2014 06:56, Lukas Haase wrote: >> I use Cygwin/X to display a CAD application on my Windows cient. For >> some reason new windows always open on the secondary display and I >> always need to manually drag them to my primary display. That's sooo >> annoying (since UNIX applications tend to open new windows on every >> action). > > I'm assuming that your secondary display is to the left of your primary > display. Yes. Secondary: builtin laptop display (on left) Primary: main monitor (on right) If I do "Identify", the laptop display is identified as "1" and the main monitor as "2". > I think that it's a bug that these windows are appearing at the > top-left, rather than on the primary display, in that we don't > distinguish well enough between "the application asked us to place the > window at 0x0" and "the application didn't specify where to put the window" > > It would help if you could give the name of this application, and can > you install 'xprop', and show the output you get from running that, then > clicking on one of the window which gets placed incorrectly. Sure. It's Cadence Virtuoso/ADE. The xprop output is: _WINDOWSWM_NATIVE_HWND(INTEGER) = 77728452 WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. bitmap id # to use for icon: 0x200178 bitmap id # of mask for icon: 0x200179 window id # of group leader: 0x200001 _NET_WM_ICON(CARDINAL) = Icon (50 x 50): [...] _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 2097527 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL _NET_WM_USER_TIME(CARDINAL) = 744838078 _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x200176 WM_CLIENT_LEADER(WINDOW): window id # 0x200001 _NET_WM_PID(CARDINAL) = 24636 WM_LOCALE_NAME(STRING) = "C" WM_CLIENT_MACHINE(STRING) = "corn" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified location: 0, 0 program specified minimum size: 100 by 100 program specified maximum size: 3820 by 2500 window gravity: NorthWest WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_CLASS(STRING) = "Qt-subapplication", "Virtuoso" WM_ICON_NAME(STRING) = "Virtuoso® Schematic Editor L Editing: project sch1 schematic on corn" _NET_WM_ICON_NAME(UTF8_STRING) = "Virtuoso® Schematic Editor L Editing: project sch1 schematic on corn" WM_NAME(STRING) = "Virtuoso® Schematic Editor L Editing: project sch1 schematic on corn" _NET_WM_NAME(UTF8_STRING) = "Virtuoso® Schematic Editor L Editing: project sch1 schematic on corn" >> To avoid this, I want to disable the second monitor (and *only* use the >> primary). But whatever I do, XWin seems to ignore whatever I supply. For >> example, I start >> >> /usr/bin/startxwin.exe -- -nomultiplemonitors >> /usr/bin/startxwin.exe -- -screen 0 @1 -nomultiplemonitors >> /usr/bin/startxwin.exe -- -screen 0 @1 >> /usr/bin/startxwin.exe -- -mwextwm -screen 0 @1 -nomultiplemonitors >> >> and so on. >> Nothing works - everything as before. When I select "Hide Root Window" >> from the tray icon I see that the root window indeed covers both >> monitors. > > This is not how it behaves for me. Using -nomultiplemontiors, or an > explicit -screen setting shows an appropriately sized root window when > turning off "Hide Root Window". (Although this is not terribly useful as > you can move the Windows windows out of this area, which causes their > contents to not be drawn) You are right. Further research shows me that my arguments never showed up in XWin.0.log. Maybe I there's a different bug here? I call XWin like this: C:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin.exe -- -nomultimonitors And this appears in XWin.0.log: XWin was started with the following command line: X :0 -multiwindow However, if I directly start the XServer, XWin.exe -screen 0 @1 -multiwindow -nomultimonitors it works: XWin was started with the following command line: XWin -screen 0 @1 -multiwindow -nomultimonitors Why does startxwin.exe does not pass the parameters to the XServer. However, unfortunately this does not change anything: You are right that when I uncheck "Hide Root window", the black root window *only* covers the primary monitor. That's good. But windows are *still* opened at the second monitor! What's even worse (and pretty astonishing to me): All X windows are *only* displayed correctly on the *secondary* display with the command line above. On the primary display, the window frames are shown but the windows are not drawn (they are transparent) and they do not accept mouse/keyboard input. So it's completely the oppisite as it is intended ... > Can you check if the screen dimensions reported by xdpyinfo match those > you are requesting, and attach your /var/log/xwin/XWin.0.log? Hmm, I have here: [...] default screen number: 0 number of screens: 1 screen #0: dimensions: 1920x1080 pixels (508x286 millimeters) resolution: 96x96 dots per inch depths (7): 24, 1, 4, 8, 15, 16, 32 root window id: 0x6b depth of root window: 24 planes number of colormaps: minimum 1, maximum 1 default colormap: 0x20 default number of colormap cells: 256 preallocated pixels: black 0, white 16777215 options: backing-store WHEN MAPPED, save-unders NO largest cursor: 32x32 current input event mask: 0x4a0007 KeyPressMask KeyReleaseMask ButtonPressMask StructureNotifyMask SubstructureNotifyMask PropertyChangeMask number of visuals: 21 default visual id: 0x21 visual: visual id: 0x21 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits [...] I think that's fine. XWin.0.log with the command line from above is attached. > Separately, it's possible that we should do something better with the > combination of -nomultiplemontors and -multiwindow, but it's not quite > clear to me what. (See discussion [1]) I would reaaaally appreciate that. Unfortunately I am not really an X expert. What bothers me a little bit is that windows are displayed on a screen which should not even exist. (besides the problem reported above that the windows are not even drawn on the intended screen). Thanks Luke