XWin ignores all parameters related to multiple monitors

Lukas Haase lukashaase@gmx.at
Tue May 6 21:54:00 GMT 2014

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.

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.


It's Cadence Virtuoso/ADE.

The xprop output is:

		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_USER_TIME_WINDOW(WINDOW): window id # 0x200176
WM_CLIENT_LEADER(WINDOW): window id # 0x200001
		program specified location: 0, 0
		program specified minimum size: 100 by 100
		program specified maximum size: 3820 by 2500
		window gravity: NorthWest
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 --

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 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).


-------------- next part --------------
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
OS: CYGWIN_NT-6.2-WOW64 thinktank 1.7.29(0.272/5/3) 2014-04-07 13:44 i686
OS: Windows 8  [Windows NT 6.2 build 9200] (WoW64)
Package: version 1.15.1-1 built 2014-04-16

XWin was started with the following command line:

XWin -screen 0 @1 -multiwindow -nomultimonitors 

ddxProcessArgument - Initializing default screens
winInitializeScreenDefaults - primary monitor w 1920 h 1080
winInitializeScreenDefaults - native DPI x 96 y 96
winInitializeScreens - 1
winInitializeScreen - 0
ddxProcessArgument - screen - Found Valid ``@Monitor'' = 1 arg
_XSERVTransmkdir: Mode of /tmp/.X11-unix should be set to 1777
_XSERVTransmkdir: this may cause subsequent errors
[745929.703] Initializing built-in extension Generic Event Extension
[745929.703] Initializing built-in extension SHAPE
[745929.703] Initializing built-in extension MIT-SHM
[745929.703] Initializing built-in extension XInputExtension
[745929.703] Initializing built-in extension XTEST
[745929.703] Initializing built-in extension BIG-REQUESTS
[745929.703] Initializing built-in extension SYNC
[745929.703] Initializing built-in extension XKEYBOARD
[745929.703] Initializing built-in extension XC-MISC
[745929.703] Initializing built-in extension XINERAMA
[745929.703] Initializing built-in extension XFIXES
[745929.703] Initializing built-in extension XFree86-Bigfont
[745929.703] Initializing built-in extension RENDER
[745929.703] Initializing built-in extension RANDR
[745929.703] Initializing built-in extension COMPOSITE
[745929.703] Initializing built-in extension DAMAGE
[745929.703] Initializing built-in extension MIT-SCREEN-SAVER
[745929.703] Initializing built-in extension DOUBLE-BUFFER
[745929.703] Initializing built-in extension RECORD
[745929.703] Initializing built-in extension DPMS
[745929.703] Initializing built-in extension Present
[745929.703] Initializing built-in extension X-Resource
[745929.703] Initializing built-in extension GLX
[745929.703] (II) xorg.conf is not supported
[745929.703] (II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
[745929.703] LoadPreferences: /home/niki/.XWinrc not found
[745929.703] LoadPreferences: Loading /etc/X11/system.XWinrc
[745929.703] LoadPreferences: Done parsing the configuration file...
[745929.718] winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL
[745929.718] winDetectSupportedEngines - Returning, supported engines 00000015
[745929.718] winSetEngine - Multi Window or Rootless => ShadowGDI
[745929.718] winScreenInit - Using Windows display depth of 32 bits per pixel
[745929.812] winAllocateFBShadowGDI - Creating DIB with width: 1920 height: 1080 depth: 32
[745929.812] winFinishScreenInitFB - Masks: 00ff0000 0000ff00 000000ff
[745929.812] winInitVisualsShadowGDI - Masks 00ff0000 0000ff00 000000ff BPRGB 8 d 24 bpp 32
[745929.812] winInitMultiWindowWM - Calling pthread_mutex_lock ()
[745929.812] winMultiWindowXMsgProc - Calling pthread_mutex_lock ()
[745929.812] MIT-SHM extension disabled due to lack of kernel support
[745929.812] XFree86-Bigfont extension local-client optimization disabled due to lack of shared memory support in the kernel
[745929.828] glWinSelectGLimplementation: Loaded 'cygnativeGLthunk.dll'
[745929.968] GL_VERSION:     4.0.0 - Build
[745929.968] GL_VENDOR:      Intel
[745929.968] GL_RENDERER:    Intel(R) HD Graphics 4000
[745929.968] (II) AIGLX: enabled GLX_SGI_make_current_read
[745929.968] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[745929.968] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[745929.968] (II) AIGLX: enabled GLX_SGIX_pbuffer
[745929.968] (II) AIGLX: enabled GLX_ARB_multisample and GLX_SGIS_multisample
[745929.968] (II) 66 pixel formats reported by wglGetPixelFormatAttribivARB
[745929.968] (II) AIGLX: Set GLX version to 1.4
[745929.984] (II) 21 fbConfigs
[745929.984] (II) GLX: Initialized Win32 native WGL GL provider for screen 0
[745930.109] winPointerWarpCursor - Discarding first warp: 960 540
[745930.109] (--) 5 mouse buttons found
[745930.109] (--) Setting autorepeat to delay=500, rate=31
[745930.109] (--) Windows keyboard layout: "00000409" (00000409) "US", type 4
[745930.109] (--) Found matching XKB configuration "English (USA)"
[745930.109] (--) Model = "pc105" Layout = "us" Variant = "none" Options = "none"
[745930.109] Rules = "base" Model = "pc105" Layout = "us" Variant = "none" Options = "none"
[745930.109] winBlockHandler - pthread_mutex_unlock()
[745930.109] winInitMultiWindowWM - pthread_mutex_lock () returned.
[745930.109] winInitMultiWindowWM - pthread_mutex_unlock () returned.
[745930.109] winInitMultiWindowWM - DISPLAY=:0.0
[745930.109] winMultiWindowXMsgProc - pthread_mutex_lock () returned.
[745930.109] winMultiWindowXMsgProc - pthread_mutex_unlock () returned.
[745930.109] winMultiWindowXMsgProc - DISPLAY=:0.0
[745930.109] winProcEstablishConnection - winInitClipboard returned.
[745930.109] winInitMultiWindowWM - XOpenDisplay () returned and successfully opened the display.
[745930.109] winClipboardThreadProc - DISPLAY=:0.0
[745930.109] winMultiWindowXMsgProc - XOpenDisplay () returned and successfully opened the display.
[745930.109] winClipboardProc - XOpenDisplay () returned and successfully opened the display.
[745938.484] OS has icon alpha channel support: yes
[745948.156] executing 'xterm', pid 7992
[745948.250] (pid 7992 stderr) Warning: Missing charsets in String to FontSet conversion
[745980.343] executing 'xterm', pid 13548
[745980.453] (pid 13548 stderr) Warning: Missing charsets in String to FontSet conversion
-------------- next part --------------
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/

More information about the Cygwin-xfree mailing list