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 135903 - GtkDialog doesn't redraw area after resizable is set
GtkDialog doesn't redraw area after resizable is set
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.6.x
Other Linux
: High normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
: 155190 155526 (view as bug list)
Depends on:
Blocks: 135902
 
 
Reported: 2004-03-02 01:03 UTC by Jonathan Blandford
Modified: 2005-06-21 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sshot showing bug (41.95 KB, image/png)
2004-03-02 01:04 UTC, Jonathan Blandford
  Details
Superimposed shot of before and after (48.76 KB, image/png)
2004-03-02 01:05 UTC, Jonathan Blandford
  Details
Testcase in C (2.38 KB, text/x-c)
2005-01-24 15:35 UTC, Nickolay V. Shmyrev
  Details
Patch (3.62 KB, patch)
2005-01-24 15:36 UTC, Nickolay V. Shmyrev
none Details | Review
Patch (4.25 KB, patch)
2005-01-24 15:41 UTC, Nickolay V. Shmyrev
none Details | Review

Description Jonathan Blandford 2004-03-02 01:03:33 UTC
If I change a dialog from not resizable to resizable, any widgets that are
now drawn where the old window was are not drawn correctly.  Two
screenshots are attached to clarify the issue.  One is of the bug, the
other is the bug superimposed with the  'before shot' at a low alpha.
Comment 1 Jonathan Blandford 2004-03-02 01:04:47 UTC
Created attachment 25008 [details]
sshot showing bug
Comment 2 Jonathan Blandford 2004-03-02 01:05:27 UTC
Created attachment 25009 [details]
Superimposed shot of before and after
Comment 3 Jonathan Blandford 2004-03-07 21:25:17 UTC
There are a few more comments on this at:
http://bugzilla.gnome.org/show_bug.cgi?id=135902
Comment 4 Soren Sandmann Pedersen 2004-03-07 22:24:24 UTC
The situation is:

    - w is not visible and its position is outside its parents
    allocation.

    - someone calls gtk_widget_show(w), which queues a resize on
     w and it parent. Also w's position is invalidated

    - gdk_window_process_updates() is called, but w is not drawn
      at this point because it is outside its parent's allocation

    - w is size allocated, but doesn't change size or is 
      !redraw_on_allocate, so isn't invalidated

A similar argument applies to children of w.

So, it seems we will need a flag or something to indicate that the
next size allocate is the first one after map and so _has_ to
invalidate the widget, no matter what the widget itself thinks.

Also, it seems that the queue_resize() done by gtk_widget_show()
should actually be a "deep" resize so that all the children will also
be size allocated.
Comment 5 Owen Taylor 2004-03-11 21:18:18 UTC
A private GTK_REPAINT_NEEDED flag sounds approximately right;
another possibility would be to set a widgets allocation back
to -1-1x1x1 on unmapping it, but that has at least the 
potential to be less efficient / more side-effect causing.
Comment 6 Elijah Newren 2004-06-19 18:45:40 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.
Comment 7 Nickolay V. Shmyrev 2005-01-20 19:24:35 UTC
*** Bug 155190 has been marked as a duplicate of this bug. ***
Comment 8 Nickolay V. Shmyrev 2005-01-24 15:35:08 UTC
Created attachment 36452 [details]
Testcase in C
Comment 9 Nickolay V. Shmyrev 2005-01-24 15:36:49 UTC
Created attachment 36453 [details] [review]
Patch

This patch fixes the problem with introducing new private flag ALLOC_INVALID
which shows that allocation structure is not valid anymore. This flag is set in
gtk_widget_real_hide and unset in gtk_widget_size_allocate and forces widget
redraw.
Comment 10 Nickolay V. Shmyrev 2005-01-24 15:39:05 UTC
Also, note that bug 135502 describes workaround this problem in
GtkFileChooserDefault. Probably, it this workaround should be removed when this
bug will be fixed.
Comment 11 Nickolay V. Shmyrev 2005-01-24 15:41:58 UTC
Created attachment 36454 [details] [review]
Patch 

Sorry, the bug about filechooser was 135902. And here is updated patch.
Comment 12 Matthias Clasen 2005-05-18 04:34:31 UTC
Hmm, I'm not seeing the problem with either your testcase or the filechooser
after removing the workaround on cvs HEAD. I do see it on 2.6. So maybe the
cairo changes have fixed this somehow ?
Comment 13 Matthias Clasen 2005-05-18 16:23:27 UTC
This happens to be fixed by the draw-border changes in cvs HEAD, so I'm just
going to remove the workaround in gtkfilechooserdefault.c
Comment 14 Owen Taylor 2005-05-18 16:30:45 UTC
Just to explain why briefly - the reason is that now 
gtk_widget_queue_draw() on a widget draws the bounding box
of the widget and all (mapped) children rather than just
the bounding box of the widget.

So, this means that queue_draw() works properly in the intermediate
state where we've mapped the child, but not yet reallocated the parent.
Comment 15 Matthias Clasen 2005-06-21 13:34:20 UTC
*** Bug 155526 has been marked as a duplicate of this bug. ***