Workaround menu click-through on macOS 14.1.
This commit is contained in:
parent
0837a6364d
commit
d28afffcb9
5 changed files with 25 additions and 0 deletions
|
|
@ -29,6 +29,9 @@ inline void UpdateOverlayed(not_null<QWidget*> widget) {
|
||||||
inline void ShowOverAll(not_null<QWidget*> widget, bool canFocus) {
|
inline void ShowOverAll(not_null<QWidget*> widget, bool canFocus) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void AcceptAllMouseInput(not_null<QWidget*> widget) {
|
||||||
|
}
|
||||||
|
|
||||||
inline void DisableSystemWindowResize(not_null<QWidget*> widget, QSize ratio) {
|
inline void DisableSystemWindowResize(not_null<QWidget*> widget, QSize ratio) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,23 @@ void ShowOverAll(not_null<QWidget*> widget, bool canFocus) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AcceptAllMouseInput(not_null<QWidget*> widget) {
|
||||||
|
// https://github.com/telegramdesktop/tdesktop/issues/27025
|
||||||
|
//
|
||||||
|
// By default system clicks through fully transparent pixels,
|
||||||
|
// and starting with macOS 14.1 it counts the transparency
|
||||||
|
// incorrectly (as if `y` is mirrored), so when clicking
|
||||||
|
// on a reactions strip outside of the menu column the click
|
||||||
|
// is ignored and made on the underlying window, because at the
|
||||||
|
// bottom of the menu in the same place there is nothing, empty.
|
||||||
|
//
|
||||||
|
// We explicitly request all the input to disable this behavior.
|
||||||
|
//
|
||||||
|
// See https://stackoverflow.com/a/29451199 and comments.
|
||||||
|
NSWindow *window = [reinterpret_cast<NSView*>(widget->winId()) window];
|
||||||
|
[window setIgnoresMouseEvents:NO];
|
||||||
|
}
|
||||||
|
|
||||||
void DrainMainQueue() {
|
void DrainMainQueue() {
|
||||||
#ifndef OS_MAC_STORE
|
#ifndef OS_MAC_STORE
|
||||||
_dispatch_main_queue_callback_4CF(nullptr);
|
_dispatch_main_queue_callback_4CF(nullptr);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ void UpdateOverlayed(not_null<QWidget*> widget);
|
||||||
void ShowOverAll(not_null<QWidget*> widget, bool canFocus = true);
|
void ShowOverAll(not_null<QWidget*> widget, bool canFocus = true);
|
||||||
void IgnoreAllActivation(not_null<QWidget*> widget);
|
void IgnoreAllActivation(not_null<QWidget*> widget);
|
||||||
void ClearTransientParent(not_null<QWidget*> widget);
|
void ClearTransientParent(not_null<QWidget*> widget);
|
||||||
|
void AcceptAllMouseInput(not_null<QWidget*> widget);
|
||||||
|
|
||||||
void DisableSystemWindowResize(not_null<QWidget*> widget, QSize ratio);
|
void DisableSystemWindowResize(not_null<QWidget*> widget, QSize ratio);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ inline void ReInitOnTopPanel(not_null<QWidget*> panel) {
|
||||||
inline void ShowOverAll(not_null<QWidget*> widget, bool canFocus) {
|
inline void ShowOverAll(not_null<QWidget*> widget, bool canFocus) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void AcceptAllMouseInput(not_null<QWidget*> widget) {
|
||||||
|
}
|
||||||
|
|
||||||
inline void ClearTransientParent(not_null<QWidget*> widget) {
|
inline void ClearTransientParent(not_null<QWidget*> widget) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -490,6 +490,7 @@ void PopupMenu::paintEvent(QPaintEvent *e) {
|
||||||
PostponeCall(this, [=] {
|
PostponeCall(this, [=] {
|
||||||
showChildren();
|
showChildren();
|
||||||
_animatePhase = AnimatePhase::Shown;
|
_animatePhase = AnimatePhase::Shown;
|
||||||
|
Platform::AcceptAllMouseInput(this);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
paintBg(p);
|
paintBg(p);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue