getPosition reports incorrect (x,y) values in Linux #346

Closed
jarrettchisholm opened this Issue Jan 29, 2013 · 7 comments

3 participants

@jarrettchisholm

running on debian testing 64bit with proprietary nvidia driver.

calling getPosition() returns (10, 40) every time, no matter where I move the window to.

@jarrettchisholm

Fixed it - I used some older code from some cross-platform windowing code I had around (actually, I replaced it with SFML :)

patch file linked at bottom (gist repo).

File changed: src/SFML/Window/Linux/WindowImplX11.cpp

https://gist.github.com/4666488

@jarrettchisholm

Any idea if this will be accepted into the release?

I have to patch sfml on each linux box I use for development, so I'm hoping it will be :)

@LaurentGomila
Simple and Fast Multimedia Library member

Sorry, I won't have the time to process it before the release of SFML 2.0. You'll have to wait for at least SFML 2.1.

@abodelot

I can confirm the bug, reproduced on the following systems:

  • Debian 32 bits / Nvidia NV43
  • Debian 64 bits / Intel mobile 4 chipset

I also tested the patch supplied and it correctly fixes the bug.

@jarrettchisholm: You might want to correct the coding style: SFML uses 4 spaces for indentation and curly brackets are on a new line. Also a pull-request might be easier to integrate.
Good job anyway.

@jarrettchisholm

@LaurentGomila ok - I'm sure you have lots on your plate as it is. I guess I'll wait for 2.1.

@abodelot ahh, ok, I didn't even think about that - I'll fix it on Monday. I'll also see about doing the pull-request.

Cheers

@jarrettchisholm

@abodelot made corrects you suggested - pull request is now pending.

@LaurentGomila
Simple and Fast Multimedia Library member

Wouldn't XTranslateCoordinates do the same thing with just a single line of code?

@eXpl0it3r eXpl0it3r pushed a commit to eXpl0it3r/SFML that referenced this issue Sep 10, 2015
@LaurentGomila LaurentGomila Fixed Window::getPosition() on Linux (#346) 2d183e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment