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

Bug 135946

Summary: Virtual Tree eats shell activations
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: billy.biggs, daniel_megert, Mike_Wilson, snorthov, Tod_Creasey
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Bug Depends on:    
Bug Blocks: 135535    
Attachments:
Description Flags
2 SWT shells with a virtual tree none

Description Paul Webster CLA 2006-04-10 14:20:54 EDT
see bug 135535 - using ALT+TAB to switch between multiple workbench windows kills keybindings, because after one or two times the shell activation events go missing and/or show up for the wrong shell.

I'll attach an SWT program to demonstrate.
Comment 1 Paul Webster CLA 2006-04-10 14:25:12 EDT
Created attachment 38192 [details]
2 SWT shells with a virtual tree

start up both windows and switch between them ... fine.

Expand and select a second level item in one tree, switch to the other window and select text in the styledtext widget, and then ALT+TAB between them.  Sometimes I'll get the 2 activations, sometimes it'll skip an activation, and sometimes it always gives me the activation for the last active window (shell-1 when it should be shell-2).

I'm running gnome on:
Red Hat Enterprise Linux WS release 4 (Nahant Update 2)
Linux wspwebster 2.6.9-22.0.1.EL #1 Tue Oct 18 18:29:40 EDT 2005 i686 i686 i386 GNU/Linux
gtk2-2.4.13-18


Later,
PW
Comment 2 Tod Creasey CLA 2006-04-10 16:09:37 EDT
Paul

Here are my windows results

ASSP: handleEvent:19: Shell {Shell-2}
	newActiveShell: Shell {Shell-2}
ASSP: handleEvent:20: Tree {}
ASSP: handleEvent:21: Shell {Shell-1}
	newActiveShell: Shell {Shell-1}
ASSP: handleEvent:22: Tree {}
Comment 3 Silenio Quarti CLA 2006-04-10 17:57:57 EDT
SN and I are looking at this.
Comment 4 Silenio Quarti CLA 2006-04-11 17:29:03 EDT
Fixed > 20060411

This bug was caused by the work around for the "three wise men" bug #67979 (ontop shells that have focus cause GTK to go into "focus follows pointer" mode when they are disposed).  The old work around filtered the X queue (gasp).  The new work around uses XSetInputFocus() to hammer the X focus whenever an ontop shell is active (yikes).  Everyone needs to be on the look out for "wrong window coming to front" and "keys going nowhere" bugs.

Silenio & Steve
Comment 5 Billy Biggs CLA 2006-04-12 03:46:21 EDT
(Note that the real fix is to upgrade to GTK+ 2.6.8 where the GTK+
bug that causes this is fixed).

This is a very dangerous thing to change this late in 3.2.  I hope
this fix is good.
Comment 6 Paul Webster CLA 2006-04-12 13:49:08 EDT
With I20060412-1200 I can kill my keybindings very quickly.

In eclipse, open the second window and open some files.  CTRL+F7 to the outline view and select a method.

Now when I switch back to my first window (with editors active) I no longer get a caret and none of my key-presses seem to get through.

Once I click in the window, I still don't get a caret, but CTRL+J will insert a CR in the java editor (it's supposed to be incremental find).

PW
Comment 7 Paul Webster CLA 2006-04-12 15:07:38 EDT
I just ran a test with the SWT example and cannot reproduce the problem in straight SWT.  It seems to work fine.

PW
Comment 8 Silenio Quarti CLA 2006-04-12 17:57:07 EDT
The fix for the original problem missed some causes. Fixed > 20060412.

Paul, could you try the next RC1 candidate build?
Comment 9 Paul Webster CLA 2006-04-13 08:41:28 EDT
I've tried I20060413-0010 and it's a great improvement.  I haven't had the problem in the first 30 minutes (it used to take 30 seconds).

PW
Comment 10 Paul Webster CLA 2006-04-13 10:11:02 EDT
But I do get into this state eventually.

I'm receiving shell activation events but for only one of the 2 windows.  I no longer receive them for the second window.

PW