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
=== modified file 'plugins/composite/src/privates.h'
--- plugins/composite/src/privates.h 2011-12-19 12:52:16 +0000
+++ plugins/composite/src/privates.h 2012-01-23 18:50:37 +0000
@@ -35,11 +35,6 @@
3535
36#include "composite_options.h"36#include "composite_options.h"
3737
38#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR > 2
39#define USE_COW
40extern bool useCow;
41#endif
42
43extern CompPlugin::VTable *compositeVTable;38extern CompPlugin::VTable *compositeVTable;
4439
45extern CompWindow *lastDamagedWindow;40extern CompWindow *lastDamagedWindow;
4641
=== modified file 'plugins/composite/src/screen.cpp'
--- plugins/composite/src/screen.cpp 2012-01-20 09:05:56 +0000
+++ plugins/composite/src/screen.cpp 2012-01-23 18:50:37 +0000
@@ -249,12 +249,8 @@
249249
250CompositeScreen::~CompositeScreen ()250CompositeScreen::~CompositeScreen ()
251{251{
252#ifdef USE_COW252 XCompositeReleaseOverlayWindow (screen->dpy (),
253 if (useCow)253 screen->root ());
254 XCompositeReleaseOverlayWindow (screen->dpy (),
255 screen->root ());
256#endif
257
258 delete priv;254 delete priv;
259}255}
260256
@@ -485,8 +481,7 @@
485void481void
486CompositeScreen::showOutputWindow ()482CompositeScreen::showOutputWindow ()
487{483{
488#ifdef USE_COW484 if (priv->pHnd)
489 if (useCow && priv->pHnd)
490 {485 {
491 Display *dpy = screen->dpy ();486 Display *dpy = screen->dpy ();
492 XserverRegion region;487 XserverRegion region;
@@ -506,37 +501,28 @@
506501
507 damageScreen ();502 damageScreen ();
508 }503 }
509#endif
510
511}504}
512505
513void506void
514CompositeScreen::hideOutputWindow ()507CompositeScreen::hideOutputWindow ()
515{508{
516#ifdef USE_COW509 Display *dpy = screen->dpy ();
517 if (useCow)510 XserverRegion region;
518 {511
519 Display *dpy = screen->dpy ();512 region = XFixesCreateRegion (dpy, NULL, 0);
520 XserverRegion region;513
521514 XFixesSetWindowShapeRegion (dpy,
522 region = XFixesCreateRegion (dpy, NULL, 0);515 priv->output,
523516 ShapeBounding,
524 XFixesSetWindowShapeRegion (dpy,517 0, 0, region);
525 priv->output,518
526 ShapeBounding,519 XFixesDestroyRegion (dpy, region);
527 0, 0, region);
528
529 XFixesDestroyRegion (dpy, region);
530 }
531#endif
532
533}520}
534521
535void522void
536CompositeScreen::updateOutputWindow ()523CompositeScreen::updateOutputWindow ()
537{524{
538#ifdef USE_COW525 if (priv->pHnd)
539 if (useCow && priv->pHnd)
540 {526 {
541 Display *dpy = screen->dpy ();527 Display *dpy = screen->dpy ();
542 XserverRegion region;528 XserverRegion region;
@@ -563,24 +549,16 @@
563549
564 XFixesDestroyRegion (dpy, region);550 XFixesDestroyRegion (dpy, region);
565 }551 }
566#endif
567552
568}553}
569554
570void555void
571PrivateCompositeScreen::makeOutputWindow ()556PrivateCompositeScreen::makeOutputWindow ()
572{557{
573#ifdef USE_COW558 overlay = XCompositeGetOverlayWindow (screen->dpy (), screen->root ());
574 if (useCow)559 output = overlay;
575 {
576 overlay = XCompositeGetOverlayWindow (screen->dpy (), screen->root ());
577 output = overlay;
578560
579 XSelectInput (screen->dpy (), output, ExposureMask);561 XSelectInput (screen->dpy (), output, ExposureMask);
580 }
581 else
582#endif
583 output = overlay = screen->root ();
584562
585 cScreen->hideOutputWindow ();563 cScreen->hideOutputWindow ();
586}564}
@@ -843,11 +821,8 @@
843PrivateCompositeScreen::outputChangeNotify ()821PrivateCompositeScreen::outputChangeNotify ()
844{822{
845 screen->outputChangeNotify ();823 screen->outputChangeNotify ();
846#ifdef USE_COW824 XMoveResizeWindow (screen->dpy (), overlay, 0, 0,
847 if (useCow)825 screen->width (), screen->height ());
848 XMoveResizeWindow (screen->dpy (), overlay, 0, 0,
849 screen->width (), screen->height ());
850#endif
851 cScreen->damageScreen ();826 cScreen->damageScreen ();
852}827}
853828
854829
=== modified file 'plugins/opengl/src/screen.cpp'
--- plugins/opengl/src/screen.cpp 2012-01-20 09:05:56 +0000
+++ plugins/opengl/src/screen.cpp 2012-01-23 18:50:37 +0000
@@ -95,15 +95,27 @@
95 const char *glRenderer;95 const char *glRenderer;
96 CompOption::Vector o (0);96 CompOption::Vector o (0);
9797
98 priv->ctx = glXCreateContext (dpy, visinfo, NULL, !indirectRendering);98 priv->ctx = glXCreateContext (dpy, visinfo, NULL, false);
99 if (!priv->ctx)99 if (!priv->ctx)
100 {100 {
101 compLogMessage ("opengl", CompLogLevelFatal,101 compLogMessage ("opengl", CompLogLevelWarn,
102 "glXCreateContext failed");102 "glXCreateContext with direct rendering failed - trying indirect");
103 XFree (visinfo);103
104104 /* force Mesa libGL into indirect rendering mode, because
105 screen->handleCompizEvent ("opengl", "fatal_fallback", o);105 glXQueryExtensionsString is context-independant */
106 return false;106 setenv ("LIBGL_ALWAYS_INDIRECT", "1", True);
107 priv->ctx = glXCreateContext(dpy, visinfo, NULL, true);
108
109 if (!priv->ctx)
110 {
111 compLogMessage ("opengl", CompLogLevelWarn,
112 "glXCreateContext failed");
113
114 XFree (visinfo);
115
116 screen->handleCompizEvent ("opengl", "fatal_fallback", o);
117 return false;
118 }
107 }119 }
108120
109 XFree (visinfo);121 XFree (visinfo);
@@ -299,13 +311,6 @@
299 XWindowAttributes attr;311 XWindowAttributes attr;
300 CompOption::Vector o (0);312 CompOption::Vector o (0);
301313
302 if (indirectRendering)
303 {
304 /* force Mesa libGL into indirect rendering mode, because
305 glXQueryExtensionsString is context-independant */
306 setenv ("LIBGL_ALWAYS_INDIRECT", "1", True);
307 }
308
309 if (!XGetWindowAttributes (dpy, s->root (), &attr))314 if (!XGetWindowAttributes (dpy, s->root (), &attr))
310 {315 {
311 screen->handleCompizEvent ("opengl", "fatal_fallback", o);316 screen->handleCompizEvent ("opengl", "fatal_fallback", o);
@@ -850,61 +855,51 @@
850 if (backgroundTextures.empty ())855 if (backgroundTextures.empty ())
851 {856 {
852 CompSize size;857 CompSize size;
853 if (backgroundImage)858 /* Try to get the root window background */
854 {859 XGCValues gcv;
855 CompString fileName (backgroundImage);860 GC gc;
856 CompString pname ("");861
857862 gcv.graphics_exposures = false;
858 backgroundTextures = GLTexture::readImageToTexture (fileName, pname, size);863 gcv.subwindow_mode = IncludeInferiors;
859 }864 gc = XCreateGC (screen->dpy (), screen->root (),
860 else865 GCGraphicsExposures | GCSubwindowMode, &gcv);
861 {866
862 /* Try to get the root window background */867 if (rootPixmapSize.width () != screen->width () ||
863 XGCValues gcv;868 rootPixmapSize.height () != screen->height ())
864 GC gc;869 {
865
866 gcv.graphics_exposures = false;
867 gcv.subwindow_mode = IncludeInferiors;
868 gc = XCreateGC (screen->dpy (), screen->root (),
869 GCGraphicsExposures | GCSubwindowMode, &gcv);
870
871 if (rootPixmapSize.width () != screen->width () ||
872 rootPixmapSize.height () != screen->height ())
873 {
874 if (rootPixmapCopy)
875 XFreePixmap (screen->dpy (), rootPixmapCopy);
876
877 rootPixmapSize = CompSize (screen->width (), screen->height ());
878
879 rootPixmapCopy = XCreatePixmap (screen->dpy (), screen->root (),
880 rootPixmapSize.width (), rootPixmapSize.height (),
881 DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
882
883 backgroundTextures =
884 GLTexture::bindPixmapToTexture (rootPixmapCopy, rootPixmapSize.width (), rootPixmapSize.height (),
885 DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
886
887 if (backgroundTextures.empty ())
888 {
889 compLogMessage ("core", CompLogLevelWarn,
890 "Couldn't bind background pixmap 0x%x to "
891 "texture", (int) screen->width ());
892 }
893 }
894
895 if (rootPixmapCopy)870 if (rootPixmapCopy)
896 {871 XFreePixmap (screen->dpy (), rootPixmapCopy);
897 XCopyArea (screen->dpy (), screen->root (), rootPixmapCopy, gc,872
898 0, 0, screen->width (), screen->height (), 0, 0);873 rootPixmapSize = CompSize (screen->width (), screen->height ());
899 XSync (screen->dpy (), false);874
900 }875 rootPixmapCopy = XCreatePixmap (screen->dpy (), screen->root (),
901 else876 rootPixmapSize.width (), rootPixmapSize.height (),
902 {877 DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
903 backgroundTextures.clear ();878
904 }879 backgroundTextures =
905880 GLTexture::bindPixmapToTexture (rootPixmapCopy, rootPixmapSize.width (), rootPixmapSize.height (),
906 XFreeGC(dpy, gc); 881 DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
907 }882
883 if (backgroundTextures.empty ())
884 {
885 compLogMessage ("core", CompLogLevelWarn,
886 "Couldn't bind background pixmap 0x%x to "
887 "texture", (int) screen->width ());
888 }
889 }
890
891 if (rootPixmapCopy)
892 {
893 XCopyArea (screen->dpy (), screen->root (), rootPixmapCopy, gc,
894 0, 0, screen->width (), screen->height (), 0, 0);
895 XSync (screen->dpy (), false);
896 }
897 else
898 {
899 backgroundTextures.clear ();
900 }
901
902 XFreeGC(dpy, gc);
908 }903 }
909904
910 if (!backgroundTextures.empty ())905 if (!backgroundTextures.empty ())
911906
=== modified file 'src/global.cpp'
--- src/global.cpp 2012-01-19 11:25:58 +0000
+++ src/global.cpp 2012-01-23 18:50:37 +0000
@@ -33,16 +33,11 @@
33char **programArgv;33char **programArgv;
34int programArgc;34int programArgc;
3535
36char *backgroundImage = NULL;
37
38bool shutDown = false;
39bool restartSignal = false;36bool restartSignal = false;
4037
41CompWindow *lastFoundWindow = 0;38CompWindow *lastFoundWindow = 0;
4239
43bool replaceCurrentWm = false;40bool replaceCurrentWm = false;
44bool indirectRendering = false;
45bool noDetection = false;
46bool useDesktopHints = false;41bool useDesktopHints = false;
47bool debugOutput = false;42bool debugOutput = false;
4843
4944
=== modified file 'src/main.cpp'
--- src/main.cpp 2012-01-23 17:45:39 +0000
+++ src/main.cpp 2012-01-23 18:50:37 +0000
@@ -51,13 +51,9 @@
51 printf ("Usage: %s "51 printf ("Usage: %s "
52 "[--replace] "52 "[--replace] "
53 "[--display DISPLAY]\n "53 "[--display DISPLAY]\n "
54 "[--indirect-rendering] "
55 "[--sm-disable] "54 "[--sm-disable] "
56 "[--sm-client-id ID]\n "55 "[--sm-client-id ID]\n "
57 "[--bg-image PNG] "
58 "[--no-detection] "
59 "[--keep-desktop-hints]\n "56 "[--keep-desktop-hints]\n "
60 "[--use-root-window] "
61 "[--debug] "57 "[--debug] "
62 "[--version] "58 "[--version] "
63 "[--help] "59 "[--help] "
@@ -101,18 +97,10 @@
101 if (i + 1 < argc)97 if (i + 1 < argc)
102 displayName = argv[++i];98 displayName = argv[++i];
103 }99 }
104 else if (!strcmp (argv[i], "--indirect-rendering"))
105 {
106 indirectRendering = true;
107 }
108 else if (!strcmp (argv[i], "--keep-desktop-hints"))100 else if (!strcmp (argv[i], "--keep-desktop-hints"))
109 {101 {
110 useDesktopHints = true;102 useDesktopHints = true;
111 }103 }
112 else if (!strcmp (argv[i], "--use-root-window"))
113 {
114 useCow = false;
115 }
116 else if (!strcmp (argv[i], "--replace"))104 else if (!strcmp (argv[i], "--replace"))
117 {105 {
118 replaceCurrentWm = true;106 replaceCurrentWm = true;
@@ -126,15 +114,6 @@
126 if (i + 1 < argc)114 if (i + 1 < argc)
127 clientId = argv[++i];115 clientId = argv[++i];
128 }116 }
129 else if (!strcmp (argv[i], "--no-detection"))
130 {
131 noDetection = true;
132 }
133 else if (!strcmp (argv[i], "--bg-image"))
134 {
135 if (i + 1 < argc)
136 backgroundImage = argv[++i];
137 }
138 else if (*argv[i] == '-')117 else if (*argv[i] == '-')
139 {118 {
140 compLogMessage ("core", CompLogLevelWarn,119 compLogMessage ("core", CompLogLevelWarn,
141120
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2012-01-21 13:34:31 +0000
+++ src/privatescreen.h 2012-01-23 18:50:37 +0000
@@ -55,11 +55,6 @@
55extern CompWindow *lastFoundWindow;55extern CompWindow *lastFoundWindow;
56extern bool useDesktopHints;56extern bool useDesktopHints;
5757
58extern bool inHandleEvent;
59
60extern CompScreen *targetScreen;
61extern CompOutput *targetOutput;
62
63extern std::list <CompString> initialPlugins;58extern std::list <CompString> initialPlugins;
6459
6560
6661
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2012-01-23 17:40:11 +0000
+++ src/screen.cpp 2012-01-23 18:50:37 +0000
@@ -60,11 +60,6 @@
60#include "privateaction.h"60#include "privateaction.h"
61#include "privatestackdebugger.h"61#include "privatestackdebugger.h"
6262
63bool inHandleEvent = false;
64
65bool screenInitalized = false;
66
67CompScreen *targetScreen = NULL;
68CompOutput *targetOutput;63CompOutput *targetOutput;
6964
70int lastPointerX = 0;65int lastPointerX = 0;
@@ -74,6 +69,13 @@
74int pointerY = 0;69int pointerY = 0;
75unsigned int pointerMods = 0;70unsigned int pointerMods = 0;
7671
72namespace
73{
74bool inHandleEvent = false;
75
76bool screenInitalized = false;
77}
78
77#define MwmHintsFunctions (1L << 0)79#define MwmHintsFunctions (1L << 0)
78#define MwmHintsDecorations (1L << 1)80#define MwmHintsDecorations (1L << 1)
79#define PropMotifWmHintElements 381#define PropMotifWmHintElements 3
@@ -118,17 +120,17 @@
118 {120 {
119 case SIGINT:121 case SIGINT:
120 case SIGTERM:122 case SIGTERM:
121 shutDown = true;123 mainloop->quit ();
122 break;124 break;
123 case SIGHUP:125 case SIGHUP:
124 restartSignal = true;126 restartSignal = true;
127 mainloop->quit ();
125 break;128 break;
126 default:129 default:
127 break;130 break;
128 }131 }
129132
130 if (shutDown || restartSignal)133 mainloop->quit ();
131 mainloop->quit ();
132}134}
133135
134void136void
@@ -629,7 +631,7 @@
629 return screen->updateDefaultIcon ();631 return screen->updateDefaultIcon ();
630 break;632 break;
631 case CoreOptions::Outputs:633 case CoreOptions::Outputs:
632 if (!noDetection && optionGetDetectOutputs ())634 if (optionGetDetectOutputs ())
633 return false;635 return false;
634 updateOutputDevices ();636 updateOutputDevices ();
635 break;637 break;
@@ -1110,7 +1112,7 @@
1110 wmSnAtom != event->xselectionclear.selection)1112 wmSnAtom != event->xselectionclear.selection)
1111 return;1113 return;
11121114
1113 shutDown = true;1115 mainloop->quit ();
1114}1116}
11151117
1116#define IMAGEDIR "images"1118#define IMAGEDIR "images"
@@ -1926,7 +1928,7 @@
1926void1928void
1927PrivateScreen::detectOutputDevices ()1929PrivateScreen::detectOutputDevices ()
1928{1930{
1929 if (!noDetection && optionGetDetectOutputs ())1931 if (optionGetDetectOutputs ())
1930 {1932 {
1931 CompString name;1933 CompString name;
1932 CompOption::Value value;1934 CompOption::Value value;

Subscribers

People subscribed via source and target branches