]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Correctly initialise the minimum width when getting minimal window
authorCharlie Brej <cbrej@cs.man.ac.uk>
Mon, 22 Mar 2010 23:33:21 +0000 (23:33 +0000)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Mon, 22 Mar 2010 23:33:21 +0000 (23:33 +0000)
Values were preset to zero which was the smallest width/height.

src/plugins/splash/script/script-lib-sprite.c

index c27ac10c06d894056e4fef3d10d35c1e7ab87b9f..1baf511d3daf27ad2e3a8ed683688c39d9559ba2 100644 (file)
@@ -230,7 +230,10 @@ static script_return_t sprite_window_get_width (script_state_t *state,
        node = ply_list_get_next_node (data->displays, node))
     {
       display = ply_list_node_get_data (node);
-      width = MIN (width, ply_pixel_display_get_width (display->pixel_display));
+      if (width == 0)
+        width = ply_pixel_display_get_width (display->pixel_display);
+      else
+        width = MIN (width, ply_pixel_display_get_width (display->pixel_display));
     }
   return script_return_obj (script_obj_new_number (width));
 }
@@ -267,7 +270,10 @@ static script_return_t sprite_window_get_height (script_state_t *state,
        node = ply_list_get_next_node (data->displays, node))
     {
       display = ply_list_node_get_data (node);
-      height = MIN (height, ply_pixel_display_get_height (display->pixel_display));
+      if (height == 0)
+        height = ply_pixel_display_get_height (display->pixel_display);
+      else
+        height = MIN (height, ply_pixel_display_get_height (display->pixel_display));
     }
   return script_return_obj (script_obj_new_number (height));
 }