Merge lp:~smspillaz/compiz-core/compiz-core.dropuseless-switches into lp:compiz-core/0.9.5

Proposed by Sam Spilsbury
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 2948
Merged at revision: 2968
Proposed branch: lp:~smspillaz/compiz-core/compiz-core.dropuseless-switches
Merge into: lp:compiz-core/0.9.5
Prerequisite: lp:~smspillaz/compiz-core/compiz-core.drop-ini-plugin
Diff against target: 463 lines (+96/-160)
7 files modified
plugins/composite/src/privates.h (+0/-5)
plugins/composite/src/screen.cpp (+20/-45)
plugins/opengl/src/screen.cpp (+63/-68)
src/global.cpp (+0/-5)
src/main.cpp (+0/-21)
src/privatescreen.h (+0/-5)
src/screen.cpp (+13/-11)
To merge this branch: bzr merge lp:~smspillaz/compiz-core/compiz-core.dropuseless-switches
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Alan Griffiths Needs Fixing
Thomas Voß Needs Fixing
Review via email: mp+89763@code.launchpad.net

Description of the change

Drop useless command line switches

    Drop some unused globals and command line switchers, notable changes

    --indirect-rendering : There isn't a sane usecase for this anymore
    apart from remote compositing. Enable it automatically if needed, otherwise
    force direct rendering

    --use-root-window : Composite Overlay Window support was added to the server
    six years ago. We can drop this

    --background-image : Use the wallpaper plugin

    --no-detection : Use ccsm

To post a comment you must log in.
Revision history for this message
Thomas Voß (thomas-voss) wrote :

Cannot compile the branch due to:

[ 0%] Built target decoration
[ 0%] Built target compiz.desktop
[ 1%] Generating /tmp/compiz-core.dropuseless-switches/po/compiz.pot
can't open ./../plugins/ini/ini.xml.in: No such file or directory at /usr/bin/intltool-extract line 212.
xgettext: error while opening "../plugins/ini/ini.xml.in.h" for reading: No such file or directory
ERROR: xgettext failed to generate PO template file. Please consult
       error message above if there is any.
make[2]: *** [/tmp/compiz-core.dropuseless-switches/po/compiz.pot] Error 1
make[1]: *** [po/CMakeFiles/nls.dir/all] Error 2
make: *** [all] Error 2

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Deleting dead code - cool

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Confirm the build error

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This builds, merges and runs cleanly, the build error was due to the fact that it was based on a trunk that wasn't building.

Changing back to approved given that it was already previously approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/composite/src/privates.h'
2--- plugins/composite/src/privates.h 2011-12-19 12:52:16 +0000
3+++ plugins/composite/src/privates.h 2012-01-23 18:50:37 +0000
4@@ -35,11 +35,6 @@
5
6 #include "composite_options.h"
7
8-#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR > 2
9-#define USE_COW
10-extern bool useCow;
11-#endif
12-
13 extern CompPlugin::VTable *compositeVTable;
14
15 extern CompWindow *lastDamagedWindow;
16
17=== modified file 'plugins/composite/src/screen.cpp'
18--- plugins/composite/src/screen.cpp 2012-01-20 09:05:56 +0000
19+++ plugins/composite/src/screen.cpp 2012-01-23 18:50:37 +0000
20@@ -249,12 +249,8 @@
21
22 CompositeScreen::~CompositeScreen ()
23 {
24-#ifdef USE_COW
25- if (useCow)
26- XCompositeReleaseOverlayWindow (screen->dpy (),
27- screen->root ());
28-#endif
29-
30+ XCompositeReleaseOverlayWindow (screen->dpy (),
31+ screen->root ());
32 delete priv;
33 }
34
35@@ -485,8 +481,7 @@
36 void
37 CompositeScreen::showOutputWindow ()
38 {
39-#ifdef USE_COW
40- if (useCow && priv->pHnd)
41+ if (priv->pHnd)
42 {
43 Display *dpy = screen->dpy ();
44 XserverRegion region;
45@@ -506,37 +501,28 @@
46
47 damageScreen ();
48 }
49-#endif
50-
51 }
52
53 void
54 CompositeScreen::hideOutputWindow ()
55 {
56-#ifdef USE_COW
57- if (useCow)
58- {
59- Display *dpy = screen->dpy ();
60- XserverRegion region;
61-
62- region = XFixesCreateRegion (dpy, NULL, 0);
63-
64- XFixesSetWindowShapeRegion (dpy,
65- priv->output,
66- ShapeBounding,
67- 0, 0, region);
68-
69- XFixesDestroyRegion (dpy, region);
70- }
71-#endif
72-
73+ Display *dpy = screen->dpy ();
74+ XserverRegion region;
75+
76+ region = XFixesCreateRegion (dpy, NULL, 0);
77+
78+ XFixesSetWindowShapeRegion (dpy,
79+ priv->output,
80+ ShapeBounding,
81+ 0, 0, region);
82+
83+ XFixesDestroyRegion (dpy, region);
84 }
85
86 void
87 CompositeScreen::updateOutputWindow ()
88 {
89-#ifdef USE_COW
90- if (useCow && priv->pHnd)
91+ if (priv->pHnd)
92 {
93 Display *dpy = screen->dpy ();
94 XserverRegion region;
95@@ -563,24 +549,16 @@
96
97 XFixesDestroyRegion (dpy, region);
98 }
99-#endif
100
101 }
102
103 void
104 PrivateCompositeScreen::makeOutputWindow ()
105 {
106-#ifdef USE_COW
107- if (useCow)
108- {
109- overlay = XCompositeGetOverlayWindow (screen->dpy (), screen->root ());
110- output = overlay;
111+ overlay = XCompositeGetOverlayWindow (screen->dpy (), screen->root ());
112+ output = overlay;
113
114- XSelectInput (screen->dpy (), output, ExposureMask);
115- }
116- else
117-#endif
118- output = overlay = screen->root ();
119+ XSelectInput (screen->dpy (), output, ExposureMask);
120
121 cScreen->hideOutputWindow ();
122 }
123@@ -843,11 +821,8 @@
124 PrivateCompositeScreen::outputChangeNotify ()
125 {
126 screen->outputChangeNotify ();
127-#ifdef USE_COW
128- if (useCow)
129- XMoveResizeWindow (screen->dpy (), overlay, 0, 0,
130- screen->width (), screen->height ());
131-#endif
132+ XMoveResizeWindow (screen->dpy (), overlay, 0, 0,
133+ screen->width (), screen->height ());
134 cScreen->damageScreen ();
135 }
136
137
138=== modified file 'plugins/opengl/src/screen.cpp'
139--- plugins/opengl/src/screen.cpp 2012-01-20 09:05:56 +0000
140+++ plugins/opengl/src/screen.cpp 2012-01-23 18:50:37 +0000
141@@ -95,15 +95,27 @@
142 const char *glRenderer;
143 CompOption::Vector o (0);
144
145- priv->ctx = glXCreateContext (dpy, visinfo, NULL, !indirectRendering);
146+ priv->ctx = glXCreateContext (dpy, visinfo, NULL, false);
147 if (!priv->ctx)
148 {
149- compLogMessage ("opengl", CompLogLevelFatal,
150- "glXCreateContext failed");
151- XFree (visinfo);
152-
153- screen->handleCompizEvent ("opengl", "fatal_fallback", o);
154- return false;
155+ compLogMessage ("opengl", CompLogLevelWarn,
156+ "glXCreateContext with direct rendering failed - trying indirect");
157+
158+ /* force Mesa libGL into indirect rendering mode, because
159+ glXQueryExtensionsString is context-independant */
160+ setenv ("LIBGL_ALWAYS_INDIRECT", "1", True);
161+ priv->ctx = glXCreateContext(dpy, visinfo, NULL, true);
162+
163+ if (!priv->ctx)
164+ {
165+ compLogMessage ("opengl", CompLogLevelWarn,
166+ "glXCreateContext failed");
167+
168+ XFree (visinfo);
169+
170+ screen->handleCompizEvent ("opengl", "fatal_fallback", o);
171+ return false;
172+ }
173 }
174
175 XFree (visinfo);
176@@ -299,13 +311,6 @@
177 XWindowAttributes attr;
178 CompOption::Vector o (0);
179
180- if (indirectRendering)
181- {
182- /* force Mesa libGL into indirect rendering mode, because
183- glXQueryExtensionsString is context-independant */
184- setenv ("LIBGL_ALWAYS_INDIRECT", "1", True);
185- }
186-
187 if (!XGetWindowAttributes (dpy, s->root (), &attr))
188 {
189 screen->handleCompizEvent ("opengl", "fatal_fallback", o);
190@@ -850,61 +855,51 @@
191 if (backgroundTextures.empty ())
192 {
193 CompSize size;
194- if (backgroundImage)
195- {
196- CompString fileName (backgroundImage);
197- CompString pname ("");
198-
199- backgroundTextures = GLTexture::readImageToTexture (fileName, pname, size);
200- }
201- else
202- {
203- /* Try to get the root window background */
204- XGCValues gcv;
205- GC gc;
206-
207- gcv.graphics_exposures = false;
208- gcv.subwindow_mode = IncludeInferiors;
209- gc = XCreateGC (screen->dpy (), screen->root (),
210- GCGraphicsExposures | GCSubwindowMode, &gcv);
211-
212- if (rootPixmapSize.width () != screen->width () ||
213- rootPixmapSize.height () != screen->height ())
214- {
215- if (rootPixmapCopy)
216- XFreePixmap (screen->dpy (), rootPixmapCopy);
217-
218- rootPixmapSize = CompSize (screen->width (), screen->height ());
219-
220- rootPixmapCopy = XCreatePixmap (screen->dpy (), screen->root (),
221- rootPixmapSize.width (), rootPixmapSize.height (),
222- DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
223-
224- backgroundTextures =
225- GLTexture::bindPixmapToTexture (rootPixmapCopy, rootPixmapSize.width (), rootPixmapSize.height (),
226- DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
227-
228- if (backgroundTextures.empty ())
229- {
230- compLogMessage ("core", CompLogLevelWarn,
231- "Couldn't bind background pixmap 0x%x to "
232- "texture", (int) screen->width ());
233- }
234- }
235-
236+ /* Try to get the root window background */
237+ XGCValues gcv;
238+ GC gc;
239+
240+ gcv.graphics_exposures = false;
241+ gcv.subwindow_mode = IncludeInferiors;
242+ gc = XCreateGC (screen->dpy (), screen->root (),
243+ GCGraphicsExposures | GCSubwindowMode, &gcv);
244+
245+ if (rootPixmapSize.width () != screen->width () ||
246+ rootPixmapSize.height () != screen->height ())
247+ {
248 if (rootPixmapCopy)
249- {
250- XCopyArea (screen->dpy (), screen->root (), rootPixmapCopy, gc,
251- 0, 0, screen->width (), screen->height (), 0, 0);
252- XSync (screen->dpy (), false);
253- }
254- else
255- {
256- backgroundTextures.clear ();
257- }
258-
259- XFreeGC(dpy, gc);
260- }
261+ XFreePixmap (screen->dpy (), rootPixmapCopy);
262+
263+ rootPixmapSize = CompSize (screen->width (), screen->height ());
264+
265+ rootPixmapCopy = XCreatePixmap (screen->dpy (), screen->root (),
266+ rootPixmapSize.width (), rootPixmapSize.height (),
267+ DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
268+
269+ backgroundTextures =
270+ GLTexture::bindPixmapToTexture (rootPixmapCopy, rootPixmapSize.width (), rootPixmapSize.height (),
271+ DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
272+
273+ if (backgroundTextures.empty ())
274+ {
275+ compLogMessage ("core", CompLogLevelWarn,
276+ "Couldn't bind background pixmap 0x%x to "
277+ "texture", (int) screen->width ());
278+ }
279+ }
280+
281+ if (rootPixmapCopy)
282+ {
283+ XCopyArea (screen->dpy (), screen->root (), rootPixmapCopy, gc,
284+ 0, 0, screen->width (), screen->height (), 0, 0);
285+ XSync (screen->dpy (), false);
286+ }
287+ else
288+ {
289+ backgroundTextures.clear ();
290+ }
291+
292+ XFreeGC(dpy, gc);
293 }
294
295 if (!backgroundTextures.empty ())
296
297=== modified file 'src/global.cpp'
298--- src/global.cpp 2012-01-19 11:25:58 +0000
299+++ src/global.cpp 2012-01-23 18:50:37 +0000
300@@ -33,16 +33,11 @@
301 char **programArgv;
302 int programArgc;
303
304-char *backgroundImage = NULL;
305-
306-bool shutDown = false;
307 bool restartSignal = false;
308
309 CompWindow *lastFoundWindow = 0;
310
311 bool replaceCurrentWm = false;
312-bool indirectRendering = false;
313-bool noDetection = false;
314 bool useDesktopHints = false;
315 bool debugOutput = false;
316
317
318=== modified file 'src/main.cpp'
319--- src/main.cpp 2012-01-23 17:45:39 +0000
320+++ src/main.cpp 2012-01-23 18:50:37 +0000
321@@ -51,13 +51,9 @@
322 printf ("Usage: %s "
323 "[--replace] "
324 "[--display DISPLAY]\n "
325- "[--indirect-rendering] "
326 "[--sm-disable] "
327 "[--sm-client-id ID]\n "
328- "[--bg-image PNG] "
329- "[--no-detection] "
330 "[--keep-desktop-hints]\n "
331- "[--use-root-window] "
332 "[--debug] "
333 "[--version] "
334 "[--help] "
335@@ -101,18 +97,10 @@
336 if (i + 1 < argc)
337 displayName = argv[++i];
338 }
339- else if (!strcmp (argv[i], "--indirect-rendering"))
340- {
341- indirectRendering = true;
342- }
343 else if (!strcmp (argv[i], "--keep-desktop-hints"))
344 {
345 useDesktopHints = true;
346 }
347- else if (!strcmp (argv[i], "--use-root-window"))
348- {
349- useCow = false;
350- }
351 else if (!strcmp (argv[i], "--replace"))
352 {
353 replaceCurrentWm = true;
354@@ -126,15 +114,6 @@
355 if (i + 1 < argc)
356 clientId = argv[++i];
357 }
358- else if (!strcmp (argv[i], "--no-detection"))
359- {
360- noDetection = true;
361- }
362- else if (!strcmp (argv[i], "--bg-image"))
363- {
364- if (i + 1 < argc)
365- backgroundImage = argv[++i];
366- }
367 else if (*argv[i] == '-')
368 {
369 compLogMessage ("core", CompLogLevelWarn,
370
371=== modified file 'src/privatescreen.h'
372--- src/privatescreen.h 2012-01-21 13:34:31 +0000
373+++ src/privatescreen.h 2012-01-23 18:50:37 +0000
374@@ -55,11 +55,6 @@
375 extern CompWindow *lastFoundWindow;
376 extern bool useDesktopHints;
377
378-extern bool inHandleEvent;
379-
380-extern CompScreen *targetScreen;
381-extern CompOutput *targetOutput;
382-
383 extern std::list <CompString> initialPlugins;
384
385
386
387=== modified file 'src/screen.cpp'
388--- src/screen.cpp 2012-01-23 17:40:11 +0000
389+++ src/screen.cpp 2012-01-23 18:50:37 +0000
390@@ -60,11 +60,6 @@
391 #include "privateaction.h"
392 #include "privatestackdebugger.h"
393
394-bool inHandleEvent = false;
395-
396-bool screenInitalized = false;
397-
398-CompScreen *targetScreen = NULL;
399 CompOutput *targetOutput;
400
401 int lastPointerX = 0;
402@@ -74,6 +69,13 @@
403 int pointerY = 0;
404 unsigned int pointerMods = 0;
405
406+namespace
407+{
408+bool inHandleEvent = false;
409+
410+bool screenInitalized = false;
411+}
412+
413 #define MwmHintsFunctions (1L << 0)
414 #define MwmHintsDecorations (1L << 1)
415 #define PropMotifWmHintElements 3
416@@ -118,17 +120,17 @@
417 {
418 case SIGINT:
419 case SIGTERM:
420- shutDown = true;
421+ mainloop->quit ();
422 break;
423 case SIGHUP:
424 restartSignal = true;
425+ mainloop->quit ();
426 break;
427 default:
428 break;
429 }
430
431- if (shutDown || restartSignal)
432- mainloop->quit ();
433+ mainloop->quit ();
434 }
435
436 void
437@@ -629,7 +631,7 @@
438 return screen->updateDefaultIcon ();
439 break;
440 case CoreOptions::Outputs:
441- if (!noDetection && optionGetDetectOutputs ())
442+ if (optionGetDetectOutputs ())
443 return false;
444 updateOutputDevices ();
445 break;
446@@ -1110,7 +1112,7 @@
447 wmSnAtom != event->xselectionclear.selection)
448 return;
449
450- shutDown = true;
451+ mainloop->quit ();
452 }
453
454 #define IMAGEDIR "images"
455@@ -1926,7 +1928,7 @@
456 void
457 PrivateScreen::detectOutputDevices ()
458 {
459- if (!noDetection && optionGetDetectOutputs ())
460+ if (optionGetDetectOutputs ())
461 {
462 CompString name;
463 CompOption::Value value;

Subscribers

People subscribed via source and target branches