Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c262a0931e
2 changed files with 11 additions and 11 deletions
|
|
@ -43,7 +43,6 @@ base::flat_map<HWND, not_null<WindowShadow*>> ShadowByHandle;
|
||||||
WindowShadow::WindowShadow(not_null<RpWidget*> window, QColor color)
|
WindowShadow::WindowShadow(not_null<RpWidget*> window, QColor color)
|
||||||
: _window(window)
|
: _window(window)
|
||||||
, _handle(GetWindowHandle(window)) {
|
, _handle(GetWindowHandle(window)) {
|
||||||
window->hide();
|
|
||||||
init(color);
|
init(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -173,12 +172,11 @@ void WindowShadow::init(QColor color) {
|
||||||
_widthMax = std::max(avail.width(), 1);
|
_widthMax = std::max(avail.width(), 1);
|
||||||
_heightMax = std::max(avail.height(), 1);
|
_heightMax = std::max(avail.height(), 1);
|
||||||
|
|
||||||
const auto instance = (HINSTANCE)GetModuleHandle(nullptr);
|
static const auto instance = (HINSTANCE)GetModuleHandle(nullptr);
|
||||||
for (auto i = 0; i != 4; ++i) {
|
static const auto className = u"WindowShadow"_q;
|
||||||
const auto className = "WindowShadow" + QString::number(i);
|
static const auto wcharClassName = className.toStdWString();
|
||||||
const auto wcharClassName = className.toStdWString();
|
static const auto registered = [] {
|
||||||
auto wc = WNDCLASSEX();
|
auto wc = WNDCLASSEX();
|
||||||
|
|
||||||
wc.cbSize = sizeof(wc);
|
wc.cbSize = sizeof(wc);
|
||||||
wc.style = 0;
|
wc.style = 0;
|
||||||
wc.lpfnWndProc = WindowCallback;
|
wc.lpfnWndProc = WindowCallback;
|
||||||
|
|
@ -191,10 +189,12 @@ void WindowShadow::init(QColor color) {
|
||||||
wc.lpszMenuName = NULL;
|
wc.lpszMenuName = NULL;
|
||||||
wc.lpszClassName = wcharClassName.c_str();
|
wc.lpszClassName = wcharClassName.c_str();
|
||||||
wc.hIconSm = 0;
|
wc.hIconSm = 0;
|
||||||
if (!RegisterClassEx(&wc)) {
|
return RegisterClassEx(&wc) ? true : false;
|
||||||
return;
|
}();
|
||||||
}
|
if (!registered) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (auto i = 0; i != 4; ++i) {
|
||||||
_handles[i] = CreateWindowEx(
|
_handles[i] = CreateWindowEx(
|
||||||
WS_EX_LAYERED | WS_EX_TOOLWINDOW,
|
WS_EX_LAYERED | WS_EX_TOOLWINDOW,
|
||||||
wcharClassName.c_str(),
|
wcharClassName.c_str(),
|
||||||
|
|
|
||||||
|
|
@ -3173,7 +3173,7 @@ void String::enumerateText(TextSelection selection, AppendPartCallback appendPar
|
||||||
flagsChangeCallback(flags, blockFlags);
|
flagsChangeCallback(flags, blockFlags);
|
||||||
flags = blockFlags;
|
flags = blockFlags;
|
||||||
}
|
}
|
||||||
if (i == e || blockFrom >= selection.to) {
|
if (i == e || (lnkIndex ? lnkFrom : blockFrom) >= selection.to) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue