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

Bug 363582

Summary: [QuickAccess] Quick access closes during resize
Product: [Eclipse Project] Platform Reporter: Dean Roberts <dean.t.roberts>
Component: UIAssignee: Dean Roberts <dean.t.roberts>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gheorghe, pwebster
Version: 4.2Flags: dean.t.roberts: review? (pwebster)
Target Milestone: 4.2 M4   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 362421    
Attachments:
Description Flags
Patch
none
Fix pre-existing warnings in SearchField - Apply after real patch none

Description Dean Roberts CLA 2011-11-11 08:36:09 EST
Very hard to resize the Quick access list since it tends to close at random points during the resize.
Comment 1 Dean Roberts CLA 2011-11-11 08:38:50 EST
Created attachment 206841 [details]
Patch
Comment 2 Dean Roberts CLA 2011-11-11 08:45:27 EST
Created attachment 206842 [details]
Fix pre-existing warnings in SearchField - Apply after real patch
Comment 3 Paul Webster CLA 2011-11-11 10:42:10 EST
I still get the same problem when I start to drag a corner on my linux box.  It almost immediately disappears.

It only works if I activate the shell (by using the down arrow or something).  Then I can resize it.

PW
Comment 4 Dean Roberts CLA 2011-11-15 15:19:21 EST
The problem on Linux appears to be Linux specific and an SWT issue.  I've asked Bogdan to take a look at it.

In essence, The Text widget is losing Focus which is calling SearchField.checkFocusLost() but the checkFocusLost() code is executing before a new focusControl is set.

This can be confirmed by wrapping the code in checkFocusLost() with a syncExec rather than the existing asyncExec and observing the problem goes away.

However, syncExec is not a valid fix.

Silenio pointed out that this is the same pattern as content assist, and that it would seem the content assist folks worked around it.
Comment 5 Dean Roberts CLA 2011-11-15 15:20:28 EST
I suggest that this patch could (should?) be released as is, since it does fix the Windows case and makes the Linux case no worse.

It would also allow the applying of the other QuickAssist patches I've submitted without getting into overlap hell.
Comment 6 Bogdan Gheorghe CLA 2011-11-15 18:03:46 EST
On Linux, during a resize, there will be no focus control set (can't do anything about that).

We might be able to get around the problem by checking the current active shell. If it is the same as the table's shell then run away, else keep going. This seemed to work on both Win32 and Linux, but some more testing is warranted.

Something like this:

protected void checkFocusLost(final Table table, final Text text) {
   table.getDisplay().asyncExec(new Runnable() {
     public void run() {
       if (!table.isDisposed() && !text.isDisposed()) {
>>       if (table.getDisplay().getActiveShell() == table.getShell()) return;
					
[Rest is unchanged]
Comment 7 Paul Webster CLA 2011-11-16 09:33:31 EST
(In reply to comment #5)
> I suggest that this patch could (should?) be released as is, since it does fix
> the Windows case and makes the Linux case no worse.

I released the fix as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=31b6f47769902c006ddb775d5a08ce2d76b37fb5

I also released the warnings.  If I had better git-fu, I could have squashed the commits and then pushed, but no luck.

PW
Comment 8 Dean Roberts CLA 2011-11-17 08:58:09 EST
Marking as fixed.  Opened bug 360429 to track the Linux issue
Comment 9 Dean Roberts CLA 2011-12-06 13:07:20 EST
Verified on Windows 7 for build I20111205-2330