]> uap-core.de Git - uwplayer.git/commitdiff
add threshold to WindowAdjustAspectRatio to prevent resizing loop with some window... default
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Fri, 30 May 2025 15:22:01 +0000 (17:22 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Fri, 30 May 2025 15:22:01 +0000 (17:22 +0200)
application/window.c

index 96a4510d0918f4fbfdf623323abcf5a461783219..8d8a285ebbe1f65933478cc3db2eba9ac243fedc 100644 (file)
@@ -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);
 }