Commit 7892a18c authored by Luca Carlon's avatar Luca Carlon Committed by Nate Graham
Browse files

Add a new window type named AppletPopup.

See discussion in plasma-framework!500.

CCBUG: 411462
CCBUG: 332512
parent f6a218b8
Pipeline #181578 passed with stage
in 2 minutes and 24 seconds
......@@ -408,6 +408,7 @@ void KWindowInfoX11Test::testWindowType_data()
QTest::newRow("DNDIcon") << NET::DNDIconMask << NET::DNDIcon << NET::DNDIcon;
QTest::newRow("OnScreenDisplay") << NET::OnScreenDisplayMask << NET::OnScreenDisplay << NET::OnScreenDisplay;
QTest::newRow("CriticalNotification") << NET::CriticalNotificationMask << NET::CriticalNotification << NET::CriticalNotification;
QTest::newRow("AppletPopup") << NET::AppletPopupMask << NET::AppletPopup << NET::AppletPopup;
// incorrect masks
QTest::newRow("desktop-unknown") << NET::NormalMask << NET::Desktop << NET::Unknown;
......@@ -427,6 +428,7 @@ void KWindowInfoX11Test::testWindowType_data()
QTest::newRow("DNDIcon-unknown") << NET::NormalMask << NET::DNDIcon << NET::Unknown;
QTest::newRow("OnScreenDisplay-unknown") << NET::NormalMask << NET::OnScreenDisplay << NET::Unknown;
QTest::newRow("CriticalNotification-unknown") << NET::NormalMask << NET::CriticalNotification << NET::Unknown;
QTest::newRow("AppletPopup-unknown") << NET::NormalMask << NET::AppletPopup << NET::Unknown;
// clang-format on
}
......
......@@ -222,7 +222,7 @@ void NetRootInfoTestWM::testSupported()
NETRootInfo
rootInfo(connection(), m_supportWindow, s_wmName, NET::WMAllProperties, NET::AllTypesMask, NET::States(~0u), NET::WM2AllProperties, NET::Actions(~0u));
int count = 0;
for (int i = 0; i < 33; ++i) {
for (int i = 0; i < 34; ++i) {
if (i == 12) {
continue;
}
......
......@@ -638,6 +638,7 @@ void NetWinInfoTestClient::testWindowType_data()
QTest::newRow("Normal") << NET::Normal << 1 << QByteArrayLiteral("_NET_WM_WINDOW_TYPE_NORMAL") << QByteArray();
QTest::newRow("OnScreenDisplay") << NET::OnScreenDisplay << 1 << QByteArrayLiteral("_KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY") << QByteArray();
QTest::newRow("CriticalNotification") << NET::CriticalNotification << 1 << QByteArrayLiteral("_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION") << QByteArray();
QTest::newRow("AppletPopup") << NET::AppletPopup << 1 << QByteArrayLiteral("_KDE_NET_WM_WINDOW_TYPE_APPLET_POPUP") << QByteArray();
}
void NetWinInfoTestClient::testWindowType()
......
......@@ -439,6 +439,10 @@ public:
@since 5.58
**/
CriticalNotification = 17, // NON STANDARD
/**
* indicates that this window is an applet.
*/
AppletPopup = 18, // NON STANDARD
};
/**
......@@ -465,6 +469,7 @@ public:
DNDIconMask = 1u << 15, ///< @see DNDIcon
OnScreenDisplayMask = 1u << 16, ///< NON STANDARD @see OnScreenDisplay @since 5.6
CriticalNotificationMask = 1u << 17, ///< NON STANDARD @see CriticalNotification @since 5.58
AppletPopupMask = 1u << 18, ///< NON STANDARD @see AppletPopup
AllTypesMask = 0U - 1, ///< All window types.
};
/**
......
......@@ -143,6 +143,7 @@ ENUM_BEGIN(KwsAtom)
ENUM(_KDE_NET_WM_WINDOW_TYPE_TOPMENU),
ENUM(_KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY),
ENUM(_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION),
ENUM(_KDE_NET_WM_WINDOW_TYPE_APPLET_POPUP),
ENUM(_KDE_NET_WM_TEMPORARY_RULES),
ENUM(_NET_WM_FRAME_OVERLAP),
ENUM(_KDE_NET_WM_APPMENU_SERVICE_NAME),
......
......@@ -938,6 +938,9 @@ void NETRootInfo::setSupported()
if (p->windowTypes & CriticalNotificationMask) {
atoms[pnum++] = p->atom(_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION);
}
if (p->windowTypes & AppletPopupMask) {
atoms[pnum++] = p->atom(_KDE_NET_WM_WINDOW_TYPE_APPLET_POPUP);
}
}
if (p->properties & WMState) {
......@@ -1279,6 +1282,8 @@ void NETRootInfo::updateSupportedProperties(xcb_atom_t atom)
p->windowTypes |= OnScreenDisplayMask;
} else if (atom == p->atom(_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION)) {
p->windowTypes |= CriticalNotificationMask;
} else if (atom == p->atom(_KDE_NET_WM_WINDOW_TYPE_APPLET_POPUP)) {
p->windowTypes |= AppletPopupMask;
}
else if (atom == p->atom(_NET_WM_STATE)) {
......@@ -3142,6 +3147,12 @@ void NETWinInfo::setWindowType(WindowType type)
data[1] = p->atom(_NET_WM_WINDOW_TYPE_NOTIFICATION);
len = 2;
break;
case AppletPopup:
data[0] = p->atom(_KDE_NET_WM_WINDOW_TYPE_APPLET_POPUP);
data[1] = XCB_NONE;
len = 1;
break;
default:
case Normal:
......@@ -4257,6 +4268,10 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
else if (type == p->atom(_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION)) {
p->types[pos++] = CriticalNotification;
}
else if (type == p->atom(_KDE_NET_WM_WINDOW_TYPE_APPLET_POPUP)) {
p->types[pos++] = AppletPopup;
}
}
}
}
......@@ -4696,6 +4711,7 @@ case type: \
CHECK_TYPE_MASK(DNDIcon)
CHECK_TYPE_MASK(OnScreenDisplay)
CHECK_TYPE_MASK(CriticalNotification)
CHECK_TYPE_MASK(AppletPopup)
#undef CHECK_TYPE_MASK
default:
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment