summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-02-02 15:05:01 +0100
committerDanny Baumann <dannybaumann@web.de>2009-02-02 15:05:01 +0100
commit59f2ddd3303d771df771372e140b82fec0cbd773 (patch)
tree270ee92f66a7cca1a02d7eed8851863a7f1d4343
parent61d7383adcb8645f6dbdeb310d5ae2e4c00cda55 (diff)
downloadextrawm-59f2ddd3303d771df771372e140b82fec0cbd773.tar.gz
extrawm-59f2ddd3303d771df771372e140b82fec0cbd773.tar.bz2
Minor stylistic improvements.
-rw-r--r--extrawm.cpp47
1 files changed, 24 insertions, 23 deletions
diff --git a/extrawm.cpp b/extrawm.cpp
index afa264f..abcb1de 100644
--- a/extrawm.cpp
+++ b/extrawm.cpp
@@ -32,8 +32,7 @@ ExtraWMScreen::addAttentionWindow (CompWindow *w)
/* check if the window is already there */
for (it = attentionWindows.begin (); it != attentionWindows.end (); it++)
{
- CompWindow *window = *it;
- if (window == w)
+ if (*it == w)
return;
}
@@ -50,13 +49,13 @@ void
ExtraWMScreen::updateAttentionWindow (CompWindow *w)
{
XWMHints *hints;
- Bool urgent = FALSE;
+ bool urgent = false;
hints = XGetWMHints (screen->dpy (), w->id ());
if (hints)
{
if (hints->flags & XUrgencyHint)
- urgent = TRUE;
+ urgent = true;
XFree (hints);
}
@@ -76,9 +75,9 @@ ExtraWMScreen::activateDemandsAttention (CompAction *action,
if (!es->attentionWindows.empty ())
{
- CompWindow *w = es->attentionWindows.front (); // first member
+ CompWindow *w = es->attentionWindows.front ();
- es->removeAttentionWindow (w);
+ es->attentionWindows.pop_front ();
w->activate ();
}
@@ -94,11 +93,12 @@ ExtraWMScreen::activateWin (CompAction *action,
Window xid;
xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findWindow (xid);
+ w = screen->findWindow (xid);
+
if (w)
- screen->sendWindowActivationRequest (w->id ());
+ screen->sendWindowActivationRequest (w->id ());
- return TRUE;
+ return true;
}
void
@@ -135,15 +135,17 @@ ExtraWMScreen::toggleFullscreen (CompAction *action,
CompWindow *w;
Window xid;
- EXTRAWM_SCREEN (screen);
-
xid = CompOption::getIntOptionNamed (options, "window");
+ w = screen->findWindow (xid);
- w = screen->findWindow (xid);
if (w && (w->actions () & CompWindowActionFullscreenMask))
+ {
+ EXTRAWM_SCREEN (screen);
+
es->fullscreenWindow (w, w->state () ^ CompWindowStateFullscreenMask);
+ }
- return TRUE;
+ return true;
}
bool
@@ -155,7 +157,8 @@ ExtraWMScreen::toggleRedirect (CompAction *action,
Window xid;
xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findTopLevelWindow (xid);
+ w = screen->findTopLevelWindow (xid);
+
if (w)
{
CompositeWindow *cWindow = CompositeWindow::get (w);
@@ -169,7 +172,7 @@ ExtraWMScreen::toggleRedirect (CompAction *action,
}
}
- return TRUE;
+ return true;
}
bool
@@ -181,10 +184,12 @@ ExtraWMScreen::toggleAlwaysOnTop (CompAction *action,
Window xid;
xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findTopLevelWindow (xid);
+ w = screen->findTopLevelWindow (xid);
+
if (w)
{
unsigned int newState;
+
newState = w->state () ^ CompWindowStateAboveMask;
w->changeState (newState);
w->updateAttributes (CompStackingUpdateModeNormal);
@@ -193,8 +198,6 @@ ExtraWMScreen::toggleAlwaysOnTop (CompAction *action,
return TRUE;
}
-/* From here */
-
bool
ExtraWMScreen::toggleSticky (CompAction *action,
CompAction::State state,
@@ -204,7 +207,8 @@ ExtraWMScreen::toggleSticky (CompAction *action,
Window xid;
xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findTopLevelWindow (xid);
+ w = screen->findTopLevelWindow (xid);
+
if (w && (w->actions () & CompWindowActionStickMask))
{
unsigned int newState;
@@ -216,9 +220,8 @@ ExtraWMScreen::toggleSticky (CompAction *action,
}
void
-ExtraWMScreen::handleEvent (XEvent *event)
+ExtraWMScreen::handleEvent (XEvent *event)
{
-
screen->handleEvent (event);
switch (event->type) {
@@ -252,7 +255,6 @@ ExtraWMScreen::ExtraWMScreen (CompScreen *screen) :
PrivateHandler <ExtraWMScreen, CompScreen> (screen),
ExtrawmOptions (extrawmVTable->getMetadata ())
{
-
ScreenInterface::setHandler (screen);
optionSetToggleRedirectKeyInitiate (toggleRedirect);
@@ -261,7 +263,6 @@ ExtraWMScreen::ExtraWMScreen (CompScreen *screen) :
optionSetToggleFullscreenKeyInitiate (toggleFullscreen);
optionSetActivateInitiate (activateWin);
optionSetActivateDemandsAttentionKeyInitiate (activateDemandsAttention);
-
}
ExtraWMWindow::ExtraWMWindow (CompWindow *window) :