dont block visibility function after Meta trigger

--Menu11 and SimpleMenu applets are using a custom
plasmoid approach in order to be able to position their
popups differently on the screen. This patch considers
this in a more generic way and does not use the default
codepath to show popups from these applets. More
importantly the Needs/RequiresAttention status is used
in order to determine the panel/dock visibility for
these applets.

BUG:441053
work/m_layershell
Michail Vourlakos 3 years ago
parent d354cc4513
commit 59360176ee

@ -122,17 +122,17 @@ bool ContainmentInterface::applicationLauncherInPopup() const
}
uint launcherAppletId = applicationLauncherId();
QString launcherPluginId;
const auto applets = m_view->containment()->applets();
PlasmaQuick::AppletQuickItem *appLauncherItem{nullptr};
for (auto applet : applets) {
if (applet->id() == launcherAppletId) {
launcherPluginId = applet->kPackage().metadata().pluginId();
appLauncherItem = applet->property("_plasma_graphicObject").value<PlasmaQuick::AppletQuickItem *>();
}
}
return launcherPluginId != "org.kde.plasma.kickerdash";
return appLauncherItem && appletIsExpandable(appLauncherItem);
}
bool ContainmentInterface::containsApplicationLauncher() const
@ -415,7 +415,7 @@ void ContainmentInterface::deactivateApplets()
}
}
bool ContainmentInterface::appletIsExpandable(const int id)
bool ContainmentInterface::appletIsExpandable(const int id) const
{
if (!m_view->containment() || !m_view->inReadyState()) {
return false;
@ -438,7 +438,7 @@ bool ContainmentInterface::appletIsExpandable(const int id)
return false;
}
bool ContainmentInterface::appletIsExpandable(PlasmaQuick::AppletQuickItem *appletQuickItem)
bool ContainmentInterface::appletIsExpandable(PlasmaQuick::AppletQuickItem *appletQuickItem) const
{
if (!appletQuickItem || !m_view->inReadyState()) {
return false;
@ -554,7 +554,7 @@ void ContainmentInterface::onPlasmaTasksCountChanged()
emit hasPlasmaTasksChanged();
}
bool ContainmentInterface::appletIsExpanded(const int id)
bool ContainmentInterface::appletIsExpanded(const int id) const
{
return m_expandedAppletIds.values().contains(id);
}

@ -80,8 +80,8 @@ public slots:
Q_INVOKABLE void deactivateApplets();
Q_INVOKABLE void toggleAppletExpanded(const int id);
Q_INVOKABLE bool appletIsExpandable(const int id);
Q_INVOKABLE bool appletIsExpanded(const int id);
Q_INVOKABLE bool appletIsExpandable(const int id) const;
Q_INVOKABLE bool appletIsExpanded(const int id) const;
Q_INVOKABLE bool isApplication(const QUrl &url) const;
@ -109,7 +109,7 @@ private:
void addExpandedApplet(PlasmaQuick::AppletQuickItem * appletQuickItem);
void removeExpandedApplet(PlasmaQuick::AppletQuickItem *appletQuickItem);
bool appletIsExpandable(PlasmaQuick::AppletQuickItem *appletQuickItem);
bool appletIsExpandable(PlasmaQuick::AppletQuickItem *appletQuickItem) const;
private:
bool m_hasLatteTasks{false};

@ -665,7 +665,7 @@ void View::statusChanged(Plasma::Types::ItemStatus status)
//! Fix for #443236, following setFlags(...) need to be added at all three cases
//! but initViewFlags() should be called afterwards because setFlags(...) breaks
//! the Dock window default behavior under x11
if (status == Plasma::Types::NeedsAttentionStatus) {
if (status == Plasma::Types::NeedsAttentionStatus || status == Plasma::Types::RequiresAttentionStatus) {
m_visibility->addBlockHidingEvent(BLOCKHIDINGNEEDSATTENTIONTYPE);
setFlags(flags() | Qt::WindowDoesNotAcceptFocus);
m_visibility->initViewFlags();

Loading…
Cancel
Save