DeviceHeight() misreports when using renderer.

Monkey Forums/Monkey Bug Reports/DeviceHeight() misreports when using renderer.

Richard Betson(Posted 2016) [#1]
Hi,

Below is a copy of the renderer demo modified (see commented sections) to show an issue with DeviceHeight() reporting the wrong device height when using mojo2 renderer. Adding the following (to code) will cause DeviceHeight() to miss report the actual device height.
#GLFW_WINDOW_WIDTH=1280
#GLFW_WINDOW_HEIGHT=720
#GLFW_WINDOW_RESIZABLE=True
#GLFW_WINDOW_RENDER_WHILE_RESIZING=True


The code below will print into the console the device height. On the first iteration DeviceHeight() reports the right height (720). On the following iterations it reports the wrong device height (691).

I have tested this on Monkey 86e and compiled it on my Linux Mint 17.2 system.




ImmutableOctet(SKNG)(Posted 2016) [#2]
I think this is a Linux specific issue (Or even a display server issue), because it only says 720 for me.

I'm running Windows 10 Pro (x64) with an AMD Radeon HD 6950 using the 15.10 drivers (Which I need to update).


Richard Betson(Posted 2016) [#3]
Emm,

I guess not a bug. What is going on is when the application window is set to be re-sizable (#GLFW_WINDOW_RESIZABLE=True) it is initially 720 in height. Then when the application window opens it is resized (by OS) to fit KDE's desktop allowing for the task bar height essentially automatically adjusting the applications window height.

Learning is fun. :/


dawlane(Posted 2016) [#4]
@Richard: Your right it's not a bug. It's actually the correct behaviour for the window managers on Linux. You will find that DeviceWidth will also report something different from what you expect. If you look closely, you will see that when GLFW_WINDOW_RESIZABLE is set to false, you will be missing the right and bottom window boarders. When GLFW_WINDOW_RESIZABLE is true and the window exceeds the physical display mode set for that monitor, then the window manager correctly adjusts the window to fit.
A quirk that you should be aware of when using full screen modes is, you must preserve the current resolution so you can restore it, if you intend to change a resolution for your application. No doing this before exiting the application will put the display server into virtual display mode. By this I mean the physical monitor resolution mode will small; say 800x600, while the desktop could be 1920x1200.