After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 466000 - Fix GdkWindow nesting in GtkSpinButton
Fix GdkWindow nesting in GtkSpinButton
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.11.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-08-12 17:04 UTC by Jan Arne Petersen
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make panel window a child of widget->window (8.03 KB, patch)
2007-08-12 17:05 UTC, Jan Arne Petersen
none Details | Review
Fix an allocation bug in the previous patch. (14.82 KB, patch)
2007-08-23 12:39 UTC, Jan Arne Petersen
committed Details | Review
Fix wrong frame height assumption (804 bytes, patch)
2008-05-29 15:29 UTC, Jan Arne Petersen
none Details | Review
Screenshot High contrast theme (53.62 KB, image/png)
2008-06-04 14:52 UTC, Jan Arne Petersen
  Details
Use special casing for GtkSpinButtons (1.32 KB, patch)
2008-06-04 15:36 UTC, Jan Arne Petersen
committed Details | Review

Description Jan Arne Petersen 2007-08-12 17:04:39 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).
Comment 1 Jan Arne Petersen 2007-08-12 17:05:36 UTC
Created attachment 93548 [details] [review]
make panel window a child of widget->window
Comment 2 Kristian Rietveld 2007-08-22 16:50:15 UTC
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? ...
Comment 3 Jan Arne Petersen 2007-08-23 12:39:21 UTC
Created attachment 94185 [details] [review]
Fix an allocation bug in the previous patch.
Comment 4 Matthias Clasen 2007-09-07 04:34:02 UTC
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. 
Comment 5 Matthias Clasen 2008-05-25 03:49:58 UTC
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 ?

Comment 6 Jan Arne Petersen 2008-05-25 12:46:41 UTC
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).
Comment 7 Sven Neumann 2008-05-29 14:10:49 UTC
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.
Comment 8 Jan Arne Petersen 2008-05-29 15:29:20 UTC
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.
Comment 9 Sven Neumann 2008-06-04 14:05:37 UTC
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.
Comment 10 Jan Arne Petersen 2008-06-04 14:52:49 UTC
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.
Comment 11 Jan Arne Petersen 2008-06-04 15:36:34 UTC
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.
Comment 12 Matthias Clasen 2008-06-13 04:56:52 UTC
I've committed the last patch