Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8273355: Lanai: Flickering on tooltip appearance IntelliJ IDEA 2021.2.1 #5373

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -289,6 +289,16 @@ protected void setVisibleImpl(final boolean visible) {
updateFocusableWindowState();
super.setVisibleImpl(visible);
// TODO: update graphicsConfig, see 4868278
if (visible) {
// Set correct background for a window before making it visible.
// It is necessary for some pipelines (e.g., metal) to eliminate
// flashing effect (when initial background color replaced with
// the content layer's color)
Color color = getBackground();
if (color != null) {
platformWindow.setBackground(color);
}
}

This comment has been minimized.

@prrace

prrace Sep 4, 2021
Contributor

This looks as if it will affect OpenGL as well as Metal.
Do you see the flckering with both pipelines ?
What testing have you done with both of them ?

This comment has been minimized.

@avu

avu Sep 5, 2021
Author

Yes, it affects both pipelines, but flickering was noticed only with Metal. I've tried IDEA on both pipelines and I've run desktop tests only with Metal. I'm going to run desktop ones with OGL too.

This comment has been minimized.

@avu

avu Sep 9, 2021
Author

OGL desktop tests are OK.

This looks as if it will affect OpenGL as well as Metal.
Do you see the flckering with both pipelines ?
What testing have you done with both of them ?

This comment has been minimized.

@mrserb

mrserb Sep 11, 2021
Member

If the user will create a peer then change the background color, then show the window the flickering will occur. you need to override the LWWIndowPeer.setBackground and call the platformWindow.setBackground from there. The LWWIndowPeer.setBackground is also called during peer initialization so the code above will not be needed.

But it will be good to root cause the problem if it is not related to the performance.

platformWindow.setVisible(visible);
if (isSimpleWindow()) {
KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
@@ -139,6 +139,8 @@ public default void setMaximizedBounds(int x, int y, int w, int h){}

public void setOpaque(boolean isOpaque);

public void setBackground(Color color);

public void enterFullScreenMode();

public void exitFullScreenMode();
@@ -180,6 +180,9 @@ public void setOpacity(float opacity) {}
@Override
public void setOpaque(boolean isOpaque) {}

@Override
public void setBackground(Color color) {}

@Override
public void enterFullScreenMode() {}

@@ -948,6 +948,12 @@ public void setOpaque(boolean isOpaque) {
SwingUtilities.invokeLater(this::invalidateShadow);
}

@Override
public void setBackground(Color color) {
int rgb = color.getRGB();
execute(ptr->CWrapper.NSWindow.setBackgroundColor(ptr, rgb));
}

@Override
public void enterFullScreenMode() {
isFullScreenMode = true;
@@ -25,6 +25,7 @@

package sun.lwawt.macosx;

import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GraphicsDevice;
@@ -181,6 +182,10 @@ public void setOpacity(float opacity) {
public void setOpaque(boolean isOpaque) {
}

@Override
public void setBackground(Color color) {
}

@Override
public void enterFullScreenMode() {
}