Merge lp:~vanvugt/compiz/fix-1014461 into lp:compiz/0.9.8
- fix-1014461
- Merge into 0.9.8
Status: | Merged |
---|---|
Approved by: | Sam Spilsbury |
Approved revision: | 3250 |
Merged at revision: | 3253 |
Proposed branch: | lp:~vanvugt/compiz/fix-1014461 |
Merge into: | lp:compiz/0.9.8 |
Diff against target: |
173 lines (+123/-2) 4 files modified
plugins/decor/CMakeLists.txt (+2/-0) plugins/decor/decor.xml.in (+2/-1) plugins/decor/src/compiz-decorator (+101/-0) src/screen.cpp (+18/-1) |
To merge this branch: | bzr merge lp:~vanvugt/compiz/fix-1014461 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sam Spilsbury | Approve | ||
Review via email: mp+110734@code.launchpad.net |
Commit message
Description of the change
Start a window decorator automatically when the decor plugin starts, if none
is running already (LP: #1014461)
Daniel van Vugt (vanvugt) wrote : | # |
Didier Roche-Tolomelli (didrocks) wrote : | # |
FYI, as the kde decorator doesn't work anymore, I've removed the script in quantal and starts direclty the only working window decorator (gtk-w-d)
Daniel van Vugt (vanvugt) wrote : | # |
No problem. You can still configure the command to whatever you want in the ubuntu branch. This proposal is mostly for making development easier.
Sam Spilsbury (smspillaz) : | # |
Sam Spilsbury (smspillaz) wrote : | # |
(preferably remove emerald, I'd prefer not to give the impression that its even supported *ugh*)
Daniel van Vugt (vanvugt) wrote : | # |
I would prefer to not modify a script that's stable and already in use in the ubuntu branches :P
Sam Spilsbury (smspillaz) wrote : | # |
There is no point keeping emerald. It doesn't work with newer compiz versions afaik
Daniel van Vugt (vanvugt) wrote : | # |
There are people using Emerald today with precise. Someone is maintaining it in a PPA I saw recently.
Daniel van Vugt (vanvugt) wrote : | # |
triplesqaurednine (triplesquarednine) wrote : | # |
@Sam
I just tested it, not only does it work - but i am no longer plagued by the white-edges on roll up/shade - which means that is a feature that i can use again (at least with emerald, as with gtk it looks horrible). or until this code gets pulled from compiz...
I think some of the compiz-standalone folks might appreciate it as well, i see people posting screenshots of emerald all the time (running with 0.8.8). I know i was disappointed when i couldn't use it anymore with compiz++, it might draw in some of those people and be a useful alternative to gtk-window-
i also haven't noticed any bugs/problems or weird issues using emerald. (for an hour or so).
cheerz
MC Return (mc-return) wrote : | # |
Emerald from the archive Daniel posted (https:/
I would even like to see Emerald being used as default in Ubuntu 12.10+.
MC Return (mc-return) wrote : | # |
The only two bugs with Emerald at the moment:
https:/
I contacted brainpower about his Emerald PPA for Precise and about compiling instructions or code changes, this is what I got as answer:
"Well,
can you tell me, what git describe prints?
if there is output like "0.8.8-1-ga8c21c4", you've got the wrong version
and gotta switch to 0.9.5 (git checkout -b 0.9.5),
then git describe should print "0.8.4-11-ga272e26" (I know its weird, but it's alright) and emerald compiles fine ;)
"
Unfortunately this did not work here yet.
The second minor issue hunts Emerald for quite some time now:
https:/
MC Return (mc-return) wrote : | # |
Regarding stability: I am running Compiz/
The only issue with the disappearing buttons can easily be reproduced and so it should not be hard to fix...
MC Return (mc-return) wrote : | # |
Sorry for spamming here, but I want to quote Mark Shuttleworth here:
"From a styling point of view, we think in terms of quadruples: this next release starts a cycle of four, which will culminate in 14.04 LTS. So there’s an opportunity to refresh the look. That will kick off with a project on typography to make sure we are expressing ourselves with crystal clarity – making the most of Ubuntu’s Light and Medium font weights for a start. And a project on iconography, with the University of Reading, to refine the look of apps and interfaces throughout the platform. It’s amazing how quaint the early releases of Ubuntu look compared to the current style. And we’re only just getting started! In our artistic explorations we want to embrace tessellation as an expression of the part-digital, part-organic nature of Ubuntu. We love the way tessellated art expresses both the precision and reliability of our foundations, and the freedom and collaboration of a project driven by people making stuff for people. There’s nothing quixotic in our desire to make Ubuntu the easiest, steadiest, and most beautiful way to live digitally."
For me this means: Bring Emerald and upgrade and refresh the look of Ubuntu :)
Sam Spilsbury (smspillaz) wrote : | # |
The developers employed by canonical have other priorities, we don't want to increase the maintainece burden by supporting something that was never supported in the first place.
If emerald still works, then I'd be fine with allowing an internal script to start it as a last resort, but there is no support for it.
Daniel van Vugt (vanvugt) wrote : | # |
We don't claim to support Emerald. If anyone wants to remove references to it from /usr/bin/
Alan Griffiths (alan-griffiths) wrote : | # |
> The developers employed by canonical have other priorities, we don't want to
> increase the maintainece burden by supporting something that was never
> supported in the first place.
>
> If emerald still works, then I'd be fine with allowing an internal script to
> start it as a last resort, but there is no support for it.
While we are not free to put time into supporting emerald we shouldn't get in the way of others who want to. But for that all that is needed is a way to flag plugins as "supported by the community".
triplesqaurednine (triplesquarednine) wrote : | # |
@ Sam and Daniel
My point wasn't to say that Canonical should 'officially support Emerald'. it was more along the lines of 'leave it be, if it is working and not causing issues'... and like i said, Gtk-window-
I think Alan Griffiths, best summed it up (above).
anyway, for now i would like (and am going) to stick with emerald, so i can use shade on larger windows to (quickly) peek other windows - which is a feature of compiz that i have missed, being as it's somewhat broken... and after tweaking emerald looks exactly like my metacity does - so little to no impact on GUI.
Preview Diff
1 | === modified file 'plugins/decor/CMakeLists.txt' |
2 | --- plugins/decor/CMakeLists.txt 2012-05-10 15:40:25 +0000 |
3 | +++ plugins/decor/CMakeLists.txt 2012-06-18 06:29:36 +0000 |
4 | @@ -18,3 +18,5 @@ |
5 | INSTALL_RPATH "${COMPIZ_LIBDIR}" |
6 | ) |
7 | endif (COMPIZ_BUILD_WITH_RPATH AND NOT COMPIZ_DISABLE_PLUGIN_DECOR) |
8 | + |
9 | +install (PROGRAMS "src/compiz-decorator" DESTINATION ${exec_prefix}) |
10 | |
11 | === modified file 'plugins/decor/decor.xml.in' |
12 | --- plugins/decor/decor.xml.in 2012-01-17 05:19:03 +0000 |
13 | +++ plugins/decor/decor.xml.in 2012-06-18 06:29:36 +0000 |
14 | @@ -99,7 +99,8 @@ |
15 | </subgroup> |
16 | <option name="command" type="string"> |
17 | <_short>Command</_short> |
18 | - <_long>Decorator command line that is executed if no decorator is already running</_long> |
19 | + <_long>Decorator command line that is executed if no decorator is already running. Use prefix "./" if you want the program run from the compiz bin directory.</_long> |
20 | + <default>./compiz-decorator</default> |
21 | </option> |
22 | <option name="mipmap" type="bool"> |
23 | <_short>Mipmap</_short> |
24 | |
25 | === added file 'plugins/decor/src/compiz-decorator' |
26 | --- plugins/decor/src/compiz-decorator 1970-01-01 00:00:00 +0000 |
27 | +++ plugins/decor/src/compiz-decorator 2012-06-18 06:29:36 +0000 |
28 | @@ -0,0 +1,101 @@ |
29 | +#!/bin/sh |
30 | +# Starts Compiz Decorator depending on the DE |
31 | +# |
32 | +# Copyright (c) 2007 CyberOrg <cyberorg@cyberorg.info> |
33 | +# Based on compiz-manager script by Kristian Lyngstøl <kristian@bohemians.org> |
34 | +# This program is free software; you can redistribute it and/or modify |
35 | +# it under the terms of the GNU General Public License as published by |
36 | +# the Free Software Foundation; either version 2 of the License, or |
37 | +# (at your option) any later version. |
38 | +# |
39 | +# This program is distributed in the hope that it will be useful, |
40 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
41 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
42 | +# GNU General Public License for more details. |
43 | +# |
44 | +# |
45 | +# You should have received a copy of the GNU General Public License |
46 | +# along with this program; if not, write to the Free Software |
47 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
48 | +# |
49 | +# Contributions by: crdlb |
50 | +# Modifications by: Daniel van Vugt <daniel.van.vugt@canonical.com> |
51 | +# |
52 | + |
53 | +if [ -z "$COMPIZ_BIN_PATH" ]; then |
54 | + COMPIZ_BIN_PATH="/usr/bin/" |
55 | +fi |
56 | +KWIN=`which kwin` |
57 | +METACITY="/usr/bin/metacity" |
58 | + |
59 | +# |
60 | +# Default to gtk/kde4-window-decorator |
61 | +# |
62 | +USE_EMERALD="no" |
63 | +DECORATOR="" |
64 | + |
65 | +#Do not leave users without decoration if decorator fails |
66 | +if [ "$DESKTOP_SESSION" = "kde" ]; then |
67 | + FALLBACKWM="${KWIN}" |
68 | +else |
69 | + FALLBACKWM="${METACITY}" |
70 | +fi |
71 | +FALLBACKWM_OPTIONS=" --replace" |
72 | + |
73 | +# |
74 | +# Set to yes to enable verbose |
75 | +# |
76 | +VERBOSE="yes" |
77 | + |
78 | +# |
79 | +# Echos the arguments if verbose |
80 | +# |
81 | +verbose() |
82 | +{ |
83 | + if [ "x$VERBOSE" = "xyes" ]; then |
84 | + printf "$*" |
85 | + fi |
86 | +} |
87 | + |
88 | +# Read configuration from XDG paths |
89 | +if [ -z "$XDG_CONFIG_DIRS" ]; then |
90 | + test -f /etc/xdg/compiz/compiz-manager && . /etc/xdg/compiz/compiz-manager |
91 | +else |
92 | + test -f $XDG_CONFIG_DIRS/compiz/compiz-manager && . $XDG_CONFIG_DIRS/compiz/compiz-manager |
93 | +fi |
94 | + |
95 | +if [ -z "$XDG_CONFIG_HOME" ]; then |
96 | + test -f $HOME/.config/compiz/compiz-manager && . $HOME/.config/compiz/compiz-manager |
97 | +else |
98 | + test -f $XDG_CONFIG_HOME/compiz/compiz-manager && . $XDG_CONFIG_HOME/compiz/compiz-manager |
99 | +fi |
100 | + |
101 | +# start a decorator |
102 | +if [ -x ${COMPIZ_BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then |
103 | + DECORATOR=emerald |
104 | +elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ] && [ -n "$GNOME_DESKTOP_SESSION_ID" ]; then |
105 | + DECORATOR=gtk-window-decorator |
106 | +elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ] && [ x$KDE_SESSION_VERSION = x"4" ]; then |
107 | + DECORATOR=kde4-window-decorator |
108 | +fi |
109 | + |
110 | +# fall back to any decorator that is installed |
111 | +if [ -z "$DECORATOR" ]; then |
112 | + verbose "Couldn't find a perfect decorator match; trying all decorators\n" |
113 | + if [ -x ${COMPIZ_BIN_PATH}emerald ]; then |
114 | + DECORATOR=emerald |
115 | + elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ]; then |
116 | + DECORATOR=gtk-window-decorator |
117 | + elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ]; then |
118 | + DECORATOR=kde4-window-decorator |
119 | + fi |
120 | +fi |
121 | + |
122 | +if [ -n "$DECORATOR" ]; then |
123 | + verbose "Starting ${DECORATOR}\n" |
124 | + exec ${COMPIZ_BIN_PATH}$DECORATOR "$@" |
125 | +else |
126 | + verbose "Found no decorator to start\n" |
127 | + exec $FALLBACKWM $FALLBACKWM_OPTIONS |
128 | +fi |
129 | + |
130 | |
131 | === modified file 'src/screen.cpp' |
132 | --- src/screen.cpp 2012-06-01 07:38:33 +0000 |
133 | +++ src/screen.cpp 2012-06-18 06:29:36 +0000 |
134 | @@ -39,6 +39,7 @@ |
135 | #include <assert.h> |
136 | #include <limits.h> |
137 | #include <poll.h> |
138 | +#include <libgen.h> |
139 | #include <algorithm> |
140 | |
141 | #include <boost/bind.hpp> |
142 | @@ -52,6 +53,7 @@ |
143 | #include <X11/extensions/shape.h> |
144 | #include <X11/cursorfont.h> |
145 | |
146 | +#include <core/global.h> |
147 | #include <core/screen.h> |
148 | #include <core/icon.h> |
149 | #include <core/atoms.h> |
150 | @@ -3893,7 +3895,22 @@ |
151 | |
152 | env.append (compPrintf (".%d", privateScreen.screenNum)); |
153 | |
154 | - putenv (const_cast<char *> (env.c_str ())); |
155 | + putenv (strdup (env.c_str ())); // parameter needs to be leaked! |
156 | + |
157 | + // We need a private copy of argv[0] for dirname() to modify |
158 | + char *argv0 = strdup (programArgv[0]); |
159 | + if (argv0 != NULL) |
160 | + { |
161 | + const char *binpath = dirname (argv0); |
162 | + if (binpath == NULL) |
163 | + binpath = "."; |
164 | + char binenv[PATH_MAX]; |
165 | + snprintf (binenv, sizeof(binenv)-1, "COMPIZ_BIN_PATH=%s/", binpath); |
166 | + putenv (strdup (binenv)); // parameter needs to be leaked! |
167 | + if (binpath != NULL && command.substr (0, 2) == "./") |
168 | + command.replace (0, 1, binpath); |
169 | + free (argv0); |
170 | + } |
171 | |
172 | exit (execl ("/bin/sh", "/bin/sh", "-c", command.c_str (), NULL)); |
173 | } |
The script "compiz-decorator" has been copied from downstream Ubuntu (precise).