mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Prevent window resizes on DPI change.
This commit is contained in:
parent
4fbef01729
commit
c673056dd4
@ -220,7 +220,13 @@ static void RecomputeScale()
|
|||||||
{
|
{
|
||||||
if( out.second->entered && out.second->scale > max ) max = out.second->scale;
|
if( out.second->entered && out.second->scale > max ) max = out.second->scale;
|
||||||
}
|
}
|
||||||
if( s_maxScale != max ) tracy::s_wasActive = true;
|
if( s_maxScale != max )
|
||||||
|
{
|
||||||
|
tracy::s_wasActive = true;
|
||||||
|
s_w = s_w / s_maxScale * max;
|
||||||
|
s_h = s_h / s_maxScale * max;
|
||||||
|
wl_egl_window_resize( s_eglWin, s_w, s_h, 0, 0 );
|
||||||
|
}
|
||||||
s_maxScale = max;
|
s_maxScale = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,7 +651,13 @@ static void SurfaceLeave( void*, struct wl_surface* surface, struct wl_output* o
|
|||||||
|
|
||||||
static void SurfacePreferredBufferScale( void*, struct wl_surface* surface, int32_t scale )
|
static void SurfacePreferredBufferScale( void*, struct wl_surface* surface, int32_t scale )
|
||||||
{
|
{
|
||||||
if( s_maxScale != scale ) tracy::s_wasActive = true;
|
if( s_maxScale != scale )
|
||||||
|
{
|
||||||
|
tracy::s_wasActive = true;
|
||||||
|
s_w = s_w / s_maxScale * scale;
|
||||||
|
s_h = s_h / s_maxScale * scale;
|
||||||
|
wl_egl_window_resize( s_eglWin, s_w, s_h, 0, 0 );
|
||||||
|
}
|
||||||
s_maxScale = scale;
|
s_maxScale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,8 +863,8 @@ void Backend::NewFrame( int& w, int& h )
|
|||||||
m_winPos.maximize = s_maximized;
|
m_winPos.maximize = s_maximized;
|
||||||
if( !s_maximized )
|
if( !s_maximized )
|
||||||
{
|
{
|
||||||
m_winPos.w = s_w;
|
m_winPos.w = s_w / s_maxScale;
|
||||||
m_winPos.h = s_h;
|
m_winPos.h = s_h / s_maxScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
w = s_w;
|
w = s_w;
|
||||||
|
Loading…
Reference in New Issue
Block a user