Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 11 additions & 20 deletions Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,17 @@ public class JavaSEPort extends CodenameOneImplementation {
// frame off every reachable display.
static final int MAX_PERSISTED_WINDOW_DIMENSION = 32767;

static {
// The canvas blits straight to the screen through getGraphics(), outside
// Swing's paint cycle, so a lightweight popup (painted into the same
// surface) is overwritten wherever it overlaps the canvas and smears
// (#5850). A heavyweight popup lives in its own native window above it.
// Set here, before any frame or menu exists: a JPopupMenu reads the default
// when it is constructed, and the native-chrome menu bars
// (buildNativeMenuBar) are built without installMenu ever running.
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
}

static {
IOS_NATIVE_FONT_CANDIDATES.put("native:MainThin", new String[] {
"SF Pro Display", "SF Pro Text",
Expand Down Expand Up @@ -4457,26 +4468,6 @@ public void run() {
updateEdtBufferSize();
}

if (window != null) {

if (zoomLevel != 1) {
Graphics2D g2d = (Graphics2D) g;
g2d.setTransform(AffineTransform.getScaleInstance(1, 1));
}

if (window.getJMenuBar() != null) {
for (int i = 0; i < window.getJMenuBar().getComponentCount(); i++) {
JMenu m = (JMenu) window.getJMenuBar().getComponent(i);
if (m.isPopupMenuVisible()) {
JPopupMenu pop = m.getPopupMenu();
pop.getInvoker().getX();
g.translate(pop.getInvoker().getX(), 0);
pop.update(g);
g.translate(-pop.getInvoker().getX(), 0);
}
}
}
}
g.dispose();
}
}
Expand Down
Loading