Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 393156 - [ GTK+ 3 ] Shell.forceResize() gives Critical error when running with GTK+3
Summary: [ GTK+ 3 ] Shell.forceResize() gives Critical error when running with GTK+3
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M4   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 393351 (view as bug list)
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-10-30 10:43 EDT by Anatoly Spektor CLA
Modified: 2012-11-16 10:56 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2012-10-30 10:43:23 EDT
When trying to run any snippet that includes Shell with GTK+ 3 this error occur:

(SWT:15686): Gtk-CRITICAL **: gtk_scrollable_get_vscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed

Cause of this error is Shell.forceResize(width,height) line 946:

OS.gtk_widget_size_allocate (vboxHandle, allocation);


To reproduce I used Helloworld2.java.
Comment 1 Anatoly Spektor CLA 2012-10-30 10:57:44 EDT
One more place where this error is triggered is Shell.setVisible(visible) line 2102:

OS.gtk_widget_show (shellHandle);
Comment 2 Anatoly Spektor CLA 2012-11-01 14:17:34 EDT
(In reply to comment #1)
> One more place where this error is triggered is Shell.setVisible(visible)
> line 2102:
> 
> OS.gtk_widget_show (shellHandle);

Also same error persist when you move, resize shell.
Comment 3 Silenio Quarti CLA 2012-11-02 10:28:50 EDT
This is happening because we add a GtkFixed to a GtkScrolledWindow. In GTK 3, we can only added a GtkScrollable.

There is a bigger problem with our uses of GtkFixed. Composite.moveAbove() and Composite.moveBelow() expects to access the children field of GtkFixed so that it can change the Z-order.  This field is not public anymore and there is no way to get a hold of it.

To solve the first problem, we could use GtkLayout instead of GtkFixed, but GtkLayout also hides its children field.

I see no way around this other than having our own implementation of GtkScrollable.

I have a fix ready below. I will push to master when M3 is done. Eclipse is running much better with all the fix in that branch.

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=silenio/Bug389910&id=28693b715394e6d7185e331f748190abf197da68
Comment 4 Silenio Quarti CLA 2012-11-02 10:29:19 EDT
*** Bug 393351 has been marked as a duplicate of this bug. ***
Comment 5 Silenio Quarti CLA 2012-11-02 16:27:20 EDT
Pushed to master.