summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-08-10 01:21:37 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-08-10 01:21:37 +0800
commit4e0bad2e7f8a1e16cec41f6909c19bab33d93e17 (patch)
treea10f9bfaba3fb9da99353f50269f011cccacf086 /src/window.cpp
parent95df71e732b00dba9910683804171faa72c38d65 (diff)
downloadunity-window-decorator-4e0bad2e7f8a1e16cec41f6909c19bab33d93e17.tar.gz
unity-window-decorator-4e0bad2e7f8a1e16cec41f6909c19bab33d93e17.tar.bz2
Call wrapped hide and show functions for minimize and unminimize and also
unite frame region with input shaped region (so that decorations don't lose input)
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp43
1 files changed, 28 insertions, 15 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 468180b..14d3cc6 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -3367,7 +3367,7 @@ PrivateWindow::ensureWindowVisibility ()
void
PrivateWindow::reveal ()
{
- if (minimized)
+ if (window->minimized ())
window->unminimize ();
screen->leaveShowDesktopMode (window);
@@ -3571,6 +3571,7 @@ CompWindow::constrainNewWindowSize (int width,
void
CompWindow::hide ()
{
+ WRAPABLE_HND_FUNC (13, hide);
priv->hidden = true;
priv->hide ();
}
@@ -3578,6 +3579,7 @@ CompWindow::hide ()
void
CompWindow::show ()
{
+ WRAPABLE_HND_FUNC (14, show);
priv->hidden = false;
priv->show ();
}
@@ -3590,7 +3592,7 @@ PrivateWindow::hide ()
if (!managed)
return;
- if (!minimized && !inShowDesktopMode &&
+ if (!window->minimized () && !inShowDesktopMode &&
!hidden && onDesktop)
{
if (state & CompWindowStateShadedMask)
@@ -3622,7 +3624,7 @@ PrivateWindow::hide ()
XUnmapWindow (screen->dpy (), id);
- if (minimized || inShowDesktopMode || hidden || shaded)
+ if (window->minimized () || inShowDesktopMode || hidden || shaded)
window->changeState (state | CompWindowStateHiddenMask);
if (shaded && id == screen->activeWindow ())
@@ -3696,7 +3698,7 @@ PrivateWindow::minimizeTransients (CompWindow *w,
void
CompWindow::minimize ()
-{
+{
if (!priv->managed)
return;
@@ -3709,7 +3711,7 @@ CompWindow::minimize ()
screen->forEachWindow (
boost::bind (PrivateWindow::minimizeTransients, _1, this));
- priv->hide ();
+ hide ();
}
}
@@ -3731,7 +3733,7 @@ CompWindow::unminimize ()
priv->minimized = false;
- priv->show ();
+ show ();
screen->forEachWindow (
boost::bind (PrivateWindow::unminimizeTransients, _1, this));
@@ -4402,6 +4404,18 @@ void
WindowInterface::updateFrameRegion (CompRegion &region)
WRAPABLE_DEF (updateFrameRegion, region)
+void
+WindowInterface::hide ()
+ WRAPABLE_DEF (hide);
+
+void
+WindowInterface::show ()
+ WRAPABLE_DEF (show);
+
+bool
+WindowInterface::minimized ()
+ WRAPABLE_DEF (minimized);
+
bool
WindowInterface::alpha ()
WRAPABLE_DEF (alpha);
@@ -4594,7 +4608,7 @@ PrivateWindow::processMap ()
window->updateAttributes (stackingMode);
- if (priv->minimized)
+ if (window->minimized ())
window->unminimize ();
screen->leaveShowDesktopMode (window);
@@ -4834,6 +4848,7 @@ CompWindow::pendingUnmaps ()
bool
CompWindow::minimized ()
{
+ WRAPABLE_HND_FUNC_RETURN (15, bool, minimized);
return priv->minimized;
}
@@ -5311,7 +5326,7 @@ CompWindow::syncWait ()
bool
CompWindow::alpha ()
{
- WRAPABLE_HND_FUNC_RETURN (13, bool, alpha);
+ WRAPABLE_HND_FUNC_RETURN (16, bool, alpha);
return priv->alpha;
}
@@ -5353,7 +5368,7 @@ CompWindow::isViewable () const
bool
CompWindow::isFocussable ()
{
- WRAPABLE_HND_FUNC_RETURN (14, bool, isFocussable);
+ WRAPABLE_HND_FUNC_RETURN (17, bool, isFocussable);
if (priv->inputHint)
return true;
@@ -5408,7 +5423,6 @@ CompWindow::updateFrameRegion ()
if (priv->frame && priv->serverGeometry.width () == priv->geometry.width () &&
priv->serverGeometry.height () == priv->geometry.height ())
{
-
priv->frameRegion = CompRegion ();
updateFrameRegion (priv->frameRegion);
@@ -5428,8 +5442,7 @@ CompWindow::updateFrameRegion ()
x = priv->geometry.x () - priv->input.left;
y = priv->geometry.y () - priv->input.top;
-
-
+
XShapeCombineRegion (screen->dpy (), priv->frame,
ShapeBounding, -x, -y,
priv->frameRegion.united (priv->region).handle (),
@@ -5437,7 +5450,7 @@ CompWindow::updateFrameRegion ()
XShapeCombineRegion (screen->dpy (), priv->frame,
ShapeInput, -x, -y,
- priv->inputRegion.handle (),
+ priv->frameRegion.united (priv->inputRegion).handle (),
ShapeSet);
}
}
@@ -5482,7 +5495,7 @@ CompWindow::updateFrameRegion (CompRegion& region)
bool
PrivateWindow::reparent ()
-{
+{
XSetWindowAttributes attr;
XWindowAttributes wa;
XWindowChanges xwc;
@@ -5587,7 +5600,7 @@ PrivateWindow::reparent ()
void
PrivateWindow::unreparent ()
-{
+{
Display *dpy = screen->dpy ();
XEvent e;
bool alive = true;