~jamespharaoh/ubuntu/precise/compiz/focus-follows-mouse

« back to all changes in this revision

Viewing changes to .pc/fix-863328.patch/plugins/scale/src/privates.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-10-06 17:57:36 UTC
  • Revision ID: james.westby@ubuntu.com-20111006175736-ra3xnpa8tyy3z7vn
Tags: 1:0.9.6+bzr20110929-0ubuntu4
* debian/control:
  - don't suggest nvidia-glx, it's part of the old initial packaging
    and probably a bad hint on non nvidia system (LP: #844218)
* Cherry-pick upstream patches:
  - Windows should not automatically be focused when opened if the focus
    is on another application (LP: #748840)
  - Launcher - If a spread contains minimised windows, when the spread
    exits, the minimised windows momentarily appear on the desktop
    before disappearing (LP: #863328)
  - reproducible stacking bug in compiz (LP: #869316)
  - Click-dragging a window that's stacked above a fullscreen window will
    cause it to go underneath the fullscreen window (LP: #869919)
  - sometimes the keyboard input doesn't go to the apparently focussed
    dialog (LP: #869967)
  - Opening mumble can cause it to be stacked above the dash if you
    open the dash at the same time (LP: #865863)
  - Sometimes configure events are missed and windows move slow as a result
    (LP: #866752)
  - Workaround ubuntu desktop unity. Mouse at the left side doesn't reveal
    launcher (LP: #832150)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2007 Novell, Inc.
 
3
 *
 
4
 * Permission to use, copy, modify, distribute, and sell this software
 
5
 * and its documentation for any purpose is hereby granted without
 
6
 * fee, provided that the above copyright notice appear in all copies
 
7
 * and that both that copyright notice and this permission notice
 
8
 * appear in supporting documentation, and that the name of
 
9
 * Novell, Inc. not be used in advertising or publicity pertaining to
 
10
 * distribution of the software without specific, written prior permission.
 
11
 * Novell, Inc. makes no representations about the suitability of this
 
12
 * software for any purpose. It is provided "as is" without express or
 
13
 * implied warranty.
 
14
 *
 
15
 * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
16
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
 
17
 * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
18
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 
19
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 
20
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 
21
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
22
 *
 
23
 * Author: David Reveman <davidr@novell.com>
 
24
 */
 
25
 
 
26
#ifndef _SCALE_PRIVATES_H
 
27
#define _SCALE_PRIVATES_H
 
28
 
 
29
#include <scale/scale.h>
 
30
#include "scale_options.h"
 
31
 
 
32
class SlotArea {
 
33
    public:
 
34
        int      nWindows;
 
35
        CompRect workArea;
 
36
 
 
37
        typedef std::vector<SlotArea> vector;
 
38
};
 
39
 
 
40
class PrivateScaleScreen :
 
41
    public ScreenInterface,
 
42
    public CompositeScreenInterface,
 
43
    public GLScreenInterface,
 
44
    public ScaleOptions
 
45
{
 
46
    public:
 
47
        PrivateScaleScreen (CompScreen *);
 
48
        ~PrivateScaleScreen ();
 
49
 
 
50
        void handleEvent (XEvent *event);
 
51
 
 
52
        void preparePaint (int);
 
53
        void donePaint ();
 
54
 
 
55
        bool glPaintOutput (const GLScreenPaintAttrib &,
 
56
                            const GLMatrix &, const CompRegion &,
 
57
                            CompOutput *, unsigned int);
 
58
 
 
59
        void activateEvent (bool activating);
 
60
 
 
61
        void layoutSlotsForArea (const CompRect&, int);
 
62
        void layoutSlots ();
 
63
        void findBestSlots ();
 
64
        bool fillInWindows ();
 
65
        bool layoutThumbs ();
 
66
 
 
67
        SlotArea::vector getSlotAreas ();
 
68
 
 
69
        ScaleWindow * checkForWindowAt (int x, int y);
 
70
 
 
71
        void sendDndStatusMessage (Window);
 
72
 
 
73
        bool
 
74
        actionShouldToggle (CompAction        *action,
 
75
                            CompAction::State state);
 
76
 
 
77
        static bool scaleTerminate (CompAction         *action,
 
78
                                    CompAction::State  state,
 
79
                                    CompOption::Vector &options);
 
80
        static bool scaleInitiate (CompAction         *action,
 
81
                                   CompAction::State  state,
 
82
                                   CompOption::Vector &options,
 
83
                                   ScaleType          type);
 
84
 
 
85
        bool scaleInitiateCommon (CompAction         *action,
 
86
                                  CompAction::State  state,
 
87
                                  CompOption::Vector &options);
 
88
 
 
89
        bool ensureDndRedirectWindow ();
 
90
 
 
91
        bool selectWindowAt (int x, int y, bool moveInputFocus);
 
92
 
 
93
        void moveFocusWindow (int dx, int dy);
 
94
 
 
95
        void windowRemove (CompWindow *);
 
96
 
 
97
        bool hoverTimeout ();
 
98
 
 
99
        void updateOpacity ();
 
100
 
 
101
        int getMultioutputMode ();
 
102
 
 
103
    public:
 
104
 
 
105
        CompositeScreen *cScreen;
 
106
        GLScreen        *gScreen;
 
107
 
 
108
        unsigned int lastActiveNum;
 
109
        Window       lastActiveWindow;
 
110
 
 
111
        Window       selectedWindow;
 
112
        Window       hoveredWindow;
 
113
        Window       previousActiveWindow;
 
114
 
 
115
        KeyCode  leftKeyCode, rightKeyCode, upKeyCode, downKeyCode;
 
116
 
 
117
        bool grab;
 
118
        CompScreen::GrabHandle grabIndex;
 
119
 
 
120
        Window dndTarget;
 
121
 
 
122
        CompTimer hover;
 
123
 
 
124
        ScaleScreen::State state;
 
125
        int                moreAdjust;
 
126
 
 
127
        Cursor cursor;
 
128
 
 
129
        std::vector<ScaleSlot> slots;
 
130
        int                  nSlots;
 
131
 
 
132
        ScaleScreen::WindowList windows;
 
133
 
 
134
        GLushort opacity;
 
135
 
 
136
        ScaleType type;
 
137
 
 
138
        Window clientLeader;
 
139
 
 
140
        CompMatch match;
 
141
        CompMatch currentMatch;
 
142
};
 
143
 
 
144
class PrivateScaleWindow :
 
145
    public CompositeWindowInterface,
 
146
    public GLWindowInterface
 
147
{
 
148
    public:
 
149
        PrivateScaleWindow (CompWindow *);
 
150
        ~PrivateScaleWindow ();
 
151
 
 
152
        bool damageRect (bool, const CompRect &);
 
153
 
 
154
        bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
 
155
                      const CompRegion &, unsigned int);
 
156
 
 
157
        bool isNeverScaleWin () const;
 
158
        bool isScaleWin () const;
 
159
 
 
160
        bool adjustScaleVelocity ();
 
161
 
 
162
        static bool compareWindowsDistance (ScaleWindow *, ScaleWindow *);
 
163
 
 
164
    public:
 
165
        CompWindow         *window;
 
166
        CompositeWindow    *cWindow;
 
167
        GLWindow           *gWindow;
 
168
        ScaleWindow        *sWindow;
 
169
        ScaleScreen        *sScreen;
 
170
        PrivateScaleScreen *spScreen;
 
171
 
 
172
        ScaleSlot *slot;
 
173
 
 
174
        int sid;
 
175
        int distance;
 
176
 
 
177
        GLfloat xVelocity, yVelocity, scaleVelocity;
 
178
        GLfloat scale;
 
179
        GLfloat tx, ty;
 
180
        float   delta;
 
181
        bool    adjust;
 
182
 
 
183
        float lastThumbOpacity;
 
184
};
 
185
 
 
186
 
 
187
#endif