mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-27 14:50:21 +03:00
x11: do not track popups at all cases
This commit is contained in:
parent
050074f5e4
commit
2df242444c
@ -592,7 +592,7 @@ bool XWindowInterface::isValidWindow(WindowId wid) const
|
||||
return true;
|
||||
}
|
||||
|
||||
const KWindowInfo winfo{wid.value<WId>(), NET::WMWindowType};
|
||||
const KWindowInfo winfo{wid.value<WId>(), NET::WMWindowType | NET::WMState};
|
||||
|
||||
return isValidWindow(winfo);
|
||||
}
|
||||
@ -603,10 +603,6 @@ bool XWindowInterface::isValidWindow(const KWindowInfo &winfo) const
|
||||
return true;
|
||||
}
|
||||
|
||||
constexpr auto types = NET::DockMask | NET::MenuMask | NET::SplashMask | NET::PopupMenuMask | NET::NormalMask | NET::DialogMask;
|
||||
NET::WindowType winType = winfo.windowType(types);
|
||||
const auto winClass = KWindowInfo(winfo.win(), 0, NET::WM2WindowClass).windowClassName();
|
||||
|
||||
//! ignored windows from tracking
|
||||
if (m_ignoredWindows.contains(winfo.win())) {
|
||||
return false;
|
||||
@ -616,26 +612,12 @@ bool XWindowInterface::isValidWindow(const KWindowInfo &winfo) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (winType == -1) {
|
||||
// Trying to get more types for verify if the window have any other type
|
||||
winType = winfo.windowType(~types & NET::AllTypesMask);
|
||||
bool hasSkipTaskbar = winfo.hasState(NET::SkipTaskbar);
|
||||
bool hasSkipPager = winfo.hasState(NET::SkipPager);
|
||||
|
||||
if (winType == -1) {
|
||||
qWarning() << KWindowInfo(winfo.win(), 0, NET::WM2WindowClass).windowClassName()
|
||||
<< "doesn't have any WindowType, assuming as NET::Normal";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool isSkipped = hasSkipTaskbar && hasSkipPager;
|
||||
|
||||
bool isMenu = ((winType & NET::Menu) == true);
|
||||
bool isDock = ((winType & NET::Dock) == true);
|
||||
bool isPopup = ((winType & NET::PopupMenu) == true);
|
||||
bool isSplash = ((winType & NET::Splash) == true);
|
||||
|
||||
//! GTK2+ dialogs case e.g. inkscape, gimp2, etc...
|
||||
//! are both Popups and Splash types, this is why
|
||||
//! we can not black list them here
|
||||
return !(isMenu || isDock);
|
||||
return !isSkipped;
|
||||
}
|
||||
|
||||
void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2)
|
||||
@ -682,7 +664,6 @@ void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::P
|
||||
return;
|
||||
}
|
||||
|
||||
//! ignore windows that do not respect normal windows types
|
||||
if (!isValidWindow(wid)) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user