GNOME Bugzilla – Bug 466000
Fix GdkWindow nesting in GtkSpinButton
Last modified: 2011-02-04 16:11:11 UTC
In the current GtkSpinButton implementation the panel window is no child-window of widget->window but of widget->parent->window (with widget->parent->window != widget->window). This causes some problems in algorithms which assume, that widgets only consist of widget->window and childs (like bug 457642 and bug 318807).
Created attachment 93548 [details] [review] make panel window a child of widget->window
Putting on 2.12 Freeze, would be good to get fixed so tooltips work nicely on it ;) Is this windows hierarchies like this an ABI change btw? ...
Created attachment 94185 [details] [review] Fix an allocation bug in the previous patch.
I don't think we consider such details of the window hierarchy part of the ABI. I think the patch is a bit too big this close to the 2.12 release.
We should try to get this in before 2.14, at least... Patch looks ok on cursory inspection. I assume you have tested this with e.g RTL languages and with themes that change some relevant parameters ?
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org> * gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size), (gtk_entry_get_text_area_size), (gtk_entry_draw_frame): * gtk/gtkentry.h: * gtk/gtkspinbutton.c: (gtk_spin_button_class_init), (gtk_spin_button_realize), (gtk_spin_button_size_allocate), (gtk_spin_button_expose), (gtk_spin_button_draw_arrow), (gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify), (gtk_spin_button_grab_notify), (gtk_spin_button_state_changed), (start_spinning), (gtk_spin_button_button_release), (gtk_spin_button_motion_notify), (gtk_spin_button_value_changed), (gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin), (gtk_spin_button_update): Reorder strange window hierarchy of the GtkSpinButton (#466000).
The change to gtkentry.c breaks rendering for some cases. The old code used to render the entry's frame to the size allocated by the entry's window. The new code only looks at the text area and the borders. It assumes that the entry would only allocate it's size request. That's a wrong assumption to make because the entry expands vertically and the frame should expand with it. Please revert the changes to gtkentry.c.
Created attachment 111737 [details] [review] Fix wrong frame height assumption It seems to be only a problem for the height? That should be fixed with this patch.
That change will most probably fix it. But now you got to explain me why the width can not also be taken from the drawable. I guess I simply did not understand the point of your initial patch.
Created attachment 112136 [details] Screenshot High contrast theme (In reply to comment #9) > That change will most probably fix it. But now you got to explain me why the > width can not also be taken from the drawable. I guess I simply did not > understand the point of your initial patch. The reason was backward compatibility with HighContrast and other themes. See attached screenshot, the top one with the width taken from widget->window the second one with the width based on get_text_area_size.
Created attachment 112142 [details] [review] Use special casing for GtkSpinButtons This patch would allow GtkIconEntry (Bug 85292) to use the get_text_area_size virtual function instead of moving entry->text_area by itself.
I've committed the last patch