accept Gtk2+ dialogs for tracking

--Gtk2+ dialogs under X11 appear as
type Splash and PopUp at the same time.
This is a messy situation let's live
with this
pull/6/head
Michail Vourlakos 6 years ago
parent 3cbc4a5daf
commit 8a8eb632b7

@ -573,7 +573,6 @@ void Windows::updateHints(Latte::View *view)
//qDebug() << "TRACKING | activeWindowTouching: " << foundActiveTouchInCurScreen << " ,activeWindowMaximized: " << activeWindowMaximized(view);
//qDebug() << "TRACKING | existsWindowActive: " << foundActiveInCurScreen << " , existsWindowMaximized:" << existsWindowMaximized(view)
// << " , existsWindowTouching:"<<existsWindowTouching(view);
}
}

@ -447,10 +447,17 @@ void XWindowInterface::requestToggleMaximized(WindowId wid) const
}
}
bool XWindowInterface::isValidWindow(WindowId wid) const
{
const KWindowInfo winfo{wid.value<WId>(), NET::WMWindowType};
return isValidWindow(winfo);
}
bool XWindowInterface::isValidWindow(const KWindowInfo &winfo) const
{
constexpr auto types = NET::DockMask | NET::MenuMask | NET::SplashMask | NET::NormalMask;
auto winType = winfo.windowType(types);
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();
//! ignore latte related windows from tracking
@ -469,7 +476,16 @@ bool XWindowInterface::isValidWindow(const KWindowInfo &winfo) const
}
}
return !((winType & NET::Menu) || (winType & NET::Dock) || (winType & NET::Splash));
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);
}
void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2)
@ -523,6 +539,12 @@ void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::P
}
}
//! ignore windows that do not respect normal windows types
if (!isValidWindow(wid)) {
qDebug() << "rejected window...";
return;
}
considerWindowChanged(wid);
}

@ -74,6 +74,7 @@ public:
void setEdgeStateFor(QWindow *view, bool active) const override;
private:
bool isValidWindow(WindowId wid) const;
bool isValidWindow(const KWindowInfo &winfo) const;
void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2);

Loading…
Cancel
Save