summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2009-12-07 20:39:55 +0800
committerSam Spilsbury <smspillaz@gmail.com>2009-12-07 20:39:55 +0800
commit05f393a959e13ba73e635916f4b9773792f93993 (patch)
tree1dfe40d6b1f7835a2d28fc3a633ae4599845a403
parentbd4277475358ab99338db23b3203f3970961352a (diff)
downloadcompiz-with-glib-mainloop-05f393a959e13ba73e635916f4b9773792f93993.tar.gz
compiz-with-glib-mainloop-05f393a959e13ba73e635916f4b9773792f93993.tar.bz2
Add a showIconOnly () virtual function to BaseSwitchScreen so that switchers can show the icon of applications only when switching
-rw-r--r--plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h1
-rw-r--r--plugins/compiztoolbox/src/compiztoolbox.cpp6
-rw-r--r--plugins/switcher/src/switcher.cpp8
-rw-r--r--plugins/switcher/src/switcher.h1
-rw-r--r--plugins/switcher/switcher.xml.in5
5 files changed, 19 insertions, 2 deletions
diff --git a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
index 6c8b3e4..c93a5a4 100644
--- a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
+++ b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
@@ -78,6 +78,7 @@ class BaseSwitchScreen
static Visual *findArgbVisual (Display *dpy, int scr);
virtual bool shouldShowIcon () { return false; }
+ virtual bool showIconOnly () { return false; }
virtual void windowRemove (CompWindow *w) {}
virtual void doWindowDamage (CompWindow *w);
virtual void handleSelectionChange (bool toNext, int nextIdx) {}
diff --git a/plugins/compiztoolbox/src/compiztoolbox.cpp b/plugins/compiztoolbox/src/compiztoolbox.cpp
index f8d1144..9765a1f 100644
--- a/plugins/compiztoolbox/src/compiztoolbox.cpp
+++ b/plugins/compiztoolbox/src/compiztoolbox.cpp
@@ -367,7 +367,11 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib,
int width2,
int height2)
{
+
+
GLWindowPaintAttrib sAttrib (attrib);
+ bool onlyIcon = (gWindow->textures ().empty () ||
+ baseScreen->showIconOnly ());
int wx, wy;
float width, height;
GLTexture *icon = NULL;
@@ -381,7 +385,7 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib,
gWindow->bind ();
}
- if (!gWindow->textures ().empty ())
+ if (!onlyIcon)
{
GLMatrix wTransform (transform);
int ww, wh;
diff --git a/plugins/switcher/src/switcher.cpp b/plugins/switcher/src/switcher.cpp
index 57c1f1f..bf55433 100644
--- a/plugins/switcher/src/switcher.cpp
+++ b/plugins/switcher/src/switcher.cpp
@@ -130,6 +130,12 @@ SwitchScreen::shouldShowIcon ()
return optionGetIcon ();
}
+bool
+SwitchScreen::showIconOnly ()
+{
+ return optionGetIconOnly ();
+}
+
void
SwitchScreen::getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&matchOption)
@@ -740,7 +746,7 @@ SwitchScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib,
screen->unhookWindow (zoomed);
screen->insertWindow (zoomed,
- screen->windows ().back ()->id ());
+ screen->clientList ().back ()->id ());
}
}
else
diff --git a/plugins/switcher/src/switcher.h b/plugins/switcher/src/switcher.h
index c0bc93c..11d8dd9 100644
--- a/plugins/switcher/src/switcher.h
+++ b/plugins/switcher/src/switcher.h
@@ -63,6 +63,7 @@ class SwitchScreen :
void updateWindowList (int count);
void createWindowList (int count);
bool shouldShowIcon ();
+ bool showIconOnly ();
void getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&match);
void switchToWindow (bool toNext);
diff --git a/plugins/switcher/switcher.xml.in b/plugins/switcher/switcher.xml.in
index 7503b29..0446995 100644
--- a/plugins/switcher/switcher.xml.in
+++ b/plugins/switcher/switcher.xml.in
@@ -142,6 +142,11 @@
<_long>Show icon next to thumbnail</_long>
<default>true</default>
</option>
+ <option name="icon_only" type="bool">
+ <_short>Only show icon</_short>
+ <_long>Only show the window icon and do not display a thumbnail at all</_long>
+ <default>false</default>
+ </option>
<option name="minimized" type="bool">
<_short>Minimized</_short>
<_long>Show minimized windows</_long>