Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 510647 - Non-resizable Shells open with wrong size (200x200)
Summary: Non-resizable Shells open with wrong size (200x200)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 4.6.3   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 508692
Blocks:
  Show dependency tree
 
Reported: 2017-01-18 14:25 EST by Markus Keller CLA
Modified: 2017-01-19 13:58 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2017-01-18 14:25:02 EST
Eclipse SDK
Version: Oxygen (4.7)
Build id: I20170105-0320
OS: Linux, v.3.2.0-120-generic-pae, x86 / gtk 3.4.2, WebKit 1.8.3

Every once in a while, non-resizable dialogs open with size 200x200. I've only seen this in recent builds. I've seen it for dialogs from Debug (E.g. when trying to launch a runtime Eclipse that is already running, or when Hot Code Replace failed. Easiest to reproduce for me is with the text editor's "Go to Line" dialog (Ctrl+L).

I can also reproduce with Snippet295. The problem shows up more often when I move the mouse while opening the dialog. I think moving the mouse around the right half of the dialog makes it happen more often.

This is on an old machine with GTK 3.4.2 (Ubuntu 12.04) via VNC. I could not reproduce on a newer machine with GTK 3.18.9.

The bug has been introduced between v4723g and v4724. Reverting https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=c522b03e3a4f934d453256d7bba55fbc4c375f6d (bug 508692) fixes the problem.

Here's a stacktrace I made when a conditional breakpoint hit (width == 200):

	at org.eclipse.swt.widgets.Shell.resizeBounds(Shell.java:1872)
	at org.eclipse.swt.widgets.Shell.gtk_size_allocate(Shell.java:1572)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1987)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5808)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5483)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2081)
	at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:2424)
	at org.eclipse.swt.widgets.Shell.open(Shell.java:1674)
	at org.eclipse.jface.window.Window.open(Window.java:790)
	at org.eclipse.ui.texteditor.GotoLineAction.run(GotoLineAction.java:228)
Comment 1 Markus Keller CLA 2017-01-18 14:34:46 EST
A fix in master is to change the "if (OS.GTK3)" Shell#gtk_size_allocate(..) to "if (false)".
Comment 2 Markus Keller CLA 2017-01-18 14:36:12 EST
Should get fixed ASAP in master, so that we have more time to test it before fixing the backport in 4.6.3.
Comment 3 Alexander Kurtakov CLA 2017-01-18 14:57:42 EST
(In reply to Markus Keller from comment #1)
> A fix in master is to change the "if (OS.GTK3)" Shell#gtk_size_allocate(..)
> to "if (false)".

That's not a fix as it will make eclipse totally unusable (menubar invisible, diaalog/shells missing parts and etc.) under wayland. The fact that you don't experience this on Gtk 3.18 makes me believe this is bug in GTK 3.4 or even one of the many GTK issues introduced by the additional unstable modules Ubuntu shipped. If noone has better idea and due to lack of time I will change the guard to OS.GTK_VERSION >= OS.VERSION(3, 6, 0)
Comment 4 Eclipse Genie CLA 2017-01-18 15:09:10 EST
New Gerrit change created: https://git.eclipse.org/r/89043
Comment 5 Leo Ufimtsev CLA 2017-01-18 15:42:32 EST
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/89043

Thank you Markus for catching this problem and listing snippet 295.

I've tested with Snippet 295 across various gtk versions.  The issue only occurs on gtk3.4. On Gtk3.6, 3.8,3.10, 3.12, 3.14, 3.16, 3.18, 3.22 the issue does not occur.

As such Alex's patch should resolve the issue.
Comment 7 Eclipse Genie CLA 2017-01-18 16:04:14 EST
New Gerrit change created: https://git.eclipse.org/r/89046
Comment 8 Alexander Kurtakov CLA 2017-01-18 16:05:10 EST
Markus, please push the patch for 4.6.3 if your testing is successful.
Comment 10 Markus Keller CLA 2017-01-19 13:58:04 EST
Thanks Leo for checking all versions and thanks Alex for the fix.
Tested on master and R4_6_maintenance and pushed the fix for the latter.