Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 177523 Details for
Bug 323570
Shell activate order problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
Bug323570.patch (text/plain), 5.60 KB, created by
Ivan Furnadjiev
on 2010-08-26 08:47:48 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2010-08-26 08:47:48 EDT
Size:
5.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/widgets/Control.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Control.java,v >retrieving revision 1.75 >diff -u -r1.75 Control.java >--- src/org/eclipse/swt/widgets/Control.java 7 Apr 2010 14:56:11 -0000 1.75 >+++ src/org/eclipse/swt/widgets/Control.java 26 Aug 2010 12:45:08 -0000 >@@ -748,7 +748,7 @@ > // if (display.focusEvent == SWT.FocusOut) return false; > Shell shell = getShell(); // was: Decorations shell = menuShell(); > shell.setSavedFocus( this ); >- if( !isEnabled() || !isVisible() /* || !isActive() */) { >+ if( !isEnabled() || !isVisible() || !isActive() ) { > return false; > } > if( isFocusControl() ) { >@@ -1865,7 +1865,7 @@ > checkWidget(); > MenuDetectEvent.removeListener( this, listener ); > } >- >+ > //////////////// > // drawing (Note that we can't really force a redraw. This is just a > // fake for event notifications that come on OS systems with redraws) >@@ -2182,6 +2182,23 @@ > return forceFocus (); > } > >+ boolean isActive() { >+ Shell shell = getShell(); >+ boolean result = shell.getEnabled(); >+ Shell[] allShells = getDisplay().getShells(); >+ int bits = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL; >+ int shellIndex = allShells.length; >+ for( int i = 0; i < allShells.length && result; i++ ) { >+ if( allShells[ i ] == shell ) { >+ shellIndex = i; >+ } >+ if( ( allShells[ i ].style & bits ) != 0 && shellIndex < i ) { >+ result = false; >+ } >+ } >+ return result; >+ } >+ > /////////////////////////////////////////////////////// > // Helping methods to observe the disposal of the menu > >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Control_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Control_Test.java,v >retrieving revision 1.29 >diff -u -r1.29 Control_Test.java >--- src/org/eclipse/swt/widgets/Control_Test.java 20 Jul 2010 13:50:54 -0000 1.29 >+++ src/org/eclipse/swt/widgets/Control_Test.java 26 Aug 2010 12:45:09 -0000 >@@ -424,7 +424,7 @@ > assertNull( adapter.getUserForeground() ); > Color themeColor = control.getForeground(); > // enabled state: >- control.setForeground( blue ); >+ control.setForeground( blue ); > assertEquals( blue, adapter.getUserForeground() ); > assertEquals( blue, control.getForeground() ); > // disabled directly >@@ -436,7 +436,7 @@ > composite.setEnabled( false ); > assertEquals( null, adapter.getUserForeground() ); > assertEquals( blue, control.getForeground() ); >- // re-enabled >+ // re-enabled > composite.setEnabled( true ); > assertEquals( blue, adapter.getUserForeground() ); > assertEquals( blue, control.getForeground() ); >@@ -445,7 +445,7 @@ > assertEquals( null, adapter.getUserForeground() ); > assertEquals( themeColor, control.getForeground() ); > } >- >+ > public void testVisible() { > Display display = new Display(); > Shell shell = new Shell( display, SWT.NONE ); >@@ -679,6 +679,21 @@ > assertEquals( "", log.toString() ); > } > >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=323570 >+ public void testFocusOnBlockedShell() { >+ Display display = new Display(); >+ Shell shell1 = new Shell( display, SWT.NONE ); >+ Control button1 = new Button( shell1, SWT.PUSH ); >+ Shell shell2 = new Shell( shell1, SWT.APPLICATION_MODAL ); >+ shell1.open(); >+ assertEquals( button1, display.getFocusControl() ); >+ assertEquals( shell1, display.getActiveShell() ); >+ shell2.open(); >+ button1.setFocus(); >+ assertEquals( shell2, display.getFocusControl() ); >+ assertEquals( shell2, display.getActiveShell() ); >+ } >+ > public void testToControl() { > Display display = new Display(); > Shell shell = new Shell( display, SWT.NONE ); >@@ -824,10 +839,10 @@ > assertNotNull( monitor ); > assertEquals( display.getPrimaryMonitor(), monitor ); > } >- >- >+ >+ > public void testUntypedHelpListener() { >- final Event[] untypedHelpEvent = { null }; >+ final Event[] untypedHelpEvent = { null }; > Fixture.fakePhase( PhaseId.PROCESS_ACTION ); > Display display = new Display(); > Control control = new Shell( display ); >@@ -839,14 +854,14 @@ > control.notifyListeners( SWT.Help, new Event() ); > assertNotNull( untypedHelpEvent[ 0 ] ); > } >- >+ > public void testRedraw() { > Display display = new Display(); > Composite control = new Shell( display ); > control.redraw(); > assertTrue( RWTLifeCycle.needsFakeRedraw( control ) ); > } >- >+ > public void testSetBackground() { > Display display = new Display(); > Composite control = new Shell( display ); >@@ -866,7 +881,7 @@ > // Expected Exception > } > } >- >+ > public void testSetBackgroundImage() { > ClassLoader loader = Fixture.class.getClassLoader(); > InputStream stream = loader.getResourceAsStream( Fixture.IMAGE1 ); >@@ -889,7 +904,7 @@ > } > } > } >- >+ > public void testSetCursor() { > Display display = new Display(); > Composite control = new Shell( display ); >@@ -906,7 +921,7 @@ > // Expected Exception > } > } >- >+ > public void testSetFont() { > Display display = new Display(); > Composite control = new Shell( display ); >@@ -932,7 +947,7 @@ > // Expected Exception > } > } >- >+ > public void testSetForeground() { > Display display = new Display(); > Composite control = new Shell( display );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 323570
:
177391
| 177523