Merge lp:~alan-griffiths/compiz-core/Law-of-Demeter-applied-to-CompScreen into lp:compiz-core/0.9.8

Proposed by Alan Griffiths
Status: Merged
Merged at revision: 3133
Proposed branch: lp:~alan-griffiths/compiz-core/Law-of-Demeter-applied-to-CompScreen
Merge into: lp:compiz-core/0.9.8
Diff against target: 950 lines (+233/-120)
8 files modified
include/core/abiversion.h (+1/-1)
include/core/screen.h (+35/-6)
scripts/run-with-xvfb.sh (+9/-10)
src/event.cpp (+13/-13)
src/modifierhandler.cpp (+1/-1)
src/privatescreen.h (+2/-19)
src/screen.cpp (+119/-17)
src/window.cpp (+53/-53)
To merge this branch: bzr merge lp:~alan-griffiths/compiz-core/Law-of-Demeter-applied-to-CompScreen
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+105178@code.launchpad.net

Description of the change

Eliminate friend declarations from CompScreen interface. That removes loads of "screen->priv->..." calls from other classes.

This adds a number of functions to the public interface, some of which ought to be used with care. There are ways limit this access, but that consideration also applies to many existing functions.

A future exercise should separate out the "internal use" functions and make it harder to invoke them from non-core code. (But this diff is enough to grok already.)

To post a comment you must log in.
3155. By Alan Griffiths

merge lp:compiz-core

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/core/abiversion.h'
2--- include/core/abiversion.h 2012-03-05 11:23:47 +0000
3+++ include/core/abiversion.h 2012-05-10 09:01:18 +0000
4@@ -5,6 +5,6 @@
5 # error Conflicting definitions of CORE_ABIVERSION
6 #endif
7
8-#define CORE_ABIVERSION 20120305
9+#define CORE_ABIVERSION 20120508
10
11 #endif // COMPIZ_ABIVERSION_H
12
13=== modified file 'include/core/screen.h'
14--- include/core/screen.h 2012-04-24 14:22:03 +0000
15+++ include/core/screen.h 2012-05-10 09:01:18 +0000
16@@ -44,6 +44,7 @@
17 class PrivateScreen;
18 class CompManager;
19 class CoreWindow;
20+class CoreOptions;
21
22 typedef std::list<CompWindow *> CompWindowList;
23 typedef std::vector<CompWindow *> CompWindowVector;
24@@ -322,17 +323,45 @@
25 virtual bool grabbed () = 0;
26 virtual SnDisplay * snDisplay () = 0;
27
28- friend class CompWindow; // TODO get rid of friends
29- friend class PrivateWindow; // TODO get rid of friends
30- friend class ModifierHandler; // TODO get rid of friends
31-
32 virtual void processEvents () = 0;
33 virtual void alwaysHandleEvent (XEvent *event) = 0;
34
35- bool displayInitialised() const;
36+ // Replacements for friends accessing priv. They are declared virtual to
37+ // ensure the ABI is stable if/when they are moved to CompScreenImpl.
38+ // They are only intended for use within compiz-core
39+ virtual bool displayInitialised() const;
40+ virtual void updatePassiveKeyGrabs () const;
41+ virtual void applyStartupProperties (CompWindow *window);
42+ virtual void updateClientList();
43+ virtual Window getTopWindow() const;
44+ virtual CoreOptions& getCoreOptions();
45+ virtual Colormap colormap() const;
46+ virtual void setCurrentDesktop (unsigned int desktop);
47+ virtual Window activeWindow() const;
48+ virtual void updatePassiveButtonGrabs(Window serverFrame);
49+ virtual bool grabWindowIsNot(Window w) const;
50+ virtual void incrementPendingDestroys();
51+ virtual void incrementDesktopWindowCount();
52+ virtual void decrementDesktopWindowCount();
53+ virtual unsigned int nextMapNum();
54+ virtual unsigned int lastPing () const;
55+ virtual void setNextActiveWindow(Window id);
56+ virtual Window getNextActiveWindow() const;
57+ virtual CompWindow * focusTopMostWindow ();
58+
59+ virtual int getWmState (Window id);
60+ virtual void setWmState (int state, Window id) const;
61+ virtual void getMwmHints (Window id,
62+ unsigned int *func,
63+ unsigned int *decor) const;
64+ virtual unsigned int getProtocols (Window id);
65+ virtual unsigned int getWindowType (Window id);
66+ virtual unsigned int getWindowState (Window id);
67+ // End of "internal use only" functions
68+
69 protected:
70 CompScreen();
71- boost::scoped_ptr<PrivateScreen> priv; // TODO should not be par of interface
72+ boost::scoped_ptr<PrivateScreen> priv;
73
74 private:
75 // The "wrapable" functions delegate to these (for mocking)
76
77=== modified file 'scripts/run-with-xvfb.sh'
78--- scripts/run-with-xvfb.sh 2012-05-08 01:37:48 +0000
79+++ scripts/run-with-xvfb.sh 2012-05-10 09:01:18 +0000
80@@ -8,19 +8,18 @@
81 exit 1
82 fi
83
84-# The script should still pass if you have a real Xserver and no Xvfb
85-if [ ! -z "$DISPLAY" ]; then
86- echo "Note: You are already running an Xserver."
87- $1
88-else
89- xvfb=`which Xvfb`
90- if [ ! -x "$xvfb" ]; then
91- echo "Error: Xvfb does not seem to be installed."
92- exit 1
93- fi
94+xvfb=`which Xvfb`
95+if [ ! -x "$xvfb" ]; then
96+ echo "Error: Xvfb does not seem to be installed."
97+ exit 1
98+fi
99
100+if [ -z "$DISPLAY" ]; then
101 Xvfb -ac -noreset -screen 0 1024x768x16 -help 2>/dev/null 1>&2
102 XID=`for id in 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 ; do test -e /tmp/.X$id-lock || { echo $id; exit 0; }; done; echo "No Display ports available, quit."; exit 1`
103 { Xvfb -ac -noreset -screen 0 1024x768x16 :$XID -nolisten tcp -auth /dev/null >/dev/null 2>&1 & trap "kill -15 $! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; }
104 DISPLAY=:$XID $1
105+else
106+ echo "Note: You are already running an Xserver."
107+ $1
108 fi
109
110=== modified file 'src/event.cpp'
111--- src/event.cpp 2012-05-04 08:51:22 +0000
112+++ src/event.cpp 2012-05-10 09:01:18 +0000
113@@ -1158,7 +1158,7 @@
114 }
115 }
116
117- foreach (CompWindow *w, priv->windowManager.getDestroyedWindows())
118+ foreach (CompWindow *w, destroyedWindows())
119 {
120 if (w->priv->serverId == event->xcreatewindow.window)
121 {
122@@ -1191,7 +1191,7 @@
123 * that to wait until the map request */
124 if ((wa.root == priv->rootWindow()))
125 {
126- PrivateWindow::createCompWindow (priv->windowManager.getTopWindow (), wa, event->xcreatewindow.window);
127+ PrivateWindow::createCompWindow (getTopWindow (), wa, event->xcreatewindow.window);
128 }
129 else
130 XSelectInput (priv->dpy, event->xcreatewindow.window,
131@@ -1213,7 +1213,7 @@
132
133 if (!w)
134 {
135- foreach (CompWindow *dw, priv->windowManager.getDestroyedWindows())
136+ foreach (CompWindow *dw, destroyedWindows())
137 {
138 if (dw->priv->serverId == event->xdestroywindow.window)
139 {
140@@ -1268,7 +1268,7 @@
141 /* Normal -> Iconic */
142 if (w->pendingUnmaps ())
143 {
144- priv->setWmState (IconicState, w->id ());
145+ setWmState (IconicState, w->id ());
146 w->priv->pendingUnmaps--;
147 }
148 else /* X -> Withdrawn */
149@@ -1327,7 +1327,7 @@
150 if (!XGetWindowAttributes (priv->dpy, event->xcreatewindow.window, &wa))
151 priv->setDefaultWindowAttributes (&wa);
152
153- PrivateWindow::createCompWindow (priv->windowManager.getTopWindow (), wa, event->xcreatewindow.window);
154+ PrivateWindow::createCompWindow (getTopWindow (), wa, event->xcreatewindow.window);
155 break;
156 }
157 else
158@@ -1338,7 +1338,7 @@
159 * that it is already in the list of destroyed
160 * windows, so check that list too */
161
162- foreach (CompWindow *dw, priv->windowManager.getDestroyedWindows())
163+ foreach (CompWindow *dw, destroyedWindows())
164 {
165 if (dw->priv->serverId == event->xreparent.window)
166 {
167@@ -1405,7 +1405,7 @@
168 {
169 unsigned int type;
170
171- type = priv->getWindowType (w->id ());
172+ type = getWindowType (w->id ());
173
174 if (type != w->wmType ())
175 {
176@@ -1439,7 +1439,7 @@
177 {
178 unsigned int state;
179
180- state = priv->getWindowState (w->id ());
181+ state = getWindowState (w->id ());
182 state = CompWindow::constrainWindowState (state, w->actions ());
183
184 /* EWMH suggests that we ignore changes
185@@ -1508,7 +1508,7 @@
186 {
187 w = findWindow (event->xproperty.window);
188 if (w)
189- w->priv->protocols = priv->getProtocols (w->id ());
190+ w->priv->protocols = getProtocols (w->id ());
191 }
192 else if (event->xproperty.atom == Atoms::wmIcon)
193 {
194@@ -1558,7 +1558,7 @@
195
196 for (i = 1; i < 3; i++)
197 {
198- state = priv->windowStateMask (event->xclient.data.l[i]);
199+ state = cps::windowStateMask (event->xclient.data.l[i]);
200 if (state & ~CompWindowStateHiddenMask)
201 {
202
203@@ -1924,8 +1924,8 @@
204 {
205 unsigned int state = w->state ();
206
207- if (priv->orphanData.nextActiveWindow == event->xfocus.window)
208- priv->orphanData.nextActiveWindow = None;
209+ if (getNextActiveWindow() == event->xfocus.window)
210+ setNextActiveWindow(None);
211
212 if (w->id () != priv->orphanData.activeWindow)
213 {
214@@ -2057,7 +2057,7 @@
215
216 w = screen->findWindow (priv->orphanData.activeWindow);
217
218- priv->orphanData.nextActiveWindow = None;
219+ setNextActiveWindow(None);
220 priv->orphanData.activeWindow = None;
221
222 if (w)
223
224=== modified file 'src/modifierhandler.cpp'
225--- src/modifierhandler.cpp 2012-05-03 17:10:54 +0000
226+++ src/modifierhandler.cpp 2012-05-10 09:01:18 +0000
227@@ -144,7 +144,7 @@
228 (modMask[CompModNumLock] & ~CompNoMask) |
229 (modMask[CompModScrollLock] & ~CompNoMask);
230
231- screen->priv->grabManager.updatePassiveKeyGrabs ();
232+ screen->updatePassiveKeyGrabs ();
233 foreach (CompWindow *w, screen->windows ())
234 w->priv->updatePassiveButtonGrabs ();
235 }
236
237=== modified file 'src/privatescreen.h'
238--- src/privatescreen.h 2012-05-07 15:51:27 +0000
239+++ src/privatescreen.h 2012-05-10 09:01:18 +0000
240@@ -601,6 +601,8 @@
241 unsigned int lastPing_;
242 };
243
244+unsigned int windowStateMask (Atom state);
245+
246 }} // namespace compiz::private_screen
247
248 class PrivateScreen :
249@@ -669,24 +671,8 @@
250
251 Window getActiveWindow (Window root);
252
253- int getWmState (Window id);
254-
255- void setWmState (int state, Window id);
256-
257- unsigned int windowStateMask (Atom state);
258-
259- unsigned int getWindowState (Window id);
260-
261 void setWindowState (unsigned int state, Window id);
262
263- unsigned int getWindowType (Window id);
264-
265- void getMwmHints (Window id,
266- unsigned int *func,
267- unsigned int *decor);
268-
269- unsigned int getProtocols (Window id);
270-
271 bool readWindowProp32 (Window id,
272 Atom property,
273 unsigned short *returnValue);
274@@ -701,9 +687,6 @@
275
276 void disableEdge (int edge);
277
278- CompWindow *
279- focusTopMostWindow ();
280-
281 bool createFailed () const;
282
283 void setDefaultWindowAttributes (XWindowAttributes *);
284
285=== modified file 'src/screen.cpp'
286--- src/screen.cpp 2012-05-07 15:49:29 +0000
287+++ src/screen.cpp 2012-05-10 09:01:18 +0000
288@@ -1339,7 +1339,7 @@
289 }
290
291 int
292-PrivateScreen::getWmState (Window id)
293+CompScreen::getWmState (Window id)
294 {
295 Atom actual;
296 int result, format;
297@@ -1347,7 +1347,7 @@
298 unsigned char *data;
299 unsigned long state = NormalState;
300
301- result = XGetWindowProperty (dpy, id,
302+ result = XGetWindowProperty (priv->dpy, id,
303 Atoms::wmState, 0L, 2L, false,
304 Atoms::wmState, &actual, &format,
305 &n, &left, &data);
306@@ -1363,20 +1363,20 @@
307 }
308
309 void
310-PrivateScreen::setWmState (int state, Window id)
311+CompScreen::setWmState (int state, Window id) const
312 {
313 unsigned long data[2];
314
315 data[0] = state;
316 data[1] = None;
317
318- XChangeProperty (dpy, id,
319+ XChangeProperty (priv->dpy, id,
320 Atoms::wmState, Atoms::wmState,
321 32, PropModeReplace, (unsigned char *) data, 2);
322 }
323
324 unsigned int
325-PrivateScreen::windowStateMask (Atom state)
326+cps::windowStateMask (Atom state)
327 {
328 if (state == Atoms::winStateModal)
329 return CompWindowStateModalMask;
330@@ -1440,7 +1440,7 @@
331 }
332
333 unsigned int
334-PrivateScreen::getWindowState (Window id)
335+CompScreen::getWindowState (Window id)
336 {
337 Atom actual;
338 int result, format;
339@@ -1448,7 +1448,7 @@
340 unsigned char *data;
341 unsigned int state = 0;
342
343- result = XGetWindowProperty (dpy, id,
344+ result = XGetWindowProperty (priv->dpy, id,
345 Atoms::winState,
346 0L, 1024L, false, XA_ATOM, &actual, &format,
347 &n, &left, &data);
348@@ -1458,7 +1458,7 @@
349 Atom *a = (Atom *) data;
350
351 while (n--)
352- state |= windowStateMask (*a++);
353+ state |= cps::windowStateMask (*a++);
354
355 XFree ((void *) data);
356 }
357@@ -1516,14 +1516,14 @@
358 }
359
360 unsigned int
361-PrivateScreen::getWindowType (Window id)
362+CompScreen::getWindowType (Window id)
363 {
364 Atom actual, a = None;
365 int result, format;
366 unsigned long n, left;
367 unsigned char *data;
368
369- result = XGetWindowProperty (dpy , id,
370+ result = XGetWindowProperty (priv->dpy , id,
371 Atoms::winType,
372 0L, 1L, false, XA_ATOM, &actual, &format,
373 &n, &left, &data);
374@@ -1571,9 +1571,9 @@
375 }
376
377 void
378-PrivateScreen::getMwmHints (Window id,
379+CompScreen::getMwmHints (Window id,
380 unsigned int *func,
381- unsigned int *decor)
382+ unsigned int *decor) const
383 {
384 Atom actual;
385 int result, format;
386@@ -1583,7 +1583,7 @@
387 *func = MwmFuncAll;
388 *decor = MwmDecorAll;
389
390- result = XGetWindowProperty (dpy, id,
391+ result = XGetWindowProperty (priv->dpy, id,
392 Atoms::mwmHints,
393 0L, 20L, false, Atoms::mwmHints,
394 &actual, &format, &n, &left, &data);
395@@ -1606,13 +1606,13 @@
396 }
397
398 unsigned int
399-PrivateScreen::getProtocols (Window id)
400+CompScreen::getProtocols (Window id)
401 {
402 Atom *protocol;
403 int count;
404 unsigned int protocols = 0;
405
406- if (XGetWMProtocols (dpy, id, &protocol, &count))
407+ if (XGetWMProtocols (priv->dpy, id, &protocol, &count))
408 {
409 int i;
410
411@@ -3722,7 +3722,7 @@
412
413 clientListStacking.clear ();
414
415- for (cps::WindowManager::iterator i = ps.windowManager.begin(); i != ps.windowManager.end(); ++i)
416+ for (iterator i = begin(); i != end(); ++i)
417 {
418 CompWindow* const w(*i);
419 if (isClientListWindow (w))
420@@ -4760,11 +4760,113 @@
421 sigtermSource = CompSignalSource::create (SIGTERM, boost::bind (&EventManager::handleSignal, this, _1));
422 }
423
424-bool CompScreen::displayInitialised() const
425+bool
426+CompScreen::displayInitialised() const
427 {
428 return priv && priv->initialized;
429 }
430
431+void
432+CompScreen::updatePassiveKeyGrabs () const
433+{
434+ priv->grabManager.updatePassiveKeyGrabs ();
435+}
436+
437+void
438+CompScreen::applyStartupProperties (CompWindow *window)
439+{
440+ priv->startupSequence.applyStartupProperties (this, window);
441+}
442+
443+void
444+CompScreen::updateClientList()
445+{
446+ priv->updateClientList ();
447+}
448+
449+Window
450+CompScreen::getTopWindow() const
451+{
452+ return priv->windowManager.getTopWindow();
453+}
454+
455+CoreOptions&
456+CompScreen::getCoreOptions()
457+{
458+ return *priv;
459+}
460+
461+Colormap
462+CompScreen::colormap() const
463+{
464+ return priv->colormap;
465+}
466+
467+void
468+CompScreen::setCurrentDesktop (unsigned int desktop)
469+{
470+ priv->setCurrentDesktop(desktop);
471+}
472+
473+Window
474+CompScreen::activeWindow() const
475+{
476+ return priv->orphanData.activeWindow;
477+}
478+
479+void
480+CompScreen::updatePassiveButtonGrabs(Window serverFrame)
481+{
482+ priv->grabManager.updatePassiveButtonGrabs(serverFrame);
483+}
484+
485+bool
486+CompScreen::grabWindowIsNot(Window w) const
487+{
488+ return priv->eventManager.notGrabWindow(w);
489+}
490+
491+void
492+CompScreen::incrementPendingDestroys()
493+{
494+ priv->windowManager.incrementPendingDestroys();
495+}
496+
497+void
498+CompScreen::incrementDesktopWindowCount()
499+{
500+ priv->orphanData.desktopWindowCount++;
501+}
502+void
503+CompScreen::decrementDesktopWindowCount()
504+{
505+ priv->orphanData.desktopWindowCount--;
506+}
507+
508+unsigned int
509+CompScreen::nextMapNum()
510+{
511+ return priv->orphanData.mapNum++;
512+}
513+
514+unsigned int
515+CompScreen::lastPing () const
516+{
517+ return priv->ping.lastPing ();
518+}
519+
520+void
521+CompScreen::setNextActiveWindow(Window id)
522+{
523+ priv->orphanData.nextActiveWindow = id;
524+}
525+Window
526+CompScreen::getNextActiveWindow() const
527+{
528+ return priv->orphanData.nextActiveWindow;
529+}
530+
531+
532 bool
533 PrivateScreen::initDisplay (const char *name)
534 {
535
536=== modified file 'src/window.cpp'
537--- src/window.cpp 2012-05-04 10:48:04 +0000
538+++ src/window.cpp 2012-05-10 09:01:18 +0000
539@@ -1261,7 +1261,7 @@
540 }
541
542 priv->destroyed = true;
543- screen->priv->windowManager.incrementPendingDestroys();
544+ screen->incrementPendingDestroys();
545 }
546
547 }
548@@ -1343,7 +1343,7 @@
549 if (priv->pendingMaps > 0)
550 priv->pendingMaps = 0;
551
552- priv->mapNum = screen->priv->orphanData.mapNum++;
553+ priv->mapNum = screen->nextMapNum();
554
555 if (priv->struts)
556 screen->updateWorkarea ();
557@@ -1356,20 +1356,20 @@
558 priv->attrib.map_state = IsViewable;
559
560 if (!overrideRedirect ())
561- screen->priv->setWmState (NormalState, priv->id);
562+ screen->setWmState (NormalState, priv->id);
563
564 priv->invisible = priv->isInvisible ();
565 priv->alive = true;
566
567- priv->lastPong = screen->priv->ping.lastPing ();
568+ priv->lastPong = screen->lastPing ();
569
570 priv->updateRegion ();
571 priv->updateSize ();
572
573- screen->priv->updateClientList ();
574+ screen->updateClientList ();
575
576 if (priv->type & CompWindowTypeDesktopMask)
577- screen->priv->orphanData.desktopWindowCount++;
578+ screen->incrementDesktopWindowCount();
579
580 if (priv->protocols & CompWindowProtocolSyncRequestMask)
581 {
582@@ -1455,7 +1455,7 @@
583 return;
584
585 if (priv->type == CompWindowTypeDesktopMask)
586- screen->priv->orphanData.desktopWindowCount--;
587+ screen->decrementDesktopWindowCount();
588
589 priv->attrib.map_state = IsUnmapped;
590 priv->invisible = true;
591@@ -1465,7 +1465,7 @@
592 priv->updateFrameWindow ();
593 }
594
595- screen->priv->updateClientList ();
596+ screen->updateClientList ();
597
598 windowNotify (CompWindowNotifyUnmap);
599 }
600@@ -1474,7 +1474,7 @@
601 PrivateWindow::withdraw ()
602 {
603 if (!attrib.override_redirect)
604- screen->priv->setWmState (WithdrawnState, id);
605+ screen->setWmState (WithdrawnState, id);
606
607 placed = false;
608 unmanaging = managed;
609@@ -1520,7 +1520,7 @@
610 dbg->overrideRedirectRestack (window->id (), aboveId);
611 }
612
613- screen->priv->updateClientList ();
614+ screen->updateClientList ();
615
616 window->windowNotify (CompWindowNotifyRestack);
617
618@@ -1890,7 +1890,7 @@
619 Window newAboveId;
620
621 if (ce->place == PlaceOnTop)
622- newAboveId = screen->priv->windowManager.getTopWindow ();
623+ newAboveId = screen->getTopWindow ();
624 else
625 newAboveId = 0;
626
627@@ -2446,7 +2446,7 @@
628 XA_WINDOW, 32, PropModeReplace,
629 (unsigned char *) &priv->id, 1);
630
631- screen->priv->orphanData.nextActiveWindow = priv->serverFrame;
632+ screen->setNextActiveWindow(priv->serverFrame);
633 }
634 else
635 {
636@@ -2479,7 +2479,7 @@
637 }
638
639 if (setFocus)
640- screen->priv->orphanData.nextActiveWindow = priv->id;
641+ screen->setNextActiveWindow(priv->id);
642
643 if (!setFocus && !modalTransient)
644 {
645@@ -2503,13 +2503,13 @@
646 CompWindow::moveInputFocusToOtherWindow ()
647 {
648 if (priv->id == screen->activeWindow () ||
649- priv->id == screen->priv->orphanData.nextActiveWindow)
650+ priv->id == screen->getNextActiveWindow())
651 {
652 CompWindow *ancestor;
653- CompWindow *nextActive = screen->findWindow (screen->priv->orphanData.nextActiveWindow);
654+ CompWindow *nextActive = screen->findWindow (screen->getNextActiveWindow());
655
656 /* Window pending focus */
657- if (priv->id != screen->priv->orphanData.nextActiveWindow &&
658+ if (priv->id != screen->getNextActiveWindow() &&
659 nextActive &&
660 nextActive->focus ())
661 {
662@@ -4112,14 +4112,14 @@
663 }
664
665 CompWindow *
666-PrivateScreen::focusTopMostWindow ()
667+CompScreen::focusTopMostWindow ()
668 {
669 using ::compiz::private_screen::WindowManager;
670
671 CompWindow *focus = NULL;
672- WindowManager::reverse_iterator it = windowManager.rbegin ();
673+ WindowManager::reverse_iterator it = priv->windowManager.rbegin ();
674
675- for (; it != windowManager.rend (); it++)
676+ for (; it != priv->windowManager.rend (); it++)
677 {
678 CompWindow *w = *it;
679
680@@ -4135,11 +4135,11 @@
681
682 if (focus)
683 {
684- if (focus->id () != orphanData.activeWindow)
685+ if (focus->id () != priv->orphanData.activeWindow)
686 focus->moveInputFocusTo ();
687 }
688 else
689- XSetInputFocus (dpy, rootWindow(), RevertToPointerRoot,
690+ XSetInputFocus (priv->dpy, priv->rootWindow(), RevertToPointerRoot,
691 CurrentTime);
692 return focus;
693 }
694@@ -4158,9 +4158,9 @@
695
696 /* when lowering a window, focus the topmost window if
697 the click-to-focus option is on */
698- if ((screen->priv->optionGetClickToFocus ()))
699+ if ((screen->getCoreOptions().optionGetClickToFocus ()))
700 {
701- CompWindow *focusedWindow = screen->priv->focusTopMostWindow ();
702+ CompWindow *focusedWindow = screen->focusTopMostWindow ();
703
704 /* if the newly focused window is a desktop window,
705 give the focus back to w */
706@@ -4290,7 +4290,7 @@
707 /* put active or soon-to-be-active fullscreen windows over
708 all others in their layer */
709 if (priv->id == screen->activeWindow () ||
710- priv->id == screen->priv->orphanData.nextActiveWindow)
711+ priv->id == screen->getNextActiveWindow())
712 {
713 aboveFs = true;
714 }
715@@ -4408,7 +4408,7 @@
716 {
717 WRAPABLE_HND_FUNCTN (activate)
718
719- screen->priv->setCurrentDesktop (priv->desktop);
720+ screen->setCurrentDesktop (priv->desktop);
721
722 screen->forEachWindow (
723 boost::bind (PrivateWindow::revealAncestors, _1, this));
724@@ -4448,7 +4448,7 @@
725 long ignoredHints = 0;
726 long ignoredResizeHints = 0;
727
728- if (screen->priv->optionGetIgnoreHintsWhenMaximized ())
729+ if (screen->getCoreOptions().optionGetIgnoreHintsWhenMaximized ())
730 {
731 ignoredHints |= PAspect;
732
733@@ -4574,7 +4574,7 @@
734 XMapWindow (screen->dpy (), id);
735
736 window->changeState (state & ~CompWindowStateHiddenMask);
737- screen->priv->setWindowState (state, id);
738+ screen->setWindowState (state, id);
739 }
740
741 void
742@@ -4749,7 +4749,7 @@
743 int level;
744 CompPoint dvp;
745
746- level = s->priv->optionGetFocusPreventionLevel ();
747+ level = s->getCoreOptions().optionGetFocusPreventionLevel ();
748
749 if (level == CoreOptions::FocusPreventionLevelOff)
750 return true;
751@@ -4784,7 +4784,7 @@
752 }
753
754 /* allow focus for excluded windows */
755- CompMatch &match = s->priv->optionGetFocusPreventionMatch ();
756+ CompMatch &match = s->getCoreOptions().optionGetFocusPreventionMatch ();
757 if (!match.evaluate (window))
758 return true;
759
760@@ -4920,7 +4920,7 @@
761 colors[k++].pixel = XGetPixel (image, i, j);
762
763 for (i = 0; i < k; i += 256)
764- XQueryColors (dpy, screen->priv->colormap,
765+ XQueryColors (dpy, screen->colormap(),
766 &colors[i], MIN (k - i, 256));
767
768 XDestroyImage (image);
769@@ -5463,7 +5463,7 @@
770
771 priv->initialTimestampSet = false;
772
773- screen->priv->startupSequence.applyStartupProperties (screen, window);
774+ screen->applyStartupProperties (window);
775
776 initiallyMinimized = (priv->hints &&
777 priv->hints->initial_state == IconicState &&
778@@ -5521,7 +5521,7 @@
779 if (!initiallyMinimized)
780 {
781 if (allowFocus && !window->onCurrentDesktop ());
782- screen->priv->setCurrentDesktop (priv->desktop);
783+ screen->setCurrentDesktop (priv->desktop);
784
785 if (!(priv->state & CompWindowStateHiddenMask))
786 show ();
787@@ -5530,7 +5530,7 @@
788 {
789 window->moveInputFocusTo ();
790 if (!window->onCurrentDesktop ())
791- screen->priv->setCurrentDesktop (priv->desktop);
792+ screen->setCurrentDesktop (priv->desktop);
793 }
794 }
795 else
796@@ -5539,7 +5539,7 @@
797 window->changeState (window->state () | CompWindowStateHiddenMask);
798 }
799
800- screen->priv->updateClientList ();
801+ screen->updateClientList ();
802 }
803
804 /*
805@@ -5567,8 +5567,8 @@
806 void
807 PrivateWindow::updatePassiveButtonGrabs ()
808 {
809- bool onlyActions = (priv->id == screen->priv->orphanData.activeWindow ||
810- !screen->priv->optionGetClickToFocus ());
811+ bool onlyActions = (priv->id == screen->activeWindow() ||
812+ !screen->getCoreOptions().optionGetClickToFocus ());
813
814 if (!priv->frame)
815 return;
816@@ -5584,7 +5584,7 @@
817
818 if (onlyActions)
819 {
820- if (screen->priv->optionGetRaiseOnClick ())
821+ if (screen->getCoreOptions().optionGetRaiseOnClick ())
822 {
823 CompWindow *highestSibling =
824 PrivateWindow::findSiblingBelow (window, true);
825@@ -5604,7 +5604,7 @@
826
827 if (onlyActions)
828 {
829- screen->priv->grabManager.updatePassiveButtonGrabs(serverFrame);
830+ screen->updatePassiveButtonGrabs(serverFrame);
831 }
832 else
833 {
834@@ -5899,7 +5899,7 @@
835 void
836 PrivateWindow::updateMwmHints ()
837 {
838- screen->priv->getMwmHints (priv->id, &priv->mwmFunc, &priv->mwmDecor);
839+ screen->getMwmHints (priv->id, &priv->mwmFunc, &priv->mwmDecor);
840 window->recalcActions ();
841 }
842
843@@ -5925,7 +5925,7 @@
844 int x, y;
845
846 initialTimestampSet = false;
847- screen->priv->startupSequence.applyStartupProperties (screen, window);
848+ screen->applyStartupProperties (window);
849
850 if (initialTimestampSet)
851 timestamp = initialTimestamp;
852@@ -6022,7 +6022,7 @@
853 FocusChangeMask);
854
855 priv->alpha = (priv->attrib.depth == 32);
856- priv->lastPong = screen->priv->ping.lastPing ();
857+ priv->lastPong = screen->lastPing ();
858
859 if (screen->XShape ())
860 XShapeSelectInput (screen->dpy (), priv->id, ShapeNotifyMask);
861@@ -6033,7 +6033,7 @@
862 priv->inputRegion = priv->region;
863
864 /* need to check for DisplayModal state on all windows */
865- priv->state = screen->priv->getWindowState (priv->id);
866+ priv->state = screen->getWindowState (priv->id);
867
868 priv->updateClassHints ();
869 }
870@@ -6042,8 +6042,8 @@
871 priv->attrib.map_state = IsUnmapped;
872 }
873
874- priv->wmType = screen->priv->getWindowType (priv->id);
875- priv->protocols = screen->priv->getProtocols (priv->id);
876+ priv->wmType = screen->getWindowType (priv->id);
877+ priv->protocols = screen->getProtocols (priv->id);
878
879 if (!overrideRedirect ())
880 {
881@@ -6057,7 +6057,7 @@
882
883 recalcType ();
884
885- screen->priv->getMwmHints (priv->id, &priv->mwmFunc, &priv->mwmDecor);
886+ screen->getMwmHints (priv->id, &priv->mwmFunc, &priv->mwmDecor);
887
888 if (!(priv->type & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)))
889 {
890@@ -6086,7 +6086,7 @@
891 priv->reparent ();
892 priv->managed = true;
893
894- if (screen->priv->getWmState (priv->id) == IconicState)
895+ if (screen->getWmState (priv->id) == IconicState)
896 {
897 if (priv->state & CompWindowStateShadedMask)
898 priv->shaded = true;
899@@ -6130,12 +6130,12 @@
900
901 XUnmapWindow (screen->dpy (), priv->id);
902
903- screen->priv->setWindowState (priv->state, priv->id);
904+ screen->setWindowState (priv->state, priv->id);
905 }
906 }
907 else if (!overrideRedirect ())
908 {
909- if (screen->priv->getWmState (priv->id) == IconicState)
910+ if (screen->getWmState (priv->id) == IconicState)
911 {
912 // before everything else in maprequest
913 if (!priv->serverFrame)
914@@ -6177,9 +6177,9 @@
915 * pending destroy if this was a sibling
916 * of one of those */
917
918- screen->priv->windowManager.getDestroyedWindows().remove (this);
919+ screen->destroyedWindows().remove (this);
920
921- foreach (CompWindow *dw, screen->priv->windowManager.getDestroyedWindows())
922+ foreach (CompWindow *dw, screen->destroyedWindows())
923 {
924 if (dw->next == this)
925 dw->next = this->next;
926@@ -6221,7 +6221,7 @@
927 if (screen->XShape ())
928 XShapeSelectInput (screen->dpy (), priv->id, NoEventMask);
929
930- if (screen->priv->eventManager.notGrabWindow (priv->id))
931+ if (screen->grabWindowIsNot(priv->id))
932 XSelectInput (screen->dpy (), priv->id, NoEventMask);
933
934 XUngrabButton (screen->dpy (), AnyButton, AnyModifier, priv->id);
935@@ -6231,14 +6231,14 @@
936 if (priv->attrib.map_state == IsViewable)
937 {
938 if (priv->type == CompWindowTypeDesktopMask)
939- screen->priv->orphanData.desktopWindowCount--;
940+ screen->decrementDesktopWindowCount();
941
942 if (priv->destroyed && priv->struts)
943 screen->updateWorkarea ();
944 }
945
946 if (priv->destroyed)
947- screen->priv->updateClientList ();
948+ screen->updateClientList ();
949
950 CompPlugin::windowFiniPlugins (this);
951

Subscribers

People subscribed via source and target branches