use of com.intellij.openapi.wm.ex.WindowManagerEx in project intellij-community by JetBrains.
the class FloatingDecorator method show.
@Override
public final void show() {
setFocusableWindowState(myInfo.isActive());
super.show();
final UISettings uiSettings = UISettings.getInstance();
if (uiSettings.getEnableAlphaMode()) {
final WindowManagerEx windowManager = WindowManagerEx.getInstanceEx();
windowManager.setAlphaModeEnabled(this, true);
if (myInfo.isActive()) {
windowManager.setAlphaModeRatio(this, 0.0f);
} else {
windowManager.setAlphaModeRatio(this, uiSettings.getAlphaModeRatio());
}
}
// This prevents annoying flick
paint(getGraphics());
setFocusableWindowState(true);
ApplicationManager.getApplication().getMessageBus().connect(myDelayAlarm).subscribe(UISettingsListener.TOPIC, myUISettingsListener);
}
use of com.intellij.openapi.wm.ex.WindowManagerEx in project android by JetBrains.
the class GradleSyncInvoker method isBuildInProgress.
private static boolean isBuildInProgress(@NotNull Project project) {
IdeFrame frame = ((WindowManagerEx) WindowManager.getInstance()).findFrameFor(project);
StatusBarEx statusBar = frame == null ? null : (StatusBarEx) frame.getStatusBar();
if (statusBar == null) {
return false;
}
for (Pair<TaskInfo, ProgressIndicator> backgroundProcess : statusBar.getBackgroundProcesses()) {
TaskInfo task = backgroundProcess.getFirst();
if (task instanceof GradleTasksExecutor) {
ProgressIndicator second = backgroundProcess.getSecond();
if (second.isRunning()) {
return true;
}
}
}
return false;
}
use of com.intellij.openapi.wm.ex.WindowManagerEx in project intellij-community by JetBrains.
the class PlaybackDebugger method activateAndRun.
private void activateAndRun() {
assert myRunner == null;
myLog.setText(null);
final IdeFrameImpl frame = getFrame();
final Component c = ((WindowManagerEx) WindowManager.getInstance()).getFocusedComponent(frame);
if (c != null) {
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
IdeFocusManager.getGlobalInstance().requestFocus(c, true);
});
} else {
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
IdeFocusManager.getGlobalInstance().requestFocus(frame, true);
});
}
//noinspection SSBasedInspection
SwingUtilities.invokeLater(() -> startWhenFrameActive());
}
use of com.intellij.openapi.wm.ex.WindowManagerEx in project intellij-community by JetBrains.
the class AbstractPopup method updateMaskAndAlpha.
private Window updateMaskAndAlpha(Window window) {
if (window == null)
return null;
if (!window.isDisplayable() || !window.isShowing())
return window;
final WindowManagerEx wndManager = getWndManager();
if (wndManager == null)
return window;
if (!wndManager.isAlphaModeEnabled(window))
return window;
if (myAlpha != myLastAlpha) {
wndManager.setAlphaModeRatio(window, myAlpha);
myLastAlpha = myAlpha;
}
if (myMaskProvider != null) {
final Dimension size = window.getSize();
Shape mask = myMaskProvider.getMask(size);
wndManager.setWindowMask(window, mask);
}
WindowManagerEx.WindowShadowMode mode = myShadowed ? WindowManagerEx.WindowShadowMode.NORMAL : WindowManagerEx.WindowShadowMode.DISABLED;
WindowManagerEx.getInstanceEx().setWindowShadow(window, mode);
return window;
}
use of com.intellij.openapi.wm.ex.WindowManagerEx in project intellij-community by JetBrains.
the class IJSwingUtilities method hasFocus2.
/**
* @return true if window ancestor of component was most recent focused window and most recent focused component
* in that window was descended from component
*/
public static boolean hasFocus2(Component component) {
WindowManagerEx windowManager = WindowManagerEx.getInstanceEx();
Window activeWindow = null;
if (windowManager != null) {
activeWindow = windowManager.getMostRecentFocusedWindow();
}
if (activeWindow == null) {
return false;
}
Component focusedComponent = windowManager.getFocusedComponent(activeWindow);
if (focusedComponent == null) {
return false;
}
return SwingUtilities.isDescendingFrom(focusedComponent, component);
}
Aggregations