mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-13 18:52:54 +00:00
Mark event loop nesting more carefully.
Fixes #5506. I hope fixes #5508.
This commit is contained in:
parent
4e692e2c1e
commit
de4a477686
@ -430,7 +430,8 @@ bool Application::nativeEventFilter(
|
||||
const QByteArray &eventType,
|
||||
void *message,
|
||||
long *result) {
|
||||
if (_eventNestingLevel > _loopNestingLevel) {
|
||||
if (_eventNestingLevel > _loopNestingLevel
|
||||
&& Platform::NativeEventNestsLoop(message)) {
|
||||
_previousLoopNestingLevels.push_back(_loopNestingLevel);
|
||||
_loopNestingLevel = _eventNestingLevel;
|
||||
}
|
||||
|
@ -477,15 +477,19 @@ void RegisterCustomScheme() {
|
||||
#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||
}
|
||||
|
||||
PermissionStatus GetPermissionStatus(PermissionType type){
|
||||
PermissionStatus GetPermissionStatus(PermissionType type) {
|
||||
return PermissionStatus::Granted;
|
||||
}
|
||||
|
||||
void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCallback){
|
||||
void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCallback) {
|
||||
resultCallback(PermissionStatus::Granted);
|
||||
}
|
||||
|
||||
void OpenSystemSettingsForPermission(PermissionType type){
|
||||
void OpenSystemSettingsForPermission(PermissionType type) {
|
||||
}
|
||||
|
||||
bool NativeEventNestsLoop(void *message) {
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace ThirdParty {
|
||||
|
@ -332,6 +332,10 @@ void OpenSystemSettingsForPermission(PermissionType type) {
|
||||
#endif // OS_MAC_OLD
|
||||
}
|
||||
|
||||
bool NativeEventNestsLoop(void *message) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
void psNewVersion() {
|
||||
|
@ -35,6 +35,8 @@ PermissionStatus GetPermissionStatus(PermissionType type);
|
||||
void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCallback);
|
||||
void OpenSystemSettingsForPermission(PermissionType type);
|
||||
|
||||
bool NativeEventNestsLoop(void *message);
|
||||
|
||||
QString SystemLanguage();
|
||||
QString SystemCountry();
|
||||
|
||||
|
@ -657,6 +657,21 @@ void OpenSystemSettingsForPermission(PermissionType type) {
|
||||
}
|
||||
}
|
||||
|
||||
bool NativeEventNestsLoop(void *message) {
|
||||
const auto code = static_cast<const MSG*>(message)->message;
|
||||
if (code > WM_NULL && code <= WM_GETMINMAXINFO) {
|
||||
return true;
|
||||
} else if (code >= WM_NCCREATE && code <= WM_NCXBUTTONDBLCLK) {
|
||||
return true;
|
||||
} else if (code == WM_WINDOWPOSCHANGING
|
||||
|| code == WM_WINDOWPOSCHANGED
|
||||
|| code == WM_STYLECHANGING
|
||||
|| code == WM_STYLECHANGED) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
void psNewVersion() {
|
||||
|
Loading…
Reference in New Issue
Block a user