mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 16:54:35 +00:00
Fix loss of window size and position, if it was maximized.
This commit is contained in:
parent
3b241baa52
commit
28c176d3aa
@ -348,14 +348,16 @@ int main( int argc, char** argv )
|
|||||||
FILE* f = fopen( winPosFile.c_str(), "wb" );
|
FILE* f = fopen( winPosFile.c_str(), "wb" );
|
||||||
if( f )
|
if( f )
|
||||||
{
|
{
|
||||||
glfwGetWindowPos( window, &x, &y );
|
|
||||||
glfwGetWindowSize( window, &w, &h );
|
|
||||||
#ifdef GLFW_MAXIMIZED
|
#ifdef GLFW_MAXIMIZED
|
||||||
uint32_t maximized = glfwGetWindowAttrib( window, GLFW_MAXIMIZED );
|
uint32_t maximized = glfwGetWindowAttrib( window, GLFW_MAXIMIZED );
|
||||||
|
if( maximized ) glfwRestoreWindow( window );
|
||||||
#else
|
#else
|
||||||
uint32_t maximized = 0;
|
uint32_t maximized = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
glfwGetWindowPos( window, &x, &y );
|
||||||
|
glfwGetWindowSize( window, &w, &h );
|
||||||
|
|
||||||
uint32_t data[5] = { uint32_t( x ), uint32_t( y ), uint32_t( w ), uint32_t( h ), maximized };
|
uint32_t data[5] = { uint32_t( x ), uint32_t( y ), uint32_t( w ), uint32_t( h ), maximized };
|
||||||
fwrite( data, 1, sizeof( data ), f );
|
fwrite( data, 1, sizeof( data ), f );
|
||||||
fclose( f );
|
fclose( f );
|
||||||
|
Loading…
Reference in New Issue
Block a user