2
* Copyright (C) 2007 Andrew Riedi <andrewriedi@gmail.com>
4
* Sticky window handling and OpenGL fixes:
5
* Copyright (c) 2007 Dennis Kasprzyk <onestone@opencompositing.org>
7
* Ported to Compiz 0.9:
8
* Copyright (c) 2008 Sam Spilsbury <smspillaz@gmail.com>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
* This plug-in for Metacity-like workarounds.
30
#include <core/core.h>
31
#include <composite/composite.h>
32
#include <opengl/opengl.h>
33
#include <core/atoms.h>
34
#include <core/propertywriter.h>
35
#include <X11/Xatom.h>
36
#include <X11/extensions/shape.h>
38
#include "workarounds_options.h"
40
extern bool haveOpenGL;
42
typedef void (*GLProgramParameter4dvProc) (GLenum target,
44
const GLdouble *data);
46
class WorkaroundsScreen :
47
public PluginClassHandler <WorkaroundsScreen, CompScreen>,
48
public ScreenInterface,
49
public GLScreenInterface,
50
public CompositeScreenInterface,
51
public WorkaroundsOptions
55
WorkaroundsScreen (CompScreen *);
56
~WorkaroundsScreen ();
58
CompositeScreen *cScreen;
62
std::list <Window> mfwList;
63
CompWindowList minimizingWindows;
66
PropertyWriter inputDisabledAtom;
68
GL::GLProgramParameter4fProc origProgramEnvParameter4f;
69
GLProgramParameter4dvProc programEnvParameter4dv;
71
GL::GLXGetVideoSyncProc origGetVideoSync;
72
GL::GLXWaitVideoSyncProc origWaitVideoSync;
74
GL::GLXCopySubBufferProc origCopySubBuffer;
77
handleEvent (XEvent *);
83
glPaintOutput (const GLScreenPaintAttrib &,
90
handleCompizEvent (const char *pluginName,
91
const char *eventName,
92
CompOption::Vector &o);
95
addToFullscreenList (CompWindow *w);
98
removeFromFullscreenList (CompWindow *w);
101
updateParameterFix ();
104
updateVideoSyncFix ();
107
optionChanged (CompOption *opt,
108
WorkaroundsOptions::Options num);
111
checkFunctions (bool window, bool screen);
114
setWindowState (unsigned int state, Window id);
119
#define WORKAROUNDS_SCREEN(s) \
120
WorkaroundsScreen *ws = WorkaroundsScreen::get (s)
122
class WorkaroundsWindow :
123
public PluginClassHandler <WorkaroundsWindow, CompWindow>,
124
public WindowInterface,
125
public GLWindowInterface
129
typedef struct _HideInfo {
132
unsigned long skipState;
133
unsigned long shapeMask;
135
XRectangle *inputRects;
137
int inputRectOrdering;
143
WorkaroundsWindow (CompWindow *);
144
~WorkaroundsWindow ();
147
CompositeWindow *cWindow;
150
bool adjustedWinType;
154
bool madeDemandAttention;
157
HideInfo *windowHideInfo;
160
isGroupTransient (Window);
163
resizeNotify (int, int, int, int);
166
getAllowedActions (unsigned int &,
173
bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
174
const CompRegion &, unsigned int);
176
void setVisibility (bool);
177
void restoreInputShape (HideInfo *);
178
void clearInputShape (HideInfo *);
190
updateUrgencyState ();
196
updateFixedWindow (unsigned int newWmType);
199
getFixedWindowType ();
203
#define WORKAROUNDS_WINDOW(w) \
204
WorkaroundsWindow *ww = WorkaroundsWindow::get (w)
206
class WorkaroundsPluginVTable :
207
public CompPlugin::VTableForScreenAndWindow <WorkaroundsScreen,