Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 492102

Summary: [GTK][Quick Access] getting smaller each time it is opened
Product: [Eclipse Project] Platform Reporter: Robert Roth <robert.roth.off>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: ericwill, Lars.Vogel, markus.kell.r, psuzzi
Version: 4.4.1Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=479409
Whiteboard:

Description Robert Roth CLA 2016-04-20 11:11:55 EDT
The quick access tooltip (Opened by clicking the text box or by Ctrl+3) is getting smaller each time opened, so eventually by using it repeatedly it will get too small to be useful, or even too small without resizing it. Having to resize it after using it a couple of times is not really user-friendly :)

Steps to reproduce:
1. start eclipse (I used Eclipse Neon 4.6 N20160419-2000 for this test)
2. Open the quick access (either by click or Ctrl+3 shortcut)
3. Close it (either by clicking somewhere else or by pressing escape)
4. Repeat steps 2-3 until you have no quick access left (if you do not resize the quick access tooltip)

Other info:
Using Fedora 23, gtk 3.18.9, all updates applied.
Comment 1 Lars Vogel CLA 2016-04-20 11:36:38 EDT
Most likely fixed via Bug 445900

*** This bug has been marked as a duplicate of bug 445900 ***
Comment 2 Markus Keller CLA 2016-04-20 14:24:07 EDT
(Un)fortunately, this bug is not directly related to bug 445900. I can reproduce this problem with SWT from before the changes for bug 445900, and it happens even on 4.5.2 and 4.4.1 on GTK2 and GTK3.
Comment 3 Lars Vogel CLA 2016-04-20 14:29:34 EDT
(In reply to Markus Keller from comment #2)
> (Un)fortunately, this bug is not directly related to bug 445900. I can
> reproduce this problem with SWT from before the changes for bug 445900, and
> it happens even on 4.5.2 and 4.4.1 on GTK2 and GTK3.

Should we move this bug to SWT?
Comment 4 Markus Keller CLA 2016-04-21 06:59:56 EDT
Shell#getBounds() starts to return too small values after the call to OS.gtk_widget_size_allocate() in Shell#forceResize().

It looks like the problem is that Shell#setBounds() is called before the shell is visible. The hack for bug 136323 looks wrong, since it only adjusts x & y, but doesn't touch width & height.

I did some experiments, and by trial-and-error, I found a "solution" in Shell#forceResize() that looks like it fixes this concrete scenario:

	int border = gtk_widget_get_mapped (shellHandle) ? OS.gtk_container_get_border_width (shellHandle) : 0;
...
	allocation.width = width + 2 * border;
	allocation.height = height + 2 * border;

Unfortunately, this "solution" has a few problems:
- It's obviously wrong to *add* the borders to width & height. Subtracting would make sense. I should not have tried that at all...
- Shell#getBounds() returns wrong values for quite some time until after the Shell has been made visible.
- When I resize the Content Assist popup, the label on the bottom gets cut off.

Maybe the problem is that Shell#getSizeInPixels()/getBoundsInPixels() uses OS.gtk_widget_get_allocation() to determine the shell's size. https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-get-allocation and https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-default-size say that this is not guaranteed to return the allocation that was previously set.

I looked into a better solution, but didn't find anything I'd be comfortable to touch at this time.
Comment 5 Eric Williams CLA 2018-05-16 15:51:35 EDT
I cannot reproduce this issue on GTK3.22/Fedora 28/4.8 M7. It's likely this was fixed in a bunch of the sizing changes.