Xlib: DisplayWidth / DisplayHeight

Lucien Gentis lucien.gentis at univ-lorraine.fr
Tue Sep 5 11:25:03 UTC 2023

Le 05/09/2023 à 06:18, Carsten Haitzler a écrit :
> On Thu, 31 Aug 2023 08:02:38 -0400 (EDT) Vladimir Dergachev
> <volodya at mindspring.com>  said:
>> The cool thing however, is that I can launch xeyes and it works just the
>> same as when it was created decades ago. This is because people back then
>> thought through the mathematical model of what they are doing, and did not
>> just "softwared" their way to a kludge that needed compatibility breaking
>> changes every year the way python does.
> hear hear. api stability has been one of x's shining bits. it's got ugly parts
> - but not breaking is one of its positive points. evolving instead.
>> best
>> Vladimir Dergachev
>>> -- 
>>> regards,
>>> Zbigniew

I'm writing things at xlib level, so:


unsigned int displaywidth, displayheight;

Display * serveur = XOpenDisplay (NULL);

int ecran = DefaultScreen (serveur);

displaywidth = DisplayWidth(serveur,ecran);
displayheight = DisplayHeight(serveur,ecran);


and if you have more than one screen, you can get their number via macro 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20230905/dbefa867/attachment-0001.htm>

More information about the xorg mailing list