comparison mac/dw.m @ 1792:b0bdec1b820c

Similar fixes to the Mac one on OS/2 and Windows.... Plus a performance optimization on all three platforms. Don't redraw the window if the calculated control size did not change.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 05 Aug 2012 13:47:57 +0000
parents ed8851658015
children 9304241b7b33
comparison
equal deleted inserted replaced
1791:ed8851658015 1792:b0bdec1b820c
8916 Item *item = _box_item(handle); 8916 Item *item = _box_item(handle);
8917 8917
8918 /* Check to see if any of the sizes need to be recalculated */ 8918 /* Check to see if any of the sizes need to be recalculated */
8919 if(item && (item->origwidth == -1 || item->origheight == -1)) 8919 if(item && (item->origwidth == -1 || item->origheight == -1))
8920 { 8920 {
8921 _control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL); 8921 int newwidth, newheight;
8922 /* Queue a redraw on the top-level window */ 8922
8923 _dw_redraw([object window], TRUE); 8923 _control_size(handle, &newwidth, &newheight);
8924
8925 /* Only update the item and redraw the window if it changed */
8926 if((item->origwidth == -1 && item->width != newwidth) ||
8927 (item->origheight == -1 && item->height != newheight))
8928 {
8929 if(item->origwidth == -1)
8930 item->width = newwidth;
8931 if(item->origheight == -1)
8932 item->height = newheight;
8933 /* Queue a redraw on the top-level window */
8934 _dw_redraw([object window], TRUE);
8935 }
8924 } 8936 }
8925 } 8937 }
8926 8938
8927 /* 8939 /*
8928 * Sets the text used for a given window's floating bubble help. 8940 * Sets the text used for a given window's floating bubble help.