Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: window->getPosition on multiple monitors  (Read 2153 times)

0 Members and 3 Guests are viewing this topic.

Caladain

  • Newbie
  • *
  • Posts: 5
    • View Profile
window->getPosition on multiple monitors
« on: January 03, 2013, 08:37:10 pm »
Upfront-
Platform: Windows 7 64bit, up to date
Video card: K5000M Nvidia, up to date video driver
SFML version: 2.0-rc-114-g03b8a1c
Laptop: M6700 with a Dell U2410 monitor attached via dock.

I'm seeing some weird behavior with window->getPosition() with multiple monitors.  My extra monitor is on the "left" of my laptop display physically and virtually (windows thinks it's to the left).

| U2410|  | laptop monitor |

Windows recognizes the laptop monitor as monitor "1" and the U2410 as "2".

My app is a windowed SFML 2.0 renderwindow that is logging to the console for development.

When i have the laptop monitor be the main display (where the task bar lives), and the U2410 to the left of the laptop monitor, and drag a renderwindow onto the U2410 display, the window->getPosition returns a value of 4294966183 for x.

If i make the U2410 my main display, x returns the correct value.  If i swap monitor 1 and 2 in the screen resolution section of the control panel (so that the virtual layout of the monitors has the extra monitor (U2410) on the right of the main display (the laptop display) then x returns a correct value.  Is this a known bug of opengl?  I searched the term getPosition on this site, and searched for multiple monitor x window position issues in google.

Thanks :-)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window->getPosition on multiple monitors
« Reply #1 on: January 03, 2013, 08:47:53 pm »
You should try the latest sources.
Laurent Gomila - SFML developer

Caladain

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: window->getPosition on multiple monitors
« Reply #2 on: January 03, 2013, 08:52:15 pm »
Will do :-)

Caladain

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: window->getPosition on multiple monitors
« Reply #3 on: January 03, 2013, 09:06:18 pm »
Rebuilt with 38da3f4 (latest in git) and problem described above exists.   :(

Caladain

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: window->getPosition on multiple monitors
« Reply #4 on: January 03, 2013, 09:18:02 pm »
Found where in SFML it gets it's window rect from, tried:

RECT rect;
GetWindowRect(window->getSystemHandle(), &rect);

and got
debug: RenderWindow-getSize-X - 800
debug: RenderWindow-getSize-Y - 600
debug: RenderWindow-GetPosition-left - 4294966458
debug: RenderWindow-GetPosition-bottom - 986
debug: RenderWindow-GetPosition-right - 4294967274
debug: RenderWindow-GetPosition-top - 348

Possibly a bug in microsoft land?

Caladain

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: window->getPosition on multiple monitors
« Reply #5 on: January 03, 2013, 09:42:41 pm »
Never mind, it's me being stupid.  RECTs are longs, not unsigned ints.

Nothing to see, no problems, sorry for the trouble  :-[