diff options
30 files changed, 923 insertions, 779 deletions
@@ -1,16 +1,8 @@ * xfce4-session does no longer work with smproxy. We have to write our own multihead-safe smproxy replacement. -* Make the logout dialog icon themable through GtkIconTheme - -How to support several sessions: --------------------------------- +* Make the logout dialog icon themable through GtkIconTheme - * On startup, display "Press F2 for session chooser", the session menu - contains the saved sessions + Failsafe, if no F2, then start the - last session. Also support an option "Always display session chooser". - The session chooser should also offer the ability to remove/rename - sessions. +* xfce4-session sometimes exits with X error when trying to logout from + the second screen. This is likely to be a bug in the gtk-engine. - * If Failsafe was started, then display a "Save as" before saving - the session, so the user can choose a name @@ -1,26 +1,340 @@ - Copyright (c) 2003,2004 - The XFce development team. All rights reserved. - - This code was written for XFce by Benedikt Meurer <benny@xfce.org>. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/settings/session.c b/settings/session.c index 545737a6..f05d29e3 100644 --- a/settings/session.c +++ b/settings/session.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -65,11 +59,9 @@ /* prototypes */ static void run_dialog(McsPlugin *); static void save_settings(void); -static void confirmLogoutChangedCB(GtkToggleButton *, McsPlugin *); static void autoSaveChangedCB(GtkToggleButton *, McsPlugin *); /* settings */ -static gboolean confirmLogout = TRUE; static gboolean autoSave = FALSE; static gboolean displayChooser = FALSE; @@ -106,7 +98,6 @@ save_settings(void) FALSE); xfce_rc_set_group (rc, "General"); - xfce_rc_write_bool_entry (rc, "ConfirmLogout", confirmLogout); xfce_rc_write_bool_entry (rc, "AutoSave", autoSave); xfce_rc_write_bool_entry (rc, "AlwaysDisplayChooser", displayChooser); @@ -116,15 +107,6 @@ save_settings(void) /* */ static void -confirmLogoutChangedCB(GtkToggleButton *button, McsPlugin *plugin) -{ - confirmLogout = gtk_toggle_button_get_active(button); - save_settings(); -} - -/* - */ -static void autoSaveChangedCB(GtkToggleButton *button, McsPlugin *plugin) { autoSave = gtk_toggle_button_get_active(button); @@ -170,7 +152,6 @@ run_dialog(McsPlugin *plugin) "xfce4-session/xfce4-session.rc", TRUE); xfce_rc_set_group (rc, "General"); - confirmLogout = xfce_rc_read_bool_entry (rc, "ConfirmLogout", TRUE); autoSave = xfce_rc_read_bool_entry (rc, "AutoSave", TRUE); displayChooser = xfce_rc_read_bool_entry (rc, "AlwaysDisplayChooser", FALSE); xfce_rc_close (rc); @@ -213,18 +194,6 @@ run_dialog(McsPlugin *plugin) xfce_framebox_add(XFCE_FRAMEBOX(frame), vbox); /* */ - checkbox = gtk_check_button_new_with_label(_("Confirm logout")); - gtk_tooltips_set_tip(tooltips, checkbox, _( - "Should the session manager ask the user to confirm " - "the logout. If disabled, the session will be closed " - "without any further user interaction."), NULL); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), - confirmLogout); - g_signal_connect(checkbox, "toggled",G_CALLBACK(confirmLogoutChangedCB), - plugin); - gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, TRUE, 0); - - /* */ checkbox = gtk_check_button_new_with_label( _("Automatically save session on logout")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), autoSave); diff --git a/xfce4-session.spec.in b/xfce4-session.spec.in index a5794094..cff53900 100644 --- a/xfce4-session.spec.in +++ b/xfce4-session.spec.in @@ -1,8 +1,8 @@ -Summary: XFce Session manager +Summary: Xfce Session manager Name: xfce4-session Version: @VERSION@ Release: 1 -License: BSD +License: GPL URL: http://www.xfce.org/ Source0: %{name}-%{version}.tar.gz Group: User Interface/Desktops @@ -15,7 +15,7 @@ BuildRequires: libxfce4mcs-devel >= @LIBXFCE4MCS_CLIENT_REQUIRED_VERSION@ BuildRequires: xfce-mcs-manager-devel >= @XFCE_MCS_MANAGER_REQUIRED_VERSION@ %description -xfce4-session is the session manager for the XFce desktop environment +xfce4-session is the session manager for the Xfce desktop environment. %prep %setup -q diff --git a/xfce4-session/ice-layer.c b/xfce4-session/ice-layer.c index 033a745f..a2e7924c 100644 --- a/xfce4-session/ice-layer.c +++ b/xfce4-session/ice-layer.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H diff --git a/xfce4-session/ice-layer.h b/xfce4-session/ice-layer.h index befee73b..82edce5c 100644 --- a/xfce4-session/ice-layer.h +++ b/xfce4-session/ice-layer.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_ICE_LAYER_H__ diff --git a/xfce4-session/main.c b/xfce4-session/main.c index a3bac341..75c350ee 100644 --- a/xfce4-session/main.c +++ b/xfce4-session/main.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -114,7 +108,6 @@ usage (int exit_code) "\n" "GTK+\n" " --display=DISPLAY X display to use\n" - " --screen=SCREEN X screen to use\n" "\n" "Application options\n" " --disable-tcp Disable binding to TCP ports\n" diff --git a/xfce4-session/shutdown.c b/xfce4-session/shutdown.c index e035873a..3984caa3 100644 --- a/xfce4-session/shutdown.c +++ b/xfce4-session/shutdown.c @@ -1,49 +1,25 @@ /* $Id$ */ /*- - * Copyright (c) 2003,2004 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* Parts of this file where taken from logout.c - - Written by Owen Taylor <otaylor@redhat.com> - Copyright (C) Red Hat - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. + * Parts of this file where taken from gnome-session/logout.c, which + * was written by Owen Taylor <otaylor@redhat.com>. */ #ifdef HAVE_CONFIG_H @@ -120,6 +96,17 @@ fadeout_screen (GdkScreen *screen) } static void +show_fadeout_windows (void) +{ + GdkDisplay *display; + int n; + + display = gdk_display_get_default (); + for (n = 0; n < gdk_display_get_n_screens (display); ++n) + fadeout_screen (gdk_display_get_screen (display, n)); +} + +static void hide_fadeout_windows (void) { GdkWindowAttr attr; @@ -175,7 +162,6 @@ shutdownDialog(gint *shutdownType, gboolean *saveSession) GtkWidget *hidden; gboolean saveonexit; gboolean autosave; - gboolean confirm; gint monitor; gint result; XfceRc *rc; @@ -190,54 +176,45 @@ shutdownDialog(gint *shutdownType, gboolean *saveSession) xfce_rc_set_group (rc, "General"); saveonexit = xfce_rc_read_bool_entry (rc, "SaveOnExit", TRUE); autosave = xfce_rc_read_bool_entry (rc, "AutoSave", FALSE); - confirm = xfce_rc_read_bool_entry (rc, "ConfirmLogout", TRUE); - /* - * The user do not want to see a "shutdown dialog", so lets assume, - * he's willing to execute the default (whatever that be) - */ - if (!confirm) { - *saveSession = autosave || saveonexit; - *shutdownType = SHUTDOWN_LOGOUT; /* XXX - configurable? */ - return(TRUE); - } - - /* give the logout button some time to change its visual state */ - g_main_context_iteration (NULL, FALSE); + /* It's really bad here if someone else has the pointer + * grabbed, so we first grab the pointer and keyboard + * to an offscreen window, and then once we have the + * server grabbed, move that to our dialog. + */ + gtk_rc_reparse_all (); /* get screen with pointer */ screen = xfsm_locate_screen_with_pointer (&monitor); if (screen == NULL) { - monitor = 0; screen = gdk_screen_get_default (); + monitor = 0; } /* Try to grab Input on a hidden window first */ hidden = gtk_invisible_new_for_screen (screen); gtk_widget_show_now (hidden); - gdk_flush (); - + accessibility = GTK_IS_ACCESSIBLE (gtk_widget_get_accessible (hidden)); if (!accessibility) { for (;;) { - if (gdk_pointer_grab(hidden->window, FALSE, 0, NULL, NULL, - GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS) + if (gdk_pointer_grab (hidden->window, FALSE, 0, NULL, NULL, + GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS) { if (gdk_keyboard_grab (hidden->window, FALSE, GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS) { - gtk_widget_destroy(hidden); break; } - gdk_pointer_ungrab(GDK_CURRENT_TIME); + gdk_pointer_ungrab (GDK_CURRENT_TIME); } - g_usleep(50 * 1000); + g_usleep (50 * 1000); } dialog = g_object_new (GTK_TYPE_DIALOG, @@ -256,29 +233,11 @@ shutdownDialog(gint *shutdownType, gboolean *saveSession) gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL); - gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_screen (GTK_WINDOW (dialog), screen); - if (!accessibility) - { - GdkDisplay *dpy; - int n, i; - - gdk_x11_grab_server (); - - dpy = gdk_display_get_default (); - - n = gdk_display_get_n_screens (dpy); - for (i = 0; i < n; ++i) - { - GdkScreen *screen = gdk_display_get_screen (dpy, i); - fadeout_screen (screen); - } - - gdk_flush (); - } - dbox = GTK_DIALOG(dialog)->vbox; /* */ @@ -334,42 +293,34 @@ shutdownDialog(gint *shutdownType, gboolean *saveSession) checkbox = NULL; } + /* create small border */ + if (!accessibility) + xfsm_window_add_border (GTK_WINDOW (dialog)); + /* center dialog on target monitor */ xfsm_center_window_on_screen (GTK_WINDOW (dialog), screen, monitor); + if (!accessibility) + { + gdk_x11_grab_server (); + + show_fadeout_windows (); + } + /* need to realize the dialog first! */ - gtk_widget_show_now(dialog); + gtk_widget_show_now (dialog); /* Grab Keyboard and Mouse pointer */ if (!accessibility) { - gdk_pointer_grab(dialog->window, TRUE, 0, NULL, NULL, GDK_CURRENT_TIME); - gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME); - XSetInputFocus(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(dialog->window), - RevertToNone, CurrentTime); + gdk_pointer_grab (dialog->window, TRUE, 0, NULL, NULL, GDK_CURRENT_TIME); + gdk_keyboard_grab (dialog->window, FALSE, GDK_CURRENT_TIME); + XSetInputFocus (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (dialog->window), + RevertToParent, CurrentTime); } - /* create small border */ - { - GtkWidget *box1, *box2; - - box1 = gtk_event_box_new (); - gtk_widget_modify_bg (box1, GTK_STATE_NORMAL, - &(box1->style->bg [GTK_STATE_SELECTED])); - gtk_widget_show (box1); - - box2 = gtk_event_box_new (); - gtk_widget_show (box2); - gtk_container_add (GTK_CONTAINER (box1), box2); - - gtk_container_set_border_width (GTK_CONTAINER (box2), 3); - gtk_widget_reparent (GTK_BIN (dialog)->child, box2); - - gtk_container_add (GTK_CONTAINER (dialog), box1); - } - /* run the logout dialog */ - result = gtk_dialog_run(GTK_DIALOG(dialog)); + result = gtk_dialog_run (GTK_DIALOG(dialog)); if (result == GTK_RESPONSE_OK) { *saveSession = autosave || gtk_toggle_button_get_active( @@ -383,18 +334,17 @@ shutdownDialog(gint *shutdownType, gboolean *saveSession) } gtk_widget_destroy(dialog); + gtk_widget_destroy(hidden); /* Release Keyboard/Mouse pointer grab */ if (!accessibility) { - gdk_x11_ungrab_server (); - - gdk_keyboard_ungrab(GDK_CURRENT_TIME); - gdk_pointer_ungrab(GDK_CURRENT_TIME); - hide_fadeout_windows (); - gdk_flush(); + gdk_x11_ungrab_server (); + gdk_pointer_ungrab (GDK_CURRENT_TIME); + gdk_keyboard_ungrab (GDK_CURRENT_TIME); + gdk_flush (); } /* @@ -410,70 +360,14 @@ shutdownDialog(gint *shutdownType, gboolean *saveSession) { xfce_rc_write_entry (rc, "SessionName", session_name); xfce_rc_write_bool_entry (rc, "SaveOnExit", *saveSession); - xfce_rc_close (rc); - - return TRUE; } - return FALSE; -} - + xfce_rc_close (rc); -#if 0 -static void -display_shutdown_text_for_monitor (GdkScreen *screen, int monitor) -{ - PangoContext *context; - PangoLayout *layout; - GdkRectangle area; - GdkWindow *root; - int tw, th; - GdkGC *gc; - - root = gdk_screen_get_root_window (screen); - gdk_screen_get_monitor_geometry (screen, monitor, &area); - - context = gdk_pango_context_get_for_screen (screen); - layout = pango_layout_new (context); - pango_layout_set_markup (layout, "<span face=\"Sans\" size=\"x-large\">" - "Shutting down, please wait...</span>", -1); - pango_layout_get_pixel_size (layout, &tw, &th); - - gc = gdk_gc_new (GDK_DRAWABLE (root)); - gdk_gc_set_function (gc, GDK_COPY); - gdk_gc_set_subwindow (gc, TRUE); - - gdk_draw_layout (GDK_DRAWABLE (root), gc, - area.x + (area.width - tw) / 2, - area.y + (area.height - th) / 2, - layout); - - g_object_unref (G_OBJECT (gc)); - g_object_unref (G_OBJECT (layout)); + return (result == GTK_RESPONSE_OK); } -static void -display_shutdown_text (void) -{ - GdkDisplay *display; - GdkScreen *screen; - int n, m; - - display = gdk_display_get_default (); - - for (n = 0; n < gdk_display_get_n_screens (display); ++n) - { - screen = gdk_display_get_screen (display, n); - - for (m = 0; m < gdk_screen_get_n_monitors (screen); ++m) - display_shutdown_text_for_monitor (screen, m); - } - - gdk_flush (); -} -#endif - /* */ gint @@ -502,8 +396,6 @@ shutdown(gint type) return(EXIT_SUCCESS); } -/* display_shutdown_text ();*/ - again: if (!g_spawn_command_line_sync(command, NULL, &buf, &status, &error)) { if (fallback != NULL) @@ -531,7 +423,7 @@ again: return(EXIT_SUCCESS); try_fallback: - // try using fallback command + /* try using fallback command */ g_free(command); command = fallback; fallback = NULL; diff --git a/xfce4-session/shutdown.h b/xfce4-session/shutdown.h index 4eeacb7b..ed083bfc 100644 --- a/xfce4-session/shutdown.h +++ b/xfce4-session/shutdown.h @@ -1,28 +1,22 @@ /* $Id$ */ /*- - * Copyright (c) 2003,2004 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_SHUTDOWN_H__ diff --git a/xfce4-session/sm-layer.c b/xfce4-session/sm-layer.c index a49ede3b..6fd7f825 100644 --- a/xfce4-session/sm-layer.c +++ b/xfce4-session/sm-layer.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H diff --git a/xfce4-session/sm-layer.h b/xfce4-session/sm-layer.h index 4af82236..35b3b6e5 100644 --- a/xfce4-session/sm-layer.h +++ b/xfce4-session/sm-layer.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __SM_LAYER_H__ diff --git a/xfce4-session/xfce_trayicon.c b/xfce4-session/xfce_trayicon.c index 22ccf6c5..fab0dbfd 100644 --- a/xfce4-session/xfce_trayicon.c +++ b/xfce4-session/xfce_trayicon.c @@ -3,26 +3,20 @@ * Copyright (c) 2003,2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H diff --git a/xfce4-session/xfce_trayicon.h b/xfce4-session/xfce_trayicon.h index 4e522349..8fb46f46 100644 --- a/xfce4-session/xfce_trayicon.h +++ b/xfce4-session/xfce_trayicon.h @@ -1,28 +1,22 @@ /* $Id$ */ /*- - * Copyright (c) 2003,2004 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ /* diff --git a/xfce4-session/xfsm-chooser.c b/xfce4-session/xfsm-chooser.c index e20379fc..ffb671e7 100644 --- a/xfce4-session/xfsm-chooser.c +++ b/xfce4-session/xfsm-chooser.c @@ -3,26 +3,20 @@ * Copyright (c) 2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H diff --git a/xfce4-session/xfsm-chooser.h b/xfce4-session/xfsm-chooser.h index 6786f70d..6f70b896 100644 --- a/xfce4-session/xfsm-chooser.h +++ b/xfce4-session/xfsm-chooser.h @@ -3,26 +3,20 @@ * Copyright (c) 2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_CHOOSER_H__ diff --git a/xfce4-session/xfsm-client.c b/xfce4-session/xfsm-client.c index bb20aeeb..26b82fff 100644 --- a/xfce4-session/xfsm-client.c +++ b/xfce4-session/xfsm-client.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -55,8 +49,6 @@ xfsm_client_free (XfsmClient *client) xfsm_properties_free (client->properties); if (client->save_timeout_id > 0) g_source_remove (client->save_timeout_id); - if (client->old_discard_command != NULL) - g_strfreev (client->old_discard_command); g_free (client); } @@ -75,6 +67,7 @@ xfsm_client_set_initial_properties (XfsmClient *client, } +#if 0 void xfsm_client_remember_discard_command (XfsmClient *client) { @@ -119,5 +112,6 @@ xfsm_client_maybe_run_old_discard_command (XfsmClient *client) client->old_discard_command = NULL; } } +#endif diff --git a/xfce4-session/xfsm-client.h b/xfce4-session/xfsm-client.h index 1bce14dd..dc71a79d 100644 --- a/xfce4-session/xfsm-client.h +++ b/xfce4-session/xfsm-client.h @@ -1,5 +1,22 @@ /* $Id$ */ /*- + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_CLIENT_H__ @@ -29,7 +46,6 @@ struct _XfsmClient XfsmProperties *properties; SmsConn sms_conn; guint save_timeout_id; - gchar **old_discard_command; }; @@ -43,8 +59,4 @@ void xfsm_client_free (XfsmClient *client); void xfsm_client_set_initial_properties (XfsmClient *client, XfsmProperties *properties); -void xfsm_client_remember_discard_command (XfsmClient *client); - -void xfsm_client_maybe_run_old_discard_command (XfsmClient *client); - #endif /* !__XFSM_CLIENT_H__ */ diff --git a/xfce4-session/xfsm-global.c b/xfce4-session/xfsm-global.c index 06358556..35a0a9c2 100644 --- a/xfce4-session/xfsm-global.c +++ b/xfce4-session/xfsm-global.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H diff --git a/xfce4-session/xfsm-global.h b/xfce4-session/xfsm-global.h index 795aa17f..feb7aea5 100644 --- a/xfce4-session/xfsm-global.h +++ b/xfce4-session/xfsm-global.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_GLOBAL_H__ diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c index e0deef0c..b6230fb7 100644 --- a/xfce4-session/xfsm-manager.c +++ b/xfce4-session/xfsm-manager.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -630,7 +624,6 @@ xfsm_manager_save_yourself (XfsmClient *client, client->save_timeout_id = g_timeout_add (SAVE_TIMEOUT, xfsm_manager_save_timeout, client); - xfsm_client_remember_discard_command (client); } else { @@ -655,7 +648,6 @@ xfsm_manager_save_yourself (XfsmClient *client, client->save_timeout_id = g_timeout_add (SAVE_TIMEOUT, xfsm_manager_save_timeout, client); - xfsm_client_remember_discard_command (client); } } else @@ -708,9 +700,6 @@ xfsm_manager_save_yourself_done (XfsmClient *client, g_source_remove (client->save_timeout_id); client->save_timeout_id = 0; - /* run old discard command if necessary */ - xfsm_client_maybe_run_old_discard_command (client); - if (client->state == XFSM_CLIENT_SAVINGLOCAL) { /* client completed local SaveYourself */ diff --git a/xfce4-session/xfsm-manager.h b/xfce4-session/xfsm-manager.h index cb4f84f0..528cd477 100644 --- a/xfce4-session/xfsm-manager.h +++ b/xfce4-session/xfsm-manager.h @@ -1,5 +1,22 @@ /* $Id$ */ /*- + * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_MANAGER_H__ diff --git a/xfce4-session/xfsm-properties.c b/xfce4-session/xfsm-properties.c index 3d448ddd..6d3709c0 100644 --- a/xfce4-session/xfsm-properties.c +++ b/xfce4-session/xfsm-properties.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -39,7 +33,9 @@ #include <stdlib.h> #endif +#include <xfce4-session/xfsm-global.h> #include <xfce4-session/xfsm-properties.h> +#include <xfce4-session/xfsm-util.h> /* local prototypes */ @@ -50,6 +46,8 @@ static SmProp* str_to_property (const gchar *name, static SmProp* int_to_property (const gchar *name, gint value) G_GNUC_PURE; static gchar** property_to_strv (const SmProp *prop) G_GNUC_PURE; +static void xfsm_properties_replace_discard_command (XfsmProperties *properties, + gchar **new_discard); #ifndef HAVE_STRDUP @@ -171,6 +169,35 @@ property_to_strv (const SmProp *prop) } +static void +xfsm_properties_replace_discard_command (XfsmProperties *properties, + gchar **new_discard) +{ + gchar **old_discard = properties->discard_command; + + if (old_discard != NULL) + { + if (!xfsm_strv_equal (old_discard, new_discard)) + { + xfsm_verbose ("Client Id = %s, running old discard command.\n\n", + properties->client_id); + + g_spawn_sync (properties->current_directory, + old_discard, + properties->environment, + G_SPAWN_SEARCH_PATH, + NULL, NULL, + NULL, NULL, + NULL, NULL); + } + + g_strfreev (old_discard); + } + + properties->discard_command = new_discard; +} + + XfsmProperties* xfsm_properties_new (const gchar *client_id, const gchar *hostname) @@ -219,6 +246,14 @@ xfsm_properties_delete (XfsmProperties *properties, properties->discard_command = NULL; } } + else if (strcmp (prop_names[n], SmEnvironment) == 0) + { + if (properties->environment != NULL) + { + g_strfreev (properties->environment); + properties->environment = NULL; + } + } else if (strcmp (prop_names[n], GsmPriority) == 0) { properties->priority = 50; @@ -260,6 +295,9 @@ xfsm_properties_extract (XfsmProperties *properties, if (properties->discard_command != NULL) *pp++ = strv_to_property (SmDiscardCommand, properties->discard_command); + if (properties->environment != NULL) + *pp++ = strv_to_property (SmEnvironment, properties->environment); + *pp++ = int_to_property (GsmPriority, properties->priority); if (properties->program != NULL) @@ -321,9 +359,26 @@ xfsm_properties_merge (XfsmProperties *properties, if (strv != NULL) { - if (properties->discard_command != NULL) - g_strfreev (properties->discard_command); - properties->discard_command = strv; + xfsm_properties_replace_discard_command (properties, strv); + } + else + { + g_warning ("Client %s specified property %s of invalid " + "type %s, ignoring.", + properties->client_id, + prop->name, + prop->type); + } + } + else if (strcmp (prop->name, SmEnvironment) == 0) + { + strv = property_to_strv (prop); + + if (strv != NULL) + { + if (properties->environment != NULL) + g_strfreev (properties->environment); + properties->environment = strv; } else { @@ -461,6 +516,8 @@ xfsm_properties_load (XfceRc *rc, NULL); properties->discard_command = xfce_rc_read_list_entry (rc, ENTRY ("DiscardCommand"), NULL); + properties->environment = xfce_rc_read_list_entry (rc, ENTRY ("Environment"), + NULL); properties->restart_command = xfce_rc_read_list_entry (rc, ENTRY ("RestartCommand"), NULL); properties->priority = xfce_rc_read_int_entry (rc, ENTRY ("Priority"), 50); @@ -514,6 +571,12 @@ xfsm_properties_store (XfsmProperties *properties, xfce_rc_write_list_entry (rc, ENTRY ("DiscardCommand"), properties->discard_command, NULL); } + + if (properties->environment != NULL) + { + xfce_rc_write_list_entry (rc, ENTRY ("Environment"), + properties->environment, NULL); + } if (properties->priority != 50) { @@ -584,8 +647,12 @@ xfsm_properties_free (XfsmProperties *properties) g_free (properties->current_directory); if (properties->program != NULL) g_free (properties->program); + if (properties->discard_command != NULL) + g_strfreev (properties->discard_command); if (properties->restart_command != NULL) g_strfreev (properties->restart_command); + if (properties->environment != NULL) + g_strfreev (properties->environment); if (properties->user_id) g_free (properties->user_id); g_free (properties); diff --git a/xfce4-session/xfsm-properties.h b/xfce4-session/xfsm-properties.h index 7c0012c9..62c6e5f0 100644 --- a/xfce4-session/xfsm-properties.h +++ b/xfce4-session/xfsm-properties.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_PROPERTIES_H__ @@ -49,6 +43,7 @@ struct _XfsmProperties gchar **clone_command; gchar *current_directory; gchar **discard_command; + gchar **environment; gint priority; gchar *program; gchar **restart_command; diff --git a/xfce4-session/xfsm-splash-screen.c b/xfce4-session/xfsm-splash-screen.c index f860944a..4bf69a8a 100644 --- a/xfce4-session/xfsm-splash-screen.c +++ b/xfce4-session/xfsm-splash-screen.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -582,6 +576,7 @@ xfsm_splash_screen_choose (XfsmSplashScreen *splash, NULL); xfsm_chooser_set_sessions (chooser, sessions, default_session); + xfsm_window_add_border (GTK_WINDOW (chooser)); gtk_window_set_screen (GTK_WINDOW (chooser), splash->main_screen); xfsm_center_window_on_screen (GTK_WINDOW (chooser), splash->main_screen, diff --git a/xfce4-session/xfsm-splash-screen.h b/xfce4-session/xfsm-splash-screen.h index 961981f2..55208711 100644 --- a/xfce4-session/xfsm-splash-screen.h +++ b/xfce4-session/xfsm-splash-screen.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_SPLASH_SCREEN_H__ diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c index 782b876c..444be6f3 100644 --- a/xfce4-session/xfsm-startup.c +++ b/xfce4-session/xfsm-startup.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H diff --git a/xfce4-session/xfsm-startup.h b/xfce4-session/xfsm-startup.h index 5d927947..fc57fb99 100644 --- a/xfce4-session/xfsm-startup.h +++ b/xfce4-session/xfsm-startup.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_STARTUP_H__ diff --git a/xfce4-session/xfsm-util.c b/xfce4-session/xfsm-util.c index f8eeccba..53e57781 100644 --- a/xfce4-session/xfsm-util.c +++ b/xfce4-session/xfsm-util.c @@ -1,50 +1,26 @@ /* $Id$ */ /*- * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2004 Jasper Huijsmans <jasper@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* gsm-multiscreen.c - * - * Copyright (C) 2002 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Mark McLoughlin <mark@skynet.ie> + * Parts of this file where taken from gnome-session/gsm-multiscreen.c, + * which was written by Mark McLoughlin <mark@skynet.ie>. */ #ifdef HAVE_CONFIG_H @@ -335,3 +311,24 @@ xfsm_strv_equal (gchar **a, gchar **b) return (*a == NULL && *b == NULL); } + +void +xfsm_window_add_border (GtkWindow *window) +{ + GtkWidget *box1, *box2; + + box1 = gtk_event_box_new (); + gtk_widget_modify_bg (box1, GTK_STATE_NORMAL, + &(box1->style->bg [GTK_STATE_SELECTED])); + gtk_widget_show (box1); + + box2 = gtk_event_box_new (); + gtk_widget_show (box2); + gtk_container_add (GTK_CONTAINER (box1), box2); + + gtk_container_set_border_width (GTK_CONTAINER (box2), 3); + gtk_widget_reparent (GTK_BIN (window)->child, box2); + + gtk_container_add (GTK_CONTAINER (window), box1); +} + diff --git a/xfce4-session/xfsm-util.h b/xfce4-session/xfsm-util.h index 8be35134..f3ff571d 100644 --- a/xfce4-session/xfsm-util.h +++ b/xfce4-session/xfsm-util.h @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifndef __XFSM_UTIL_H__ @@ -57,6 +51,8 @@ gchar **xfsm_strv_copy (gchar **v); gboolean xfsm_strv_equal (gchar **a, gchar **b); +void xfsm_window_add_border (GtkWindow *window); + G_END_DECLS; #endif /* !__XFSM_UTIL_H__ */ diff --git a/xfce4-shutdown/main.c b/xfce4-shutdown/main.c index 8b02a94c..59f78a17 100644 --- a/xfce4-shutdown/main.c +++ b/xfce4-shutdown/main.c @@ -3,26 +3,20 @@ * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org> * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -111,10 +105,11 @@ sudo(const gchar *action) { gboolean result; gchar *command; -/* gchar *errbuf;*/ -/* gchar *outbuf;*/ + gchar **argv; + gchar **envp; GError *err; gint status; + gint argc; again: err = NULL; @@ -128,30 +123,38 @@ again: #else command = g_strdup_printf("sudo -S -u root /sbin/%s", action); #endif -#if 0 - result = g_spawn_command_line_sync(command, &outbuf, &errbuf, &status, &err); -#else - /* XXX - replace with g_spawn_sync using /dev/null for the fds */ - close (STDIN_FILENO); - close (STDOUT_FILENO); - close (STDERR_FILENO); - result = (system (command) == 0); -#endif + + result = g_shell_parse_argv (command, &argc, &argv, &err); + + if (result) + { + envp = g_new0 (gchar *, 1); + + result = g_spawn_sync (NULL, argv, envp, + G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, NULL, NULL, NULL, &status, &err); + + g_strfreev (envp); + g_strfreev (argv); + } + g_free(command); - if (!result) { -/* g_error_free(err);*/ + if (!result) + { + g_error_free (err); - if (strcmp (action, "poweroff") == 0) - { - action = "halt"; - goto again; - } + if (strcmp (action, "poweroff") == 0) + { + action = "halt"; + goto again; + } - return(FALSE); - } + return FALSE; + } - return(WIFEXITED(status) && WEXITSTATUS(status) == 0); + return (WIFEXITED (status) && WEXITSTATUS (status) == 0); } #ifdef HAVE_SIGPROCMASK @@ -200,6 +203,9 @@ main(int argc, char **argv) block_signals (); #endif + /* XXX - get rid of the shutdown.allow and replace it w/ something + * more convenient! + */ if (geteuid() == 0) { if (stat(PATH_SHUTDOWNALLOW, &sb) < 0) { fprintf(stderr, "Unable to stat file %s: %s\n", |