Bug 408505 - [GTK 3.8] In ControlExample when switching Tabs CoolBar is not visible
Summary: [GTK 3.8] In ControlExample when switching Tabs CoolBar is not visible
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 M1   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 408503 (view as bug list)
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2013-05-20 12:54 EDT by Anatoly Spektor CLA
Modified: 2017-06-23 15:48 EDT (History)
3 users (show)

See Also:


Attachments
ControlExample bug in GTK 3.8 screenshot (72.26 KB, image/png)
2013-05-20 12:54 EDT, Anatoly Spektor CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2013-05-20 12:54:01 EDT
Created attachment 231220 [details]
ControlExample bug in GTK 3.8 screenshot

I use: F19a 64bit, GTK 3.8, Eclipse Juno

How to reproduce:

1. Open ControlExample
2. Switch Tab

You will see:
SWT:5325): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed

(SWT:5325): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed

(SWT:5325): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 32670

in the console.

In attached screenshot you can see how it looks graphically.
Comment 1 Anatoly Spektor CLA 2013-05-27 16:29:52 EDT
(In reply to comment #0)
> Created attachment 231220 [details]
> ControlExample bug in GTK 3.8 screenshot
> 
> I use: F19a 64bit, GTK 3.8, Eclipse Juno
> 
> How to reproduce:
> 
> 1. Open ControlExample
> 2. Switch Tab
> 
> You will see:
> SWT:5325): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width:
> assertion `width >= 0' failed
> 
> (SWT:5325): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width:
> assertion `width >= 0' failed
> 
> (SWT:5325): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate
> widget with width -5 and height 32670
> 
> in the console.
> 
> In attached screenshot you can see how it looks graphically.

After numerous tests if appears to me that changes in GTK 3.8 imply that if widget is hidden, widget_size_allocate() does not allocate size properly. 

Here is the patch,  which makes widget visible, before GridLayout in ControlExample allocates size for it:

http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=bug_408505

I would  be glad to hear your thoughts on that one.
Comment 2 Alexander Kurtakov CLA 2013-05-27 16:38:49 EDT
Silenio, could we target this for Kepler ? It prevents many misrendering issues with Gtk 3.8.
Comment 3 Silenio Quarti CLA 2013-05-27 17:56:24 EDT
It is quite late for this (RC3 week), but we can try to fix it for 4.3, since it only affects GTK3.

I have not been able to test the patch yet but I believe it has a quite bad side effect: widgets that are not visible will become visible by calling Control.setBounds().  This most certainly will break other places.
Comment 4 Anatoly Spektor CLA 2013-05-27 19:08:49 EDT
(In reply to comment #3)
> It is quite late for this (RC3 week), but we can try to fix it for 4.3,
> since it only affects GTK3.
> 
> I have not been able to test the patch yet but I believe it has a quite bad
> side effect: widgets that are not visible will become visible by calling
> Control.setBounds().  This most certainly will break other places.

I suppose it is a silly proposal, but we can hide widget after widget_allocation is done... Otherwise widgets there are hidden are not shown at all.
Comment 5 Silenio Quarti CLA 2013-05-28 12:12:17 EDT
(In reply to comment #4)
> I suppose it is a silly proposal, but we can hide widget after
> widget_allocation is done... Otherwise widgets there are hidden are not
> shown at all.

Maybe hiding the widget again after size_allocate is ok.  It might cause unexpected redraws though (which may affect performance). I am getting Fedora 19 beta to be able to reproduce the problem and try the fix out.
Comment 6 Anatoly Spektor CLA 2013-05-29 15:12:38 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > I suppose it is a silly proposal, but we can hide widget after
> > widget_allocation is done... Otherwise widgets there are hidden are not
> > shown at all.
> 
> Maybe hiding the widget again after size_allocate is ok.  It might cause
> unexpected redraws though (which may affect performance). I am getting
> Fedora 19 beta to be able to reproduce the problem and try the fix out.

You will also get numerous of GSignal errors when you run Eclipse in F19. I have proposed a solution for this here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=407077
Comment 7 Anatoly Spektor CLA 2013-07-01 10:18:03 EDT
(In reply to comment #3)
> It is quite late for this (RC3 week), but we can try to fix it for 4.3,
> since it only affects GTK3.
> 
> I have not been able to test the patch yet but I believe it has a quite bad
> side effect: widgets that are not visible will become visible by calling
> Control.setBounds().  This most certainly will break other places.

Silenio addressing your issue, I have updated my patch. Now it will check if widget is visible, show it, allocate size and hide it right away. I have tested it with ControlExample and it works the same as the previous patch, which I have posted. I would appreciate your feedback.

The updated patch can be found here:

http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=widget_show_2
Comment 8 Alexander Kurtakov CLA 2013-07-23 03:05:49 EDT
*** Bug 408503 has been marked as a duplicate of this bug. ***
Comment 9 Alexander Kurtakov CLA 2013-07-23 03:07:15 EDT
Slightly modified to show/hide only for GTK 3.8 or newer is pushed to master.

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=c7907f96191641b1b0c373205c20d6cc221d8499