Native window decorations: fixed occasional double window title bar when creating many frames or dialogs (issue #315)

This commit is contained in:
Karl Tauber
2021-04-23 18:14:00 +02:00
parent 5a05efefdd
commit 9d0823038e
2 changed files with 6 additions and 4 deletions

View File

@@ -43,6 +43,8 @@ FlatLaf Change Log
`FlatPopupFactory.fixToolTipLocation()`. (issue #305) `FlatPopupFactory.fixToolTipLocation()`. (issue #305)
- IntelliJ Themes: Fixed background colors of DesktopPane and DesktopIcon in all - IntelliJ Themes: Fixed background colors of DesktopPane and DesktopIcon in all
themes. themes.
- Native window decorations: Fixed occasional double window title bar when
creating many frames or dialogs. (issue #315)
## 1.1.2 ## 1.1.2

View File

@@ -102,17 +102,17 @@ void HWNDMap::remove( HWND key ) {
} }
int HWNDMap::binarySearch( HWND key ) { int HWNDMap::binarySearch( HWND key ) {
__int64 ikey = reinterpret_cast<__int64>( key );
int low = 0; int low = 0;
int high = size - 1; int high = size - 1;
while( low <= high ) { while( low <= high ) {
int mid = (low + high) >> 1; int mid = (low + high) >> 1;
HWND midKey = table[mid].key; __int64 midKey = reinterpret_cast<__int64>( table[mid].key );
int cmp = midKey - key; if( midKey < ikey )
if( cmp < 0 )
low = mid + 1; low = mid + 1;
else if( cmp > 0 ) else if( midKey > ikey )
high = mid - 1; high = mid - 1;
else else
return mid; return mid;