GNOME Bugzilla – Bug 632357
Contact list pane start with zero size
Last modified: 2011-09-19 14:07:56 UTC
Created attachment 172542 [details] zero size contact list pane It is present, but it has zero size, so I have to drag the pane to see the contacts (attached screenshot). When this happens, there's another problem: when I type in the text entry to send a text, when the message is longer than the text entry, the whole window resizes with each character, instead of breaking the text like and keep the windows size (that was the usual behaviour in previous versions). I don't know if the second problem is related. This happens at least in jabber muc and irc. Empathy 2.32.0.1, Fedora 14 beta.
I confirm the "resize window on text entry" but happens even when the pane has the correct size. Should I file a different bug for this?
Created attachment 172544 [details] example of the 'resize' problem Just in case my explanation isn't clear enough :)
I've noticed that when you paste a long text in the text entry, the weird window resize doesn't happen. So it happens when typing in the text entry only.
(In reply to comment #0) > Created an attachment (id=172542) [details] > zero size contact list pane > > It is present, but it has zero size, so I have to drag the pane to see the > contacts (attached screenshot). Empathy is supposed to reuse the last used size but that seems broken indeed. > When this happens, there's another problem: when I type in the text entry to > send a text, when the message is longer than the text entry, the whole window > resizes with each character, instead of breaking the text like and keep the > windows size (that was the usual behaviour in previous versions). That's bug #587441
OK, thank you! I'm adding myself to the CC of bug #587441.
Humm that's actually harder to fix than I thought. The size of the pane is properly saved and restored. But for some reason, GTK+ changes the size of the pane after we restored it (during the call of chat_size_allocate). Ideally we should restore the size of the pane once the widget has been fully allocated, but I didn't manage to find a trick to do that. Help welcome.
taking
Ok, have a good understanding of what happens now: When the window is created, we do a gtk_window_resize() on it to restore saved size. But that takes effect only after an idle callback (resizes are queued into GTK). So until we re-enter mainloop, the window (and its content) has default small allocation. So when we do the gtk_paned_set_position() the position is bigger than its allocation so it gets forced to the max of the window's size. Later the window resize happens and the extra space is given to the chat part and not contact-list (that's what we want when user resizes the window) and so the position stay on right most. We don't have any choice but setting position in an idle callback after the queued resize of the window happened.
Created attachment 196944 [details] [review] EmpathyChat: Set slider position after a timeout This ensure that the window has resized before setting the position because GtkPaned needs to know its size allocation
Bah, I wanted to find a better solution, but that's the only thing that works...
Created attachment 196945 [details] [review] EmpathyChat: Set slider position after a timeout This ensure that the window has resized before setting the position because GtkPaned needs to know its size allocation
Review of attachment 196945 [details] [review]: ++
pushed.