summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Riedi <andrewriedi@gmail.com>2007-07-26 02:07:54 -0700
committerAndrew Riedi <andrewriedi@gmail.com>2007-07-26 02:07:54 -0700
commite35218cd826aaf1bd38093733368df7f57aca6a6 (patch)
tree2122c0ce36980221dc2069fc3145296853376161
parent8e746108404addb283c5f18d38077d8e6f501ff8 (diff)
downloadworkarounds-e35218cd826aaf1bd38093733368df7f57aca6a6.tar.gz
workarounds-e35218cd826aaf1bd38093733368df7f57aca6a6.tar.bz2
Simplify code.
-rw-r--r--workarounds.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/workarounds.c b/workarounds.c
index 2eb88e5..5d7c32f 100644
--- a/workarounds.c
+++ b/workarounds.c
@@ -38,8 +38,6 @@ typedef struct _WorkaroundsScreen {
} WorkaroundsScreen;
typedef struct _WorkaroundsWindow {
- Bool bOrigWmType;
- unsigned int origWmType;
} WorkaroundsWindow;
#define GET_WORKAROUNDS_DISPLAY(d) \
@@ -100,7 +98,8 @@ workaroundsWindowResizeNotify (CompWindow *w, int dx, int dy,
static void
workaroundsWindowAddNotify (CompWindow *w)
{
- WORKAROUNDS_WINDOW (w);
+ Bool appliedFix = FALSE;
+
WORKAROUNDS_SCREEN (w->screen);
/* FIXME: Is this the best way to detect a notification type window? */
@@ -111,19 +110,17 @@ workaroundsWindowAddNotify (CompWindow *w)
strcmp (w->resName, "notification-daemon") == 0)
{
w->wmType = CompWindowTypeNotificationMask;
- ww->bOrigWmType = TRUE;
- ww->origWmType = CompWindowTypeNormalMask;
+ appliedFix = TRUE;
}
}
- if (workaroundsGetFirefoxMenuFix (w->screen->display) && !ww->bOrigWmType)
+ if (workaroundsGetFirefoxMenuFix (w->screen->display) && !appliedFix)
{
if (w->wmType == CompWindowTypeNormalMask &&
w->attrib.override_redirect)
{
w->wmType = CompWindowTypeDropdownMenuMask;
- ww->bOrigWmType = TRUE;
- ww->origWmType = CompWindowTypeNormalMask;
+ appliedFix = TRUE;
}
}
@@ -216,9 +213,6 @@ workaroundsInitWindow (CompPlugin *plugin, CompWindow *w)
if (!ww)
return FALSE;
- ww->bOrigWmType = FALSE;
- ww->origWmType = 0;
-
w->privates[ws->windowPrivateIndex].ptr = ww;
return TRUE;
@@ -229,11 +223,8 @@ workaroundsFiniWindow (CompPlugin *plugin, CompWindow *w)
{
WORKAROUNDS_WINDOW (w);
- if (ww->bOrigWmType)
- {
- w->wmType = ww->origWmType;
- recalcWindowType (w);
- }
+ w->wmType = getWindowType (w->screen->display, w->id);
+ recalcWindowType (w);
free (ww);
}