summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2009-01-21 02:21:59 -0600
committerTravis Watkins <travis@ronin.(none)>2009-01-21 02:21:59 -0600
commit50739fc0172448e4aed1c3417e46c57eb77c16cc (patch)
tree73050fe665d7cacb8cfa1ab4d1be7f916c0c66bd
parenta6973aa7911087a884f46683824a6969e7517daa (diff)
downloadautoresize-50739fc0172448e4aed1c3417e46c57eb77c16cc.tar.gz
autoresize-50739fc0172448e4aed1c3417e46c57eb77c16cc.tar.bz2
fix commented out bits, make window wraps work
-rw-r--r--snap.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/snap.cpp b/snap.cpp
index 68279de..425f31f 100644
--- a/snap.cpp
+++ b/snap.cpp
@@ -138,7 +138,7 @@ isSnapWindow (CompWindow *w)
if (UNLIKELY(!w))
return false;
- if (w->invisible () || /*w->hidden () ||*/ w->minimized ())
+ if (w->invisible () || w->isViewable () || w->minimized ())
return false;
if ((w->type () & SNAP_WINDOW_TYPE) &&
(ss->optionGetEdgesCategoriesMask () & EdgesCategoriesWindowEdgesMask))
@@ -533,31 +533,11 @@ SnapWindow::resizeCheckEdges (int dx, int dy, int dwidth, int dheight)
VerticalSnap);
}
-// avoidSnap functions ---------------------------------------------------------
-
-bool
-SnapScreen::enableSnapping (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options)
-{
- snapping = true;
- return false;
-}
-
-bool
-SnapScreen::disableSnapping (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options)
-{
- snapping = false;
- return false;
-}
-
// Check if avoidSnap is matched, and enable/disable snap consequently
void
SnapScreen::handleEvent (XEvent *event)
{
-/* if (event->type == d->xkbEvent)
+ if (event->type == screen->xkbEvent ())
{
XkbAnyEvent *xkbEvent = (XkbAnyEvent *) event;
@@ -570,12 +550,12 @@ SnapScreen::handleEvent (XEvent *event)
mods = avoidSnapMask;
if ((stateEvent->mods & mods) == mods)
- disableSnapping (NULL, 0, NULL);
+ snapping = false;
else
- enableSnapping (NULL, 0, NULL);
+ snapping = true;
}
}
-*/
+
screen->handleEvent (event);
}
@@ -832,6 +812,7 @@ SnapWindow::SnapWindow (CompWindow *window) :
grabbed (0),
skipNotify (false)
{
+ WindowInterface::setHandler (window);
}
SnapWindow::~SnapWindow ()