summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Riedi <andrewriedi@gmail.com>2007-06-13 00:32:33 -0700
committerAndrew Riedi <andrewriedi@gmail.com>2007-06-13 00:32:33 -0700
commitb71565e7186605b6765fc2157518cbeacb69c8e8 (patch)
tree47ed63c0bf754773e872a403b7c5349faa973827
parent439fa0756ea9b77021cd79706310244c35633880 (diff)
downloadworkarounds-b71565e7186605b6765fc2157518cbeacb69c8e8.tar.gz
workarounds-b71565e7186605b6765fc2157518cbeacb69c8e8.tar.bz2
Simplify code per maniac103's request.
-rw-r--r--workarounds.c49
-rw-r--r--workarounds.h37
2 files changed, 3 insertions, 83 deletions
diff --git a/workarounds.c b/workarounds.c
index 9e0da16..0d972af 100644
--- a/workarounds.c
+++ b/workarounds.c
@@ -20,56 +20,13 @@
#include <compiz.h>
#include <workarounds_options.h>
-#include "workarounds.h"
static CompMetadata workaroundsMetadata;
static int displayPrivateIndex;
-static void workaroundsDisplayOptionChanged( CompDisplay *d, CompOption *opt,
- WorkaroundsDisplayOptions num )
-{
- WORKAROUNDS_DISPLAY( d );
-
- switch( num ) {
- case WorkaroundsDisplayOptionLegacyApps:
- wd->legacyApps = opt->value.b;
- break;
- default:
- break;
- }
-}
-
-static Bool workaroundsInitDisplay( CompPlugin *plugin, CompDisplay *d )
-{
- WorkaroundsDisplay *wd =
- (WorkaroundsDisplay *) malloc( sizeof( WorkaroundsDisplay ) );
-
- wd->screenPrivateIndex = allocateScreenPrivateIndex( d );
- if ( wd->screenPrivateIndex < 0 )
- {
- free( wd );
- return FALSE;
- }
- d->privates[displayPrivateIndex].ptr = wd;
-
- workaroundsSetLegacyAppsNotify( d, workaroundsDisplayOptionChanged );
-
- return TRUE;
-}
-
-static void workaroundsFiniDisplay( CompPlugin *plugin, CompDisplay *d )
-{
- WORKAROUNDS_DISPLAY( d );
-
- freeScreenPrivateIndex( d, wd->screenPrivateIndex );
- free(wd);
-}
-
static Bool workaroundsInitWindow( CompPlugin *plugin, CompWindow *w )
{
- WORKAROUNDS_DISPLAY( w->screen->display );
-
- if ( wd->legacyApps )
+ if ( workaroundsGetLegacyApps( w->screen->display ) )
{
unsigned int type;
@@ -132,8 +89,8 @@ CompPluginVTable workaroundsVTable =
workaroundsGetMetadata,
workaroundsInit,
workaroundsFini,
- workaroundsInitDisplay,
- workaroundsFiniDisplay,
+ 0, /* InitDisplay */
+ 0, /* FiniDisplay */
0, /* InitScreen */
0, /* FiniScreen */
workaroundsInitWindow,
diff --git a/workarounds.h b/workarounds.h
deleted file mode 100644
index ff00a80..0000000
--- a/workarounds.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 Andrew Riedi <andrewriedi@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Workarounds' header file.
- */
-
-#ifndef COMPIZ_WORKAROUNDS_H
-#define COMPIZ_WORKAROUNDS_H
-
-typedef struct _WorkaroundsDisplay {
- int screenPrivateIndex;
-
- /* Options */
- Bool legacyApps;
-} WorkaroundsDisplay;
-
-#define GET_WORKAROUNDS_DISPLAY(d) \
- ((WorkaroundsDisplay *) (d)->privates[displayPrivateIndex].ptr)
-
-#define WORKAROUNDS_DISPLAY(d) \
- WorkaroundsDisplay *wd = GET_WORKAROUNDS_DISPLAY (d)
-
-#endif /* COMPIZ_WORKAROUNDS_H */