Skip to content

Commit e31c2c6

Browse files
mrserbpull[bot]
authored andcommitted
8279337: The MToolkit is still referenced in a few places
Reviewed-by: prr
1 parent 8ae9c41 commit e31c2c6

File tree

18 files changed

+60
-112
lines changed

18 files changed

+60
-112
lines changed

src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -453,7 +453,7 @@ protected void initializeDesktopProperties() {
453453
desktopProperties.put("awt.multiClickInterval", getMultiClickTime());
454454

455455
// These DnD properties must be set, otherwise Swing ends up spewing NPEs
456-
// all over the place. The values came straight off of MToolkit.
456+
// all over the place. The values came straight off of XToolkit.
457457
desktopProperties.put("DnD.Autoscroll.initialDelay", Integer.valueOf(50));
458458
desktopProperties.put("DnD.Autoscroll.interval", Integer.valueOf(50));
459459
desktopProperties.put("DnD.Autoscroll.cursorHysteresis", Integer.valueOf(5));

src/java.desktop/share/classes/sun/awt/SunToolkit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@ public abstract KeyboardFocusManagerPeer getKeyboardFocusManagerPeer()
204204
* access to Xlib, OpenGL, etc. However, these methods are implemented
205205
* in SunToolkit so that they can be called from shared code (e.g.
206206
* from the OGL pipeline) or from the X11 pipeline regardless of whether
207-
* XToolkit or MToolkit is currently in use. There are native macros
207+
* XToolkit is currently in use. There are native macros
208208
* (such as AWT_LOCK) defined in awt.h, so if the implementation of these
209209
* methods is changed, make sure it is compatible with the native macros.
210210
*

src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@ public Object run() {
6767
System.loadLibrary("awt");
6868

6969
/*
70-
* Note: The MToolkit object depends on the static initializer
70+
* Note: The XToolkit object depends on the static initializer
7171
* of X11GraphicsEnvironment to initialize the connection to
7272
* the X11 server.
7373
*/

src/java.desktop/unix/classes/sun/java2d/opengl/GLXGraphicsConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -216,7 +216,7 @@ public String toString() {
216216
}
217217

218218
/**
219-
* The following methods are invoked from MToolkit or XToolkit.java and
219+
* The following methods are invoked from XToolkit.java and
220220
* X11ComponentPeer.java rather than having the X11-dependent
221221
* implementations hardcoded in those classes. This way the appropriate
222222
* actions are taken based on the peer's GraphicsConfig, whether it is

src/java.desktop/unix/native/common/awt/awt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@ typedef char Boolean;
4141
#endif /* !HEADLESS && !MACOSX */
4242

4343

44-
/* The JVM instance: defined in awt_MToolkit.c */
44+
/* The JVM instance: defined in awt_LoadLibrary.c */
4545
extern JavaVM *jvm;
4646

4747
extern jclass tkClass;

test/jdk/java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ private static void testKeyOnChoice(int button, int key) {
131131

132132
if (toolkit.equals("sun.awt.X11.XToolkit") &&
133133
keyTypedOnTextField) {
134-
throw new RuntimeException("Test failed. (XToolkit/MToolkit). KeyEvent was addressed to TextField.");
134+
throw new RuntimeException("Test failed. (XToolkit). KeyEvent was addressed to TextField.");
135135
}
136136

137137
System.out.println("Test passed. Unfocusable Choice doesn't react on keys.");

test/jdk/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -69,11 +69,6 @@ public void eventDispatched(AWTEvent e) {
6969
}
7070

7171
public void start() {
72-
if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
73-
System.out.println("No testing on Motif. Test passed.");
74-
return;
75-
}
76-
7772
System.out.println("\nTest started:\n");
7873

7974
// Test 1.

test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -293,43 +293,39 @@ public void run() {
293293
// 6. Show unblocking modal Dialog.
294294
///////////////////////////////////
295295

296-
if ("sun.awt.motif.MToolkit".equals(toolkitClassName)) {
297-
System.out.println("Stage 6 - Skiping.");
298-
} else {
299-
System.out.println("Stage 6 in progress...");
296+
System.out.println("Stage 6 in progress...");
300297

301-
// ---
302-
// Testing the bug of activating invisible modal Dialog (awt_Window::SetAndActivateModalBlocker).
303-
// Having some window not excluded from modality, so that it would be blocked.
304-
Frame f = new Frame("Aux. Frame");
305-
f.setSize(100, 100);
306-
setVisible(f, true);
307-
// ---
298+
// ---
299+
// Testing the bug of activating invisible modal Dialog (awt_Window::SetAndActivateModalBlocker).
300+
// Having some window not excluded from modality, so that it would be blocked.
301+
Frame f = new Frame("Aux. Frame");
302+
f.setSize(100, 100);
303+
setVisible(f, true);
304+
// ---
308305

309-
setVisible(focusedFrame, true);
306+
setVisible(focusedFrame, true);
307+
if (!focusOwner.hasFocus()) {
308+
Util.clickOnComp(focusOwner, robot);
309+
Util.waitForIdle(robot);
310310
if (!focusOwner.hasFocus()) {
311-
Util.clickOnComp(focusOwner, robot);
312-
Util.waitForIdle(robot);
313-
if (!focusOwner.hasFocus()) {
314-
throw new Error("Test error: the frame couldn't be focused.");
315-
}
311+
throw new Error("Test error: the frame couldn't be focused.");
316312
}
313+
}
317314

318-
dialog.setModal(true);
319-
dialog.setAutoRequestFocus(false);
320-
focusedFrame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
315+
dialog.setModal(true);
316+
dialog.setAutoRequestFocus(false);
317+
focusedFrame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
321318

322-
TestHelper.invokeLaterAndWait(new Runnable() {
323-
public void run() {
324-
dialog.setVisible(true);
325-
}
326-
}, robot);
319+
TestHelper.invokeLaterAndWait(new Runnable() {
320+
public void run() {
321+
dialog.setVisible(true);
322+
}
323+
}, robot);
327324

328-
if (dialog.isFocused()) {
329-
throw new TestFailedException("the unblocking dialog shouldn't gain focus but it did!");
330-
}
331-
setVisible(dialog, false);
325+
if (dialog.isFocused()) {
326+
throw new TestFailedException("the unblocking dialog shouldn't gain focus but it did!");
332327
}
328+
setVisible(dialog, false);
333329

334330
System.out.println("Test passed.");
335331
}

test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -202,26 +202,22 @@ public void start() {
202202
// Focused frame is excluded from modality.
203203
////////////////////////////////////////////////
204204

205-
if (!"sun.awt.motif.MToolkit".equals(toolkitClassName)) {
206-
recreateGUI();
207-
auxFrame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
205+
recreateGUI();
206+
auxFrame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
208207

209-
Test.setWindows(modalDialog, modalDialog, new Window[] {modalDialog, frame3});
210-
Test.test("Test stage 6.1 in progress", modalDlgButton);
211-
}
208+
Test.setWindows(modalDialog, modalDialog, new Window[] {modalDialog, frame3});
209+
Test.test("Test stage 6.1 in progress", modalDlgButton);
212210

213211

214212
// 6.2. Owner Frame (with owned modal Dialog).
215213
// Focused frame is excluded from modality.
216214
////////////////////////////////////////////////
217215

218-
if (!"sun.awt.motif.MToolkit".equals(toolkitClassName)) {
219-
recreateGUI();
220-
auxFrame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
216+
recreateGUI();
217+
auxFrame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
221218

222-
Test.setWindows(frame3, modalDialog, new Window[] {modalDialog, frame3});
223-
Test.test("Test stage 6.2 in progress", modalDlgButton, true);
224-
}
219+
Test.setWindows(frame3, modalDialog, new Window[] {modalDialog, frame3});
220+
Test.test("Test stage 6.2 in progress", modalDlgButton, true);
225221

226222
///////////////////////////////////////////////////
227223
// 7. Calling setVisible(true) for the shown Frame.
@@ -422,4 +418,3 @@ class TestFailedException extends RuntimeException {
422418
super("Test failed: " + msg);
423419
}
424420
}
425-

test/jdk/java/awt/Focus/ModalBlockedStealsFocusTest/ModalBlockedStealsFocusTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -47,11 +47,6 @@ public static void main(String[] args) {
4747
}
4848

4949
public void start() {
50-
if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
51-
System.out.println("The test is not for MToolkit.");
52-
return;
53-
}
54-
5550
dialog.setBounds(800, 0, 200, 100);
5651
frame.setBounds(800, 150, 200, 100);
5752

0 commit comments

Comments
 (0)