MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / is_user_window

Method is_user_window

TranslucentTB/windows/window.cpp:188–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188bool Window::is_user_window() const
189{
190 if (valid())
191 {
192 const auto ex_style = get_long_ptr(GWL_EXSTYLE).value_or(0);
193 const bool is_tool_window = (ex_style & WS_EX_TOOLWINDOW) == WS_EX_TOOLWINDOW;
194
195 // check if the window is visible. A window with WS_EX_TOOLWINDOW is considered not visible.
196 if (!is_tool_window && visible() && !cloaked())
197 {
198 // check if the window is top-level.
199 if (ancestor(GA_ROOT) == m_WindowHandle)
200 {
201 const bool is_no_activate = (ex_style & WS_EX_NOACTIVATE) == WS_EX_NOACTIVATE;
202 const bool is_app_window = (ex_style & WS_EX_APPWINDOW) == WS_EX_APPWINDOW;
203
204 // check the window does not have WS_EX_NOACTIVATE (or if it does, it has WS_EX_APPWINDOW)
205 // then check if it's on the current virtual desktop (currently, a cloak check also catches these, but it's an implementation detail)
206 return (!is_no_activate || is_app_window) && on_current_desktop().value_or(false);
207 }
208 }
209 }
210
211 return false;
212}

Callers 1

InsertWindowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected