GNOME Bugzilla – Bug 760509
GdkWindow positions/sizes include css margins
Last modified: 2016-01-13 04:06:22 UTC
Created attachment 318845 [details] [review] Use the content allocation for GtkButton/GtkCheckbutton I'm not sure if this is also the case for the allocation in the gadget's allocate function, but at least for widgets that move_resize their windows in size_allocate, the allocation now includes the margins set in css, which is never really what is wanted(?). One example are buttons in headerbars now, which get a 6px top/bottom margin set via css, see http://videobin.org/+b6p/em3.ogg
Would also be nice to clarify where one is suposed to gdk_window_move_resize the GdkWindows, does it even matter wheter one does it size_allocate or the allocate function of the gadget? Even if it doesn't, it would be nice if all widgets did it in the same place.
Review of attachment 318845 [details] [review]: looks right to me. One consideration, though: people have actually asked for this kind of overflow for window buttons in maximized windows.
Do you have a preference for where to do all the gdk_window_move_resize logic? the gadget allocate or size_allocate? Also this seems to be broken in basically every widget -- switch, entry, spinbutton, ...
Created attachment 318901 [details] [review] switch: Fix input window and label positioning
Created attachment 318908 [details] [review] button: Don't include margin in input window size
Review of attachment 318908 [details] [review]: looks right
Review of attachment 318901 [details] [review]: note that the window gets a different size when it is initially created in realize. Maybe it doesn't matter. ::: gtk/gtkswitch.c @@ +622,3 @@ + label_x = x + ((width / 2) - rect.width) / 2; + label_y = y + (height - rect.height) / 2; Is this an unrelated fix that should be in a separate commit ?
Created attachment 318910 [details] [review] modelbutton: Don't incliude margin in input window size
(In reply to Matthias Clasen from comment #7) > Review of attachment 318901 [details] [review] [review]: > > note that the window gets a different size when it is initially created in > realize. Maybe it doesn't matter. > > ::: gtk/gtkswitch.c > @@ +622,3 @@ > > + label_x = x + ((width / 2) - rect.width) / 2; > + label_y = y + (height - rect.height) / 2; > > Is this an unrelated fix that should be in a separate commit ? yeah, probably. will make it 2.
Review of attachment 318910 [details] [review]: looks good
Created attachment 318918 [details] [review] switch: Fix text positioning
Created attachment 318919 [details] [review] switch: Don't include margins in input window size
Review of attachment 318918 [details] [review]: ok
Review of attachment 318919 [details] [review]: ok