Warning, /graphics/krita/3rdparty/ext_qt/0034-Android-Give-preference-to-certain-WindowTypes.patch is written in an unsupported language. File is not indexed.
0001 From 35d2a7ed76bdf6157f15dedcba69c14534e3d22c Mon Sep 17 00:00:00 2001 0002 From: Sharaf Zaman <sharafzaz121@gmail.com> 0003 Date: Fri, 12 Feb 2021 17:44:50 +0000 0004 Subject: [PATCH] Android: Give preference to certain WindowTypes 0005 0006 In some cases some widgets (like QDockWidget) may get added to the 0007 windowStack before the parent widget. This would make the widget 0008 unresponsive to the events. Since there is no compositor to help us with 0009 this we, naturally give preferences to Qt::Dialog and Qt:Popup. 0010 --- 0011 .../platforms/android/qandroidplatformscreen.cpp | 11 +++++++++++ 0012 1 file changed, 11 insertions(+) 0013 0014 diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp 0015 index 7dc8bb8080..4213bdc088 100644 0016 --- a/src/plugins/platforms/android/qandroidplatformscreen.cpp 0017 +++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp 0018 @@ -129,6 +129,17 @@ QWindow *QAndroidPlatformScreen::topWindow() const 0019 0020 QWindow *QAndroidPlatformScreen::topLevelAt(const QPoint &p) const 0021 { 0022 + auto isPopup = [](QAndroidPlatformWindow *w) { 0023 + return (w->window()->type() & (Qt::Dialog | Qt::Popup) & ~Qt::Window); 0024 + }; 0025 + // These are the types of widgets which are usually kept on top by the 0026 + // compositor. But since there is none for SurfaceView, we try our best to 0027 + // give them the first preference. 0028 + for (QAndroidPlatformWindow *w : m_windowStack) { 0029 + if (isPopup(w) && w->geometry().contains(p, false) && w->window()->isVisible()) { 0030 + return w->window(); 0031 + } 0032 + } 0033 for (QAndroidPlatformWindow *w : m_windowStack) { 0034 if (w->geometry().contains(p, false) && w->window()->isVisible()) 0035 return w->window(); 0036 -- 0037 2.34.1 0038