diff --git a/compiz.spec b/compiz.spec index a2ad0c1..d3cfbf6 100644 --- a/compiz.spec +++ b/compiz.spec @@ -52,6 +52,7 @@ Patch110: thumbnail-sorting.patch Patch111: button-clicks.patch Patch112: positioning.patch Patch113: resize-offset.patch +Patch114: restart.patch %description Compiz is one of the first OpenGL-accelerated compositing window @@ -94,6 +95,7 @@ windows and compositing manager. %patch111 -p1 -b .button-clicks %patch112 -p1 -b .positioning %patch113 -p1 -b .resize-offset +%patch114 -p1 -b .restart %build rm -rf $RPM_BUILD_ROOT @@ -173,6 +175,10 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/compiz %changelog +* Tue Sep 26 2006 Soren Sandmann - 0.0.13-0.29.20060817git.fc6 +- Add restart.patch to make compiz ask the session manager to restart it + if it crashes (bug 200280). + * Mon Sep 25 2006 Soren Sandmann - 0.0.13-0.28.20060817git.fc6 - Change plane.patch to not do cyclical window movement in dimensions where the desktop has size 1 (bug 207263). diff --git a/restart.patch b/restart.patch new file mode 100644 index 0000000..1a7cf60 --- /dev/null +++ b/restart.patch @@ -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); + } +