Compare commits

...

13 Commits
1903 ... 676

Author SHA1 Message Date
Ivan Migalev
894930bfb2 Fix a possible resource leak in ColorizationColorAffectsBorders
(cherry picked from commit 0c911b6ffe)
2020-01-24 14:43:58 +07:00
Ivan Migalev
1043fd5501 Refresh desktop properties on WM_DWMCOLORIZATIONCOLORCHANGED (JBR-2070)
(cherry picked from commit 06086f4a7e)
2020-01-24 14:43:56 +07:00
Ivan Migalev
7e19166df4 Extract the DWM colorization parameters from registry (JBR-2070)
(cherry picked from commit 0330cab60b)
2020-01-24 14:43:54 +07:00
Vitaly Provodin
cd670df89b Revert "8235687: Contents/MacOS/libjli.dylib cannot be a symlink Reviewed-by: tbell"
This reverts commit 276971e4
2020-01-23 20:23:29 +07:00
Vitaly Provodin
31a47e4c4d Revert "restoring MacOS/libjli.dylib as a symlink"
This reverts commit 563a1714
2020-01-23 20:22:49 +07:00
Vitaly Provodin
c01edf5089 Revert "add signing Contents/MacOS/libjli.dylib"
This reverts commit 09e603a1
2020-01-23 20:22:35 +07:00
Vitaly Provodin
895ba78eeb Revert "add signing Contents/MacOS/libjli.dylib (follow up)"
This reverts commit cc57068c
2020-01-23 20:22:30 +07:00
Vitaly Provodin
6ffac2f5fa Revert "add signing Contents/MacOS/libjli.dylib (follow up)"
This reverts commit d7b6a633
2020-01-23 20:22:22 +07:00
Vitaly Provodin
d7b6a63382 add signing Contents/MacOS/libjli.dylib (follow up) 2020-01-23 11:39:33 +07:00
Vitaly Provodin
cc57068c89 add signing Contents/MacOS/libjli.dylib (follow up) 2020-01-23 09:48:02 +07:00
Vitaly Provodin
09e603a1ad add signing Contents/MacOS/libjli.dylib 2020-01-22 18:26:27 +07:00
Anton Tarasov
011dd4a8a9 JBR-2082 Revealing taskbar does not work when "Automatically hide the taskbar"
(cherry picked from commit b31a41fb2f)
2020-01-22 11:28:10 +03:00
Vitaly Provodin
563a171434 restoring MacOS/libjli.dylib as a symlink 2020-01-21 16:20:17 +07:00
4 changed files with 79 additions and 36 deletions

View File

@@ -61,15 +61,17 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
FILES := $(call CacheFind, $(JRE_IMAGE_DIR)), \
))
$(eval $(call SetupCopyFiles, COPY_LIBJLI_JDK, \
FILES := $(JDK_IMAGE_DIR)/lib/jli/libjli.dylib, \
DEST := $(JDK_MACOSX_CONTENTS_DIR)/MacOS, \
))
$(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
$(call LogInfo, Creating link $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../Home/lib/jli/libjli.dylib $@
$(eval $(call SetupCopyFiles, COPY_LIBJLI_JRE, \
FILES := $(JRE_IMAGE_DIR)/lib/jli/libjli.dylib, \
DEST := $(JRE_MACOSX_CONTENTS_DIR)/MacOS, \
))
$(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
$(call LogInfo, Creating link $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../Home/lib/jli/libjli.dylib $@
$(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
@@ -95,19 +97,13 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
))
$(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set: $(COPY_JDK_IMAGE)
jdk-bundle: $(COPY_JDK_IMAGE) $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \
$(BUILD_JDK_PLIST)
$(SETFILE) -a B $(dir $(JDK_MACOSX_CONTENTS_DIR))
$(TOUCH) $@
$(SUPPORT_OUTPUTDIR)/images/_jre_bundle_attribute_set: $(COPY_JRE_IMAGE)
jre-bundle: $(COPY_JRE_IMAGE) $(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \
$(BUILD_JRE_PLIST)
$(SETFILE) -a B $(dir $(JRE_MACOSX_CONTENTS_DIR))
$(TOUCH) $@
jdk-bundle: $(COPY_JDK_IMAGE) $(COPY_LIBJLI_JDK) \
$(BUILD_JDK_PLIST) $(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set
jre-bundle: $(COPY_JRE_IMAGE) $(COPY_LIBJLI_JRE) \
$(BUILD_JRE_PLIST) $(SUPPORT_OUTPUTDIR)/images/_jre_bundle_attribute_set
else # Not macosx

View File

@@ -499,12 +499,38 @@ void CheckFontSmoothingSettings(HWND hWnd) {
}
}
BOOL GetDwmColorizationColorFromRegistry(DWORD& colorizationColor, DWORD& colorizationColorBalance) {
// DwmGetColorizationColor is unreliable: it doesn't extract the actual accent color value set by user. To get the
// actual value (usable e.g. to calculate the border colors), we have to use the registry.
DWORD colorizationColorBgr = 0;
DWORD dwordSize(sizeof(DWORD));
HKEY hKey = NULL;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\DWM", 0, KEY_READ, &hKey) != ERROR_SUCCESS) return FALSE;
if (::RegQueryValueEx(hKey, L"ColorizationColor", NULL, NULL, reinterpret_cast<LPBYTE>(&colorizationColorBgr), &dwordSize) != ERROR_SUCCESS) {
RegCloseKey(hKey);
return FALSE;
}
int b = colorizationColorBgr & 0xFF;
int g = (colorizationColorBgr & 0xFF00) >> 8;
int r = (colorizationColorBgr & 0xFF0000) >> 16;
colorizationColor = RGB(r, g, b);
if (::RegQueryValueEx(hKey, L"ColorizationColorBalance", NULL, NULL, reinterpret_cast<LPBYTE>(&colorizationColorBalance), &dwordSize) != ERROR_SUCCESS) {
colorizationColorBalance = -1;
}
RegCloseKey(hKey);
return TRUE;
}
BOOL ColorizationColorAffectsBorders() {
DWORD result = 0;
DWORD bufSize(sizeof(DWORD));
HKEY hKey = NULL;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\DWM"), 0, KEY_READ, &hKey) != ERROR_SUCCESS) return TRUE;
if (::RegQueryValueEx(hKey, _T("ColorPrevalence"), NULL, NULL, reinterpret_cast<LPBYTE>(&result), &bufSize) != ERROR_SUCCESS) return TRUE;
if (::RegQueryValueEx(hKey, _T("ColorPrevalence"), NULL, NULL, reinterpret_cast<LPBYTE>(&result), &bufSize) != ERROR_SUCCESS) result = 1;
RegCloseKey(hKey);
return result == 0 ? FALSE : TRUE;
}
@@ -530,11 +556,14 @@ void AwtDesktopProperties::GetColorParameters() {
BOOL enabled;
DwmIsCompositionEnabled(&enabled);
if (enabled) {
DWORD color;
BOOL opaque = FALSE;
// [tav] todo: listen WM_DWMCOLORIZATIONCOLORCHANGED
DwmGetColorizationColor(&color, &opaque);
SetColorProperty(TEXT("win.dwm.colorizationColor"), RGB(GetBValue(color), GetGValue(color), GetRValue(color)));
DWORD color = 0;
DWORD balance = 0;
if (GetDwmColorizationColorFromRegistry(color, balance)) {
SetColorProperty(TEXT("win.dwm.colorizationColor"), color);
SetIntegerProperty(TEXT("win.dwm.colorizationColorBalance"), balance);
}
SetBooleanProperty(TEXT("win.dwm.colorizationColor.affects.borders"), ColorizationColorAffectsBorders());
}

View File

@@ -1842,15 +1842,30 @@ MsgRouting AwtFrame::WmNcCalcSize(BOOL wParam, LPNCCALCSIZE_PARAMS lpncsp, LRESU
rect->top += insets.bottom;
// [moklev] Workaround for RIDER-27069, IDEA-211327
if (!this->IsUndecorated()) {
rect->right += this->ScaleUpX(1);
// [tav] Decrement NC bottom only when taskbar is bottom/autohide (JBR-1786)
APPBARDATA abData;
abData.uEdge = 0;
abData.cbSize = sizeof(abData);
if (::SHAppBarMessage(ABM_GETTASKBARPOS, &abData) &&
abData.uEdge == ABE_BOTTOM &&
::SHAppBarMessage(ABM_GETSTATE, &abData) == ABS_AUTOHIDE)
if (::SHAppBarMessage(ABM_GETSTATE, &abData) == ABS_AUTOHIDE &&
::SHAppBarMessage(ABM_GETTASKBARPOS, &abData))
{
rect->bottom -= 1;
// [tav] leave one pixel for autohide taskbar
switch (abData.uEdge) {
case ABE_TOP:
rect->top += 1;
break;
case ABE_LEFT:
rect->left += 1;
break;
case ABE_BOTTOM:
rect->bottom -= 1;
break;
case ABE_RIGHT:
rect->right -= 1;
break;
}
}
if (abData.uEdge != ABE_RIGHT) {
rect->right += this->ScaleUpX(1);
}
}
}

View File

@@ -1025,6 +1025,14 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
}
// Remove this define when we move to newer (XP) version of SDK.
#define WM_THEMECHANGED 0x031A
#ifndef WM_DWMCOMPOSITIONCHANGED
#define WM_DWMCOMPOSITIONCHANGED 0x031E
#define WM_DWMNCRENDERINGCHANGED 0x031F
#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
#define WM_DWMWINDOWMAXIMIZEDCHANGED 0x0321
#endif // WM_DWMCOMPOSITIONCHANGED
case WM_DWMCOLORIZATIONCOLORCHANGED:
case WM_THEMECHANGED: {
/* Upcall to WToolkit when user changes configuration.
*
@@ -1040,12 +1048,7 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
}
return 0;
}
#ifndef WM_DWMCOMPOSITIONCHANGED
#define WM_DWMCOMPOSITIONCHANGED 0x031E
#define WM_DWMNCRENDERINGCHANGED 0x031F
#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
#define WM_DWMWINDOWMAXIMIZEDCHANGED 0x0321
#endif // WM_DWMCOMPOSITIONCHANGED
case WM_DWMCOMPOSITIONCHANGED: {
DWMResetCompositionEnabled();
return 0;