本文整理汇总了C++中KWindowInfo::valid方法的典型用法代码示例。如果您正苦于以下问题:C++ KWindowInfo::valid方法的具体用法?C++ KWindowInfo::valid怎么用?C++ KWindowInfo::valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KWindowInfo
的用法示例。
在下文中一共展示了KWindowInfo::valid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: focusTask
//-----------------------------------------------------------------------------
// Focus task
//FIXME
void daisy::focusTask(WId id)
{
KWindowInfo taskInfo = KWindowSystem::windowInfo( id, NET::WMState, NET::WM2WindowClass );
if ( taskInfo.valid() )
{
KWindowSystem::unminimizeWindow( id, true );
KWindowSystem::activateWindow( id );
}
}
示例2: closeTask
//-----------------------------------------------------------------------------
// Close task
//FIXME
void daisy::closeTask(WId id)
{
KWindowInfo taskInfo = KWindowSystem::windowInfo( id, NET::WMState );
if ( taskInfo.valid() )
{
NETRootInfo ri( QX11Info::display(), NET::CloseWindow );
ri.closeWindowRequest( id );
}
}
示例3: onWindowChanged
void DesktopSwitch::onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2)
{
if (properties.testFlag(NET::WMState) && isWindowHighlightable(id))
{
KWindowInfo info = KWindowInfo(id, NET::WMDesktop | NET::WMState);
int desktop = info.desktop();
if (!info.valid() || info.onAllDesktops())
return;
else
{
DesktopSwitchButton *button = static_cast<DesktopSwitchButton *>(m_buttons->button(desktop - 1));
if(button)
button->setUrgencyHint(id, info.hasState(NET::DemandsAttention));
}
}
}
示例4: toggShadeTask
//-----------------------------------------------------------------------------
// Toggle Shade task
//FIXME
void daisy::toggShadeTask(WId id)
{
KWindowInfo taskInfo = KWindowSystem::windowInfo( id, NET::WMState, NET::WM2WindowClass );
if ( taskInfo.valid() )
{
if ( taskInfo.hasState( NET::Shaded ) )
{
KWindowSystem::clearState( id, NET::Shaded );
KWindowSystem::unminimizeWindow( id, true );
// KWindowSystem::activateWindow( id );
}
else
{
KWindowSystem::setState( id, NET::Shaded );
// KWindowSystem::setState( id, NET::DemandsAttention );//FOR TESTING, COMMENT AFTER
}
}
}
示例5: toggTask
//-----------------------------------------------------------------------------
// Toggle task
//FIXME
void daisy::toggTask(WId id)
{
KWindowInfo taskInfo = KWindowSystem::windowInfo( id, NET::WMState, NET::WM2WindowClass );
if ( taskInfo.valid() )
{
//HACK widget gains focus on click FIXME
if ( !taskInfo.isMinimized() && ( m_actwin_save == id ) )
{KWindowSystem::minimizeWindow( id, true );}
else
{
KWindowSystem::unminimizeWindow( id, true );
KWindowSystem::activateWindow( id );
}
m_up_tmr->stop();m_up_tmr->setInterval(10);m_up_tmr->start();
}
}
示例6: foreach
void
KWD::Decorator::handleWindowAdded (WId id)
{
QMap <WId, KWD::Window *>::ConstIterator it;
KWD::Window *client = 0;
WId select, frame = 0;
WId oframe = 0, iframe = 0;
KWD::Window::Type type = KWD::Window::Normal;
QWidgetList widgets;
QRect geometry;
/* avoid adding any of our own top level windows */
foreach (QWidget *widget, QApplication::topLevelWidgets ()) {
if (widget->winId () == id)
return;
}
if (KWD::readWindowProperty (id, Atoms::switchSelectWindow,
(long *) &select))
{
if (!mSwitcher)
mSwitcher = new Switcher (mCompositeWindow, id);
if (mSwitcher->xid () != id)
{
delete mSwitcher;
mSwitcher = new Switcher (mCompositeWindow, id);
}
geometry = mSwitcher->geometry ();
frame = None;
}
else
{
KWindowInfo wInfo;
KWD::trapXError ();
wInfo = KWindowSystem::windowInfo (id, NET::WMGeometry);
if (KWD::popXError ())
return;
if (!wInfo.valid ())
return;
KWD::readWindowProperty (id, Atoms::netInputFrameWindow, (long *) &iframe);
KWD::readWindowProperty (id, Atoms::netOutputFrameWindow, (long *) &oframe);
geometry = wInfo.geometry ();
wInfo = KWindowSystem::windowInfo (id, NET::WMWindowType, 0);
switch (wInfo.windowType (~0)) {
case NET::Normal:
case NET::Dialog:
case NET::Toolbar:
case NET::Menu:
case NET::Utility:
case NET::Splash:
case NET::Unknown:
/* decorate these window types */
break;
default:
return;
}
if (iframe)
{
type = KWD::Window::Normal;
frame = iframe;
}
else
{
type = KWD::Window::Normal2D;
frame = oframe;
}
}
KWD::trapXError ();
XSelectInput (QX11Info::display (), id,
StructureNotifyMask | PropertyChangeMask);
KWD::popXError ();
if (frame)
{
XWindowAttributes attr;
KWD::trapXError ();
XGetWindowAttributes (QX11Info::display (), frame, &attr);
if (KWD::popXError ())
frame = None;
}
if (frame)
{
if (!mClients.contains (id))
{
client = new KWD::Window (mCompositeWindow, id, frame, type,
geometry);
mClients.insert (id, client);
mFrames.insert (frame, client);
}
else
//.........这里部分代码省略.........