Unexpected wx.Display behaviour

Hi everyone!
I’m using two monitors and I’m trying to get their geometry and usable client area, but I’m getting somewhat unexpected results using wx.Display.
I have two 1600x1200 identical monitors and the main one - on the left - has a 25 pixels-high taskbar, while the other one has no taskbar at all.

Here’s my code:

for i in range(wx.Display.GetCount()):
print i, wx.Display(i).GetGeometry(), wx.Display(i).GetClientArea()

and what I get:

0 (1600, 0, 1600, 1200) (0, 0, 3200, 1175)
1 (0, 0, 1600, 1200) (0, 0, 1600, 1200)

Since wx.Display.GetFromPoint((0,0)) returns 1, I’d say that wxPython sees 1 as the left display and this matches the (0, 0) position printed above, but then I don’t understand why it shows 1200 as client area height, ignoring the taskbar.
Moreover, if 0 is the right monitor the client area is reported as 1200-25 (taskbar height) even though on that display I don’t have a taskbar.

What I’d expect is something like this:

0 (1600, 0, 1600, 1200) (0, 0, 1600, 1200)
1 (0, 0, 1600, 1200) (0, 0, 1600, 1175)

Am I missing something?

This is on Xubuntu 12.04, wxPython 2.8.12.1 (gtk2-unicode), NVIDIA GPU GeForce 210 (GT218) using the Nvidia proprietary driver

Many thanks in advance!

For the record the same test with the Nouveau driver shows something more consistent:

0 (0, 0, 1600, 1200) (0, 0, 3200, 1175)
1 (1600, 0, 1600, 1200) (1600, 0, 1600, 1200)

Federico wrote:

I'm using two monitors and I'm trying to get their geometry and usable
client area, but I'm getting somewhat unexpected results using wx.Display.
I have two 1600x1200 identical monitors and the main one - on the left
- has a 25 pixels-high taskbar, while the other one has no taskbar at all.

Here's my code:

for i in range(wx.Display.GetCount()):
    print i, wx.Display(i).GetGeometry(), wx.Display(i).GetClientArea()

and what I get:

0 (1600, 0, 1600, 1200) (0, 0, 3200, 1175)
1 (0, 0, 1600, 1200) (0, 0, 1600, 1200)

Since wx.Display.GetFromPoint((0,0)) returns 1, I'd say that wxPython
sees 1 as the left display and this matches the (0, 0) position
printed above, but then I don't understand why it shows 1200 as client
area height, ignoring the taskbar.

wx is entirely at the mercy of the video driver here. It is reflecting
to you the information that it received. Nvidia's drivers have grown by
accretion into horrible, hopeless, baroquely complicated messes over the
years, and I suspect no one at the company really understands how they
work any more.

Moreover, if 0 is the right monitor the client area is reported as
1200-25 (taskbar height) even though on that display I don't have a
taskbar.

It's also showing you a width of 3200, as if it were reporting the
entire desktop, rather than just the one display. Nvidia does have the
concept of combining two displays into one virtual monitor, and it could
be their driver is confused.

Am I missing something?

No, but I'm not sure there is a good solution for it. You might take a
long stick and poke at Nvidia.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.