summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2009-09-28 07:49:41 -0500
committerTravis Watkins <amaranth@ubuntu.com>2009-09-28 07:49:41 -0500
commitbd84cd7cc43f07c5757201ccf9e72ca551456c48 (patch)
tree4f4d42c81f90aecdf3aefc293e9e3b309e46ba80
parentffc737d0939c51f7883ad435b192975ad0a17c5f (diff)
downloadshelf-bd84cd7cc43f07c5757201ccf9e72ca551456c48.tar.gz
shelf-bd84cd7cc43f07c5757201ccf9e72ca551456c48.tar.bz2
scale window under pointer
Change shelfInc and shelfDec to scale the window currently under the mouse pointer instead of the currently active window.
-rw-r--r--shelf.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/shelf.c b/shelf.c
index 69f244d..979ea14 100644
--- a/shelf.c
+++ b/shelf.c
@@ -102,6 +102,27 @@ static int displayPrivateIndex;
GET_SHELF_SCREEN (w->screen, \
GET_SHELF_DISPLAY (w->screen->display)))
+#define GET_WINDOW \
+ CompScreen *s; \
+ CompWindow *win; \
+ CompWindow *w; \
+ Window xid; \
+ xid = getIntOptionNamed (option, nOption, "root", 0); \
+ s = findScreenAtDisplay (d, xid); \
+ if (!s) \
+ return TRUE; \
+ xid = getIntOptionNamed (option, nOption, "window", 0); \
+ win = findWindowAtDisplay (d, xid); \
+ if (!win || win->type & CompWindowTypeDesktopMask || \
+ xid == s->root) \
+ win = findWindowAtDisplay (d, d->activeWindow); \
+ if (!win) \
+ return TRUE; \
+ w = shelfGetRealWindow (win); \
+ if (!w) \
+ w = win
+
+
#define SHELF_MIN_SIZE 50.0f // Minimum pixelsize a window can be scaled to
/* Checks if w is a ipw and returns the real window */
@@ -528,9 +549,7 @@ shelfInc (CompDisplay *d,
CompOption *option,
int nOption)
{
- CompWindow *w = findWindowAtDisplay (d, d->activeWindow);
- if (!w)
- return TRUE;
+ GET_WINDOW;
SHELF_WINDOW (w);
@@ -546,9 +565,7 @@ shelfDec (CompDisplay *d,
CompOption *option,
int nOption)
{
- CompWindow *w = findWindowAtDisplay (d, d->activeWindow);
- if (!w)
- return TRUE;
+ GET_WINDOW;
SHELF_WINDOW (w);