summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-11-03 21:44:16 +0100
committerDanny Baumann <dannybaumann@web.de>2007-11-03 21:44:16 +0100
commit892d5953e4be028a1e72bd67a9fe69b64a3dbb8e (patch)
treeef992b534084171a38303c16715412c56ec04de1
parent1e485c5233d12c1939edf699381b643cb02a0569 (diff)
downloadgroup-892d5953e4be028a1e72bd67a9fe69b64a3dbb8e.tar.gz
group-892d5953e4be028a1e72bd67a9fe69b64a3dbb8e.tar.bz2
Use window parameter.
Minor cleanups.
-rw-r--r--group.c23
-rw-r--r--selection.c8
-rw-r--r--tab.c17
3 files changed, 34 insertions, 14 deletions
diff --git a/group.c b/group.c
index 3e821cd..8ffd302 100644
--- a/group.c
+++ b/group.c
@@ -802,9 +802,11 @@ groupUnGroupWindows (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
- w = findTopLevelWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findTopLevelWindowAtDisplay (d, xid);
if (w)
{
GROUP_WINDOW (w);
@@ -827,9 +829,11 @@ groupRemoveWindow (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
- w = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
if (w)
{
GROUP_WINDOW (w);
@@ -852,9 +856,11 @@ groupCloseWindows (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
- w = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
if (w)
{
GROUP_WINDOW (w);
@@ -883,9 +889,11 @@ groupChangeColor (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
- w = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
if (w)
{
GROUP_WINDOW (w);
@@ -893,10 +901,11 @@ groupChangeColor (CompDisplay *d,
if (gw->group)
{
GLushort *color = gw->group->color;
+ float factor = ((float)RAND_MAX + 1) / 0xffff;
- color[0] = (int)(rand () / (((double)RAND_MAX + 1) / 0xffff));
- color[1] = (int)(rand () / (((double)RAND_MAX + 1) / 0xffff));
- color[2] = (int)(rand () / (((double)RAND_MAX + 1) / 0xffff));
+ color[0] = (int)(rand () / factor);
+ color[1] = (int)(rand () / factor);
+ color[2] = (int)(rand () / factor);
groupRenderTopTabHighlight (gw->group);
damageScreen (w->screen);
diff --git a/selection.c b/selection.c
index b010f08..4a91351 100644
--- a/selection.c
+++ b/selection.c
@@ -259,9 +259,11 @@ groupSelectSingle (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
- w = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
if (w)
groupSelectWindow (w);
@@ -279,9 +281,11 @@ groupSelect (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
- w = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
if (w)
{
GROUP_SCREEN (w->screen);
diff --git a/tab.c b/tab.c
index 651ac6a..b7076ef 100644
--- a/tab.c
+++ b/tab.c
@@ -2589,10 +2589,12 @@ groupInitTab (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w;
Bool allowUntab = TRUE;
- w = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
if (!w)
return TRUE;
@@ -2601,8 +2603,9 @@ groupInitTab (CompDisplay *d,
if (gw->inSelection)
{
groupGroupWindows (d, action, state, option, nOption);
- /* If the window was selected, we don't want to untab the group,
- because the user probably wanted to tab the selected windows. */
+ /* If the window was selected, we don't want to
+ untab the group, because the user probably
+ wanted to tab the selected windows. */
allowUntab = FALSE;
}
@@ -2630,9 +2633,11 @@ groupChangeTabLeft (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w, *topTab;
- w = topTab = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = topTab = findWindowAtDisplay (d, xid);
if (!w)
return TRUE;
@@ -2670,9 +2675,11 @@ groupChangeTabRight (CompDisplay *d,
CompOption *option,
int nOption)
{
+ Window xid;
CompWindow *w, *topTab;
- w = topTab = findWindowAtDisplay (d, d->activeWindow);
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = topTab = findWindowAtDisplay (d, xid);
if (!w)
return TRUE;