hmm - I looked around a bit, and it might be that you are right - that it is possible to have multiple not cloned screens - each as "stand alone" with out xinerama.
I need to read more though.
Thanks.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Hmm - at least from Qt docs, this should not have been a problem to start with:
Which I did as posted before - and screenNumber() returns 0 on both screens,whereas numScreens() returns correctly 2.int QX11Info::appCells ( int screen = -1 ) [static]
Returns the number of cells used by the application on the given screen.
The screen argument is an X screen number. Be aware that if the user's system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.
Maybe a Qt bug?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
According to the docs "correctly" should be "1", not "2", so if there is a bug, it's in numScreens(). The "gimp test" should shed some light on the case. If child windows are opened on the same screen as their parents, then something indeed may be wrong, but if they are opened "randomly", then I guess it's the way it should work. Besides, Qt should have nothing to do with choosing the screen to open the window on (at least not "by default").
Why is that?According to the docs "correctly" should be "1", not "2", so if there is a bug, it's in numScreens().
And I have 2...int QDesktopWidget::numScreens () const
Returns the number of available screens.
See also primaryScreen().
Well not with choosing the screens, but delivering the right information about the location of the widget - and allowing to choose the screen on which it should live.Besides, Qt should have nothing to do with choosing the screen to open the window on (at least not "by default").
And (specially) under KDE I would expect this to work - since KDE is built on Qt.
But I will read some more and look around.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Ok, for the benefit of others who might run in to issues of that sort:
The reason I thought that its either Xinerama or clone mode is because under SUSE (which I am using) SaX2 gives only these two options.
So if you are under SUSE (currently I am on 10.1) you will have to edit your xorg.conf manually, so that the you have a "Device","Screen" and "Monitor" scetion for each screen you have.
At least with NVidia, which I use, there is an option "TwinView" which you have to comment out - and Xinerama ofcourse as well.
So now I have an X server running for each screen.
Obviously the above problem is gone but I still have to see how I will do this on the QuadView machine I am coding this for.
Its a Matrox Quad View card - not NVidia, and obviously it has no "TwinView" option.
But that is something that will have to wait for now.
At least I know what I will be looking for![]()
Hope this is of use to someone.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
So it was Xinerama causing it or a yet unknown reason?
Xinerama makes the whole desktop as one screen.
I think thats the reason why the screen number always returned 0, on both screens.
But the way I understand the docs, the screen number should return correctly even in xiberana mode.
Either I got it wrong, or Qt has a problem with this issue.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I'd say it's a good candidate for a bug report. Either way something is incorrect here.
Oh by the way - xinerama confuses gimp as well.
If I start gimp on screen 1 - all the other dialogs it wil open on screen 0.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
So it looks like the natural behaviour and the problem seems to be that Qt returns an incorrect number of screens or sth like that.
Well, yes and no.
As far as I understand the docs, Qt should return the number of physical screens, regardles if this is a viratual desktop (xinerama) or two desktops, as you can see in the illustration in the DesktopWidget docs.
Besides, the docs text it self makes no conditions on when numScreens() should return one screen (for xinerama) and N screens when not using xinerama (or virtual desktop).
The text in the quote is talking from the exact problem I have (popping dialog box on another screen than parent).All windows opened in the context of the application should be constrained to the boundaries of the primary screen; for example, it would be inconvenient if a dialog box popped up on a different screen, or split over two screens.
So Qt is supposed to allow control over this situation, and allow the user to target physical screens on a virtual desktop - but it doesn't - not in the case I posed in this thread at least.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks