Re: XWin ignores all parameters related to multiple monitors

2014-06-19 Thread Jon TURNEY

On 09/05/2014 21:25, Lukas Haase wrote:

On 2014-05-09 3:15, Jon TURNEY wrote:

On 09/05/2014 00:27, Lukas Haase wrote:

On 2014-05-08 5:15, Jon TURNEY wrote:

I've built a snapshot [1], which adds a heuristic which ignores a
'program specified location' hint if the location is the origin, which
you might like to try and see if that fixes your problem, but I'm not
sure if that is the correct solution.


I have just the issue that the exe does not seem to work for me. Is
there anything special I need to consider?


Sorry, my snapshot building script went wrong and the snapshot was
broken.  Try this one instead.

ftp://cygwin.com/pub/cygwinx/x86/XWin.20140509-git-c4a16a6606868d3e.exe.bz2


Can't believe it, great! Works exactly as it should (just with the
standard configuration, X :0 -multiwindow)!!

Now I just hope that this 'patch' somehow finds its way into the trunk ;-)


This fix is included is 1.15.1-3.

On reflection, I think a better approach would be to look at 
_NET_WM_WINDOW_TYPE and if it's _NET_WM_TYPE_NORMAL or absent, ignore 
PPosition and place the window as we like, but that is not quite as 
straightforward to implement.


--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
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/



Re: XWin ignores all parameters related to multiple monitors

2014-05-09 Thread Jon TURNEY

On 09/05/2014 00:27, Lukas Haase wrote:

On 2014-05-08 5:15, Jon TURNEY wrote:


So, do you have an example of this working as you would like on a unix
system, and what is the window manager is that case?


I am not sure if I get the question.

What I could do is to login via VNC and see how the windows are placed
are if they are placed the correct way?

Is this what you mean?

Unfortunately I have no chance to install Cadence locally and run it
from a local, dual monitor setup from Linux because Cadence is a
proprietary, expensive tool.


I understand that.

I am just looking for some evidence that it isn't a bug in the 
application, i.e. that it works correctly for *anyone* :D


Knowing a window manager which places these windows correctly would also 
give me some source code to look at to work out what I need to change.



I've built a snapshot [1], which adds a heuristic which ignores a
'program specified location' hint if the location is the origin, which
you might like to try and see if that fixes your problem, but I'm not
sure if that is the correct solution.


I have just the issue that the exe does not seem to work for me. Is
there anything special I need to consider?


Sorry, my snapshot building script went wrong and the snapshot was 
broken.  Try this one instead.


ftp://cygwin.com/pub/cygwinx/x86/XWin.20140509-git-c4a16a6606868d3e.exe.bz2

--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
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/



Re: XWin ignores all parameters related to multiple monitors

2014-05-09 Thread Lukas Haase
On 2014-05-09 3:15, Jon TURNEY wrote:
 On 09/05/2014 00:27, Lukas Haase wrote:
 On 2014-05-08 5:15, Jon TURNEY wrote:

 So, do you have an example of this working as you would like on a unix
 system, and what is the window manager is that case?

 I am not sure if I get the question.

 What I could do is to login via VNC and see how the windows are placed
 are if they are placed the correct way?

 Is this what you mean?

 Unfortunately I have no chance to install Cadence locally and run it
 from a local, dual monitor setup from Linux because Cadence is a
 proprietary, expensive tool.
 
 I understand that.
 
 I am just looking for some evidence that it isn't a bug in the
 application, i.e. that it works correctly for *anyone* :D
 
 Knowing a window manager which places these windows correctly would also
 give me some source code to look at to work out what I need to change.

Hmm, what I just did is that I started a VNC session and used VNC.
Everything seems to work as expected, new windows are /not/ placed at (0,0).

Window manager is Gnome.

However, as mentioned, this is clearly not a local multi-monitor X
session :(

 I've built a snapshot [1], which adds a heuristic which ignores a
 'program specified location' hint if the location is the origin, which
 you might like to try and see if that fixes your problem, but I'm not
 sure if that is the correct solution.

 I have just the issue that the exe does not seem to work for me. Is
 there anything special I need to consider?
 
 Sorry, my snapshot building script went wrong and the snapshot was
 broken.  Try this one instead.
 
 ftp://cygwin.com/pub/cygwinx/x86/XWin.20140509-git-c4a16a6606868d3e.exe.bz2

Can't believe it, great! Works exactly as it should (just with the
standard configuration, X :0 -multiwindow)!!

Now I just hope that this 'patch' somehow finds its way into the trunk ;-)


Luke





--
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/



Re: XWin ignores all parameters related to multiple monitors

2014-05-08 Thread Jon TURNEY

On 06/05/2014 22:54, Lukas Haase wrote:

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 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:

[...]

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


Hmmm...

There are 2 possible flags here: program specified location and user 
specified location (e.g. by using -geometry on the command line), and 
at the moment we honour them both.


Now, it might be that the client expects to see some EWMH capabilities 
advertised by the multiwindow mode WM, the absence of which causes it to 
set this, or it only sets this after the window is placed, but if it 
always creates the window with that property, it's not clear how to fix 
this.


(Just ignoring program specified location is tempting, but there are 
legitimate uses, for example a toolbar window which should be placed at 
the side)


So, do you have an example of this working as you would like on a unix 
system, and what is the window manager is that case?


I've built a snapshot [1], which adds a heuristic which ignores a 
'program specified location' hint if the location is the origin, which 
you might like to try and see if that fixes your problem, but I'm not 
sure if that is the correct solution.


(I also found a bug with how this hint is handled in 64-bit builds, but 
I don't think that affects you)


[1] 
ftp://cygwin.com/pub/cygwinx/x86/XWin.20140508-git-c4a16a6606868d3e.exe.bz2



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


You need to quote the whole command after bash's -c flag, otherwise they 
are interpreted as additional flags to bash.


See http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-command-line-args 
for an example.



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 opposite as it is intended ...


Yes, it seems there is also something wrong with the translation between 
Windows (which has 0,0 at the top-left of the primary monitor) and X 
(which has 0,0 at the top-left of the virtual screen) coordinate spaces 
here.


But even if that was fixed, there is still the problem of how X windows 
are supposed to behave when moved off the virtual screen (not allowed to 
move? empty?)


Because of that, assuming that I can fix your problem with correct 
window placement, I am inclined to just disable the combination of 
-multiwindow and -screen.


--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
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/



Re: XWin ignores all parameters related to multiple monitors

2014-05-08 Thread Lukas Haase
Hi Jon,

First of all, thank you so much for your effort!
I am struggling for so long with the issue and I am so happy to see your
encouragement here.

On 2014-05-08 5:15, Jon TURNEY wrote:
 On 06/05/2014 22:54, Lukas Haase wrote:
 On 2014-05-05 13:03, Jon TURNEY wrote:
 [...]
 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:
 [...]
 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
 
 Hmmm...
 
 There are 2 possible flags here: program specified location and user
 specified location (e.g. by using -geometry on the command line), and
 at the moment we honour them both.
 
 Now, it might be that the client expects to see some EWMH capabilities
 advertised by the multiwindow mode WM, the absence of which causes it to
 set this, or it only sets this after the window is placed, but if it
 always creates the window with that property, it's not clear how to fix
 this.

Thank you! I think I understand it (I am no X expert).

 (Just ignoring program specified location is tempting, but there are
 legitimate uses, for example a toolbar window which should be placed at
 the side)

Sounds legitimate.

Aside: Maybe it's possible to make this configurable via config or
environment variable? (but I guess the X server does not see environment
variables etc.)

 So, do you have an example of this working as you would like on a unix
 system, and what is the window manager is that case?

I am not sure if I get the question.

What I could do is to login via VNC and see how the windows are placed
are if they are placed the correct way?

Is this what you mean?

Unfortunately I have no chance to install Cadence locally and run it
from a local, dual monitor setup from Linux because Cadence is a
proprietary, expensive tool.

 I've built a snapshot [1], which adds a heuristic which ignores a
 'program specified location' hint if the location is the origin, which
 you might like to try and see if that fixes your problem, but I'm not
 sure if that is the correct solution.
 
 (I also found a bug with how this hint is handled in 64-bit builds, but
 I don't think that affects you)
 
 [1]
 ftp://cygwin.com/pub/cygwinx/x86/XWin.20140508-git-c4a16a6606868d3e.exe.bz2

Thanks so much for that!

I have just the issue that the exe does not seem to work for me. Is
there anything special I need to consider?

I tried copying both, 63 and 32 bit versions to c:\cygwin\bin:

32 bit version gives:

c:\cygwin\binXWin.new.32
XWin.new.32:./.libs/lt-XWin.c:233: FATAL: couldn't find XWin.new.32.


And 64 bit gives: The application was unable to start correctly
(0xc07b). Click OK to close the application.

What bothers me is that my original XWin.exe has 2363943 Bytes (and the
X icon) whereas your new versions are just 26624 and 27150 Byes (and no
icon).

c:\cygwin\binuname -a
CYGWIN_NT-6.2-WOW64 think 1.7.29(0.272/5/3) 2014-04-07 13:44 i686 Cygwin

 [...]
 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
 
 You need to quote the whole command after bash's -c flag, otherwise they
 are interpreted as additional flags to bash.
 
 See http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-command-line-args
 for an example.

Thanks but I think I have tried that already.
It may be hard to believe but:

c:\cygwin\var\log\xwindel XWin.0.log

c:\cygwin\var\log\xwinC:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c
/usr/bin/startxwin.exe -- -nomultimonitors -foobar

c:\cygwin\var\log\xwinc:\cygwin\bin\head -n 10 XWin.0.log
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.15.1.0
OS: CYGWIN_NT-6.2-WOW64 think 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:

X :0 -multiwindow

c:\cygwin\var\log\xwin

I made sure that XWin was not running before and waited after the call
until I saw the tray icon.

 [...]
 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 opposite as it is intended ...
 
 Yes, it seems there is also something wrong with the translation between
 Windows (which has 0,0 at the top-left of the primary monitor) and X
 (which has 0,0 at the top-left of the virtual screen) coordinate spaces
 here.

I mean something different 

Re: XWin ignores all parameters related to multiple monitors

2014-05-06 Thread Lukas Haase
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: 0x21
_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 # 0x21
_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:

Re: XWin ignores all parameters related to multiple monitors

2014-05-05 Thread Jon TURNEY

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.


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.



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)


Can you check if the screen dimensions reported by xdpyinfo match those 
you are requesting, and attach your /var/log/xwin/XWin.0.log?


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


[1] https://sourceware.org/ml/cygwin-xfree/2011-07/msg7.html

--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
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/