src/video/x11/SDL_x11modes.c
changeset 6940 142dcc136188
parent 6906 85ac6fbdf171
child 6941 9bb475091e51
equal deleted inserted replaced
6939:06a72f2f8b16 6940:142dcc136188
   574                 for (i = 0; i < nprop; ++i) {
   574                 for (i = 0; i < nprop; ++i) {
   575                     unsigned char *prop;
   575                     unsigned char *prop;
   576                     int actual_format;
   576                     int actual_format;
   577                     unsigned long nitems, bytes_after;
   577                     unsigned long nitems, bytes_after;
   578                     Atom actual_type;
   578                     Atom actual_type;
   579    
   579 
   580 	                if (props[i] == EDID) {
   580 	                if (props[i] == EDID) {
   581                         XRRGetOutputProperty(data->display, res->outputs[output], props[i],
   581                         if (XRRGetOutputProperty(data->display,
   582                                              0, 100, False, False,
   582                                                  res->outputs[output], props[i],
   583                                              AnyPropertyType,
   583                                                  0, 100, False, False,
   584                                              &actual_type, &actual_format,
   584                                                  AnyPropertyType,
   585                                              &nitems, &bytes_after, &prop);
   585                                                  &actual_type, &actual_format,
   586 
   586                                                  &nitems, &bytes_after, &prop) == Success ) {
   587                         MonitorInfo *info = decode_edid(prop);
   587                             MonitorInfo *info = decode_edid(prop);
   588                         if (info) {
   588                             if (info) {
   589 #ifdef X11MODES_DEBUG
   589     #ifdef X11MODES_DEBUG
   590                             printf("Found EDID data for %s\n", output_info->name);
   590                                 printf("Found EDID data for %s\n", output_info->name);
   591                             dump_monitor_info(info);
   591                                 dump_monitor_info(info);
   592 #endif
   592     #endif
   593                             SDL_strlcpy(display_name, info->dsc_product_name, sizeof(display_name));
   593                                 SDL_strlcpy(display_name, info->dsc_product_name, sizeof(display_name));
   594                             free(info);
   594                                 free(info);
       
   595                             }
       
   596                             SDL_free(prop);
   595                         }
   597                         }
   596                         break;
   598                         break;
   597                     }
   599                     }
       
   600                 }
       
   601                 if (props) {
       
   602                     SDL_free(props);
   598                 }
   603                 }
   599 
   604 
   600                 if (*display_name && inches) {
   605                 if (*display_name && inches) {
   601                     size_t len = SDL_strlen(display_name);
   606                     size_t len = SDL_strlen(display_name);
   602                     SDL_snprintf(&display_name[len], sizeof(display_name)-len, " %d\"", inches);
   607                     SDL_snprintf(&display_name[len], sizeof(display_name)-len, " %d\"", inches);