@@ -117,6 +117,9 @@ static void output_handle_geometry(void *data, struct wl_output *wl_output,
117117
118118 output -> geometry .x = x ;
119119 output -> geometry .y = y ;
120+ output -> geometry .physical_width = physical_width ;
121+ output -> geometry .physical_height = physical_height ;
122+ printf ("debug phys: %dmm x %dmm\n" , physical_width , physical_height );
120123 output -> transform = transform ;
121124}
122125
@@ -305,6 +308,7 @@ int main(int argc, char *argv[]) {
305308
306309 free (geometry );
307310 geometry = calloc (1 , sizeof (struct grim_box ));
311+
308312 if (!parse_box (geometry , geometry_str )) {
309313 fprintf (stderr , "invalid geometry\n" );
310314 return EXIT_FAILURE ;
@@ -478,6 +482,12 @@ int main(int argc, char *argv[]) {
478482 get_output_layout_extents (& state , geometry );
479483 }
480484
485+ printf ("debug output_layout_extents: %dpx x %dpx\n" , geometry -> width , geometry -> height );
486+ //TODO
487+ //int px_per_mm_x = geometry->width/(output_layout_extents_physical);
488+ //int px_per_mm_y = geometry->height/(output_layout_extents_physical);
489+ //printf("px/mm values: %d x %d\n", pxmm_x, pxmm_y);
490+
481491 cairo_surface_t * surface = render (& state , geometry , scale );
482492 if (surface == NULL ) {
483493 return EXIT_FAILURE ;
@@ -519,6 +529,7 @@ int main(int argc, char *argv[]) {
519529#endif
520530 }
521531 }
532+ printf ("Status was: %d, success is %d" , status , CAIRO_STATUS_SUCCESS );
522533 if (status != CAIRO_STATUS_SUCCESS ) {
523534 fprintf (stderr , "%s\n" , cairo_status_to_string (status ));
524535 if (status == CAIRO_STATUS_WRITE_ERROR && strlen (output_filepath ) > NAME_MAX ) {
0 commit comments