Xlib: DisplayWidth / DisplayHeight

Zbigniew zbigniew2011 at gmail.com
Mon Aug 28 20:25:36 UTC 2023


Hello,

I believe there's a need to change the functionality of the
DisplayWidth and DisplayHeight functions.

  It has nowadays become quite common to use the so-called virtual
screens — i.e. providing a larger operating field than visible on the
screen. The problem is that when using a virtual screen, both
functions mentioned return its size and not size of the physical
screen, which seldom makes sense in programming practice (for example,
see:
 https://stackoverflow.com/questions/28774830/retrieve-physical-screen-size
 https://unix.stackexchange.com/questions/573121/get-current-screen-dimensions-via-xlib-using-c
).

  If I understand the intentions of the creators of these functions,
which were created long ago when virtual screens were not used, they
should return the size of the physical screen, so their current
behavior should be assessed as flawed. Therefore, their operation
should be corrected so that they always return the size of the
physical screen — regardless of whether a virtual screen is used or
not — and their current functionality should simply be copied intact
into two new functions, which could be called here VirtualDisplayWidth
/ VirtualDisplayHeight.

  Such a modification would close this issue that is still open for
years — as you can see from the example links provided, it causes a
lot of problems for programmers.

What do you think about this?
-- 
regards,
Zbigniew


More information about the xorg mailing list