Community
Participate
Working Groups
In Luna, the caret in text editors often disappears on MacOSX. I can still edit but see the caret is invisible. The caret reappears after some typing / clicking. It happens almost every time I switch between two Java editors by clicking on the tabs. Eclipse is running on Oracle Java SDK 1.8.0, MacOSX Mavericks 10.9.2. No special themes.
*** This bug has been marked as a duplicate of bug 431966 ***
Bug 431966 will be used to workaround this problem in Luna. Reopening this bug to track the actual problem and fix it in a proper manner.
(In reply to Abhishek Kishore from bug bug 431966 comment #6) > (In reply to Abhishek Kishore from comment #5) > > > > Caret.setFocus() is not getting called some times, causing this issue. > > Clicking on the tab the 2nd time does that. I'm still trying to understand > > the flow. > > Looks like this is happening because of changes made for bug 388574. > Display.ignoreFocus is true during setFocus() on StyledText, which means > FocusIn event on it is not being fired. That doesn't explain yet why the problem doesn't happen when WBWRenderer#forceLayout(Shell) (bug 431966 comment 4) is not called on startup.
I would like to mention that when investigating the issue it might be worth to take a look at the bug 375576, which partially introduced the bug 348954.
(In reply to Markus Keller from comment #3) > > > > Looks like this is happening because of changes made for bug 388574. > > Display.ignoreFocus is true during setFocus() on StyledText, which means > > FocusIn event on it is not being fired. > > That doesn't explain yet why the problem doesn't happen when > WBWRenderer#forceLayout(Shell) (bug 431966 comment 4) is not called on > startup. Completely different flows are leading to the setFocus() calls to StyledText in the 2 cases. When forceLayout(Shell) is called, MElementContainer.setSelectedElement(MUIElement) on line-1034 of org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer leads to a call to StyledText.setFocus(). Without forceLayout(Shell), AbstractPartRenderer.activate(MPart) on line-1038 calls StyledText.setFocus() eventually. Basically, the way focus shifts across widgets is very different with forceLayout(Shell) and I haven't managed to find a connection yet.
(In reply to Abhishek Kishore from comment #5) > > Completely different flows are leading to the setFocus() calls to StyledText > in the 2 cases. > When forceLayout(Shell) is called, > MElementContainer.setSelectedElement(MUIElement) on line-1034 of > org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer leads to a call to > StyledText.setFocus(). Without forceLayout(Shell), > AbstractPartRenderer.activate(MPart) on line-1038 calls > StyledText.setFocus() eventually. > > Basically, the way focus shifts across widgets is very different with > forceLayout(Shell) and I haven't managed to find a connection yet. To be clear, all this happens when the user switches tabs in the Java editor.
link to gerrit review --> https://git.eclipse.org/r/#/c/28586/
Created attachment 246307 [details] Test Snippet Steps to reproduce: 1. Click on the label. 2. Text is created and resized. Focus-In on Text sent. 3. New Shell with StyledText opens (on Resize event) StyledText doesn't get focus-in event and Text doesn't get focus-out.
Hi Abhishek, The problem happens when focus changes happen with the Resize event handler. ignoreFocus doesn't have information on the control on which the focus changes have to be ignored. So, no focus events are sent for focus changes on any control when inside Resize handler. Your patch uses ignoreFocusControl, which is better as it has the information on the control. But, the attached snippet fails with the patch too. I think we can check ignoreFocusControl and based on its value ignore only focus-in or focus-out, not both. Also, its not clear, what is the use of oldIgnoreFocusControl? Is it better to use Control.ignoreFocus?
This is worth being looked at for 4.4.2.
Pushed a patch to master to fix this -- http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=57929132178dcab4df2cb95ec4d0af0055f9ce62
pushed fix to R4_4_maintenance branch --> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_4_maintenance&id=277aeded307fb2c4aeb04a15836c1409f4c11b7b
Verified on build: I20150126-2000
Verified in build: M20150128-1000