From: Olaf Wintermann Date: Fri, 30 May 2025 15:22:01 +0000 (+0200) Subject: add threshold to WindowAdjustAspectRatio to prevent resizing loop with some window... X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;p=uwplayer.git add threshold to WindowAdjustAspectRatio to prevent resizing loop with some window managers --- diff --git a/application/window.c b/application/window.c index 96a4510..8d8a285 100644 --- a/application/window.c +++ b/application/window.c @@ -738,12 +738,17 @@ void WindowAdjustAspectRatio(MainWindow *win) { Dimension new_width = p_width + win_width - player_width; Dimension new_height = p_height + win_height - player_height; + if(abs((int)new_width-(int)win_width) <= 1 && abs((int)new_height - (int)win_height) <= 1) { + return; + } + XSizeHints hints; hints.flags = PAspect; hints.min_aspect.x = new_width; hints.min_aspect.y = new_height; hints.max_aspect.x = new_width; hints.max_aspect.y = new_height; + //printf("new size: %d x %d current: %d x %d\n", (int)new_width, (int)new_height, (int)win_width, (int)win_height); XSetWMNormalHints(XtDisplay(win->window), XtWindow(win->window), &hints); }