mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-28 05:58:29 +00:00
Fix loss of window size and position, if it was maximized.
This commit is contained in:
@@ -348,14 +348,16 @@ int main( int argc, char** argv )
|
||||
FILE* f = fopen( winPosFile.c_str(), "wb" );
|
||||
if( f )
|
||||
{
|
||||
glfwGetWindowPos( window, &x, &y );
|
||||
glfwGetWindowSize( window, &w, &h );
|
||||
#ifdef GLFW_MAXIMIZED
|
||||
uint32_t maximized = glfwGetWindowAttrib( window, GLFW_MAXIMIZED );
|
||||
if( maximized ) glfwRestoreWindow( window );
|
||||
#else
|
||||
uint32_t maximized = 0;
|
||||
#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 };
|
||||
fwrite( data, 1, sizeof( data ), f );
|
||||
fclose( f );
|
||||
|
||||
Reference in New Issue
Block a user