Author: blino
Date: Fri Feb 9 22:00:12 2007
New Revision: 118642
Added:
packages/cooker/compiz/current/SOURCES/restart.patch
Modified:
packages/cooker/compiz/current/SPECS/compiz.spec
Log:
allow session manager to restart compiz if it crashes (from RH)
Added: packages/cooker/compiz/current/SOURCES/restart.patch
==============================================================================
--- (empty file)
+++ packages/cooker/compiz/current/SOURCES/restart.patch Fri Feb 9
22:00:12 2007
@@ -0,0 +1,93 @@
+--- compiz-3173a142efe5e7af83ebb534a074d9d2a0c67a86/src/session.c.restart
2006-08-17 17:36:07.000000000 -0400
++++ compiz-3173a142efe5e7af83ebb534a074d9d2a0c67a86/src/session.c
2006-09-26 13:57:18.000000000 -0400
+@@ -49,6 +49,71 @@
+ static void iceInit (void);
+
+ static void
++set_string_list_property (SmcConn connection,
++ const char *name,
++ const char **values)
++{
++ SmProp prop, *pProp;
++ int i;
++
++ prop.name = (char *)name;
++ prop.type = SmLISTofARRAY8;
++
++ i = 0;
++ while (values[i] != NULL)
++ i++;
++
++ prop.vals = malloc (i * sizeof (SmPropValue));
++ if (!prop.vals)
++ return;
++
++ i = 0;
++ while (values[i] != NULL)
++ {
++ prop.vals[i].value = (char *)values[i];
++ prop.vals[i].length = strlen (values[i]);
++
++ i++;
++ }
++
++ prop.num_vals = i;
++
++ pProp = ∝
++ SmcSetProperties (connection, 1, &pProp);
++
++ free (prop.vals);
++}
++
++static void
++set_clone_restart_commands (SmcConn connection)
++{
++ const char *clone[] = { "compiz", NULL };
++ const char *restart[] = { "compiz", "gconf", NULL };
++
++ set_string_list_property (connection, SmCloneCommand, clone);
++ set_string_list_property (connection, SmRestartCommand, restart);
++}
++
++static void
++set_restart_style (SmcConn connection)
++{
++ SmProp prop, *pProp;
++ SmPropValue propVal;
++ char hint = SmRestartImmediately;
++
++ prop.name = SmRestartStyleHint;
++ prop.type = SmCARD8;
++ prop.num_vals = 1;
++ prop.vals = &propVal;
++ propVal.value = &hint;
++ propVal.length = 1;
++
++ pProp = ∝
++
++ SmcSetProperties (connection, 1, &pProp);
++}
++
++static void
+ saveYourselfGotProps (SmcConn connection,
+ SmPointer client_data,
+ int num_props,
+@@ -69,13 +134,16 @@
+ SmcSetProperties (connection, 1, &props[p]);
+ props[p]->vals[i + 1] = oldVal;
+
+- SmcSaveYourselfDone (connection, 1);
+- return;
++ goto out;
+ }
+ }
+ }
+ }
+
++out:
++ set_restart_style (connection);
++ set_clone_restart_commands (connection);
++
+ SmcSaveYourselfDone (connection, 1);
+ }
+
Modified: packages/cooker/compiz/current/SPECS/compiz.spec
==============================================================================
--- packages/cooker/compiz/current/SPECS/compiz.spec (original)
+++ packages/cooker/compiz/current/SPECS/compiz.spec Fri Feb 9 22:00:12 2007
@@ -1,6 +1,6 @@
%define name compiz
%define version 0.3.6
-%define rel 1
+%define rel 2
%define cvs_version 0
%if %{cvs_version}
@@ -32,6 +32,7 @@
Patch5: compiz-mandriva-top.patch
# Patches from fedora
Patch6: glfinish.patch
+Patch7: restart.patch
# Patch from mandriva
Patch8: minimize-unminimize.patch
# From gandalfn
@@ -88,6 +89,7 @@
%patch4 -p1 -b .disable_child_window
%patch5 -p1 -b .top
%patch6 -p1 -b .glfinish
+%patch7 -p1 -b .restart
%patch8 -p1 -b .minimize
%patch9 -p1 -b .white