Adjust kde-workspace to introduction of flags in NET classes
This commit is contained in:
parent
dc9f613113
commit
fdee4ea8c8
17 changed files with 44 additions and 52 deletions
|
@ -699,7 +699,7 @@ void Client::demandAttention(bool set)
|
|||
if (demands_attention == set)
|
||||
return;
|
||||
demands_attention = set;
|
||||
info->setState(set ? NET::DemandsAttention : 0, NET::DemandsAttention);
|
||||
info->setState(set ? NET::DemandsAttention : NET::States(0), NET::DemandsAttention);
|
||||
workspace()->clientAttentionChanged(this, set);
|
||||
emit demandsAttentionChanged();
|
||||
}
|
||||
|
|
14
client.cpp
14
client.cpp
|
@ -1020,8 +1020,8 @@ void Client::setShade(ShadeMode mode)
|
|||
if (isActive())
|
||||
workspace()->requestFocus(this);
|
||||
}
|
||||
info->setState(isShade() ? NET::Shaded : 0, NET::Shaded);
|
||||
info->setState(isShown(false) ? 0 : NET::Hidden, NET::Hidden);
|
||||
info->setState(isShade() ? NET::Shaded : NET::States(0), NET::Shaded);
|
||||
info->setState(isShown(false) ? NET::States(0) : NET::Hidden, NET::Hidden);
|
||||
discardWindowPixmap();
|
||||
updateVisibility();
|
||||
updateAllowedActions();
|
||||
|
@ -1398,7 +1398,7 @@ void Client::setSkipTaskbar(bool b, bool from_outside)
|
|||
if (b == skipTaskbar())
|
||||
return;
|
||||
skip_taskbar = b;
|
||||
info->setState(b ? NET::SkipTaskbar : 0, NET::SkipTaskbar);
|
||||
info->setState(b ? NET::SkipTaskbar : NET::States(0), NET::SkipTaskbar);
|
||||
updateWindowRules(Rules::SkipTaskbar);
|
||||
if (was_wants_tab_focus != wantsTabFocus())
|
||||
FocusChain::self()->update(this,
|
||||
|
@ -1412,7 +1412,7 @@ void Client::setSkipPager(bool b)
|
|||
if (b == skipPager())
|
||||
return;
|
||||
skip_pager = b;
|
||||
info->setState(b ? NET::SkipPager : 0, NET::SkipPager);
|
||||
info->setState(b ? NET::SkipPager : NET::States(0), NET::SkipPager);
|
||||
updateWindowRules(Rules::SkipPager);
|
||||
emit skipPagerChanged();
|
||||
}
|
||||
|
@ -2279,7 +2279,7 @@ void Client::updateAllowedActions(bool force)
|
|||
{
|
||||
if (!isManaged() && !force)
|
||||
return;
|
||||
unsigned long old_allowed_actions = allowed_actions;
|
||||
NET::Actions old_allowed_actions = NET::Actions(allowed_actions);
|
||||
allowed_actions = 0;
|
||||
if (isMovable())
|
||||
allowed_actions |= NET::ActionMove;
|
||||
|
@ -2303,7 +2303,7 @@ void Client::updateAllowedActions(bool force)
|
|||
info->setAllowedActions(allowed_actions);
|
||||
|
||||
// ONLY if relevant features have changed (and the window didn't just get/loose moveresize for maximization state changes)
|
||||
const unsigned long relevant = ~(NET::ActionMove|NET::ActionResize);
|
||||
const NET::Actions relevant = ~(NET::ActionMove|NET::ActionResize);
|
||||
if (decoration && (allowed_actions & relevant) != (old_allowed_actions & relevant))
|
||||
emit decoration->decorationButtonsChanged();
|
||||
}
|
||||
|
@ -2461,7 +2461,7 @@ NET::WindowType Client::windowType(bool direct, int supportedTypes) const
|
|||
if (supportedTypes == 0) {
|
||||
supportedTypes = SUPPORTED_MANAGED_WINDOW_TYPES_MASK;
|
||||
}
|
||||
NET::WindowType wt = info->windowType(supportedTypes);
|
||||
NET::WindowType wt = info->windowType(NET::WindowTypes(supportedTypes));
|
||||
if (direct) {
|
||||
return wt;
|
||||
}
|
||||
|
|
2
client.h
2
client.h
|
@ -940,7 +940,7 @@ private:
|
|||
qint64 m_killHelperPID;
|
||||
xcb_timestamp_t m_pingTimestamp;
|
||||
xcb_timestamp_t m_userTime;
|
||||
unsigned long allowed_actions;
|
||||
NET::Actions allowed_actions;
|
||||
QSize client_size;
|
||||
int block_geometry_updates; // > 0 = New geometry is remembered, but not actually set
|
||||
enum PendingGeometry_t {
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace Oxygen
|
|||
return;
|
||||
}
|
||||
|
||||
_info.reset(new KWindowInfo( window, -1U, -1U ));
|
||||
_info.reset(new KWindowInfo( window, NET::WMAllProperties, NET::WM2AllProperties ));
|
||||
if( !_info->valid())
|
||||
{
|
||||
emit detectionDone( false );
|
||||
|
|
|
@ -179,7 +179,7 @@ NET::WindowType Deleted::windowType(bool direct, int supportedTypes) const
|
|||
if (supportedTypes == 0) {
|
||||
supportedTypes = SUPPORTED_UNMANAGED_WINDOW_TYPES_MASK;
|
||||
}
|
||||
return info->windowType(supportedTypes);
|
||||
return info->windowType(NET::WindowTypes(supportedTypes));
|
||||
}
|
||||
|
||||
void Deleted::mainClientClosed(Toplevel *client)
|
||||
|
|
|
@ -2415,7 +2415,7 @@ void Client::setFullScreen(bool set, bool user)
|
|||
StackingUpdatesBlocker blocker1(workspace());
|
||||
GeometryUpdatesBlocker blocker2(this);
|
||||
workspace()->updateClientLayer(this); // active fullscreens get different layer
|
||||
info->setState(isFullScreen() ? NET::FullScreen : 0, NET::FullScreen);
|
||||
info->setState(isFullScreen() ? NET::FullScreen : NET::States(0), NET::FullScreen);
|
||||
updateDecoration(false, false);
|
||||
if (isFullScreen()) {
|
||||
if (info->fullscreenMonitors().isSet())
|
||||
|
|
|
@ -78,7 +78,7 @@ void DetectDialog::readWindow(WId w)
|
|||
emit detectionDone(false);
|
||||
return;
|
||||
}
|
||||
info.reset(new KWindowInfo(w, -1U, -1U)); // read everything
|
||||
info.reset(new KWindowInfo(w, NET::WMAllProperties, NET::WM2AllProperties)); // read everything
|
||||
if (!info->valid()) {
|
||||
emit detectionDone(false);
|
||||
return;
|
||||
|
|
|
@ -164,7 +164,7 @@ static Rules* findRule(const QList< Rules* >& rules, Window wid, bool whole_app)
|
|||
if (type == NET::Unknown)
|
||||
ret->types = NET::NormalMask;
|
||||
else
|
||||
ret->types = 1 << type; // convert type to its mask
|
||||
ret->types = NET::WindowTypeMask( 1 << type); // convert type to its mask
|
||||
ret->title = title; // set, but make unimportant
|
||||
ret->titlematch = Rules::UnimportantMatch;
|
||||
ret->clientmachine = machine; // set, but make unimportant
|
||||
|
|
|
@ -552,16 +552,16 @@ Rules* RulesWidget::rules() const
|
|||
if (all_types) // if all types are selected, use AllTypesMask (for future expansion)
|
||||
rules->types = NET::AllTypesMask;
|
||||
else {
|
||||
rules->types |= types->item(0)->isSelected() ? NET::NormalMask : 0U;
|
||||
rules->types |= types->item(1)->isSelected() ? NET::DialogMask : 0U;
|
||||
rules->types |= types->item(2)->isSelected() ? NET::UtilityMask : 0U;
|
||||
rules->types |= types->item(3)->isSelected() ? NET::DockMask : 0U;
|
||||
rules->types |= types->item(4)->isSelected() ? NET::ToolbarMask : 0U;
|
||||
rules->types |= types->item(5)->isSelected() ? NET::MenuMask : 0U;
|
||||
rules->types |= types->item(6)->isSelected() ? NET::SplashMask : 0U;
|
||||
rules->types |= types->item(7)->isSelected() ? NET::DesktopMask : 0U;
|
||||
rules->types |= types->item(8)->isSelected() ? NET::OverrideMask : 0U;
|
||||
rules->types |= types->item(9)->isSelected() ? NET::TopMenuMask : 0U;
|
||||
rules->types |= types->item(0)->isSelected() ? NET::NormalMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(1)->isSelected() ? NET::DialogMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(2)->isSelected() ? NET::UtilityMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(3)->isSelected() ? NET::DockMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(4)->isSelected() ? NET::ToolbarMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(5)->isSelected() ? NET::MenuMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(6)->isSelected() ? NET::SplashMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(7)->isSelected() ? NET::DesktopMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(8)->isSelected() ? NET::OverrideMask : NET::WindowTypeMask(0);
|
||||
rules->types |= types->item(9)->isSelected() ? NET::TopMenuMask : NET::WindowTypeMask(0);
|
||||
}
|
||||
rules->title = title->text();
|
||||
rules->titlematch = static_cast< Rules::StringMatch >(title_match->currentIndex());
|
||||
|
@ -762,7 +762,7 @@ bool RulesWidget::finalCheck()
|
|||
void RulesWidget::prepareWindowSpecific(WId window)
|
||||
{
|
||||
tabs->setCurrentIndex(1); // geometry tab, skip tab for window identification
|
||||
KWindowInfo info(window, -1U, -1U); // read everything
|
||||
KWindowInfo info(window, NET::WMAllProperties, NET::WM2AllProperties); // read everything
|
||||
prefillUnusedValues(info);
|
||||
}
|
||||
|
||||
|
|
|
@ -774,11 +774,11 @@ void Client::setKeepAbove(bool b)
|
|||
if (b == keepAbove()) {
|
||||
// force hint change if different
|
||||
if (bool(info->state() & NET::KeepAbove) != keepAbove())
|
||||
info->setState(keepAbove() ? NET::KeepAbove : 0, NET::KeepAbove);
|
||||
info->setState(keepAbove() ? NET::KeepAbove : NET::States(0), NET::KeepAbove);
|
||||
return;
|
||||
}
|
||||
keep_above = b;
|
||||
info->setState(keepAbove() ? NET::KeepAbove : 0, NET::KeepAbove);
|
||||
info->setState(keepAbove() ? NET::KeepAbove : NET::States(0), NET::KeepAbove);
|
||||
workspace()->updateClientLayer(this);
|
||||
updateWindowRules(Rules::Above);
|
||||
|
||||
|
@ -796,11 +796,11 @@ void Client::setKeepBelow(bool b)
|
|||
if (b == keepBelow()) {
|
||||
// force hint change if different
|
||||
if (bool(info->state() & NET::KeepBelow) != keepBelow())
|
||||
info->setState(keepBelow() ? NET::KeepBelow : 0, NET::KeepBelow);
|
||||
info->setState(keepBelow() ? NET::KeepBelow : NET::States(0), NET::KeepBelow);
|
||||
return;
|
||||
}
|
||||
keep_below = b;
|
||||
info->setState(keepBelow() ? NET::KeepBelow : 0, NET::KeepBelow);
|
||||
info->setState(keepBelow() ? NET::KeepBelow : NET::States(0), NET::KeepBelow);
|
||||
workspace()->updateClientLayer(this);
|
||||
updateWindowRules(Rules::Below);
|
||||
|
||||
|
|
|
@ -90,16 +90,14 @@ bool Client::manage(xcb_window_t w, bool isMapped)
|
|||
NET::WMIconGeometry |
|
||||
NET::WMIcon |
|
||||
NET::WMPid |
|
||||
NET::WMIconName |
|
||||
0;
|
||||
NET::WMIconName;
|
||||
properties[WinInfo::PROTOCOLS2] =
|
||||
NET::WM2UserTime |
|
||||
NET::WM2StartupId |
|
||||
NET::WM2ExtendedStrut |
|
||||
NET::WM2Opacity |
|
||||
NET::WM2FullscreenMonitors |
|
||||
NET::WM2FrameOverlap |
|
||||
0;
|
||||
NET::WM2FrameOverlap;
|
||||
|
||||
info = new WinInfo(this, m_client, rootWindow(), properties, 2);
|
||||
|
||||
|
|
14
netinfo.cpp
14
netinfo.cpp
|
@ -86,9 +86,8 @@ RootInfo *RootInfo::create()
|
|||
NET::DialogMask |
|
||||
NET::OverrideMask |
|
||||
NET::UtilityMask |
|
||||
NET::SplashMask |
|
||||
NET::SplashMask
|
||||
// No compositing window types here unless we support them also as managed window types
|
||||
0
|
||||
,
|
||||
NET::Modal |
|
||||
//NET::Sticky | // Large desktops not supported (and probably never will be)
|
||||
|
@ -102,8 +101,7 @@ RootInfo *RootInfo::create()
|
|||
NET::Hidden |
|
||||
NET::FullScreen |
|
||||
NET::KeepBelow |
|
||||
NET::DemandsAttention |
|
||||
0
|
||||
NET::DemandsAttention
|
||||
,
|
||||
NET::WM2UserTime |
|
||||
NET::WM2StartupId |
|
||||
|
@ -116,8 +114,7 @@ RootInfo *RootInfo::create()
|
|||
NET::WM2DesktopLayout |
|
||||
NET::WM2FullPlacement |
|
||||
NET::WM2FullscreenMonitors |
|
||||
NET::WM2KDEShadow |
|
||||
0
|
||||
NET::WM2KDEShadow
|
||||
,
|
||||
NET::ActionMove |
|
||||
NET::ActionResize |
|
||||
|
@ -128,8 +125,7 @@ RootInfo *RootInfo::create()
|
|||
NET::ActionMaxHoriz |
|
||||
NET::ActionFullScreen |
|
||||
NET::ActionChangeDesktop |
|
||||
NET::ActionClose |
|
||||
0
|
||||
NET::ActionClose
|
||||
,
|
||||
};
|
||||
|
||||
|
@ -265,7 +261,7 @@ void WinInfo::changeFullscreenMonitors(NETFullscreenMonitors topology)
|
|||
m_client->updateFullscreenMonitors(topology);
|
||||
}
|
||||
|
||||
void WinInfo::changeState(unsigned long state, unsigned long mask)
|
||||
void WinInfo::changeState(NET::States state, NET::States mask)
|
||||
{
|
||||
mask &= ~NET::Sticky; // KWin doesn't support large desktops, ignore
|
||||
mask &= ~NET::Hidden; // clients are not allowed to change this directly
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
xcb_window_t rwin, const unsigned long pr[], int pr_size);
|
||||
virtual void changeDesktop(int desktop) override;
|
||||
virtual void changeFullscreenMonitors(NETFullscreenMonitors topology) override;
|
||||
virtual void changeState(unsigned long state, unsigned long mask) override;
|
||||
virtual void changeState(NET::States state, NET::States mask) override;
|
||||
void disable();
|
||||
|
||||
private:
|
||||
|
|
|
@ -144,7 +144,7 @@ void Rules::readFromCfg(const KConfigGroup& cfg)
|
|||
READ_MATCH_STRING(windowrole, .toLower().toLatin1());
|
||||
READ_MATCH_STRING(title,);
|
||||
READ_MATCH_STRING(clientmachine, .toLower().toLatin1());
|
||||
types = cfg.readEntry("types", uint(NET::AllTypesMask));
|
||||
types = NET::WindowTypeMask(cfg.readEntry<uint>("types", NET::AllTypesMask));
|
||||
READ_FORCE_RULE2(placement, QString(), Placement::policyFromString, false);
|
||||
READ_SET_RULE_DEF(position, , invalidPoint);
|
||||
READ_SET_RULE(size, , QSize());
|
||||
|
|
2
rules.h
2
rules.h
|
@ -211,7 +211,7 @@ private:
|
|||
StringMatch titlematch;
|
||||
QByteArray clientmachine;
|
||||
StringMatch clientmachinematch;
|
||||
unsigned long types; // types for matching
|
||||
NET::WindowTypes types; // types for matching
|
||||
Placement::Policy placement;
|
||||
ForceRule placementrule;
|
||||
QPoint position;
|
||||
|
|
|
@ -66,11 +66,9 @@ bool Unmanaged::track(Window w)
|
|||
unsigned long properties[ 2 ];
|
||||
properties[ NETWinInfo::PROTOCOLS ] =
|
||||
NET::WMWindowType |
|
||||
NET::WMPid |
|
||||
0;
|
||||
NET::WMPid;
|
||||
properties[ NETWinInfo::PROTOCOLS2 ] =
|
||||
NET::WM2Opacity |
|
||||
0;
|
||||
NET::WM2Opacity;
|
||||
info = new NETWinInfo(connection(), w, rootWindow(), properties, 2);
|
||||
getResourceClass();
|
||||
getWindowRole();
|
||||
|
@ -153,7 +151,7 @@ NET::WindowType Unmanaged::windowType(bool direct, int supportedTypes) const
|
|||
if (supportedTypes == 0) {
|
||||
supportedTypes = SUPPORTED_UNMANAGED_WINDOW_TYPES_MASK;
|
||||
}
|
||||
return info->windowType(supportedTypes);
|
||||
return info->windowType(NET::WindowTypes(supportedTypes));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
4
utils.h
4
utils.h
|
@ -42,11 +42,11 @@ namespace KWin
|
|||
{
|
||||
|
||||
// window types that are supported as normal windows (i.e. KWin actually manages them)
|
||||
const int SUPPORTED_MANAGED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
|
||||
const NET::WindowTypes SUPPORTED_MANAGED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
|
||||
| NET::ToolbarMask | NET::MenuMask | NET::DialogMask /*| NET::OverrideMask*/ | NET::TopMenuMask
|
||||
| NET::UtilityMask | NET::SplashMask | NET::NotificationMask;
|
||||
// window types that are supported as unmanaged (mainly for compositing)
|
||||
const int SUPPORTED_UNMANAGED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
|
||||
const NET::WindowTypes SUPPORTED_UNMANAGED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
|
||||
| NET::ToolbarMask | NET::MenuMask | NET::DialogMask /*| NET::OverrideMask*/ | NET::TopMenuMask
|
||||
| NET::UtilityMask | NET::SplashMask | NET::DropdownMenuMask | NET::PopupMenuMask
|
||||
| NET::TooltipMask | NET::NotificationMask | NET::ComboBoxMask | NET::DNDIconMask;
|
||||
|
|
Loading…
Reference in a new issue