A most weird problem has occurred to me a couple of days ago during my exploration of the pyglet package: While window.set_location(x,y), window centering on the screen etc. were working fine, at a certain point when I wanted to center a pyglet window on the Windows screen as usual, the window was totallly off center. See image below.
I then started to investigate the problem in various ways. One of them was to re-install pyglet. The problem insisted.
I also searched in the Web and I couldn’t find a single reference about tht problem.
I did a few practical tests and I found out that there was a constant difference between the calculated (expected) window location and the actual one (what appeared on screen). This constant or factor was 1.25. The coordinates on the screen were always increased by that factor in relation the calculated coordinates. I thought this had to do with dpi but the dpi in pyglet seems to apply only to text and more specifically to fonts.
So what the heck is this (pixelling?) factor that modifies positioning on screen and how it is put into effect?
Does anyone know anything about this subject?
Note that this problem is most probably not reproducable, since it occurs unexpectedly and I have no clue about why or how. However, I can provide a simple code, for anyone who would like to try it (It will most probably work fine! ????:
import pyglet
screen_w, screen_h = 1920, 1080 # Windows screen size
window_w, window_h = 400,400 # pyglet window size
window = pyglet.window.Window(window_w, window_h)
window.set_location((screen_w-window_w)//2, (screen_h-window_h)//2) # Center the window on the screen
pyglet.app.run()
So, I would like please to have replies only from people who know about the problem.