getting the screen number

Hal V. Engel hvengel at astound.net
Mon Apr 23 11:22:04 PDT 2007


I have an application that needs to be able to access and change the video 
card gamma ramps of the screens on a machine.  The app is using Qt as it's 
widget set and looking at the Qt documentation it appears that using 
QDesktopWidget::screenNumber(this) should return the screenNumber of the 
screen where the dialog is displayed which is exactly what I want and need.  
This works for separate displays but in xinerama always returns screen == 0 
even though other screen numbers would be valid in this mode (IE. for a dual 
screen machine there will be screens 0 and 1).  This makes the Qt call 
useless for my purposes.  

I have looked at some of the X11 documentation trying to find some call or 
calls I could make that would get me the screen number where the dialog 
making the call is displayed with no success.  I have also looked for example 
code for this and have only found command line apps where the user must pass 
in the screen number as a command line argument.  This seems reasonable since 
the application may not have an X11 based window at any point that could be 
used to locate which screen the user wants to make changes to.  But none of 
this has helped me to find a solution to this issue.

Could someone point me to the X11 APIs to do this? 

Hal



More information about the xorg mailing list