Merge lp:~thomas-voss/compiz-core/fix-globals-simplified into lp:compiz-core/0.9.5

Proposed by Thomas Voß
Status: Merged
Merged at revision: 2945
Proposed branch: lp:~thomas-voss/compiz-core/fix-globals-simplified
Merge into: lp:compiz-core/0.9.5
Prerequisite: lp:~thomas-voss/compiz-core/fix-option
Diff against target: 148 lines (+58/-46) (has conflicts)
5 files modified
src/CMakeLists.txt (+1/-0)
src/global.cpp (+51/-0)
src/main.cpp (+6/-20)
src/tests/globals.h (+0/-24)
src/tests/option.cpp (+0/-2)
Text conflict in src/option.cpp
To merge this branch: bzr merge lp:~thomas-voss/compiz-core/fix-globals-simplified
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Daniel van Vugt Needs Fixing
Thomas Voß Needs Resubmitting
Review via email: mp+89190@code.launchpad.net

This proposal supersedes a proposal from 2012-01-18.

Description of the change

Move the globals definitions into a separate file

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

There seems to be a lot shown in the diff that isn't about moving global variables. (That bit seems fine.)

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Please remove all the changes unrelated to the globals clean-up in question.

It looks like lots of them crept in from:
https://code.launchpad.net/~thomas-voss/compiz-core/CompizOptionRework/+merge/87714

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm not sure it's appropriate to be changing the compiz command line parameters in this proposal:

106 - "[--use-root-window] "

114 - else if (!strcmp (argv[i], "--use-root-window"))
115 - {
116 - useCow = false;
117 - }

If you want to remove "useCow" then it should be done in a separate proposal, and also plugins/composite/src/* would need to be updated to no longer reference useCow.

review: Needs Fixing
2922. By Thomas Voß

Re-enabled command-line flag --use-root-window and defined the variable in main.cpp.

Revision history for this message
Thomas Voß (thomas-voss) wrote :

> I'm not sure it's appropriate to be changing the compiz command line
> parameters in this proposal:
>

Reverted that change and added a comment in the code.

> If you want to remove "useCow" then it should be done in a separate proposal,
> and also plugins/composite/src/* would need to be updated to no longer
> reference useCow.

Ack.

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

> 106 - "[--use-root-window] "

> 114 - else if (!strcmp (argv[i], "--use-root-window"))
> 115 - {
> 116 - useCow = false;
> 117 - }

> If you want to remove "useCow" then it should be done in a separate proposal, and also plugins/composite/src/* would need to be updated to no longer reference useCow.

Support for drawing directly to the root window should be removed. The composite overlay window is the correct way to do it. This was added in 2006 ! http://lists.x.org/archives/xorg-arch/2006-February/000437.html

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, moving the useCow / --use-root-window discussion to bug 919023.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

While the diff looks OK on the web page, I get a conflict and then build failures (after I fixed the conflict) when merged with lp:compiz-core.

Please fix the conflict and build failures by merging the latest lp:compiz-core into your branch. Test everything builds and that nothing unrelated to the globals cleanup has crept in.

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

Seems OK now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2012-01-19 11:30:31 +0000
3+++ src/CMakeLists.txt 2012-01-19 11:30:31 +0000
4@@ -60,6 +60,7 @@
5 )
6
7 add_library (compiz_core
8+ ${CMAKE_CURRENT_SOURCE_DIR}/global.cpp
9 ${CMAKE_CURRENT_SOURCE_DIR}/region.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/atoms.cpp
11 ${CMAKE_CURRENT_SOURCE_DIR}/actions.cpp
12
13=== added file 'src/global.cpp'
14--- src/global.cpp 1970-01-01 00:00:00 +0000
15+++ src/global.cpp 2012-01-19 11:30:31 +0000
16@@ -0,0 +1,51 @@
17+/*
18+ * Copyright © 2012 Canonical Ltd.
19+ *
20+ * Permission to use, copy, modify, distribute, and sell this software
21+ * and its documentation for any purpose is hereby granted without
22+ * fee, provided that the above copyright notice appear in all copies
23+ * and that both that copyright notice and this permission notice
24+ * appear in supporting documentation, and that the name of
25+ * Novell, Inc. not be used in advertising or publicity pertaining to
26+ * distribution of the software without specific, written prior permission.
27+ * Novell, Inc. makes no representations about the suitability of this
28+ * software for any purpose. It is provided "as is" without express or
29+ * implied warranty.
30+ *
31+ * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
32+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
33+ * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
34+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
35+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
36+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
37+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
38+ *
39+ * Author: Thomas Voss <thomas.voss@canonical.com>
40+ */
41+
42+#include <list>
43+
44+#include "core/string.h"
45+
46+class CompWindow;
47+
48+char *programName;
49+char **programArgv;
50+int programArgc;
51+
52+char *backgroundImage = NULL;
53+
54+bool shutDown = false;
55+bool restartSignal = false;
56+
57+CompWindow *lastFoundWindow = 0;
58+
59+bool replaceCurrentWm = false;
60+bool indirectRendering = false;
61+bool noDetection = false;
62+bool useDesktopHints = false;
63+bool debugOutput = false;
64+
65+std::list <CompString> initialPlugins;
66+
67+unsigned int pluginClassHandlerIndex = 0;
68
69=== modified file 'src/main.cpp'
70--- src/main.cpp 2012-01-19 06:08:11 +0000
71+++ src/main.cpp 2012-01-19 11:30:31 +0000
72@@ -37,28 +37,14 @@
73 #include "privatescreen.h"
74 #include "privatestackdebugger.h"
75
76-char *programName;
77-char **programArgv;
78-int programArgc;
79-
80-char *backgroundImage = NULL;
81-
82-bool shutDown = false;
83-bool restartSignal = false;
84-
85-CompWindow *lastFoundWindow = 0;
86-
87-bool replaceCurrentWm = false;
88-bool indirectRendering = false;
89-bool noDetection = false;
90-bool useDesktopHints = false;
91-bool debugOutput = false;
92+/*
93+ * The extern declaration of useCow
94+ * is in plugins/composite/src/privates.h.
95+ * It needs to be defined here to
96+ * make it visible to the command line parser.
97+ */
98 bool useCow = true;
99
100-std::list <CompString> initialPlugins;
101-
102-unsigned int pluginClassHandlerIndex = 0;
103-
104 void
105 CompManager::usage ()
106 {
107
108=== removed file 'src/tests/globals.h'
109--- src/tests/globals.h 2012-01-19 11:30:31 +0000
110+++ src/tests/globals.h 1970-01-01 00:00:00 +0000
111@@ -1,24 +0,0 @@
112-#ifndef GLOBALS_H
113-#define GLOBALS_H
114-
115-char *programName;
116-char **programArgv;
117-int programArgc;
118-
119-bool shutDown = false;
120-bool restartSignal = false;
121-
122-CompWindow *lastFoundWindow = 0;
123-
124-bool replaceCurrentWm = false;
125-bool indirectRendering = false;
126-bool noDetection = false;
127-bool useDesktopHints = false;
128-bool debugOutput = false;
129-bool useCow = true;
130-
131-std::list <CompString> initialPlugins;
132-
133-unsigned int pluginClassHandlerIndex = 0;
134-
135-#endif // GLOBALS_H
136
137=== modified file 'src/tests/option.cpp'
138--- src/tests/option.cpp 2012-01-19 11:30:31 +0000
139+++ src/tests/option.cpp 2012-01-19 11:30:31 +0000
140@@ -5,8 +5,6 @@
141 #include "core/match.h"
142 #include "core/option.h"
143
144-#include "globals.h"
145-
146 namespace {
147 template<typename T>
148 void

Subscribers

People subscribed via source and target branches