summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2007-07-29 00:48:06 -0400
committerErkin Bahceci <erkinbah@gmail.com>2007-07-29 00:48:06 -0400
commit4a98ef4b75f68406b1068481eb1de5ed614f4e1d (patch)
treee976e67e747bcc09c0abbe7b2bb42ec664808564
parent090c139bbde7c6f6fa7537bdafd15eaec52a2153 (diff)
downloadworkarounds-4a98ef4b75f68406b1068481eb1de5ed614f4e1d.tar.gz
workarounds-4a98ef4b75f68406b1068481eb1de5ed614f4e1d.tar.bz2
windowAddNotify -> initWindow. Remove getWindowUserTime.
windowAddNotify doesn't get called for all existing windows (e.g. menus of KDE apps). initWindow gets called for all windows (all existing and newly opened windows), therefore is the right place for workarounds, rather than windowAddNotify.
-rw-r--r--workarounds.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/workarounds.c b/workarounds.c
index c8f9f17..899d1ea 100644
--- a/workarounds.c
+++ b/workarounds.c
@@ -35,7 +35,6 @@ typedef struct _WorkaroundsDisplay {
} WorkaroundsDisplay;
typedef struct _WorkaroundsScreen {
- WindowAddNotifyProc windowAddNotify;
WindowResizeNotifyProc windowResizeNotify;
} WorkaroundsScreen;
@@ -120,13 +119,11 @@ workaroundsWindowResizeNotify (CompWindow *w, int dx, int dy,
WRAP (ws, w->screen, windowResizeNotify, workaroundsWindowResizeNotify);
}
-static void
-workaroundsWindowAddNotify (CompWindow *w)
+static Bool
+workaroundsInitWindow (CompPlugin *plugin, CompWindow *w)
{
Bool appliedFix = FALSE;
- WORKAROUNDS_SCREEN (w->screen);
-
/* FIXME: Is this the best way to detect a notification type window? */
if (workaroundsGetNotificationDaemonFix (w->screen->display) && w->resName)
{
@@ -138,7 +135,7 @@ workaroundsWindowAddNotify (CompWindow *w)
appliedFix = TRUE;
}
}
-
+
if (workaroundsGetFirefoxMenuFix (w->screen->display) && !appliedFix)
{
if (w->wmType == CompWindowTypeNormalMask &&
@@ -191,11 +188,7 @@ workaroundsWindowAddNotify (CompWindow *w)
/* fix Qt transients - FIXME: is there a better way to detect them? */
if (!appliedFix)
{
- Time t;
- Bool res;
-
- res = getWindowUserTime (w, &t);
- if (res && !w->resName && (w->wmType == CompWindowTypeUnknownMask))
+ if (!w->resName && (w->wmType == CompWindowTypeUnknownMask))
{
w->wmType = CompWindowTypeDropdownMenuMask;
appliedFix = TRUE;
@@ -208,9 +201,7 @@ workaroundsWindowAddNotify (CompWindow *w)
if (workaroundsGetLegacyFullscreen (w->screen->display))
workaroundsDoLegacyFullscreen (w);
- UNWRAP (ws, w->screen, windowAddNotify);
- (*w->screen->windowAddNotify) (w);
- WRAP (ws, w->screen, windowAddNotify, workaroundsWindowAddNotify);
+ return TRUE;
}
static Bool
@@ -257,7 +248,6 @@ workaroundsInitScreen (CompPlugin *plugin, CompScreen *s)
if (!ws)
return FALSE;
- WRAP (ws, s, windowAddNotify, workaroundsWindowAddNotify);
WRAP (ws, s, windowResizeNotify, workaroundsWindowResizeNotify);
s->privates[wd->screenPrivateIndex].ptr = ws;
@@ -270,7 +260,6 @@ workaroundsFiniScreen (CompPlugin *plugin, CompScreen *s)
{
WORKAROUNDS_SCREEN (s);
- UNWRAP (ws, s, windowAddNotify);
UNWRAP (ws, s, windowResizeNotify);
free (ws);
@@ -333,7 +322,7 @@ CompPluginVTable workaroundsVTable =
workaroundsFiniDisplay,
workaroundsInitScreen,
workaroundsFiniScreen,
- 0, /* InitWindow */
+ workaroundsInitWindow,
workaroundsFiniWindow,
0, /* GetDisplayOptions */
0, /* SetDisplayOption */