Xlib: DisplayWidth / DisplayHeight

Carsten Haitzler raster at rasterman.com
Tue Sep 5 04:13:56 UTC 2023

On Wed, 30 Aug 2023 18:49:12 +0200 Zbigniew <zbigniew2011 at gmail.com> said:

> >>       „The  DisplayHeight  macro returns the height of the specified
> >> screen in
> >>       pixels.
> >>
> >>       The DisplayWidth macro returns the width of the screen in pixels.”
> >>
> >> This is what I want, and this is what — as „man” page states — I
> >
> > And this what you get. Now when I say "Screen" I mean large rectangular
> > matrix of pixels I can paint on. Which is pretty much what any application
> > cares about - you don't need to paint outside of screen.
> Dear, if we should mean by „screen” just any „large rectangular matrix
> of pixels we can paint on” — then the whole discussion has no sense
> whatsoever, and I should IYO be pleased, that the two functions return
> to me, well, anything at all. Just in such case — you forgot(?) to add
> — the use of the functions, that return „just something”, has no
> purpose.
> > What do you mean by "Screen" and why ?
> You already know, what I mean — since you've already guessed it: the
> physical screen I have. Why? Because that's the area where the window
> of my program will appear.
> What makes you think, that the creators of these functions, when
> designing them years ago, meant anything different at that time, than
> „resolution of physical screen handled by its Xserver”?

You keep avoiding the question. WHICH SCREEN?

the screen where your window WILL appear on in future? the one it's currently
on? if it is spanning multiple screens (half way between 2 or perhaps 3 or 4
etc.) then which one(s) do you mean? what happens if your window moves from
screen to screen? the user moves it (via the window manager) or the wm just
decides to move it e.g. if a new screen is plugged in (or if a screen is

in the days these original macros were made screens ere not "dynamic". you
couldn't change resolution, refresh rate on the fly at all. a set of screens
was a fixed setup for an xserver and it would only ever change by bringing down
the whole xserver and running it again. that changed with xrandr making screen
setup dynamic and far more complex than originally envisaged in the 1980's and
thus the original api's were just not able to sensibly describe the modern day
setups we have like plugging and unplugging external screens into laptops and
so on.

so will you answer the question - what screen do you mean? as i mentioned
before. i think you have a far too basic view of screen and i'm trying to
paint just a few of the possible scenarios to have you think about this. this
discussion is going nowhere otherwise.

------------- Codito, ergo sum - "I code, therefore I am" --------------
Carsten Haitzler - raster at rasterman.com

More information about the xorg mailing list