Re: Xlib: DisplayWidth / DisplayHeight

2023-09-18 Thread Zbigniew
> Oh, I see. I suggest you try writing some concrete code - learning this in abstract can be tricky. > Don't be afraid to rewrite it from scratch a few times. There is existing source code from X examples > and tools, as well as other libraries, such as gtk and Qt. Dear Volodya, dpn't you worry a

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-12 Thread Vladimir Dergachev
On Fri, 8 Sep 2023, Zbigniew wrote: If you are doing this for open source project, you should change your code to: [..] The code you've pasted doesn't work properly; it returns the size of virtual screen — so you added 3x as much lines to get, in effect, the same (incorrect) result as the

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-12 Thread Zbigniew
> If you are doing this for open source project, you should change your code > to: > > [..] The code you've pasted doesn't work properly; it returns the size of virtual screen — so you added 3x as much lines to get, in effect, the same (incorrect) result as the few lines I pasted. > Oh, and no I

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-08 Thread Vladimir Dergachev
On Tue, 5 Sep 2023, Zbigniew wrote: To help you see our point of view, imagine someone complaining to you that even though the computer science course talked about trees and leaves there were no actual trees anywhere in sight, and how exactly does that help with CO2 emissions ? Display and Sc

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-08 Thread Zbigniew
> To help you see our point of view, imagine someone complaining to you that > even though the computer science course talked about trees and leaves > there were no actual trees anywhere in sight, and how exactly does that > help with CO2 emissions ? > > Display and Screen structures are abstractio

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-08 Thread Zbigniew
> Which screen? What is your use case? What are you trying to achieve? I already wrote that in my post — that was my reply to yours — from 31. August, I quote: „Could you, please, suggest a „replacement functions” for these two [macros we're talking about], that I could use to get the dimensions

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-05 Thread Julian Bradfield
Could I suggest that further engagement with Zbigniew on-list is a waste of everybody's time? He's either incapable of understanding the basics and/or knowing what he actually wishes to achieve, or is wilfully refusing to understand in order to troll us. Either way, we're not going to get any furt

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-05 Thread Carsten Haitzler
On Tue, 5 Sep 2023 13:25:03 +0200 Lucien Gentis said: > > Le 05/09/2023 à 06:18, Carsten Haitzler a écrit : > > On Thu, 31 Aug 2023 08:02:38 -0400 (EDT) Vladimir Dergachev > > said: > > > >> The cool thing however, is that I can launch xeyes and it works just the > >> same as when it was creat

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-05 Thread Vladimir Dergachev
On Tue, 5 Sep 2023, Zbigniew wrote: You keep avoiding the question. WHICH SCREEN? [..] 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 thi

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-05 Thread Po Lu
Zbigniew writes: > I've got a feeling you are trying to dilute this exchange by > artificially introducing conceptual confusion. Sure, the distinction between screens and output devices may be confusing. But it is how X functions, and is not subject to change, particularly not merely to congrue

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-05 Thread Zbigniew
> You keep avoiding the question. WHICH SCREEN? > [..] > > 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 discussi

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-05 Thread Lucien Gentis
Le 05/09/2023 à 06:18, Carsten Haitzler a écrit : On Thu, 31 Aug 2023 08:02:38 -0400 (EDT) Vladimir Dergachev 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 mathemati

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-04 Thread Carsten Haitzler
On Thu, 31 Aug 2023 08:02:38 -0400 (EDT) Vladimir Dergachev 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

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-04 Thread Carsten Haitzler
On Wed, 30 Aug 2023 18:49:12 +0200 Zbigniew 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 „ma

Re: Xlib: DisplayWidth / DisplayHeight

2023-09-04 Thread Carsten Haitzler
On Thu, 31 Aug 2023 13:09:14 +0200 Zbigniew said: > > Perhaps you should share your use case on why you need to know the screen > > size when there are far better mechanisms to handle this? > > Because the use of the mentioned functions/macros is simple and > straightforward. But they are flawed

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Dave Howorth
On Thu, 31 Aug 2023 10:14:38 -0700, Alan Coopersmith wrote: > On 8/31/23 10:01, Vladimir Dergachev wrote: > > I don't know exactly why they named things as they did. One > > possibility is that the idea was that a display could consist of > > several physical devices, like an airport display for a

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Alan Coopersmith
On 8/31/23 10:01, Vladimir Dergachev wrote: I don't know exactly why they named things as they did. One possibility is that the idea was that a display could consist of several physical devices, like an airport display for arrivals and deparatures. I don't either, but https://www.x.org/wiki/gu

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Vladimir Dergachev
have a look, please, at the man page: int DisplayHeight(Display *display, int screen_number); int DisplayWidth(Display *display, int screen_number); „What screen is that”? The one described by the parameters. ('display' is a pointer to a 'Display' structure returned by a previous cal

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Zbigniew
> Perhaps you should share your use case on why you need to know the screen > size when there are far better mechanisms to handle this? Because the use of the mentioned functions/macros is simple and straightforward. But they are flawed, unfortunately. So what mechanism do you propose to use for

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Vladimir Dergachev
On Wed, 30 Aug 2023, Zbigniew wrote: „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.

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Po Lu
Zbigniew writes: > 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 anythin

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Krzysztof Hałasa
Zbigniew writes: > Are you serious when stating, that during creation of a program I > should play guessing game „what kind of 'subsystem' the user may > employ”? No, your program should simply get WxH and draw there. That's the point. Now, certain specific programs may want to know physical ch

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-31 Thread Zbigniew
>> „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 "Scre

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Vladimir Dergachev
Just to make it easier for anyone who is reading this thread in the archives: At the moment the library you need is libxrandr (on Ubuntu install with apt install libxrandr-dev), and read the man page Xrandr. It is also useful to read the paper describing Xrandr protocol: https://cgit.freede

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Po Lu
Zbigniew writes: > No, dear Volodya, > >„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 > should

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Carsten Haitzler
On Wed, 30 Aug 2023 18:27:12 +0200 Zbigniew said: Perhaps you should share your use case on why you need to know the screen size when there are far better mechanisms to handle this? But below is a list of why changing these are not sane/possible etc. 1. You cannot change the way DisplayWidth/He

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Julian Bradfield
On 2023-08-30, Zbigniew wrote: >„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 > should get, rega

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Vladimir Dergachev
On Wed, 30 Aug 2023, Zbigniew wrote: What you want is to find out the width and height of physical screen you have. Indeed. That's what DisplayWidth and DisplayHeight functions have been created for. To do that you need to use the subsystem that manages them - which is xrandr. And don't fo

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Zbigniew
> What you want is to find out the width and height of physical screen you > have. Indeed. That's what DisplayWidth and DisplayHeight functions have been created for. > To do that you need to use the subsystem that manages them - which > is xrandr. And don't forget to specify which of 5 screen yo

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Vladimir Dergachev
On Wed, 30 Aug 2023, Zbigniew wrote: So I would expect (in my particular case) to get 1920 and 1200 values, and NOT dimensions of virtual screen, I mean 2520 and 1575 The behavior prescribed for these macros is to return the width and height of the screen, and doesn't provide for the existe

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Zbigniew
>>> Are you making reference to DisplayWidth and DisplayHeight, or >>> DisplayWidthMM and DisplayHeightMM? >> >> Talking about DisplayWidth and DisplayHeight functions. >> >>> And please explain which X extension supplies your ``virtual >>> screen'' functionality >> >> It's done like this: >> xran

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Po Lu
Zbigniew writes: >> Are you making reference to DisplayWidth and DisplayHeight, or >> DisplayWidthMM and DisplayHeightMM? > > Talking about DisplayWidth and DisplayHeight functions. > >> And please explain which X extension supplies your ``virtual >> screen'' functionality > > It's done like thi

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-30 Thread Zbigniew
> Are you making reference to DisplayWidth and DisplayHeight, or > DisplayWidthMM and DisplayHeightMM? Talking about DisplayWidth and DisplayHeight functions. > And please explain which X extension supplies your ``virtual screen'' > functionality It's done like this: xrandr --output DVI-0 --mo

Re: Xlib: DisplayWidth / DisplayHeight

2023-08-29 Thread Po Lu
Zbigniew writes: > 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 proble

Xlib: DisplayWidth / DisplayHeight

2023-08-29 Thread Zbigniew
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 sc