From e68a56ec71508e26d41a0a1ddad10f52593dd217 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Mon, 23 Oct 2006 19:33:47 +0000 Subject: [PATCH 001/105] Initialize branch FC-6 for xchat-gnome --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..d5b6362 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +FC-6 From f4366a5940ea7c7cbc80455d4104f888324defee Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Fri, 27 Oct 2006 13:50:34 +0000 Subject: [PATCH 002/105] - Update to 0.14. - Remove xchat-gnome-remote. - Drop X-Fedora desktop category. - Use disable-schemas-install & disable-static with configure. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-config.patch | 52 ++++++++++++++++------------------------ xchat-gnome.spec | 31 +++++++++++------------- 4 files changed, 36 insertions(+), 51 deletions(-) diff --git a/.cvsignore b/.cvsignore index 28b7725..9beabf6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.13.tar.bz2 +xchat-gnome-0.14.tar.bz2 diff --git a/sources b/sources index 05dc245..b041b1b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5614773724afa0c2e617615722e10091 xchat-gnome-0.13.tar.bz2 +8686d5328541404415df486fa115eb6d xchat-gnome-0.14.tar.bz2 diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch index 7594470..472244f 100644 --- a/xchat-gnome-config.patch +++ b/xchat-gnome-config.patch @@ -1,30 +1,6 @@ -diff -ur xchat-gnome-0.13.OLD/plugins/perl/perl.c xchat-gnome-0.13/plugins/perl/perl.c ---- xchat-gnome-0.13.OLD/plugins/perl/perl.c 2006-05-01 11:31:57.000000000 -0400 -+++ xchat-gnome-0.13/plugins/perl/perl.c 2006-07-26 10:47:56.000000000 -0400 -@@ -93,7 +93,7 @@ - if (!xdir) /* xchatdirfs is new for 2.0.9, will fail on older */ - xdir = xchat_get_info (ph, "xchatdir"); - -- /* autoload from ~/.xchat2/ or ${APPDATA}\X-Chat 2\ on win32 */ -+ /* autoload from ~/.xchat-gnome/ or ${APPDATA}\X-Chat 2\ on win32 */ - perl_auto_load_from_path (xdir); - - #ifdef WIN32 -diff -ur xchat-gnome-0.13.OLD/plugins/python/python.c xchat-gnome-0.13/plugins/python/python.c ---- xchat-gnome-0.13.OLD/plugins/python/python.c 2005-11-26 02:10:29.000000000 -0500 -+++ xchat-gnome-0.13/plugins/python/python.c 2006-07-26 10:47:32.000000000 -0400 -@@ -392,7 +392,7 @@ - return expanded; - g_free(expanded); - -- /* Check if ~/.xchat2/ exists. */ -+ /* Check if ~/.xchat-gnome/ exists. */ - expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), - filename, NULL); - if (g_file_test(expanded, G_FILE_TEST_EXISTS)) -diff -ur xchat-gnome-0.13.OLD/src/common/cfgfiles.c xchat-gnome-0.13/src/common/cfgfiles.c ---- xchat-gnome-0.13.OLD/src/common/cfgfiles.c 2006-06-17 21:11:18.000000000 -0400 -+++ xchat-gnome-0.13/src/common/cfgfiles.c 2006-07-26 10:46:12.000000000 -0400 +diff -ur xchat-gnome-0.14.OLD/src/common/cfgfiles.c xchat-gnome-0.14/src/common/cfgfiles.c +--- xchat-gnome-0.14.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 ++++ xchat-gnome-0.14/src/common/cfgfiles.c 2006-10-26 18:59:21.000000000 -0400 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -43,10 +19,22 @@ diff -ur xchat-gnome-0.13.OLD/src/common/cfgfiles.c xchat-gnome-0.13/src/common/ } } -diff -ur xchat-gnome-0.13.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.13/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.13.OLD/src/fe-gnome/preferences-page-plugins.c 2006-04-17 18:15:14.000000000 -0400 -+++ xchat-gnome-0.13/src/fe-gnome/preferences-page-plugins.c 2006-07-26 10:47:06.000000000 -0400 -@@ -182,7 +182,7 @@ +diff -ur xchat-gnome-0.14.OLD/src/common/fe.h xchat-gnome-0.14/src/common/fe.h +--- xchat-gnome-0.14.OLD/src/common/fe.h 2006-10-11 20:31:48.000000000 -0400 ++++ xchat-gnome-0.14/src/common/fe.h 2006-10-26 18:59:00.000000000 -0400 +@@ -100,7 +100,7 @@ + void fe_get_int (char *prompt, int def, void *callback, void *ud); + #define FRF_WRITE 1 /* save file */ + #define FRF_MULTIPLE 2 /* multi-select */ +-#define FRF_ADDFOLDER 4 /* add ~/.xchat2 to favourites */ ++#define FRF_ADDFOLDER 4 /* add ~/.xchat-gnome to favourites */ + #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ + #define FRF_FILTERISINITIAL 16 /* unused */ + #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ +diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-13 00:09:17.000000000 -0400 ++++ xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c 2006-10-26 18:59:45.000000000 -0400 +@@ -184,7 +184,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); homedir = g_get_home_dir(); @@ -55,7 +43,7 @@ diff -ur xchat-gnome-0.13.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -346,7 +346,7 @@ +@@ -347,7 +347,7 @@ #endif homedir = g_get_home_dir (); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f304a52..d385fd9 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,9 +1,8 @@ -%define with_dbus 1 %define with_libnotify 1 Name: xchat-gnome -Version: 0.13 -Release: 4%{?dist} +Version: 0.14 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -22,10 +21,7 @@ BuildRequires: scrollkeeper BuildRequires: gettext BuildRequires: perl(XML::Parser) BuildRequires: gnome-doc-utils - -%if %{with_dbus} BuildRequires: dbus-devel -%endif # Leave as conditional until API is more stable. %if %{with_libnotify} @@ -56,22 +52,18 @@ common settings will be included in the main user interface. . %build -%configure --disable-tcl --disable-scrollkeeper +%configure --disable-tcl --disable-scrollkeeper --disable-schemas-install --disable-static make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 make install DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} -unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL - -rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.{l,}a +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' desktop-file-install --vendor fedora --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ - --add-category X-Fedora \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop @@ -92,7 +84,7 @@ fi %post export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` -SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas xchat_gnome_url_handler.schemas" +SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" for i in $SCHEMAS; do gconftool-2 --makefile-install-rule \ %{_sysconfdir}/gconf/schemas/$i > /dev/null || : @@ -107,7 +99,7 @@ fi %preun if [ "$1" -eq 0 ]; then export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas xchat_gnome_url_handler.schemas" + SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" for i in $SCHEMAS; do gconftool-2 --makefile-uninstall-rule \ %{_sysconfdir}/gconf/schemas/$i > /dev/null || : @@ -134,14 +126,19 @@ fi %{_datadir}/applications/fedora-%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ +%{_datadir}/dbus-1/services/org.gnome.Xchat.service +%{_mandir}/man1/%{name}.1.gz %dir %{_libdir}/%{name} %{_libdir}/%{name}/plugins/ -%if %{with_dbus} -%{_bindir}/%{name}-remote -%endif %changelog +* Thu Oct 26 2006 Brian Pepple - 0.14-1 +- Update to 0.14. +- Remove xchat-gnome-remote. +- Drop X-Fedora desktop category. +- Use disable-schemas-install & disable-static with configure. + * Thu Aug 31 2006 Brian Pepple - 0.13-4 - Add BR for perl(XML::Parser). From 086f08ecaf5b2490b064c2a8bc6e619a01d6415d Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Fri, 27 Oct 2006 14:11:24 +0000 Subject: [PATCH 003/105] - Update to 0.14. - Remove xchat-gnome-remote. - Drop X-Fedora desktop category. - Use disable-schemas-install & disable-static with configure. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-config.patch | 52 ++++++++++++++++------------------------ xchat-gnome.spec | 31 +++++++++++------------- 4 files changed, 36 insertions(+), 51 deletions(-) diff --git a/.cvsignore b/.cvsignore index 28b7725..9beabf6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.13.tar.bz2 +xchat-gnome-0.14.tar.bz2 diff --git a/sources b/sources index 05dc245..b041b1b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5614773724afa0c2e617615722e10091 xchat-gnome-0.13.tar.bz2 +8686d5328541404415df486fa115eb6d xchat-gnome-0.14.tar.bz2 diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch index 7594470..472244f 100644 --- a/xchat-gnome-config.patch +++ b/xchat-gnome-config.patch @@ -1,30 +1,6 @@ -diff -ur xchat-gnome-0.13.OLD/plugins/perl/perl.c xchat-gnome-0.13/plugins/perl/perl.c ---- xchat-gnome-0.13.OLD/plugins/perl/perl.c 2006-05-01 11:31:57.000000000 -0400 -+++ xchat-gnome-0.13/plugins/perl/perl.c 2006-07-26 10:47:56.000000000 -0400 -@@ -93,7 +93,7 @@ - if (!xdir) /* xchatdirfs is new for 2.0.9, will fail on older */ - xdir = xchat_get_info (ph, "xchatdir"); - -- /* autoload from ~/.xchat2/ or ${APPDATA}\X-Chat 2\ on win32 */ -+ /* autoload from ~/.xchat-gnome/ or ${APPDATA}\X-Chat 2\ on win32 */ - perl_auto_load_from_path (xdir); - - #ifdef WIN32 -diff -ur xchat-gnome-0.13.OLD/plugins/python/python.c xchat-gnome-0.13/plugins/python/python.c ---- xchat-gnome-0.13.OLD/plugins/python/python.c 2005-11-26 02:10:29.000000000 -0500 -+++ xchat-gnome-0.13/plugins/python/python.c 2006-07-26 10:47:32.000000000 -0400 -@@ -392,7 +392,7 @@ - return expanded; - g_free(expanded); - -- /* Check if ~/.xchat2/ exists. */ -+ /* Check if ~/.xchat-gnome/ exists. */ - expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), - filename, NULL); - if (g_file_test(expanded, G_FILE_TEST_EXISTS)) -diff -ur xchat-gnome-0.13.OLD/src/common/cfgfiles.c xchat-gnome-0.13/src/common/cfgfiles.c ---- xchat-gnome-0.13.OLD/src/common/cfgfiles.c 2006-06-17 21:11:18.000000000 -0400 -+++ xchat-gnome-0.13/src/common/cfgfiles.c 2006-07-26 10:46:12.000000000 -0400 +diff -ur xchat-gnome-0.14.OLD/src/common/cfgfiles.c xchat-gnome-0.14/src/common/cfgfiles.c +--- xchat-gnome-0.14.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 ++++ xchat-gnome-0.14/src/common/cfgfiles.c 2006-10-26 18:59:21.000000000 -0400 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -43,10 +19,22 @@ diff -ur xchat-gnome-0.13.OLD/src/common/cfgfiles.c xchat-gnome-0.13/src/common/ } } -diff -ur xchat-gnome-0.13.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.13/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.13.OLD/src/fe-gnome/preferences-page-plugins.c 2006-04-17 18:15:14.000000000 -0400 -+++ xchat-gnome-0.13/src/fe-gnome/preferences-page-plugins.c 2006-07-26 10:47:06.000000000 -0400 -@@ -182,7 +182,7 @@ +diff -ur xchat-gnome-0.14.OLD/src/common/fe.h xchat-gnome-0.14/src/common/fe.h +--- xchat-gnome-0.14.OLD/src/common/fe.h 2006-10-11 20:31:48.000000000 -0400 ++++ xchat-gnome-0.14/src/common/fe.h 2006-10-26 18:59:00.000000000 -0400 +@@ -100,7 +100,7 @@ + void fe_get_int (char *prompt, int def, void *callback, void *ud); + #define FRF_WRITE 1 /* save file */ + #define FRF_MULTIPLE 2 /* multi-select */ +-#define FRF_ADDFOLDER 4 /* add ~/.xchat2 to favourites */ ++#define FRF_ADDFOLDER 4 /* add ~/.xchat-gnome to favourites */ + #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ + #define FRF_FILTERISINITIAL 16 /* unused */ + #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ +diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-13 00:09:17.000000000 -0400 ++++ xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c 2006-10-26 18:59:45.000000000 -0400 +@@ -184,7 +184,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); homedir = g_get_home_dir(); @@ -55,7 +43,7 @@ diff -ur xchat-gnome-0.13.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -346,7 +346,7 @@ +@@ -347,7 +347,7 @@ #endif homedir = g_get_home_dir (); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f304a52..d385fd9 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,9 +1,8 @@ -%define with_dbus 1 %define with_libnotify 1 Name: xchat-gnome -Version: 0.13 -Release: 4%{?dist} +Version: 0.14 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -22,10 +21,7 @@ BuildRequires: scrollkeeper BuildRequires: gettext BuildRequires: perl(XML::Parser) BuildRequires: gnome-doc-utils - -%if %{with_dbus} BuildRequires: dbus-devel -%endif # Leave as conditional until API is more stable. %if %{with_libnotify} @@ -56,22 +52,18 @@ common settings will be included in the main user interface. . %build -%configure --disable-tcl --disable-scrollkeeper +%configure --disable-tcl --disable-scrollkeeper --disable-schemas-install --disable-static make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 make install DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} -unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL - -rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.{l,}a +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' desktop-file-install --vendor fedora --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ - --add-category X-Fedora \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop @@ -92,7 +84,7 @@ fi %post export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` -SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas xchat_gnome_url_handler.schemas" +SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" for i in $SCHEMAS; do gconftool-2 --makefile-install-rule \ %{_sysconfdir}/gconf/schemas/$i > /dev/null || : @@ -107,7 +99,7 @@ fi %preun if [ "$1" -eq 0 ]; then export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas xchat_gnome_url_handler.schemas" + SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" for i in $SCHEMAS; do gconftool-2 --makefile-uninstall-rule \ %{_sysconfdir}/gconf/schemas/$i > /dev/null || : @@ -134,14 +126,19 @@ fi %{_datadir}/applications/fedora-%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ +%{_datadir}/dbus-1/services/org.gnome.Xchat.service +%{_mandir}/man1/%{name}.1.gz %dir %{_libdir}/%{name} %{_libdir}/%{name}/plugins/ -%if %{with_dbus} -%{_bindir}/%{name}-remote -%endif %changelog +* Thu Oct 26 2006 Brian Pepple - 0.14-1 +- Update to 0.14. +- Remove xchat-gnome-remote. +- Drop X-Fedora desktop category. +- Use disable-schemas-install & disable-static with configure. + * Thu Aug 31 2006 Brian Pepple - 0.13-4 - Add BR for perl(XML::Parser). From d4328dbf9a65b87dd6557f03acee478ea548c7bf Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 29 Oct 2006 14:44:00 +0000 Subject: [PATCH 004/105] - Update to 0.15. - Add new icons. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-config.patch | 30 +++++++++++------------------- xchat-gnome.spec | 12 ++++++++++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.cvsignore b/.cvsignore index 9beabf6..d5e8f25 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.14.tar.bz2 +xchat-gnome-0.15.tar.bz2 diff --git a/sources b/sources index b041b1b..ff44289 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8686d5328541404415df486fa115eb6d xchat-gnome-0.14.tar.bz2 +a0f1f011e594d85a5a5781cfc5f52221 xchat-gnome-0.15.tar.bz2 diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch index 472244f..1fdab2d 100644 --- a/xchat-gnome-config.patch +++ b/xchat-gnome-config.patch @@ -1,6 +1,7 @@ -diff -ur xchat-gnome-0.14.OLD/src/common/cfgfiles.c xchat-gnome-0.14/src/common/cfgfiles.c ---- xchat-gnome-0.14.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 -+++ xchat-gnome-0.14/src/common/cfgfiles.c 2006-10-26 18:59:21.000000000 -0400 +Only in xchat-gnome-0.15/plugins/python: #python.c# +diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/cfgfiles.c +--- xchat-gnome-0.15.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 ++++ xchat-gnome-0.15/src/common/cfgfiles.c 2006-10-29 00:12:49.000000000 -0400 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -19,21 +20,11 @@ diff -ur xchat-gnome-0.14.OLD/src/common/cfgfiles.c xchat-gnome-0.14/src/common/ } } -diff -ur xchat-gnome-0.14.OLD/src/common/fe.h xchat-gnome-0.14/src/common/fe.h ---- xchat-gnome-0.14.OLD/src/common/fe.h 2006-10-11 20:31:48.000000000 -0400 -+++ xchat-gnome-0.14/src/common/fe.h 2006-10-26 18:59:00.000000000 -0400 -@@ -100,7 +100,7 @@ - void fe_get_int (char *prompt, int def, void *callback, void *ud); - #define FRF_WRITE 1 /* save file */ - #define FRF_MULTIPLE 2 /* multi-select */ --#define FRF_ADDFOLDER 4 /* add ~/.xchat2 to favourites */ -+#define FRF_ADDFOLDER 4 /* add ~/.xchat-gnome to favourites */ - #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ - #define FRF_FILTERISINITIAL 16 /* unused */ - #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ -diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-13 00:09:17.000000000 -0400 -+++ xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c 2006-10-26 18:59:45.000000000 -0400 +Only in xchat-gnome-0.15/src/common: cfgfiles.c~ +Only in xchat-gnome-0.15/src/common: #fe.h# +diff -ur xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-28 01:48:21.000000000 -0400 ++++ xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c 2006-10-29 00:13:17.000000000 -0400 @@ -184,7 +184,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); @@ -43,7 +34,7 @@ diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -347,7 +347,7 @@ +@@ -346,7 +346,7 @@ #endif homedir = g_get_home_dir (); @@ -52,3 +43,4 @@ diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom pageref = page; for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); +Only in xchat-gnome-0.15/src/fe-gnome: preferences-page-plugins.c~ diff --git a/xchat-gnome.spec b/xchat-gnome.spec index d385fd9..a5068b5 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,7 +1,7 @@ %define with_libnotify 1 Name: xchat-gnome -Version: 0.14 +Version: 0.15 Release: 1%{?dist} Summary: GNOME front-end to xchat @@ -74,7 +74,7 @@ rm -rf $RPM_BUILD_ROOT %pre if [ "$1" -gt 1 ]; then export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas xchat_gnome_url_handler.schemas" + SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" for i in $SCHEMAS; do gconftool-2 --makefile-uninstall-rule \ %{_sysconfdir}/gconf/schemas/$i >/dev/null || : @@ -122,7 +122,11 @@ fi %{_bindir}/%{name} %{_sysconfdir}/gconf/schemas/*.schemas %{_datadir}/%{name}/ +%{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png +%{_datadir}/icons/hicolor/22x22/apps/%{name}-*.png +%{_datadir}/icons/hicolor/16x16/apps/%{name}-*.png +%{_datadir}/icons/hicolor/scalable/apps/%{name}-plugin.svg %{_datadir}/applications/fedora-%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ @@ -133,6 +137,10 @@ fi %changelog +* Sun Oct 29 2006 Brian Pepple - 0.15-1 +- Update to 0.15. +- Add new icons. + * Thu Oct 26 2006 Brian Pepple - 0.14-1 - Update to 0.14. - Remove xchat-gnome-remote. From a8b731612d6f3d3ff9d954c18cd408e1faf5295e Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 29 Oct 2006 17:56:44 +0000 Subject: [PATCH 005/105] - Update to 0.15. - Add new icons. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-config.patch | 30 +++++++++++------------------- xchat-gnome.spec | 12 ++++++++++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.cvsignore b/.cvsignore index 9beabf6..d5e8f25 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.14.tar.bz2 +xchat-gnome-0.15.tar.bz2 diff --git a/sources b/sources index b041b1b..ff44289 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8686d5328541404415df486fa115eb6d xchat-gnome-0.14.tar.bz2 +a0f1f011e594d85a5a5781cfc5f52221 xchat-gnome-0.15.tar.bz2 diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch index 472244f..1fdab2d 100644 --- a/xchat-gnome-config.patch +++ b/xchat-gnome-config.patch @@ -1,6 +1,7 @@ -diff -ur xchat-gnome-0.14.OLD/src/common/cfgfiles.c xchat-gnome-0.14/src/common/cfgfiles.c ---- xchat-gnome-0.14.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 -+++ xchat-gnome-0.14/src/common/cfgfiles.c 2006-10-26 18:59:21.000000000 -0400 +Only in xchat-gnome-0.15/plugins/python: #python.c# +diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/cfgfiles.c +--- xchat-gnome-0.15.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 ++++ xchat-gnome-0.15/src/common/cfgfiles.c 2006-10-29 00:12:49.000000000 -0400 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -19,21 +20,11 @@ diff -ur xchat-gnome-0.14.OLD/src/common/cfgfiles.c xchat-gnome-0.14/src/common/ } } -diff -ur xchat-gnome-0.14.OLD/src/common/fe.h xchat-gnome-0.14/src/common/fe.h ---- xchat-gnome-0.14.OLD/src/common/fe.h 2006-10-11 20:31:48.000000000 -0400 -+++ xchat-gnome-0.14/src/common/fe.h 2006-10-26 18:59:00.000000000 -0400 -@@ -100,7 +100,7 @@ - void fe_get_int (char *prompt, int def, void *callback, void *ud); - #define FRF_WRITE 1 /* save file */ - #define FRF_MULTIPLE 2 /* multi-select */ --#define FRF_ADDFOLDER 4 /* add ~/.xchat2 to favourites */ -+#define FRF_ADDFOLDER 4 /* add ~/.xchat-gnome to favourites */ - #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ - #define FRF_FILTERISINITIAL 16 /* unused */ - #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ -diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-13 00:09:17.000000000 -0400 -+++ xchat-gnome-0.14/src/fe-gnome/preferences-page-plugins.c 2006-10-26 18:59:45.000000000 -0400 +Only in xchat-gnome-0.15/src/common: cfgfiles.c~ +Only in xchat-gnome-0.15/src/common: #fe.h# +diff -ur xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-28 01:48:21.000000000 -0400 ++++ xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c 2006-10-29 00:13:17.000000000 -0400 @@ -184,7 +184,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); @@ -43,7 +34,7 @@ diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -347,7 +347,7 @@ +@@ -346,7 +346,7 @@ #endif homedir = g_get_home_dir (); @@ -52,3 +43,4 @@ diff -ur xchat-gnome-0.14.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom pageref = page; for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); +Only in xchat-gnome-0.15/src/fe-gnome: preferences-page-plugins.c~ diff --git a/xchat-gnome.spec b/xchat-gnome.spec index d385fd9..a5068b5 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,7 +1,7 @@ %define with_libnotify 1 Name: xchat-gnome -Version: 0.14 +Version: 0.15 Release: 1%{?dist} Summary: GNOME front-end to xchat @@ -74,7 +74,7 @@ rm -rf $RPM_BUILD_ROOT %pre if [ "$1" -gt 1 ]; then export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas xchat_gnome_url_handler.schemas" + SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" for i in $SCHEMAS; do gconftool-2 --makefile-uninstall-rule \ %{_sysconfdir}/gconf/schemas/$i >/dev/null || : @@ -122,7 +122,11 @@ fi %{_bindir}/%{name} %{_sysconfdir}/gconf/schemas/*.schemas %{_datadir}/%{name}/ +%{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png +%{_datadir}/icons/hicolor/22x22/apps/%{name}-*.png +%{_datadir}/icons/hicolor/16x16/apps/%{name}-*.png +%{_datadir}/icons/hicolor/scalable/apps/%{name}-plugin.svg %{_datadir}/applications/fedora-%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ @@ -133,6 +137,10 @@ fi %changelog +* Sun Oct 29 2006 Brian Pepple - 0.15-1 +- Update to 0.15. +- Add new icons. + * Thu Oct 26 2006 Brian Pepple - 0.14-1 - Update to 0.14. - Remove xchat-gnome-remote. From ab1a213b10d4e5daa69921e395b77c8d2f8819cd Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sat, 9 Dec 2006 00:31:59 +0000 Subject: [PATCH 006/105] - Rebuild for new python. --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a5068b5..77a17ed 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.15 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -137,6 +137,9 @@ fi %changelog +* Fri Dec 8 2006 Brian Pepple - 0.15-2 +- Rebuild for new python. + * Sun Oct 29 2006 Brian Pepple - 0.15-1 - Update to 0.15. - Add new icons. From 0f2a578e518626914226e1fc48248836f3cda6c4 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 10 Jan 2007 20:42:41 +0000 Subject: [PATCH 007/105] - Update to 0.16. - Move themeable app icon to correct directory. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-config.patch | 26 +++++++++++--------------- xchat-gnome.spec | 25 ++++++++++++++++++++----- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.cvsignore b/.cvsignore index d5e8f25..702d66b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.15.tar.bz2 +xchat-gnome-0.16.tar.bz2 diff --git a/sources b/sources index ff44289..7616e88 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a0f1f011e594d85a5a5781cfc5f52221 xchat-gnome-0.15.tar.bz2 +2b2a4f42b9ea8cbcd15e1ad597cc8b33 xchat-gnome-0.16.tar.bz2 diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch index 1fdab2d..01eed5e 100644 --- a/xchat-gnome-config.patch +++ b/xchat-gnome-config.patch @@ -1,7 +1,6 @@ -Only in xchat-gnome-0.15/plugins/python: #python.c# -diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/cfgfiles.c ---- xchat-gnome-0.15.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 -+++ xchat-gnome-0.15/src/common/cfgfiles.c 2006-10-29 00:12:49.000000000 -0400 +diff -ur xchat-gnome-0.16.OLD/src/common/cfgfiles.c xchat-gnome-0.16/src/common/cfgfiles.c +--- xchat-gnome-0.16.OLD/src/common/cfgfiles.c 2006-11-01 03:26:06.000000000 -0500 ++++ xchat-gnome-0.16/src/common/cfgfiles.c 2007-01-10 10:50:45.000000000 -0500 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -11,7 +10,7 @@ diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/ #endif #define DEF_FONT "Monospace 9" -@@ -347,7 +347,7 @@ +@@ -348,7 +348,7 @@ #else if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) #endif @@ -20,12 +19,10 @@ diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/ } } -Only in xchat-gnome-0.15/src/common: cfgfiles.c~ -Only in xchat-gnome-0.15/src/common: #fe.h# -diff -ur xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-28 01:48:21.000000000 -0400 -+++ xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c 2006-10-29 00:13:17.000000000 -0400 -@@ -184,7 +184,7 @@ +diff -ur xchat-gnome-0.16.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.16/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.16.OLD/src/fe-gnome/preferences-page-plugins.c 2007-01-01 03:49:04.000000000 -0500 ++++ xchat-gnome-0.16/src/fe-gnome/preferences-page-plugins.c 2007-01-10 10:52:17.000000000 -0500 +@@ -244,7 +244,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); homedir = g_get_home_dir(); @@ -34,13 +31,12 @@ diff -ur xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -346,7 +346,7 @@ - #endif +@@ -446,7 +446,7 @@ + xchat_plugin *plugin; homedir = g_get_home_dir (); - xchatdir = g_strdup_printf ("%s/.xchat2/plugins", homedir); + xchatdir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); - pageref = page; for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); -Only in xchat-gnome-0.15/src/fe-gnome: preferences-page-plugins.c~ + for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 77a17ed..caf1d80 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,8 +1,8 @@ %define with_libnotify 1 Name: xchat-gnome -Version: 0.15 -Release: 2%{?dist} +Version: 0.16 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -66,6 +66,20 @@ desktop-file-install --vendor fedora --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop +# Place app icons in correct directory. +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/ +cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/%{name}.png \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/ +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/%{name}.png +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/ +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/ +cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps/%{name}.png \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/ +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps/%{name}.png +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/ + %clean rm -rf $RPM_BUILD_ROOT @@ -124,9 +138,6 @@ fi %{_datadir}/%{name}/ %{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png -%{_datadir}/icons/hicolor/22x22/apps/%{name}-*.png -%{_datadir}/icons/hicolor/16x16/apps/%{name}-*.png -%{_datadir}/icons/hicolor/scalable/apps/%{name}-plugin.svg %{_datadir}/applications/fedora-%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ @@ -137,6 +148,10 @@ fi %changelog +* Wed Jan 10 2007 Brian Pepple - 0.16-1 +- Update to 0.16. +- Move themeable app icon to correct directory. + * Fri Dec 8 2006 Brian Pepple - 0.15-2 - Rebuild for new python. From 270abb2aed20c60b696b69b01b25c211380cad09 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 31 Jan 2007 13:08:26 +0000 Subject: [PATCH 008/105] - Drop conditional statement for libnotify. - Remove BR on dbus-devel, since libnotify-devel will pull this in. --- xchat-gnome.spec | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index caf1d80..92b646e 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,8 +1,6 @@ -%define with_libnotify 1 - Name: xchat-gnome Version: 0.16 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -21,12 +19,7 @@ BuildRequires: scrollkeeper BuildRequires: gettext BuildRequires: perl(XML::Parser) BuildRequires: gnome-doc-utils -BuildRequires: dbus-devel - -# Leave as conditional until API is more stable. -%if %{with_libnotify} BuildRequires: libnotify-devel -%endif Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") @@ -148,6 +141,10 @@ fi %changelog +* Tue Jan 16 2007 Brian Pepple - 0.16-2 +- Drop conditional statement for libnotify. +- Remove BR on dbus-devel, since libnotify-devel will pull this in. + * Wed Jan 10 2007 Brian Pepple - 0.16-1 - Update to 0.16. - Move themeable app icon to correct directory. From fef1cdc76ebab76a7eb9983e44a4950ba123b33c Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 31 Jan 2007 13:21:37 +0000 Subject: [PATCH 009/105] - Drop conditional statement for libnotify. - Remove BR on dbus-devel, since libnotify-devel will pull this in. - Move themeable app icon to correct directory. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-config.patch | 26 +++++++++++--------------- xchat-gnome.spec | 31 ++++++++++++++++++++----------- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/.cvsignore b/.cvsignore index d5e8f25..702d66b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.15.tar.bz2 +xchat-gnome-0.16.tar.bz2 diff --git a/sources b/sources index ff44289..7616e88 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a0f1f011e594d85a5a5781cfc5f52221 xchat-gnome-0.15.tar.bz2 +2b2a4f42b9ea8cbcd15e1ad597cc8b33 xchat-gnome-0.16.tar.bz2 diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch index 1fdab2d..01eed5e 100644 --- a/xchat-gnome-config.patch +++ b/xchat-gnome-config.patch @@ -1,7 +1,6 @@ -Only in xchat-gnome-0.15/plugins/python: #python.c# -diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/cfgfiles.c ---- xchat-gnome-0.15.OLD/src/common/cfgfiles.c 2006-10-11 20:31:47.000000000 -0400 -+++ xchat-gnome-0.15/src/common/cfgfiles.c 2006-10-29 00:12:49.000000000 -0400 +diff -ur xchat-gnome-0.16.OLD/src/common/cfgfiles.c xchat-gnome-0.16/src/common/cfgfiles.c +--- xchat-gnome-0.16.OLD/src/common/cfgfiles.c 2006-11-01 03:26:06.000000000 -0500 ++++ xchat-gnome-0.16/src/common/cfgfiles.c 2007-01-10 10:50:45.000000000 -0500 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -11,7 +10,7 @@ diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/ #endif #define DEF_FONT "Monospace 9" -@@ -347,7 +347,7 @@ +@@ -348,7 +348,7 @@ #else if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) #endif @@ -20,12 +19,10 @@ diff -ur xchat-gnome-0.15.OLD/src/common/cfgfiles.c xchat-gnome-0.15/src/common/ } } -Only in xchat-gnome-0.15/src/common: cfgfiles.c~ -Only in xchat-gnome-0.15/src/common: #fe.h# -diff -ur xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c 2006-10-28 01:48:21.000000000 -0400 -+++ xchat-gnome-0.15/src/fe-gnome/preferences-page-plugins.c 2006-10-29 00:13:17.000000000 -0400 -@@ -184,7 +184,7 @@ +diff -ur xchat-gnome-0.16.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.16/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.16.OLD/src/fe-gnome/preferences-page-plugins.c 2007-01-01 03:49:04.000000000 -0500 ++++ xchat-gnome-0.16/src/fe-gnome/preferences-page-plugins.c 2007-01-10 10:52:17.000000000 -0500 +@@ -244,7 +244,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); homedir = g_get_home_dir(); @@ -34,13 +31,12 @@ diff -ur xchat-gnome-0.15.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -346,7 +346,7 @@ - #endif +@@ -446,7 +446,7 @@ + xchat_plugin *plugin; homedir = g_get_home_dir (); - xchatdir = g_strdup_printf ("%s/.xchat2/plugins", homedir); + xchatdir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); - pageref = page; for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); -Only in xchat-gnome-0.15/src/fe-gnome: preferences-page-plugins.c~ + for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a5068b5..c3c31cd 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,7 +1,5 @@ -%define with_libnotify 1 - Name: xchat-gnome -Version: 0.15 +Version: 0.16 Release: 1%{?dist} Summary: GNOME front-end to xchat @@ -21,12 +19,7 @@ BuildRequires: scrollkeeper BuildRequires: gettext BuildRequires: perl(XML::Parser) BuildRequires: gnome-doc-utils -BuildRequires: dbus-devel - -# Leave as conditional until API is more stable. -%if %{with_libnotify} BuildRequires: libnotify-devel -%endif Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") @@ -66,6 +59,20 @@ desktop-file-install --vendor fedora --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop +# Place app icons in correct directory. +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/ +cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/%{name}.png \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/ +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/%{name}.png +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/ +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/ +cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps/%{name}.png \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/ +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps/%{name}.png +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps +rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/ + %clean rm -rf $RPM_BUILD_ROOT @@ -124,9 +131,6 @@ fi %{_datadir}/%{name}/ %{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png -%{_datadir}/icons/hicolor/22x22/apps/%{name}-*.png -%{_datadir}/icons/hicolor/16x16/apps/%{name}-*.png -%{_datadir}/icons/hicolor/scalable/apps/%{name}-plugin.svg %{_datadir}/applications/fedora-%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ @@ -137,6 +141,11 @@ fi %changelog +* Wed Jan 31 2007 Brian Pepple - 0.16-2 +- Drop conditional statement for libnotify. +- Remove BR on dbus-devel, since libnotify-devel will pull this in. +- Move themeable app icon to correct directory. + * Sun Oct 29 2006 Brian Pepple - 0.15-1 - Update to 0.15. - Add new icons. From 7baa5d01a8d31e1757d75200f61544f12f6f14b5 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Mon, 2 Apr 2007 13:34:57 +0000 Subject: [PATCH 010/105] - Update to 0.17 (bugfix release). - Update the config patch. - libsexy-devel to be at least 0.1.11. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome.spec | 27 +++++++++------------------ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.cvsignore b/.cvsignore index 702d66b..7467103 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.16.tar.bz2 +xchat-gnome-0.17.tar.bz2 diff --git a/sources b/sources index 7616e88..9b70c4c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2b2a4f42b9ea8cbcd15e1ad597cc8b33 xchat-gnome-0.16.tar.bz2 +bcb8e97a63c0fda6fcba0f88309ea645 xchat-gnome-0.17.tar.bz2 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 92b646e..81a0d3e 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,17 +1,17 @@ Name: xchat-gnome -Version: 0.16 -Release: 2%{?dist} +Version: 0.17 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet License: GPL URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 -Patch0: %{name}-config.patch +Patch0: %{name}-%{version}-config.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel -Buildrequires: libsexy-devel +Buildrequires: libsexy-devel >= 0.1.11 BuildRequires: libgnomeui-devel BuildRequires: python-devel BuildRequires: desktop-file-utils @@ -59,20 +59,6 @@ desktop-file-install --vendor fedora --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop -# Place app icons in correct directory. -mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/ -cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/%{name}.png \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/ -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/%{name}.png -rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/apps/ -rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/48x48/ -mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/ -cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps/%{name}.png \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/ -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps/%{name}.png -rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/apps -rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/icons/hicolor/128x128/ - %clean rm -rf $RPM_BUILD_ROOT @@ -141,6 +127,11 @@ fi %changelog +* Mon Apr 2 2007 Brian Pepple - 0.17-1 +- Update to 0.17 (bugfix release). +- Update the config patch. +- libsexy-devel to be at least 0.1.11. + * Tue Jan 16 2007 Brian Pepple - 0.16-2 - Drop conditional statement for libnotify. - Remove BR on dbus-devel, since libnotify-devel will pull this in. From 7993857e9e758f3be647f4d0ddd987cd84e84786 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Mon, 2 Apr 2007 13:37:35 +0000 Subject: [PATCH 011/105] - D'Oh! Forgot to add the new config patch. --- xchat-gnome-0.17-config.patch | 78 +++++++++++++++++++++++++++++++++++ xchat-gnome-config.patch | 42 ------------------- xchat-gnome.spec | 5 ++- 3 files changed, 82 insertions(+), 43 deletions(-) create mode 100644 xchat-gnome-0.17-config.patch delete mode 100644 xchat-gnome-config.patch diff --git a/xchat-gnome-0.17-config.patch b/xchat-gnome-0.17-config.patch new file mode 100644 index 0000000..f02abf2 --- /dev/null +++ b/xchat-gnome-0.17-config.patch @@ -0,0 +1,78 @@ +diff -ur xchat-gnome-0.17.OLD/plugins/perl/perl.c xchat-gnome-0.17/plugins/perl/perl.c +--- xchat-gnome-0.17.OLD/plugins/perl/perl.c 2007-03-06 17:47:26.000000000 -0500 ++++ xchat-gnome-0.17/plugins/perl/perl.c 2007-04-02 08:40:39.000000000 -0400 +@@ -92,7 +92,7 @@ + if (!xdir) /* xchatdirfs is new for 2.0.9, will fail on older */ + xdir = xchat_get_info (ph, "xchatdir"); + +- /* autoload from ~/.xchat2/ or ${APPDATA}\X-Chat 2\ on win32 */ ++ /* autoload from ~/.xchat-gnome/ or ${APPDATA}\X-Chat 2\ on win32 */ + perl_auto_load_from_path (xdir); + + #ifdef WIN32 +diff -ur xchat-gnome-0.17.OLD/plugins/python/python.c xchat-gnome-0.17/plugins/python/python.c +--- xchat-gnome-0.17.OLD/plugins/python/python.c 2007-03-06 17:47:26.000000000 -0500 ++++ xchat-gnome-0.17/plugins/python/python.c 2007-04-02 08:41:13.000000000 -0400 +@@ -412,7 +412,7 @@ + return expanded; + g_free(expanded); + +- /* Check if ~/.xchat2/ exists. */ ++ /* Check if ~/.xchat-gnome/ exists. */ + expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), + filename, NULL); + if (g_file_test(expanded, G_FILE_TEST_EXISTS)) +diff -ur xchat-gnome-0.17.OLD/src/common/cfgfiles.c xchat-gnome-0.17/src/common/cfgfiles.c +--- xchat-gnome-0.17.OLD/src/common/cfgfiles.c 2007-03-17 21:40:09.000000000 -0400 ++++ xchat-gnome-0.17/src/common/cfgfiles.c 2007-04-02 08:39:50.000000000 -0400 +@@ -34,7 +34,7 @@ + #ifdef WIN32 + #define XCHAT_DIR "X-Chat 2" + #else +-#define XCHAT_DIR ".xchat2" ++#define XCHAT_DIR ".xchat-gnome" + #endif + #define DEF_FONT "Monospace 9" + +@@ -352,7 +352,7 @@ + #else + if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) + #endif +- fe_message (_("Cannot create ~/.xchat2"), FE_MSG_ERROR); ++ fe_message (_("Cannot create ~/.xchat-gnome"), FE_MSG_ERROR); + } + } + +diff -ur xchat-gnome-0.17.OLD/src/common/fe.h xchat-gnome-0.17/src/common/fe.h +--- xchat-gnome-0.17.OLD/src/common/fe.h 2007-03-06 17:47:37.000000000 -0500 ++++ xchat-gnome-0.17/src/common/fe.h 2007-04-02 08:40:15.000000000 -0400 +@@ -106,7 +106,7 @@ + void fe_get_int (char *prompt, int def, void *callback, void *ud); + #define FRF_WRITE 1 /* save file */ + #define FRF_MULTIPLE 2 /* multi-select */ +-#define FRF_ADDFOLDER 4 /* add ~/.xchat2 to favourites */ ++#define FRF_ADDFOLDER 4 /* add ~/.xchat-gnome to favourites */ + #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ + #define FRF_FILTERISINITIAL 16 /* unused */ + #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ +diff -ur xchat-gnome-0.17.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.17/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.17.OLD/src/fe-gnome/preferences-page-plugins.c 2007-03-31 07:07:34.000000000 -0400 ++++ xchat-gnome-0.17/src/fe-gnome/preferences-page-plugins.c 2007-04-02 08:39:21.000000000 -0400 +@@ -240,7 +240,7 @@ + file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + + homedir = g_get_home_dir(); +- plugindir = g_strdup_printf ("%s/.xchat2/plugins", homedir); ++ plugindir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); + g_free (plugindir); + +@@ -434,7 +434,7 @@ + xchat_plugin *plugin; + + homedir = g_get_home_dir (); +- xchatdir = g_strdup_printf ("%s/.xchat2/plugins", homedir); ++ xchatdir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); + for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); + for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); + for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); diff --git a/xchat-gnome-config.patch b/xchat-gnome-config.patch deleted file mode 100644 index 01eed5e..0000000 --- a/xchat-gnome-config.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -ur xchat-gnome-0.16.OLD/src/common/cfgfiles.c xchat-gnome-0.16/src/common/cfgfiles.c ---- xchat-gnome-0.16.OLD/src/common/cfgfiles.c 2006-11-01 03:26:06.000000000 -0500 -+++ xchat-gnome-0.16/src/common/cfgfiles.c 2007-01-10 10:50:45.000000000 -0500 -@@ -34,7 +34,7 @@ - #ifdef WIN32 - #define XCHAT_DIR "X-Chat 2" - #else --#define XCHAT_DIR ".xchat2" -+#define XCHAT_DIR ".xchat-gnome" - #endif - #define DEF_FONT "Monospace 9" - -@@ -348,7 +348,7 @@ - #else - if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) - #endif -- fe_message (_("Cannot create ~/.xchat2"), FE_MSG_ERROR); -+ fe_message (_("Cannot create ~/.xchat-gnome"), FE_MSG_ERROR); - } - } - -diff -ur xchat-gnome-0.16.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.16/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.16.OLD/src/fe-gnome/preferences-page-plugins.c 2007-01-01 03:49:04.000000000 -0500 -+++ xchat-gnome-0.16/src/fe-gnome/preferences-page-plugins.c 2007-01-10 10:52:17.000000000 -0500 -@@ -244,7 +244,7 @@ - file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); - - homedir = g_get_home_dir(); -- plugindir = g_strdup_printf ("%s/.xchat2/plugins", homedir); -+ plugindir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); - g_free (plugindir); - -@@ -446,7 +446,7 @@ - xchat_plugin *plugin; - - homedir = g_get_home_dir (); -- xchatdir = g_strdup_printf ("%s/.xchat2/plugins", homedir); -+ xchatdir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); - for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); - for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); - for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 81a0d3e..d691014 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.17 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -127,6 +127,9 @@ fi %changelog +* Mon Apr 2 2007 Brian Pepple - 0.17-2 +- D'Oh! Forgot to add the new config patch. + * Mon Apr 2 2007 Brian Pepple - 0.17-1 - Update to 0.17 (bugfix release). - Update the config patch. From 4f5660cb49203055d2597823ddfe2b6bf091fa6c Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 4 Apr 2007 01:03:03 +0000 Subject: [PATCH 012/105] - Add patch to fix crasher. (#235144). --- xchat-gnome-0.17-static.patch | 17 +++++++++++++++++ xchat-gnome.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.17-static.patch diff --git a/xchat-gnome-0.17-static.patch b/xchat-gnome-0.17-static.patch new file mode 100644 index 0000000..0d11fb9 --- /dev/null +++ b/xchat-gnome-0.17-static.patch @@ -0,0 +1,17 @@ +diff -ur xchat-gnome-0.17.OLD/src/fe-gnome/preferences.c xchat-gnome-0.17/src/fe-gnome/preferences.c +--- xchat-gnome-0.17.OLD/src/fe-gnome/preferences.c 2007-03-06 17:47:37.000000000 -0500 ++++ xchat-gnome-0.17/src/fe-gnome/preferences.c 2007-04-03 20:23:51.000000000 -0400 +@@ -163,9 +163,11 @@ + gchar * + get_save_directory(void) + { +- char *dir = prefs.dccdir; +- if (0 == strlen (dir)) { ++ char *dir; ++ if (0 == strlen (prefs.dccdir)) { + dir = NULL; ++ } else { ++ dir = g_strdup (prefs.dccdir); + } + + /* Starts with ~/ ? */ diff --git a/xchat-gnome.spec b/xchat-gnome.spec index d691014..acae65c 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.17 -Release: 2%{?dist} +Release: 3%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -8,6 +8,7 @@ License: GPL URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-config.patch +Patch1: %{name}-%{version}-static.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -42,6 +43,7 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config +%patch1 -p1 -b .static %build @@ -127,6 +129,9 @@ fi %changelog +* Tue Apr 3 2007 Brian Pepple - 0.17-3 +- Add patch to fix crasher. (#235144). + * Mon Apr 2 2007 Brian Pepple - 0.17-2 - D'Oh! Forgot to add the new config patch. From cd3b7b6898bc9a476cb1b9637529f601d8a68ac8 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Tue, 17 Apr 2007 00:07:30 +0000 Subject: [PATCH 013/105] - Add patch to fix setup-dialog. (#236636) --- xchat-gnome-0.17-setup-dialog.patch | 79 +++++++++++++++++++++++++++++ xchat-gnome.spec | 7 ++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.17-setup-dialog.patch diff --git a/xchat-gnome-0.17-setup-dialog.patch b/xchat-gnome-0.17-setup-dialog.patch new file mode 100644 index 0000000..c1896d0 --- /dev/null +++ b/xchat-gnome-0.17-setup-dialog.patch @@ -0,0 +1,79 @@ +--- trunk/src/fe-gnome/setup-dialog.c 2007/03/19 00:05:08 2491 ++++ trunk/src/fe-gnome/setup-dialog.c 2007/04/15 00:56:09 2513 +@@ -29,7 +29,9 @@ + #include "util.h" + #include "preferences.h" + +-static GladeXML *xml = NULL; ++static GtkWidget *real_entry = NULL; ++static GtkWidget *nick_entry = NULL; ++static GtkWidget *ok_button = NULL; + static gboolean done; + + static void ok_clicked (GtkButton *button, gpointer data); +@@ -37,12 +39,6 @@ + + void run_setup_dialog (void) + { +- GtkSizeGroup *group; +- GtkWidget *window; +- GtkWidget *nick_entry; +- GtkWidget *real_entry; +- GtkWidget *button; +- + gchar *path = locate_data_file ("setup-dialog.glade"); + g_assert (path != NULL); + +@@ -51,9 +47,9 @@ + + g_free (path); + +- window = glade_xml_get_widget (xml, "setup window"); ++ GtkWidget *window = glade_xml_get_widget (xml, "setup window"); + +- group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); ++ GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + nick_entry = glade_xml_get_widget (xml, "nick name entry"); + real_entry = glade_xml_get_widget (xml, "real name entry"); + gtk_size_group_add_widget (group, nick_entry); +@@ -66,8 +62,8 @@ + gtk_entry_set_text (GTK_ENTRY (real_entry), g_get_real_name ()); + gtk_widget_grab_focus (nick_entry); + +- button = glade_xml_get_widget (xml, "ok button"); +- g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (ok_clicked), NULL); ++ ok_button = glade_xml_get_widget (xml, "ok button"); ++ g_signal_connect (G_OBJECT (ok_button), "clicked", G_CALLBACK (ok_clicked), NULL); + + gtk_widget_show_all (window); + done = FALSE; +@@ -82,8 +78,6 @@ + static void + ok_clicked (GtkButton *button, gpointer data) + { +- GtkWidget *nick_entry = glade_xml_get_widget (xml, "nick name entry"); +- GtkWidget *real_entry = glade_xml_get_widget (xml, "real name entry"); + const gchar *nick = gtk_entry_get_text (GTK_ENTRY (nick_entry)); + const gchar *real = gtk_entry_get_text (GTK_ENTRY (real_entry)); + +@@ -108,16 +102,11 @@ + static void + entry_changed (GtkEditable *entry, gpointer user_data) + { +- GtkWidget *ok_button, *nick_entry, *real_entry; +- const gchar *nick, *real; +- +- ok_button = glade_xml_get_widget (xml, "ok button"); +- nick_entry = glade_xml_get_widget (xml, "nick name entry"); +- real_entry = glade_xml_get_widget (xml, "real name entry"); +- nick = gtk_entry_get_text (GTK_ENTRY (nick_entry)); +- real = gtk_entry_get_text (GTK_ENTRY (real_entry)); ++ const gchar *nick = gtk_entry_get_text (GTK_ENTRY (nick_entry)); ++ const gchar *real = gtk_entry_get_text (GTK_ENTRY (real_entry)); + +- if (strlen(nick) == 0 || strlen(real) == 0) { ++ if ((nick == NULL || strlen(nick) == 0) || ++ (real == NULL || strlen(real) == 0)) { + gtk_widget_set_sensitive (ok_button, FALSE); + } else { + gtk_widget_set_sensitive (ok_button, TRUE); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index acae65c..f6c0874 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.17 -Release: 3%{?dist} +Release: 4%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -9,6 +9,7 @@ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-static.patch +Patch2: %{name}-%{version}-setup-dialog.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -44,6 +45,7 @@ common settings will be included in the main user interface. . %setup -q -n %{name}-%{version} %patch0 -p1 -b .config %patch1 -p1 -b .static +%patch2 -p1 -b .dialog %build @@ -129,6 +131,9 @@ fi %changelog +* Mon Apr 16 2007 Brian Pepple - 0.17-4 +- Add patch to fix setup-dialog. (#236636) + * Tue Apr 3 2007 Brian Pepple - 0.17-3 - Add patch to fix crasher. (#235144). From 026e80486bb2bafab4eb8e940aa4e9b080bf5827 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Mon, 28 May 2007 16:03:15 +0000 Subject: [PATCH 014/105] - Add gettext patch so we don't print translation information when open a query window. --- xchat-gnome-0.17-gettext.patch | 29 +++++++++++++++++++++++++++++ xchat-gnome.spec | 7 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.17-gettext.patch diff --git a/xchat-gnome-0.17-gettext.patch b/xchat-gnome-0.17-gettext.patch new file mode 100644 index 0000000..84d0832 --- /dev/null +++ b/xchat-gnome-0.17-gettext.patch @@ -0,0 +1,29 @@ +--- src/common/text.c.orig 2007-03-29 22:44:16.000000000 +0000 ++++ src/common/text.c 2007-03-29 22:45:25.000000000 +0000 +@@ -1117,7 +1117,7 @@ + free (pntevts_text[i]); + + /* make-te.c sets this 128 flag (DON'T call gettext() flag) */ +- if (te[i].num_args & 128 || strcmp (_(te[i].def), "")) ++ if (te[i].num_args & 128 || strcmp (te[i].def, "") == 0) + pntevts_text[i] = strdup (te[i].def); + else + pntevts_text[i] = strdup (_(te[i].def)); +@@ -1141,7 +1141,7 @@ + fe_message (out, FE_MSG_WARN); + free (pntevts_text[i]); + /* make-te.c sets this 128 flag (DON'T call gettext() flag) */ +- if (te[i].num_args & 128 || strcmp (_(te[i].def), "")) ++ if (te[i].num_args & 128 || strcmp (te[i].def, "") == 0) + pntevts_text[i] = strdup (te[i].def); + else + pntevts_text[i] = strdup (_(te[i].def)); +@@ -1321,7 +1321,7 @@ + snprintf(out, sizeof(out), "The data for event %s failed to load. Reverting to defaults.\nThis may be because a new version of XChat is loading an old config file.\n\nCheck all print event texts are correct", evtnames[i]); + gtkutil_simpledialog(out); */ + /* make-te.c sets this 128 flag (DON'T call gettext() flag) */ +- if (te[i].num_args & 128 || strcmp (_(te[i].def), "")) ++ if (te[i].num_args & 128 || strcmp (te[i].def, "") == 0) + pntevts_text[i] = strdup (te[i].def); + else + pntevts_text[i] = strdup (_(te[i].def)); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f6c0874..14144d0 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.17 -Release: 4%{?dist} +Release: 5%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -10,6 +10,7 @@ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar. Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-static.patch Patch2: %{name}-%{version}-setup-dialog.patch +Patch3: %{name}-%{version}-gettext.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -46,6 +47,7 @@ common settings will be included in the main user interface. . %patch0 -p1 -b .config %patch1 -p1 -b .static %patch2 -p1 -b .dialog +%patch3 -p0 -b .gettext %build @@ -131,6 +133,9 @@ fi %changelog +* Mon May 28 2007 Brian Pepple - 0.17-5 +- Add gettext patch so we don't print translation information when open a query window. + * Mon Apr 16 2007 Brian Pepple - 0.17-4 - Add patch to fix setup-dialog. (#236636) From cc4efc2fc547c7dd2e86a2095166fc83541ec08e Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sat, 9 Jun 2007 18:25:23 +0000 Subject: [PATCH 015/105] - Add requires on yelp. (#243417) --- xchat-gnome.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 14144d0..8e30ed0 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.17 -Release: 5%{?dist} +Release: 6%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -26,6 +26,7 @@ BuildRequires: libnotify-devel Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") +Requires: yelp Requires(pre): GConf2 Requires(post): GConf2 @@ -133,6 +134,9 @@ fi %changelog +* Sat Jun 9 2007 Brian Pepple - 0.17-6 +- Add requires on yelp. (#243417) + * Mon May 28 2007 Brian Pepple - 0.17-5 - Add gettext patch so we don't print translation information when open a query window. From aeae4280502f14db8067f32c5176175898391bbe Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 10 Jun 2007 19:18:11 +0000 Subject: [PATCH 016/105] - Drop requires on yelp. --- xchat-gnome.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 8e30ed0..260281d 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.17 -Release: 6%{?dist} +Release: 7%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -26,7 +26,6 @@ BuildRequires: libnotify-devel Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") -Requires: yelp Requires(pre): GConf2 Requires(post): GConf2 @@ -134,6 +133,9 @@ fi %changelog +* Sun Jun 10 2007 Brian Pepple - 0.17-7 +- Drop requires on yelp. + * Sat Jun 9 2007 Brian Pepple - 0.17-6 - Add requires on yelp. (#243417) From 6baea93c963145fba0cbd05a961add9ef76877d7 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Mon, 9 Jul 2007 20:25:20 +0000 Subject: [PATCH 017/105] - Update to 0.18. - Drop static patch, fixed upstream. - Drop setup-dialog patch, fixed upstream. - Drop gettext patch. - Update config patch. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-0.17-gettext.patch | 29 ------- xchat-gnome-0.17-setup-dialog.patch | 79 ------------------- xchat-gnome-0.17-static.patch | 17 ---- ...fig.patch => xchat-gnome-0.18-config.patch | 39 +++++---- xchat-gnome.spec | 17 ++-- 7 files changed, 33 insertions(+), 152 deletions(-) delete mode 100644 xchat-gnome-0.17-gettext.patch delete mode 100644 xchat-gnome-0.17-setup-dialog.patch delete mode 100644 xchat-gnome-0.17-static.patch rename xchat-gnome-0.17-config.patch => xchat-gnome-0.18-config.patch (62%) diff --git a/.cvsignore b/.cvsignore index 7467103..ee0653f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.17.tar.bz2 +xchat-gnome-0.18.tar.bz2 diff --git a/sources b/sources index 9b70c4c..c38bd4a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bcb8e97a63c0fda6fcba0f88309ea645 xchat-gnome-0.17.tar.bz2 +4976cd34a0e9115c800b5d317e121182 xchat-gnome-0.18.tar.bz2 diff --git a/xchat-gnome-0.17-gettext.patch b/xchat-gnome-0.17-gettext.patch deleted file mode 100644 index 84d0832..0000000 --- a/xchat-gnome-0.17-gettext.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- src/common/text.c.orig 2007-03-29 22:44:16.000000000 +0000 -+++ src/common/text.c 2007-03-29 22:45:25.000000000 +0000 -@@ -1117,7 +1117,7 @@ - free (pntevts_text[i]); - - /* make-te.c sets this 128 flag (DON'T call gettext() flag) */ -- if (te[i].num_args & 128 || strcmp (_(te[i].def), "")) -+ if (te[i].num_args & 128 || strcmp (te[i].def, "") == 0) - pntevts_text[i] = strdup (te[i].def); - else - pntevts_text[i] = strdup (_(te[i].def)); -@@ -1141,7 +1141,7 @@ - fe_message (out, FE_MSG_WARN); - free (pntevts_text[i]); - /* make-te.c sets this 128 flag (DON'T call gettext() flag) */ -- if (te[i].num_args & 128 || strcmp (_(te[i].def), "")) -+ if (te[i].num_args & 128 || strcmp (te[i].def, "") == 0) - pntevts_text[i] = strdup (te[i].def); - else - pntevts_text[i] = strdup (_(te[i].def)); -@@ -1321,7 +1321,7 @@ - snprintf(out, sizeof(out), "The data for event %s failed to load. Reverting to defaults.\nThis may be because a new version of XChat is loading an old config file.\n\nCheck all print event texts are correct", evtnames[i]); - gtkutil_simpledialog(out); */ - /* make-te.c sets this 128 flag (DON'T call gettext() flag) */ -- if (te[i].num_args & 128 || strcmp (_(te[i].def), "")) -+ if (te[i].num_args & 128 || strcmp (te[i].def, "") == 0) - pntevts_text[i] = strdup (te[i].def); - else - pntevts_text[i] = strdup (_(te[i].def)); diff --git a/xchat-gnome-0.17-setup-dialog.patch b/xchat-gnome-0.17-setup-dialog.patch deleted file mode 100644 index c1896d0..0000000 --- a/xchat-gnome-0.17-setup-dialog.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- trunk/src/fe-gnome/setup-dialog.c 2007/03/19 00:05:08 2491 -+++ trunk/src/fe-gnome/setup-dialog.c 2007/04/15 00:56:09 2513 -@@ -29,7 +29,9 @@ - #include "util.h" - #include "preferences.h" - --static GladeXML *xml = NULL; -+static GtkWidget *real_entry = NULL; -+static GtkWidget *nick_entry = NULL; -+static GtkWidget *ok_button = NULL; - static gboolean done; - - static void ok_clicked (GtkButton *button, gpointer data); -@@ -37,12 +39,6 @@ - - void run_setup_dialog (void) - { -- GtkSizeGroup *group; -- GtkWidget *window; -- GtkWidget *nick_entry; -- GtkWidget *real_entry; -- GtkWidget *button; -- - gchar *path = locate_data_file ("setup-dialog.glade"); - g_assert (path != NULL); - -@@ -51,9 +47,9 @@ - - g_free (path); - -- window = glade_xml_get_widget (xml, "setup window"); -+ GtkWidget *window = glade_xml_get_widget (xml, "setup window"); - -- group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); -+ GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); - nick_entry = glade_xml_get_widget (xml, "nick name entry"); - real_entry = glade_xml_get_widget (xml, "real name entry"); - gtk_size_group_add_widget (group, nick_entry); -@@ -66,8 +62,8 @@ - gtk_entry_set_text (GTK_ENTRY (real_entry), g_get_real_name ()); - gtk_widget_grab_focus (nick_entry); - -- button = glade_xml_get_widget (xml, "ok button"); -- g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (ok_clicked), NULL); -+ ok_button = glade_xml_get_widget (xml, "ok button"); -+ g_signal_connect (G_OBJECT (ok_button), "clicked", G_CALLBACK (ok_clicked), NULL); - - gtk_widget_show_all (window); - done = FALSE; -@@ -82,8 +78,6 @@ - static void - ok_clicked (GtkButton *button, gpointer data) - { -- GtkWidget *nick_entry = glade_xml_get_widget (xml, "nick name entry"); -- GtkWidget *real_entry = glade_xml_get_widget (xml, "real name entry"); - const gchar *nick = gtk_entry_get_text (GTK_ENTRY (nick_entry)); - const gchar *real = gtk_entry_get_text (GTK_ENTRY (real_entry)); - -@@ -108,16 +102,11 @@ - static void - entry_changed (GtkEditable *entry, gpointer user_data) - { -- GtkWidget *ok_button, *nick_entry, *real_entry; -- const gchar *nick, *real; -- -- ok_button = glade_xml_get_widget (xml, "ok button"); -- nick_entry = glade_xml_get_widget (xml, "nick name entry"); -- real_entry = glade_xml_get_widget (xml, "real name entry"); -- nick = gtk_entry_get_text (GTK_ENTRY (nick_entry)); -- real = gtk_entry_get_text (GTK_ENTRY (real_entry)); -+ const gchar *nick = gtk_entry_get_text (GTK_ENTRY (nick_entry)); -+ const gchar *real = gtk_entry_get_text (GTK_ENTRY (real_entry)); - -- if (strlen(nick) == 0 || strlen(real) == 0) { -+ if ((nick == NULL || strlen(nick) == 0) || -+ (real == NULL || strlen(real) == 0)) { - gtk_widget_set_sensitive (ok_button, FALSE); - } else { - gtk_widget_set_sensitive (ok_button, TRUE); diff --git a/xchat-gnome-0.17-static.patch b/xchat-gnome-0.17-static.patch deleted file mode 100644 index 0d11fb9..0000000 --- a/xchat-gnome-0.17-static.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur xchat-gnome-0.17.OLD/src/fe-gnome/preferences.c xchat-gnome-0.17/src/fe-gnome/preferences.c ---- xchat-gnome-0.17.OLD/src/fe-gnome/preferences.c 2007-03-06 17:47:37.000000000 -0500 -+++ xchat-gnome-0.17/src/fe-gnome/preferences.c 2007-04-03 20:23:51.000000000 -0400 -@@ -163,9 +163,11 @@ - gchar * - get_save_directory(void) - { -- char *dir = prefs.dccdir; -- if (0 == strlen (dir)) { -+ char *dir; -+ if (0 == strlen (prefs.dccdir)) { - dir = NULL; -+ } else { -+ dir = g_strdup (prefs.dccdir); - } - - /* Starts with ~/ ? */ diff --git a/xchat-gnome-0.17-config.patch b/xchat-gnome-0.18-config.patch similarity index 62% rename from xchat-gnome-0.17-config.patch rename to xchat-gnome-0.18-config.patch index f02abf2..7a81b3e 100644 --- a/xchat-gnome-0.17-config.patch +++ b/xchat-gnome-0.18-config.patch @@ -1,6 +1,6 @@ -diff -ur xchat-gnome-0.17.OLD/plugins/perl/perl.c xchat-gnome-0.17/plugins/perl/perl.c ---- xchat-gnome-0.17.OLD/plugins/perl/perl.c 2007-03-06 17:47:26.000000000 -0500 -+++ xchat-gnome-0.17/plugins/perl/perl.c 2007-04-02 08:40:39.000000000 -0400 +diff -ur xchat-gnome-0.18.OLD/plugins/perl/perl.c xchat-gnome-0.18/plugins/perl/perl.c +--- xchat-gnome-0.18.OLD/plugins/perl/perl.c 2007-03-06 17:47:26.000000000 -0500 ++++ xchat-gnome-0.18/plugins/perl/perl.c 2007-07-09 10:24:01.000000000 -0400 @@ -92,7 +92,7 @@ if (!xdir) /* xchatdirfs is new for 2.0.9, will fail on older */ xdir = xchat_get_info (ph, "xchatdir"); @@ -10,10 +10,11 @@ diff -ur xchat-gnome-0.17.OLD/plugins/perl/perl.c xchat-gnome-0.17/plugins/perl/ perl_auto_load_from_path (xdir); #ifdef WIN32 -diff -ur xchat-gnome-0.17.OLD/plugins/python/python.c xchat-gnome-0.17/plugins/python/python.c ---- xchat-gnome-0.17.OLD/plugins/python/python.c 2007-03-06 17:47:26.000000000 -0500 -+++ xchat-gnome-0.17/plugins/python/python.c 2007-04-02 08:41:13.000000000 -0400 -@@ -412,7 +412,7 @@ +Only in xchat-gnome-0.18/plugins/perl: perl.c~ +diff -ur xchat-gnome-0.18.OLD/plugins/python/python.c xchat-gnome-0.18/plugins/python/python.c +--- xchat-gnome-0.18.OLD/plugins/python/python.c 2007-07-07 16:28:05.000000000 -0400 ++++ xchat-gnome-0.18/plugins/python/python.c 2007-07-09 10:24:20.000000000 -0400 +@@ -414,7 +414,7 @@ return expanded; g_free(expanded); @@ -22,9 +23,10 @@ diff -ur xchat-gnome-0.17.OLD/plugins/python/python.c xchat-gnome-0.17/plugins/p expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), filename, NULL); if (g_file_test(expanded, G_FILE_TEST_EXISTS)) -diff -ur xchat-gnome-0.17.OLD/src/common/cfgfiles.c xchat-gnome-0.17/src/common/cfgfiles.c ---- xchat-gnome-0.17.OLD/src/common/cfgfiles.c 2007-03-17 21:40:09.000000000 -0400 -+++ xchat-gnome-0.17/src/common/cfgfiles.c 2007-04-02 08:39:50.000000000 -0400 +Only in xchat-gnome-0.18/plugins/python: python.c~ +diff -ur xchat-gnome-0.18.OLD/src/common/cfgfiles.c xchat-gnome-0.18/src/common/cfgfiles.c +--- xchat-gnome-0.18.OLD/src/common/cfgfiles.c 2007-06-12 20:03:17.000000000 -0400 ++++ xchat-gnome-0.18/src/common/cfgfiles.c 2007-07-09 10:26:09.000000000 -0400 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -34,7 +36,7 @@ diff -ur xchat-gnome-0.17.OLD/src/common/cfgfiles.c xchat-gnome-0.17/src/common/ #endif #define DEF_FONT "Monospace 9" -@@ -352,7 +352,7 @@ +@@ -351,7 +351,7 @@ #else if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) #endif @@ -43,9 +45,10 @@ diff -ur xchat-gnome-0.17.OLD/src/common/cfgfiles.c xchat-gnome-0.17/src/common/ } } -diff -ur xchat-gnome-0.17.OLD/src/common/fe.h xchat-gnome-0.17/src/common/fe.h ---- xchat-gnome-0.17.OLD/src/common/fe.h 2007-03-06 17:47:37.000000000 -0500 -+++ xchat-gnome-0.17/src/common/fe.h 2007-04-02 08:40:15.000000000 -0400 +Only in xchat-gnome-0.18/src/common: cfgfiles.c~ +diff -ur xchat-gnome-0.18.OLD/src/common/fe.h xchat-gnome-0.18/src/common/fe.h +--- xchat-gnome-0.18.OLD/src/common/fe.h 2007-06-12 20:21:16.000000000 -0400 ++++ xchat-gnome-0.18/src/common/fe.h 2007-07-09 10:25:46.000000000 -0400 @@ -106,7 +106,7 @@ void fe_get_int (char *prompt, int def, void *callback, void *ud); #define FRF_WRITE 1 /* save file */ @@ -55,9 +58,10 @@ diff -ur xchat-gnome-0.17.OLD/src/common/fe.h xchat-gnome-0.17/src/common/fe.h #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ #define FRF_FILTERISINITIAL 16 /* unused */ #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ -diff -ur xchat-gnome-0.17.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.17/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.17.OLD/src/fe-gnome/preferences-page-plugins.c 2007-03-31 07:07:34.000000000 -0400 -+++ xchat-gnome-0.17/src/fe-gnome/preferences-page-plugins.c 2007-04-02 08:39:21.000000000 -0400 +Only in xchat-gnome-0.18/src/common: fe.h~ +diff -ur xchat-gnome-0.18.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.18/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.18.OLD/src/fe-gnome/preferences-page-plugins.c 2007-03-31 07:07:34.000000000 -0400 ++++ xchat-gnome-0.18/src/fe-gnome/preferences-page-plugins.c 2007-07-09 10:25:27.000000000 -0400 @@ -240,7 +240,7 @@ file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); @@ -76,3 +80,4 @@ diff -ur xchat-gnome-0.17.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); +Only in xchat-gnome-0.18/src/fe-gnome: preferences-page-plugins.c~ diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 260281d..e18e960 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome -Version: 0.17 -Release: 7%{?dist} +Version: 0.18 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -8,9 +8,6 @@ License: GPL URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-config.patch -Patch1: %{name}-%{version}-static.patch -Patch2: %{name}-%{version}-setup-dialog.patch -Patch3: %{name}-%{version}-gettext.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -45,9 +42,6 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config -%patch1 -p1 -b .static -%patch2 -p1 -b .dialog -%patch3 -p0 -b .gettext %build @@ -133,6 +127,13 @@ fi %changelog +* Mon Jul 9 2007 Brian Pepple - 0.18-1 +- Update to 0.18. +- Drop static patch, fixed upstream. +- Drop setup-dialog patch, fixed upstream. +- Drop gettext patch. +- Update config patch. + * Sun Jun 10 2007 Brian Pepple - 0.17-7 - Drop requires on yelp. From e221755da66752adf438213617ded218a6c22cb8 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Tue, 10 Jul 2007 00:46:41 +0000 Subject: [PATCH 018/105] - Drop requires on python, since dep on python-libs will be pulled in. --- xchat-gnome.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index e18e960..a6ca0f9 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -22,7 +22,6 @@ BuildRequires: gnome-doc-utils BuildRequires: libnotify-devel Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") Requires(pre): GConf2 Requires(post): GConf2 @@ -127,6 +126,9 @@ fi %changelog +* Mon Jul 9 2007 Brian Pepple - 0.18-2 +- Drop requires on python, since dep on python-libs will be pulled in. + * Mon Jul 9 2007 Brian Pepple - 0.18-1 - Update to 0.18. - Drop static patch, fixed upstream. From d8390544a9e77952bd1cc3aa55f421175f0ffb88 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Fri, 3 Aug 2007 01:44:48 +0000 Subject: [PATCH 019/105] - Update license tag. --- xchat-gnome.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a6ca0f9..87aef4a 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,10 +1,10 @@ Name: xchat-gnome Version: 0.18 -Release: 2%{?dist} +Release: 3%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet -License: GPL +License: GPLv2+ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-config.patch @@ -126,6 +126,9 @@ fi %changelog +* Thu Aug 2 2007 Brian Pepple - 0.18-3 +- Update license tag. + * Mon Jul 9 2007 Brian Pepple - 0.18-2 - Drop requires on python, since dep on python-libs will be pulled in. From bea6385fe9330ca2ac069739b579a274160d7012 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Fri, 3 Aug 2007 01:47:37 +0000 Subject: [PATCH 020/105] - Update license tag. --- xchat-gnome.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index c3c31cd..effb87c 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,10 +1,10 @@ Name: xchat-gnome Version: 0.16 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet -License: GPL +License: GPLv2+ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-config.patch @@ -141,6 +141,9 @@ fi %changelog +* Thu Aug 2 2007 Brian Pepple - 0.16-2 +- Update license tag. + * Wed Jan 31 2007 Brian Pepple - 0.16-2 - Drop conditional statement for libnotify. - Remove BR on dbus-devel, since libnotify-devel will pull this in. From 9f84f5e9c6c23a5e341bbf4d2a8c0ab928790114 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Tue, 21 Aug 2007 17:50:37 +0000 Subject: [PATCH 021/105] - Rebuild. --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 87aef4a..806b3dc 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 3%{?dist} +Release: 4%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -126,6 +126,9 @@ fi %changelog +* Tue Aug 21 2007 Brian Pepple - 0.18-4 +- Rebuild. + * Thu Aug 2 2007 Brian Pepple - 0.18-3 - Update license tag. From a048ca7b21be0a9e3900c12338111dbfb194835d Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Fri, 14 Sep 2007 01:15:03 +0000 Subject: [PATCH 022/105] - Add patch to fix reconnect bug. (#225408) --- xchat-gnome-0.18-reconnect.patch | 26 ++++++++++++++++++++++++++ xchat-gnome.spec | 7 ++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.18-reconnect.patch diff --git a/xchat-gnome-0.18-reconnect.patch b/xchat-gnome-0.18-reconnect.patch new file mode 100644 index 0000000..9ebc1a7 --- /dev/null +++ b/xchat-gnome-0.18-reconnect.patch @@ -0,0 +1,26 @@ +--- trunk/plugins/net-monitor/net-monitor.c 2007/09/12 22:18:13 2568 ++++ trunk/plugins/net-monitor/net-monitor.c 2007/09/13 01:25:13 2569 +@@ -30,6 +30,9 @@ + #include + #include + #include ++#include ++#include ++#include + #include "xchat-plugin.h" + + #define NET_MONITOR_VERSION "0.1" +@@ -166,6 +169,13 @@ + + g_hash_table_foreach (networks, (GHFunc) disconnect_from_network, NULL); + } else { ++ /* ++ * We need to tell the nameserver resolver to reread ++ * /etc/resolve.conf, since the nameservers might have changed ++ * when moving between networks. ++ */ ++ res_init(); ++ + g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL); + } + } diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 806b3dc..161971d 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 4%{?dist} +Release: 5%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -8,6 +8,7 @@ License: GPLv2+ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-config.patch +Patch1: %{name}-%{version}-reconnect.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -41,6 +42,7 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config +%patch1 -p1 -b .reconnect %build @@ -126,6 +128,9 @@ fi %changelog +* Thu Sep 13 2007 Brian Pepple - 0.18-5 +- Add patch to fix reconnect bug. (#225408) + * Tue Aug 21 2007 Brian Pepple - 0.18-4 - Rebuild. From f2d77474bcab9924741f2bfa30a62f3ac5885781 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 18 Nov 2007 00:26:55 +0000 Subject: [PATCH 023/105] - Add patch to fix away/back command. --- xchat-gnome-fix_away_command.patch | 27 +++++++++++++++++++++++++++ xchat-gnome.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-fix_away_command.patch diff --git a/xchat-gnome-fix_away_command.patch b/xchat-gnome-fix_away_command.patch new file mode 100644 index 0000000..a909d0b --- /dev/null +++ b/xchat-gnome-fix_away_command.patch @@ -0,0 +1,27 @@ +--- trunk/src/fe-gnome/main-window.c 2007/09/09 22:34:50 2560 ++++ trunk/src/fe-gnome/main-window.c 2007/09/09 22:56:32 2561 +@@ -532,11 +532,20 @@ + g_free (buf); + + /* Away */ +- if (current_sess->server->is_away != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away))) { +- if (all) { +- handle_command (current_sess, "allserv away", FALSE); ++ gboolean away = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away)); ++ if (current_sess->server->is_away != away) { ++ if (away) { ++ if (all) { ++ handle_command (current_sess, "allserv away", FALSE); ++ } else { ++ handle_command (current_sess, "away", FALSE); ++ } + } else { +- handle_command (current_sess, "away", FALSE); ++ if (all) { ++ handle_command (current_sess, "allserv back", FALSE); ++ } else { ++ handle_command (current_sess, "back", FALSE); ++ } + } + } + } diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 161971d..09ce926 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 5%{?dist} +Release: 6%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -9,6 +9,7 @@ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-reconnect.patch +Patch2: %{name}-fix_away_command.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -43,6 +44,7 @@ common settings will be included in the main user interface. . %setup -q -n %{name}-%{version} %patch0 -p1 -b .config %patch1 -p1 -b .reconnect +%patch2 -p1 -b .away %build @@ -128,6 +130,9 @@ fi %changelog +* Sat Nov 17 2007 Brian Pepple - 0.18-6 +- Add patch to fix away/back command. + * Thu Sep 13 2007 Brian Pepple - 0.18-5 - Add patch to fix reconnect bug. (#225408) From dc31e2ce97dc332f8265f46d9296edd171003816 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 5 Dec 2007 15:30:54 +0000 Subject: [PATCH 024/105] - rebuild for new libssl.so.6/libcrypto.so.6 --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 09ce926..83b4bfb 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 6%{?dist} +Release: 7%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -130,6 +130,9 @@ fi %changelog +* Wed Dec 5 2007 Brian Pepple - 0.18-7 +- rebuild for new libssl.so.6/libcrypto.so.6 + * Sat Nov 17 2007 Brian Pepple - 0.18-6 - Add patch to fix away/back command. From 31307fc9f4e1b594c664c31b847985acf7faab32 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 30 Jan 2008 20:12:51 +0000 Subject: [PATCH 025/105] - Rebuild. --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 83b4bfb..8ada936 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 7%{?dist} +Release: 8%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -130,6 +130,9 @@ fi %changelog +* Wed Jan 30 2008 Brian Pepple - 0.18-8 +- Rebuild. + * Wed Dec 5 2007 Brian Pepple - 0.18-7 - rebuild for new libssl.so.6/libcrypto.so.6 From ddfaf933271b791e3a8d522ba1e78004b09c6c6f Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 13 Feb 2008 00:59:05 +0000 Subject: [PATCH 026/105] - Updated away/back patch. (#430883) --- xchat-gnome-fix_away_command.patch | 28 +++++++++++++++++++++++++--- xchat-gnome.spec | 5 ++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/xchat-gnome-fix_away_command.patch b/xchat-gnome-fix_away_command.patch index a909d0b..e51c7a3 100644 --- a/xchat-gnome-fix_away_command.patch +++ b/xchat-gnome-fix_away_command.patch @@ -1,5 +1,27 @@ ---- trunk/src/fe-gnome/main-window.c 2007/09/09 22:34:50 2560 -+++ trunk/src/fe-gnome/main-window.c 2007/09/09 22:56:32 2561 +--- a/src/fe-gnome/main-window.c 2007-03-19 05:27:06.000000000 +0530 ++++ b/src/fe-gnome/main-window.c 2008-02-04 10:57:18.000000000 +0530 +@@ -496,7 +496,7 @@ + on_nickname_clicked (GtkButton *widget, gpointer user_data) + { + GtkWidget *dialog; +- GtkWidget *entry, *away; ++ GtkWidget *entry, *away_button; + gint result; + + if (gui.current_session == NULL) { +@@ -506,10 +506,10 @@ + + dialog = glade_xml_get_widget (gui.xml, "nickname dialog"); + entry = glade_xml_get_widget (gui.xml, "nickname dialog entry"); +- away = glade_xml_get_widget (gui.xml, "nickname dialog away"); ++ away_button = glade_xml_get_widget (gui.xml, "nickname dialog away"); + + gtk_entry_set_text (GTK_ENTRY (entry), current_sess->server->nick); +- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (away), current_sess->server->is_away); ++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (away_button), current_sess->server->is_away); + g_signal_connect (G_OBJECT (entry), "activate", G_CALLBACK (nickname_dialog_entry_activated), dialog); + + result = gtk_dialog_run (GTK_DIALOG (dialog)); @@ -532,11 +532,20 @@ g_free (buf); @@ -7,7 +29,7 @@ - if (current_sess->server->is_away != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away))) { - if (all) { - handle_command (current_sess, "allserv away", FALSE); -+ gboolean away = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away)); ++ gboolean away = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away_button)); + if (current_sess->server->is_away != away) { + if (away) { + if (all) { diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 8ada936..7854362 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 8%{?dist} +Release: 9%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -130,6 +130,9 @@ fi %changelog +* Tue Feb 12 2008 Brian Pepple - 0.18-9 +- Updated away/back patch. (#430883) + * Wed Jan 30 2008 Brian Pepple - 0.18-8 - Rebuild. From cb73498e0ff9cc16df1840e845d91f2192fd807e Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 7 Mar 2008 02:23:03 +0000 Subject: [PATCH 027/105] new perl --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 7854362..8974887 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 9%{?dist} +Release: 10%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -130,6 +130,9 @@ fi %changelog +* Thu Mar 06 2008 Tom "spot" Callaway - 0.18-10 +Rebuild for new perl + * Tue Feb 12 2008 Brian Pepple - 0.18-9 - Updated away/back patch. (#430883) From 6be2c0b75ee281950f9ff0acd85b8edadd71c313 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Tue, 25 Mar 2008 16:17:27 +0000 Subject: [PATCH 028/105] - Add patch to fix spell-checking language selection. (#427067) - Add BR on perl-devel & perl(ExtUtils::Embed)to actually build the perl plugin. --- xchat-gnome-spellchecking.patch | 13 +++++++++++++ xchat-gnome.spec | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 xchat-gnome-spellchecking.patch diff --git a/xchat-gnome-spellchecking.patch b/xchat-gnome-spellchecking.patch new file mode 100644 index 0000000..0ab47ce --- /dev/null +++ b/xchat-gnome-spellchecking.patch @@ -0,0 +1,13 @@ +Index: src/fe-gnome/preferences-page-spellcheck.c +=================================================================== +--- src/fe-gnome/preferences-page-spellcheck.c (révision 2576) ++++ src/fe-gnome/preferences-page-spellcheck.c (copie de travail) +@@ -153,7 +153,7 @@ + COL_LANG_CODE, &lang, -1); + active = sexy_spell_entry_language_is_active (SEXY_SPELL_ENTRY (gui.text_entry), lang); + +- gtk_list_store_set (store, &iter, COL_LANG_ACTIVATED, !active, -1); ++ gtk_list_store_set (store, &iter, COL_LANG_ACTIVATED, active, -1); + } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter)); + } + } diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 8974887..e687c72 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 10%{?dist} +Release: 11%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -10,6 +10,7 @@ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar. Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-reconnect.patch Patch2: %{name}-fix_away_command.patch +Patch3: %{name}-spellchecking.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -19,7 +20,9 @@ BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: scrollkeeper BuildRequires: gettext +BuildRequires: perl-devel BuildRequires: perl(XML::Parser) +BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils BuildRequires: libnotify-devel @@ -45,10 +48,14 @@ common settings will be included in the main user interface. . %patch0 -p1 -b .config %patch1 -p1 -b .reconnect %patch2 -p1 -b .away +%patch3 -p0 -b .spellchecking %build -%configure --disable-tcl --disable-scrollkeeper --disable-schemas-install --disable-static +%configure --disable-tcl \ + --disable-scrollkeeper \ + --disable-schemas-install \ + --disable-static make %{?_smp_mflags} @@ -130,8 +137,12 @@ fi %changelog +* Tue Mar 25 2008 Brian Pepple - 0.18-11 +- Add patch to fix spell-checking language selection. (#427067) +- Add BR on perl-devel & perl(ExtUtils::Embed)to actually build the perl plugin. + * Thu Mar 06 2008 Tom "spot" Callaway - 0.18-10 -Rebuild for new perl +- Rebuild for new perl * Tue Feb 12 2008 Brian Pepple - 0.18-9 - Updated away/back patch. (#430883) From 47dbcb89398f60d50cb9159007cef140efff0238 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Thu, 27 Mar 2008 04:38:15 +0000 Subject: [PATCH 029/105] - Add patch to fix italian translation bug. (#431133) --- xchat-gnome-0.18-it-translation.patch | 21 +++++++++++++++++++++ xchat-gnome.spec | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.18-it-translation.patch diff --git a/xchat-gnome-0.18-it-translation.patch b/xchat-gnome-0.18-it-translation.patch new file mode 100644 index 0000000..02ef2e3 --- /dev/null +++ b/xchat-gnome-0.18-it-translation.patch @@ -0,0 +1,21 @@ +diff -ur xchat-gnome-0.18.OLD/po/it.po xchat-gnome-0.18/po/it.po +--- xchat-gnome-0.18.OLD/po/it.po 2008-03-27 00:20:28.000000000 -0400 ++++ xchat-gnome-0.18/po/it.po 2008-03-27 00:21:06.000000000 -0400 +@@ -12,7 +12,7 @@ + "Project-Id-Version: xchat-gnome\n" + "Report-Msgid-Bugs-To: \n" + "POT-Creation-Date: 2007-05-16 00:00+0200\n" +-"PO-Revision-Date: 2007-04-29 10:36+0200\n" ++"PO-Revision-Date: 2007-10-29 18:42+0100\n" + "Last-Translator: Milo Casagrande \n" + "Language-Team: Italian \n" + "MIME-Version: 1.0\n" +@@ -2233,7 +2233,7 @@ + + #: ../src/common/textevents.h:273 + msgid "-%C10-%C11-%O$tNotify list is empty." +-msgstr "-%C10-%C11-%O$L'elenco di notifica è vuoto." ++msgstr "-%C10-%C11-%O$tL'elenco di notifica è vuoto." + + #: ../src/common/textevents.h:276 + msgid "%C24,18 %B Notify List " diff --git a/xchat-gnome.spec b/xchat-gnome.spec index e687c72..457d8a3 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.18 -Release: 11%{?dist} +Release: 12%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -11,6 +11,7 @@ Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-reconnect.patch Patch2: %{name}-fix_away_command.patch Patch3: %{name}-spellchecking.patch +Patch4: %{name}-%{version}-it-translation.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -49,6 +50,7 @@ common settings will be included in the main user interface. . %patch1 -p1 -b .reconnect %patch2 -p1 -b .away %patch3 -p0 -b .spellchecking +%patch4 -p1 -b .translation %build @@ -137,6 +139,9 @@ fi %changelog +* Thu Mar 27 2008 Brian Pepple - 0.18-12 +- Add patch to fix italian translation bug. (#431133) + * Tue Mar 25 2008 Brian Pepple - 0.18-11 - Add patch to fix spell-checking language selection. (#427067) - Add BR on perl-devel & perl(ExtUtils::Embed)to actually build the perl plugin. From aeeaa440cb0360dcc9d4261b449305610e89d248 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 10 Sep 2008 01:06:55 +0000 Subject: [PATCH 030/105] - Update to 0.23.92. - Add deps patch to correctly set libnotify & libcanberra options. - Update BR. - Drop reconnect patch. Fixed upstream. - Drop away-command patch. Fixed upstream. - Drop spell-checking patch. Fixed upstream. - Drop it-translation patch. Fixed upstream. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-0.18-it-translation.patch | 21 -------- xchat-gnome-0.18-reconnect.patch | 26 ---------- ....patch => xchat-gnome-0.23.92-config.patch | 47 ++++++++---------- xchat-gnome-0.23.92-deps.patch | 38 ++++++++++++++ xchat-gnome-fix_away_command.patch | 49 ------------------- xchat-gnome-spellchecking.patch | 13 ----- xchat-gnome.spec | 41 +++++++++++----- 9 files changed, 90 insertions(+), 149 deletions(-) delete mode 100644 xchat-gnome-0.18-it-translation.patch delete mode 100644 xchat-gnome-0.18-reconnect.patch rename xchat-gnome-0.18-config.patch => xchat-gnome-0.23.92-config.patch (56%) create mode 100644 xchat-gnome-0.23.92-deps.patch delete mode 100644 xchat-gnome-fix_away_command.patch delete mode 100644 xchat-gnome-spellchecking.patch diff --git a/.cvsignore b/.cvsignore index ee0653f..16a29bc 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.18.tar.bz2 +xchat-gnome-0.23.92.tar.bz2 diff --git a/sources b/sources index c38bd4a..7748412 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4976cd34a0e9115c800b5d317e121182 xchat-gnome-0.18.tar.bz2 +780963419d487cefa7c1dac14696140c xchat-gnome-0.23.92.tar.bz2 diff --git a/xchat-gnome-0.18-it-translation.patch b/xchat-gnome-0.18-it-translation.patch deleted file mode 100644 index 02ef2e3..0000000 --- a/xchat-gnome-0.18-it-translation.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ur xchat-gnome-0.18.OLD/po/it.po xchat-gnome-0.18/po/it.po ---- xchat-gnome-0.18.OLD/po/it.po 2008-03-27 00:20:28.000000000 -0400 -+++ xchat-gnome-0.18/po/it.po 2008-03-27 00:21:06.000000000 -0400 -@@ -12,7 +12,7 @@ - "Project-Id-Version: xchat-gnome\n" - "Report-Msgid-Bugs-To: \n" - "POT-Creation-Date: 2007-05-16 00:00+0200\n" --"PO-Revision-Date: 2007-04-29 10:36+0200\n" -+"PO-Revision-Date: 2007-10-29 18:42+0100\n" - "Last-Translator: Milo Casagrande \n" - "Language-Team: Italian \n" - "MIME-Version: 1.0\n" -@@ -2233,7 +2233,7 @@ - - #: ../src/common/textevents.h:273 - msgid "-%C10-%C11-%O$tNotify list is empty." --msgstr "-%C10-%C11-%O$L'elenco di notifica è vuoto." -+msgstr "-%C10-%C11-%O$tL'elenco di notifica è vuoto." - - #: ../src/common/textevents.h:276 - msgid "%C24,18 %B Notify List " diff --git a/xchat-gnome-0.18-reconnect.patch b/xchat-gnome-0.18-reconnect.patch deleted file mode 100644 index 9ebc1a7..0000000 --- a/xchat-gnome-0.18-reconnect.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- trunk/plugins/net-monitor/net-monitor.c 2007/09/12 22:18:13 2568 -+++ trunk/plugins/net-monitor/net-monitor.c 2007/09/13 01:25:13 2569 -@@ -30,6 +30,9 @@ - #include - #include - #include -+#include -+#include -+#include - #include "xchat-plugin.h" - - #define NET_MONITOR_VERSION "0.1" -@@ -166,6 +169,13 @@ - - g_hash_table_foreach (networks, (GHFunc) disconnect_from_network, NULL); - } else { -+ /* -+ * We need to tell the nameserver resolver to reread -+ * /etc/resolve.conf, since the nameservers might have changed -+ * when moving between networks. -+ */ -+ res_init(); -+ - g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL); - } - } diff --git a/xchat-gnome-0.18-config.patch b/xchat-gnome-0.23.92-config.patch similarity index 56% rename from xchat-gnome-0.18-config.patch rename to xchat-gnome-0.23.92-config.patch index 7a81b3e..1cb0439 100644 --- a/xchat-gnome-0.18-config.patch +++ b/xchat-gnome-0.23.92-config.patch @@ -1,7 +1,7 @@ -diff -ur xchat-gnome-0.18.OLD/plugins/perl/perl.c xchat-gnome-0.18/plugins/perl/perl.c ---- xchat-gnome-0.18.OLD/plugins/perl/perl.c 2007-03-06 17:47:26.000000000 -0500 -+++ xchat-gnome-0.18/plugins/perl/perl.c 2007-07-09 10:24:01.000000000 -0400 -@@ -92,7 +92,7 @@ +diff -urp xchat-gnome-0.23.92.OLD/plugins/perl/perl.c xchat-gnome-0.23.92/plugins/perl/perl.c +--- xchat-gnome-0.23.92.OLD/plugins/perl/perl.c 2007-03-09 10:42:50.000000000 -0500 ++++ xchat-gnome-0.23.92/plugins/perl/perl.c 2008-09-09 19:07:08.000000000 -0400 +@@ -92,7 +92,7 @@ perl_auto_load (void) if (!xdir) /* xchatdirfs is new for 2.0.9, will fail on older */ xdir = xchat_get_info (ph, "xchatdir"); @@ -10,11 +10,10 @@ diff -ur xchat-gnome-0.18.OLD/plugins/perl/perl.c xchat-gnome-0.18/plugins/perl/ perl_auto_load_from_path (xdir); #ifdef WIN32 -Only in xchat-gnome-0.18/plugins/perl: perl.c~ -diff -ur xchat-gnome-0.18.OLD/plugins/python/python.c xchat-gnome-0.18/plugins/python/python.c ---- xchat-gnome-0.18.OLD/plugins/python/python.c 2007-07-07 16:28:05.000000000 -0400 -+++ xchat-gnome-0.18/plugins/python/python.c 2007-07-09 10:24:20.000000000 -0400 -@@ -414,7 +414,7 @@ +diff -urp xchat-gnome-0.23.92.OLD/plugins/python/python.c xchat-gnome-0.23.92/plugins/python/python.c +--- xchat-gnome-0.23.92.OLD/plugins/python/python.c 2008-09-07 09:18:27.000000000 -0400 ++++ xchat-gnome-0.23.92/plugins/python/python.c 2008-09-09 19:06:47.000000000 -0400 +@@ -421,7 +421,7 @@ Util_Expand(char *filename) return expanded; g_free(expanded); @@ -23,10 +22,9 @@ diff -ur xchat-gnome-0.18.OLD/plugins/python/python.c xchat-gnome-0.18/plugins/p expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), filename, NULL); if (g_file_test(expanded, G_FILE_TEST_EXISTS)) -Only in xchat-gnome-0.18/plugins/python: python.c~ -diff -ur xchat-gnome-0.18.OLD/src/common/cfgfiles.c xchat-gnome-0.18/src/common/cfgfiles.c ---- xchat-gnome-0.18.OLD/src/common/cfgfiles.c 2007-06-12 20:03:17.000000000 -0400 -+++ xchat-gnome-0.18/src/common/cfgfiles.c 2007-07-09 10:26:09.000000000 -0400 +diff -urp xchat-gnome-0.23.92.OLD/src/common/cfgfiles.c xchat-gnome-0.23.92/src/common/cfgfiles.c +--- xchat-gnome-0.23.92.OLD/src/common/cfgfiles.c 2007-09-12 10:12:26.000000000 -0400 ++++ xchat-gnome-0.23.92/src/common/cfgfiles.c 2008-09-09 19:05:01.000000000 -0400 @@ -34,7 +34,7 @@ #ifdef WIN32 #define XCHAT_DIR "X-Chat 2" @@ -36,7 +34,7 @@ diff -ur xchat-gnome-0.18.OLD/src/common/cfgfiles.c xchat-gnome-0.18/src/common/ #endif #define DEF_FONT "Monospace 9" -@@ -351,7 +351,7 @@ +@@ -351,7 +351,7 @@ check_prefs_dir (void) #else if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) #endif @@ -45,11 +43,10 @@ diff -ur xchat-gnome-0.18.OLD/src/common/cfgfiles.c xchat-gnome-0.18/src/common/ } } -Only in xchat-gnome-0.18/src/common: cfgfiles.c~ -diff -ur xchat-gnome-0.18.OLD/src/common/fe.h xchat-gnome-0.18/src/common/fe.h ---- xchat-gnome-0.18.OLD/src/common/fe.h 2007-06-12 20:21:16.000000000 -0400 -+++ xchat-gnome-0.18/src/common/fe.h 2007-07-09 10:25:46.000000000 -0400 -@@ -106,7 +106,7 @@ +diff -urp xchat-gnome-0.23.92.OLD/src/common/fe.h xchat-gnome-0.23.92/src/common/fe.h +--- xchat-gnome-0.23.92.OLD/src/common/fe.h 2007-07-09 05:30:58.000000000 -0400 ++++ xchat-gnome-0.23.92/src/common/fe.h 2008-09-09 19:05:21.000000000 -0400 +@@ -106,7 +106,7 @@ void fe_get_str (char *prompt, char *def void fe_get_int (char *prompt, int def, void *callback, void *ud); #define FRF_WRITE 1 /* save file */ #define FRF_MULTIPLE 2 /* multi-select */ @@ -58,11 +55,10 @@ diff -ur xchat-gnome-0.18.OLD/src/common/fe.h xchat-gnome-0.18/src/common/fe.h #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ #define FRF_FILTERISINITIAL 16 /* unused */ #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ -Only in xchat-gnome-0.18/src/common: fe.h~ -diff -ur xchat-gnome-0.18.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.18/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.18.OLD/src/fe-gnome/preferences-page-plugins.c 2007-03-31 07:07:34.000000000 -0400 -+++ xchat-gnome-0.18/src/fe-gnome/preferences-page-plugins.c 2007-07-09 10:25:27.000000000 -0400 -@@ -240,7 +240,7 @@ +diff -urp xchat-gnome-0.23.92.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.23.92/src/fe-gnome/preferences-page-plugins.c +--- xchat-gnome-0.23.92.OLD/src/fe-gnome/preferences-page-plugins.c 2007-07-24 05:24:39.000000000 -0400 ++++ xchat-gnome-0.23.92/src/fe-gnome/preferences-page-plugins.c 2008-09-09 19:06:27.000000000 -0400 +@@ -242,7 +242,7 @@ open_plugin_clicked (GtkButton *button, file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); homedir = g_get_home_dir(); @@ -71,7 +67,7 @@ diff -ur xchat-gnome-0.18.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); g_free (plugindir); -@@ -434,7 +434,7 @@ +@@ -417,7 +417,7 @@ preferences_page_plugins_check_plugins ( xchat_plugin *plugin; homedir = g_get_home_dir (); @@ -80,4 +76,3 @@ diff -ur xchat-gnome-0.18.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnom for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); -Only in xchat-gnome-0.18/src/fe-gnome: preferences-page-plugins.c~ diff --git a/xchat-gnome-0.23.92-deps.patch b/xchat-gnome-0.23.92-deps.patch new file mode 100644 index 0000000..ddae843 --- /dev/null +++ b/xchat-gnome-0.23.92-deps.patch @@ -0,0 +1,38 @@ +--- trunk/configure.ac 2008/09/09 20:15:27 2670 ++++ trunk/configure.ac 2008/09/09 22:52:52 2671 +@@ -122,7 +122,7 @@ + AC_SUBST([LIBNOTIFY_LIBS]) + fi + +-AM_CONDITIONAL([ENABLE_LIBNOTIFY],[test "$enable_notification" = "yes"]) ++AM_CONDITIONAL([ENABLE_LIBNOTIFY],[test "x$enable_notification" = "xyes"]) + + # libcanberra-gtk + AC_MSG_CHECKING([whether to enable notification sounds using libcanberra]) +@@ -137,7 +137,7 @@ + AC_SUBST([LIBCANBERRAGTK_LIBS]) + fi + +-AM_CONDITIONAL([ENABLE_LIBCANBERRA],[test "$enable_canberra" = "yes"]) ++AM_CONDITIONAL([ENABLE_LIBCANBERRA],[test "x$enable_canberra" = "xyes"]) + + # GConf + AM_GCONF_SOURCE_2 +@@ -359,7 +359,7 @@ + DIST_PLUGINS="$ALL_PLUGINS $CANBERRA_PLUGINS $DBUS_PLUGINS $LIBNOTIFY_PLUGINS $PYTHON_PLUGINS $PERL_PLUGINS $TCL_PLUGINS" + + # canberra specific plugins +-if test "x$libcanberra" = "xyes"; then ++if test "x$enable_canberra" = "xyes"; then + ALL_PLUGINS="$ALL_PLUGINS $CANBERRA_PLUGINS" + else + AC_MSG_WARN([xchat-gnome compiled without libcanberra support, plugins $CANBERRA_PLUGINS will not be available]) +@@ -373,7 +373,7 @@ + fi + + # libnotify-specific plugins +-if test "x$libnotify" = "xyes"; then ++if test "x$enable_notification" = "xyes"; then + ALL_PLUGINS="$ALL_PLUGINS $LIBNOTIFY_PLUGINS" + else + AC_MSG_WARN([xchat-gnome compiled without libnotify support, plugins $LIBNOTIFY_PLUGINS will not be available]) diff --git a/xchat-gnome-fix_away_command.patch b/xchat-gnome-fix_away_command.patch deleted file mode 100644 index e51c7a3..0000000 --- a/xchat-gnome-fix_away_command.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- a/src/fe-gnome/main-window.c 2007-03-19 05:27:06.000000000 +0530 -+++ b/src/fe-gnome/main-window.c 2008-02-04 10:57:18.000000000 +0530 -@@ -496,7 +496,7 @@ - on_nickname_clicked (GtkButton *widget, gpointer user_data) - { - GtkWidget *dialog; -- GtkWidget *entry, *away; -+ GtkWidget *entry, *away_button; - gint result; - - if (gui.current_session == NULL) { -@@ -506,10 +506,10 @@ - - dialog = glade_xml_get_widget (gui.xml, "nickname dialog"); - entry = glade_xml_get_widget (gui.xml, "nickname dialog entry"); -- away = glade_xml_get_widget (gui.xml, "nickname dialog away"); -+ away_button = glade_xml_get_widget (gui.xml, "nickname dialog away"); - - gtk_entry_set_text (GTK_ENTRY (entry), current_sess->server->nick); -- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (away), current_sess->server->is_away); -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (away_button), current_sess->server->is_away); - g_signal_connect (G_OBJECT (entry), "activate", G_CALLBACK (nickname_dialog_entry_activated), dialog); - - result = gtk_dialog_run (GTK_DIALOG (dialog)); -@@ -532,11 +532,20 @@ - g_free (buf); - - /* Away */ -- if (current_sess->server->is_away != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away))) { -- if (all) { -- handle_command (current_sess, "allserv away", FALSE); -+ gboolean away = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (away_button)); -+ if (current_sess->server->is_away != away) { -+ if (away) { -+ if (all) { -+ handle_command (current_sess, "allserv away", FALSE); -+ } else { -+ handle_command (current_sess, "away", FALSE); -+ } - } else { -- handle_command (current_sess, "away", FALSE); -+ if (all) { -+ handle_command (current_sess, "allserv back", FALSE); -+ } else { -+ handle_command (current_sess, "back", FALSE); -+ } - } - } - } diff --git a/xchat-gnome-spellchecking.patch b/xchat-gnome-spellchecking.patch deleted file mode 100644 index 0ab47ce..0000000 --- a/xchat-gnome-spellchecking.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: src/fe-gnome/preferences-page-spellcheck.c -=================================================================== ---- src/fe-gnome/preferences-page-spellcheck.c (révision 2576) -+++ src/fe-gnome/preferences-page-spellcheck.c (copie de travail) -@@ -153,7 +153,7 @@ - COL_LANG_CODE, &lang, -1); - active = sexy_spell_entry_language_is_active (SEXY_SPELL_ENTRY (gui.text_entry), lang); - -- gtk_list_store_set (store, &iter, COL_LANG_ACTIVATED, !active, -1); -+ gtk_list_store_set (store, &iter, COL_LANG_ACTIVATED, active, -1); - } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter)); - } - } diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 457d8a3..4d91484 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,31 +1,42 @@ Name: xchat-gnome -Version: 0.18 -Release: 12%{?dist} +Version: 0.23.92 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet License: GPLv2+ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 +# Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 Patch0: %{name}-%{version}-config.patch -Patch1: %{name}-%{version}-reconnect.patch -Patch2: %{name}-fix_away_command.patch -Patch3: %{name}-spellchecking.patch -Patch4: %{name}-%{version}-it-translation.patch +# Backported patch to correctly set the libnotify and libcanberra options +# http://bugzilla.gnome.org/show_bug.cgi?id=551515 +Patch1: %{name}-%{version}-deps.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel Buildrequires: libsexy-devel >= 0.1.11 BuildRequires: libgnomeui-devel +BuildRequires: libnotify-devel +BuildRequires: glib2-devel >= 2.18.0 +BuildRequires: gtk2-devel >= 2.14.0 +BuildRequires: libcanberra-devel BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: scrollkeeper +BuildRequires: intltool BuildRequires: gettext BuildRequires: perl-devel BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils -BuildRequires: libnotify-devel +# The following BR can be dropped when deps patch is removed. +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: gettext-devel +BuildRequires: gnome-common +BuildRequires: gtk-doc Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) @@ -47,11 +58,8 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config -%patch1 -p1 -b .reconnect -%patch2 -p1 -b .away -%patch3 -p0 -b .spellchecking -%patch4 -p1 -b .translation - +%patch1 -p1 -b .deps +autoreconf %build %configure --disable-tcl \ @@ -139,6 +147,15 @@ fi %changelog +* Tue Sep 9 2008 Brian Pepple - 0.23.92-1 +- Update to 0.23.92. +- Add deps patch to correctly set libnotify & libcanberra options. +- Update BR. +- Drop reconnect patch. Fixed upstream. +- Drop away-command patch. Fixed upstream. +- Drop spell-checking patch. Fixed upstream. +- Drop it-translation patch. Fixed upstream. + * Thu Mar 27 2008 Brian Pepple - 0.18-12 - Add patch to fix italian translation bug. (#431133) From 9676c3022773fe524beff4232afa1f792be7f15d Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Tue, 23 Sep 2008 23:20:00 +0000 Subject: [PATCH 031/105] - Update to 0.24.0. - Drop deps patch. Fixed upstream. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome-0.23.92-deps.patch | 38 ---------------------------------- xchat-gnome.spec | 21 +++++++------------ 4 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 xchat-gnome-0.23.92-deps.patch diff --git a/.cvsignore b/.cvsignore index 16a29bc..55a13bd 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.23.92.tar.bz2 +xchat-gnome-0.24.0.tar.bz2 diff --git a/sources b/sources index 7748412..7b48cd3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -780963419d487cefa7c1dac14696140c xchat-gnome-0.23.92.tar.bz2 +925010f01f593e6ff7027f2ba523c607 xchat-gnome-0.24.0.tar.bz2 diff --git a/xchat-gnome-0.23.92-deps.patch b/xchat-gnome-0.23.92-deps.patch deleted file mode 100644 index ddae843..0000000 --- a/xchat-gnome-0.23.92-deps.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- trunk/configure.ac 2008/09/09 20:15:27 2670 -+++ trunk/configure.ac 2008/09/09 22:52:52 2671 -@@ -122,7 +122,7 @@ - AC_SUBST([LIBNOTIFY_LIBS]) - fi - --AM_CONDITIONAL([ENABLE_LIBNOTIFY],[test "$enable_notification" = "yes"]) -+AM_CONDITIONAL([ENABLE_LIBNOTIFY],[test "x$enable_notification" = "xyes"]) - - # libcanberra-gtk - AC_MSG_CHECKING([whether to enable notification sounds using libcanberra]) -@@ -137,7 +137,7 @@ - AC_SUBST([LIBCANBERRAGTK_LIBS]) - fi - --AM_CONDITIONAL([ENABLE_LIBCANBERRA],[test "$enable_canberra" = "yes"]) -+AM_CONDITIONAL([ENABLE_LIBCANBERRA],[test "x$enable_canberra" = "xyes"]) - - # GConf - AM_GCONF_SOURCE_2 -@@ -359,7 +359,7 @@ - DIST_PLUGINS="$ALL_PLUGINS $CANBERRA_PLUGINS $DBUS_PLUGINS $LIBNOTIFY_PLUGINS $PYTHON_PLUGINS $PERL_PLUGINS $TCL_PLUGINS" - - # canberra specific plugins --if test "x$libcanberra" = "xyes"; then -+if test "x$enable_canberra" = "xyes"; then - ALL_PLUGINS="$ALL_PLUGINS $CANBERRA_PLUGINS" - else - AC_MSG_WARN([xchat-gnome compiled without libcanberra support, plugins $CANBERRA_PLUGINS will not be available]) -@@ -373,7 +373,7 @@ - fi - - # libnotify-specific plugins --if test "x$libnotify" = "xyes"; then -+if test "x$enable_notification" = "xyes"; then - ALL_PLUGINS="$ALL_PLUGINS $LIBNOTIFY_PLUGINS" - else - AC_MSG_WARN([xchat-gnome compiled without libnotify support, plugins $LIBNOTIFY_PLUGINS will not be available]) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 4d91484..ec54ab5 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,5 +1,5 @@ Name: xchat-gnome -Version: 0.23.92 +Version: 0.24.0 Release: 1%{?dist} Summary: GNOME front-end to xchat @@ -8,10 +8,7 @@ License: GPLv2+ URL: http://%{name}.navi.cx/ Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 -Patch0: %{name}-%{version}-config.patch -# Backported patch to correctly set the libnotify and libcanberra options -# http://bugzilla.gnome.org/show_bug.cgi?id=551515 -Patch1: %{name}-%{version}-deps.patch +Patch0: %{name}-0.23.92-config.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -30,13 +27,6 @@ BuildRequires: perl-devel BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils -# The following BR can be dropped when deps patch is removed. -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool -BuildRequires: gettext-devel -BuildRequires: gnome-common -BuildRequires: gtk-doc Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) @@ -58,8 +48,7 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config -%patch1 -p1 -b .deps -autoreconf + %build %configure --disable-tcl \ @@ -147,6 +136,10 @@ fi %changelog +* Tue Sep 23 2008 Brian Pepple - 0.24.0-1 +- Update to 0.24.0. +- Drop deps patch. Fixed upstream. + * Tue Sep 9 2008 Brian Pepple - 0.23.92-1 - Update to 0.23.92. - Add deps patch to correctly set libnotify & libcanberra options. From 7decc85191ae6eef8a8c5dd27e0ba534f52c4865 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sat, 15 Nov 2008 02:17:15 +0000 Subject: [PATCH 032/105] - Update to 0.24.1. - Update Source URL. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome.spec | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index 55a13bd..9689b10 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.24.0.tar.bz2 +xchat-gnome-0.24.1.tar.bz2 diff --git a/sources b/sources index 7b48cd3..5673e90 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -925010f01f593e6ff7027f2ba523c607 xchat-gnome-0.24.0.tar.bz2 +34738e4bfd0cb4a6627f6b40a99932d2 xchat-gnome-0.24.1.tar.bz2 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index ec54ab5..f7a25aa 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,12 +1,12 @@ Name: xchat-gnome -Version: 0.24.0 +Version: 0.24.1 Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet License: GPLv2+ URL: http://%{name}.navi.cx/ -Source0: http://flapjack.navi.cx/releases/%{name}/%{name}-%{version}.tar.bz2 +Source0: http://ftp.acc.umu.se/pub/gnome/sources/%{name}/0.24/%{name}-%{version}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 Patch0: %{name}-0.23.92-config.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -136,6 +136,10 @@ fi %changelog +* Fri Nov 14 2008 Brian Pepple - 0.24.1-1 +- Update to 0.24.1. +- Update Source URL. + * Tue Sep 23 2008 Brian Pepple - 0.24.0-1 - Update to 0.24.0. - Drop deps patch. Fixed upstream. From d0b8f25f0ca1352e21878b7f65e76b3e56ff97cc Mon Sep 17 00:00:00 2001 From: Ignacio Vazquez-Abrams Date: Mon, 1 Dec 2008 05:03:55 +0000 Subject: [PATCH 033/105] Rebuild for Python 2.6 --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f7a25aa..cd01e43 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.24.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -136,6 +136,9 @@ fi %changelog +* Sun Nov 30 2008 Ignacio Vazquez-Abrams - 0.24.1-2 +- Rebuild for Python 2.6 + * Fri Nov 14 2008 Brian Pepple - 0.24.1-1 - Update to 0.24.1. - Update Source URL. From f40db56dc4cb61c0bf428c0771ff814368aed7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mr=C3=A1z?= Date: Sun, 18 Jan 2009 17:57:34 +0000 Subject: [PATCH 034/105] - rebuild with new openssl --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index cd01e43..647625d 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.24.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -136,6 +136,9 @@ fi %changelog +* Sun Jan 18 2009 Tomas Mraz - 0.24.1-3 +- rebuild with new openssl + * Sun Nov 30 2008 Ignacio Vazquez-Abrams - 0.24.1-2 - Rebuild for Python 2.6 From f4189aab71472522519945baf2996d871dd96813 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Thu, 29 Jan 2009 18:40:31 +0000 Subject: [PATCH 035/105] - Update to 0.24.3.1. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome.spec | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index 9689b10..07b4524 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.24.1.tar.bz2 +xchat-gnome-0.24.3.1.tar.bz2 diff --git a/sources b/sources index 5673e90..1f31bb0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -34738e4bfd0cb4a6627f6b40a99932d2 xchat-gnome-0.24.1.tar.bz2 +1405351c615c93a9fed0535eac6105b4 xchat-gnome-0.24.3.1.tar.bz2 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 647625d..283e65d 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome -Version: 0.24.1 -Release: 3%{?dist} +Version: 0.24.3.1 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -136,6 +136,9 @@ fi %changelog +* Thu Jan 29 2009 Brian Pepple - 0.24.3.1-1 +- Update to 0.24.3.1. + * Sun Jan 18 2009 Tomas Mraz - 0.24.1-3 - rebuild with new openssl From 2d92581617626e8d31c64c5fe6f22ac89a8ac68d Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 26 Feb 2009 08:04:16 +0000 Subject: [PATCH 036/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 283e65d..bf82513 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.24.3.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -136,6 +136,9 @@ fi %changelog +* Thu Feb 26 2009 Fedora Release Engineering - 0.24.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + * Thu Jan 29 2009 Brian Pepple - 0.24.3.1-1 - Update to 0.24.3.1. From 2912ff994ebabe90fec816ca9779acc3b411497c Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Tue, 31 Mar 2009 23:17:07 +0000 Subject: [PATCH 037/105] - Update to 0.26.0. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome.spec | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.cvsignore b/.cvsignore index 07b4524..8c747f0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.24.3.1.tar.bz2 +xchat-gnome-0.26.0.tar.bz2 diff --git a/sources b/sources index 1f31bb0..efc556d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1405351c615c93a9fed0535eac6105b4 xchat-gnome-0.24.3.1.tar.bz2 +ef230db0d104faa8dc7e5060c51f7261 xchat-gnome-0.26.0.tar.bz2 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index bf82513..dddf793 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,12 +1,12 @@ Name: xchat-gnome -Version: 0.24.3.1 -Release: 2%{?dist} +Version: 0.26.0 +Release: 1%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet License: GPLv2+ URL: http://%{name}.navi.cx/ -Source0: http://ftp.acc.umu.se/pub/gnome/sources/%{name}/0.24/%{name}-%{version}.tar.bz2 +Source0: http://ftp.acc.umu.se/pub/gnome/sources/%{name}/0.26/%{name}-%{version}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 Patch0: %{name}-0.23.92-config.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -136,6 +136,9 @@ fi %changelog +* Tue Mar 31 2009 Brian Pepple - 0.26.0-1 +- Update to 0.26.0. + * Thu Feb 26 2009 Fedora Release Engineering - 0.24.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild From 8be20f9636de81533c279e899c0d46d725ab0d65 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sat, 18 Apr 2009 22:56:53 +0000 Subject: [PATCH 038/105] - Update to 0.26.1. --- .cvsignore | 2 +- sources | 2 +- xchat-gnome.spec | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cvsignore b/.cvsignore index 8c747f0..dc6a32d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xchat-gnome-0.26.0.tar.bz2 +xchat-gnome-0.26.1.tar.bz2 diff --git a/sources b/sources index efc556d..bb6869b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ef230db0d104faa8dc7e5060c51f7261 xchat-gnome-0.26.0.tar.bz2 +c9ce3d6e549736edfc1a1dc0282fb363 xchat-gnome-0.26.1.tar.bz2 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index dddf793..45bb588 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,5 +1,5 @@ Name: xchat-gnome -Version: 0.26.0 +Version: 0.26.1 Release: 1%{?dist} Summary: GNOME front-end to xchat @@ -136,6 +136,9 @@ fi %changelog +* Sat Apr 18 2009 Brian Pepple - 0.26.1-1 +- Update to 0.26.1. + * Tue Mar 31 2009 Brian Pepple - 0.26.0-1 - Update to 0.26.0. From 6b71f6632e99e6e85b2fb954a9ecfa2591aa32e0 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 10 May 2009 12:16:50 +0000 Subject: [PATCH 039/105] - Add patch to fix topic entry bug. (#483839) --- xchat-gnome.spec | 9 ++++++++- xchat-topic-update.patch | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 xchat-topic-update.patch diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 45bb588..ee642e8 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -9,6 +9,9 @@ URL: http://%{name}.navi.cx/ Source0: http://ftp.acc.umu.se/pub/gnome/sources/%{name}/0.26/%{name}-%{version}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 Patch0: %{name}-0.23.92-config.patch +# Patch to fix pressing "enter" in the middle of editing channel topic. +# RH Bug #483839 +Patch1: xchat-topic-update.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -48,6 +51,7 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config +%patch1 -p1 -b .topic %build @@ -136,6 +140,9 @@ fi %changelog +* Sun May 10 2009 Brian Pepple - 0.26.1-2 +- Add patch to fix topic entry bug. (#483839) + * Sat Apr 18 2009 Brian Pepple - 0.26.1-1 - Update to 0.26.1. diff --git a/xchat-topic-update.patch b/xchat-topic-update.patch new file mode 100644 index 0000000..8c912f1 --- /dev/null +++ b/xchat-topic-update.patch @@ -0,0 +1,28 @@ +diff --git a/src/fe-gnome/topic-label.c b/src/fe-gnome/topic-label.c +index a7d1883..334a196 100644 +--- a/src/fe-gnome/topic-label.c ++++ b/src/fe-gnome/topic-label.c +@@ -267,8 +267,7 @@ topic_label_change_current (TopicLabel *label) + g_free (title); + + gchar *topic = priv->current->topic; +- GtkTextBuffer *buffer = gtk_text_buffer_new (NULL); +- gtk_text_view_set_buffer (GTK_TEXT_VIEW (entry), buffer); ++ GtkTextBuffer *buffer = gtk_text_view_get_buffer ( GTK_TEXT_VIEW (entry)); + g_signal_connect (G_OBJECT (buffer), "insert-text", G_CALLBACK (topic_entry_activate), dialog); + if (topic) { + gtk_text_buffer_set_text (buffer, topic, -1); +@@ -282,6 +281,12 @@ topic_label_change_current (TopicLabel *label) + gtk_widget_hide (dialog); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_NONE); + gchar *newtopic = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); ++ /* bz:536916 – Pressing "Enter" in the middle of editing channel topic truncates ++ * ignore "\n" aka enter key ++ */ ++ glong i, len = g_utf8_strlen (newtopic, -1); ++ for (i=0; i< len; i++) ++ if (newtopic[i]=='\n') newtopic[i]=' '; + priv->current->server->p_topic (priv->current->server, priv->current->channel, newtopic); + g_free (newtopic); + } + From ec21f583307543b29652868f334f7fa02af31523 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sat, 20 Jun 2009 00:04:00 +0000 Subject: [PATCH 040/105] - Fix topic patch. --- xchat-gnome.spec | 5 ++++- xchat-topic-update.patch | 40 ++++++++++++++++------------------------ 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index ee642e8..bdf4250 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -140,6 +140,9 @@ fi %changelog +* Fri Jun 19 2009 Brian Pepple - 0.26.1-3 +- Fix topic patch. + * Sun May 10 2009 Brian Pepple - 0.26.1-2 - Add patch to fix topic entry bug. (#483839) diff --git a/xchat-topic-update.patch b/xchat-topic-update.patch index 8c912f1..b572469 100644 --- a/xchat-topic-update.patch +++ b/xchat-topic-update.patch @@ -1,28 +1,20 @@ +From 6d1a939a14de918de4a79c010d82796f8035bcfa Mon Sep 17 00:00:00 2001 +From: Josselin Mouette <^Css@malsain.org> +Date: Thu, 18 Jun 2009 09:41:33 +0000 +Subject: Bug 536916 – Pressing "Enter" in the middle of editing channel topic truncates it. + +--- diff --git a/src/fe-gnome/topic-label.c b/src/fe-gnome/topic-label.c -index a7d1883..334a196 100644 +index a7d1883..977d29c 100644 --- a/src/fe-gnome/topic-label.c +++ b/src/fe-gnome/topic-label.c -@@ -267,8 +267,7 @@ topic_label_change_current (TopicLabel *label) - g_free (title); - - gchar *topic = priv->current->topic; -- GtkTextBuffer *buffer = gtk_text_buffer_new (NULL); -- gtk_text_view_set_buffer (GTK_TEXT_VIEW (entry), buffer); -+ GtkTextBuffer *buffer = gtk_text_view_get_buffer ( GTK_TEXT_VIEW (entry)); - g_signal_connect (G_OBJECT (buffer), "insert-text", G_CALLBACK (topic_entry_activate), dialog); - if (topic) { - gtk_text_buffer_set_text (buffer, topic, -1); -@@ -282,6 +281,12 @@ topic_label_change_current (TopicLabel *label) - gtk_widget_hide (dialog); - gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_NONE); - gchar *newtopic = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); -+ /* bz:536916 – Pressing "Enter" in the middle of editing channel topic truncates -+ * ignore "\n" aka enter key -+ */ -+ glong i, len = g_utf8_strlen (newtopic, -1); -+ for (i=0; i< len; i++) -+ if (newtopic[i]=='\n') newtopic[i]=' '; - priv->current->server->p_topic (priv->current->server, priv->current->channel, newtopic); - g_free (newtopic); +@@ -315,6 +315,7 @@ static void + topic_entry_activate (GtkTextBuffer *textbuffer, GtkTextIter *arg1, gchar *text, gint len, GtkDialog *dialog) + { + if (strncmp (text, "\n", len) == 0) { ++ g_signal_stop_emission_by_name (G_OBJECT (textbuffer), "insert-text"); + gtk_dialog_response (dialog, GTK_RESPONSE_OK); } - + } +-- +cgit v0.8.2 From 96046ad475831e72b10df6e563d8443ea7ddd40f Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Mon, 27 Jul 2009 07:39:55 +0000 Subject: [PATCH 041/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index bdf4250..bef9a8c 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -140,6 +140,9 @@ fi %changelog +* Mon Jul 27 2009 Fedora Release Engineering - 0.26.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + * Fri Jun 19 2009 Brian Pepple - 0.26.1-3 - Fix topic patch. From 4ea7f9e465a193c0e3b9a5f37045b9cdc4f4c461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mr=C3=A1z?= Date: Fri, 21 Aug 2009 16:32:11 +0000 Subject: [PATCH 042/105] - rebuilt with new openssl --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index bef9a8c..d304afd 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -140,6 +140,9 @@ fi %changelog +* Fri Aug 21 2009 Tomas Mraz - 0.26.1-5 +- rebuilt with new openssl + * Mon Jul 27 2009 Fedora Release Engineering - 0.26.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild From 145e68be4caeb54f36ff436e645026f807d292a3 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 22:40:54 +0000 Subject: [PATCH 043/105] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 032c409..928c5f5 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: xchat-gnome -# $Id$ +# $Id: Makefile,v 1.1 2005/11/12 14:44:36 bpepple Exp $ NAME := xchat-gnome SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From d854a22d13ea17ba2997cd09f6aa4bc42a18cdad Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:29:44 +0000 Subject: [PATCH 044/105] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 032c409..02b1948 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NAME := xchat-gnome SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 5d93bc2ce4a5f4c5591e249a994270af53d3868e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Kasal?= Date: Mon, 7 Dec 2009 00:15:19 +0000 Subject: [PATCH 045/105] - rebuild against perl 5.10.1 --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index d304afd..dc2a038 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -140,6 +140,9 @@ fi %changelog +* Mon Dec 7 2009 Stepan Kasal - 0.26.1-6 +- rebuild against perl 5.10.1 + * Fri Aug 21 2009 Tomas Mraz - 0.26.1-5 - rebuilt with new openssl From cdd4e6b1f6c6d183e094b5186a4024f11acb8e9d Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Wed, 13 Jan 2010 17:57:52 +0000 Subject: [PATCH 046/105] - Add patch to fix crash. (#550662) --- xchat-gnome-crasher.patch | 103 ++++++++++++++++++++++++++++++++++++++ xchat-gnome.spec | 9 +++- 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-crasher.patch diff --git a/xchat-gnome-crasher.patch b/xchat-gnome-crasher.patch new file mode 100644 index 0000000..ead398e --- /dev/null +++ b/xchat-gnome-crasher.patch @@ -0,0 +1,103 @@ +From 1418579a815af27190b56ac3595ec8bae5b71647 Mon Sep 17 00:00:00 2001 +From: Ritesh Khadgaray +Date: Wed, 13 Jan 2010 17:26:02 +0000 +Subject: Bug 592491 - xchat-gnome crashed with SIGSEGV in handle_command( + +Probable fix. This should also fix +rh bug 550662 - [abrt] crash detected in xchat-gnome-0.26.1-5.fc12 +--- +diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c +index f1ab1a8..a47f710 100644 +--- a/src/common/proto-irc.c ++++ b/src/common/proto-irc.c +@@ -44,7 +44,7 @@ + static void + irc_login (server *serv, char *user, char *realname) + { +- if (serv->password[0]) ++ if (serv->password) + tcp_sendf (serv, "PASS %s\r\n", serv->password); + + tcp_sendf (serv, +@@ -87,7 +87,7 @@ irc_ns_ghost (server *serv, char *usname, char *pass) + static void + irc_join (server *serv, char *channel, char *key) + { +- if (key[0]) ++ if (key) + tcp_sendf (serv, "JOIN %s %s\r\n", channel, key); + else + tcp_sendf (serv, "JOIN %s\r\n", channel); +@@ -96,7 +96,7 @@ irc_join (server *serv, char *channel, char *key) + static void + irc_part (server *serv, char *channel, char *reason) + { +- if (reason[0]) ++ if (reason) + tcp_sendf (serv, "PART %s :%s\r\n", channel, reason); + else + tcp_sendf (serv, "PART %s\r\n", channel); +@@ -105,7 +105,7 @@ irc_part (server *serv, char *channel, char *reason) + static void + irc_quit (server *serv, char *reason) + { +- if (reason[0]) ++ if (reason) + tcp_sendf (serv, "QUIT :%s\r\n", reason); + else + tcp_send_len (serv, "QUIT\r\n", 6); +@@ -114,15 +114,16 @@ irc_quit (server *serv, char *reason) + static void + irc_set_back (server *serv) + { +- tcp_send_len (serv, "AWAY\r\n", 6); ++ tcp_send_len (serv, "BACK\r\n", 6); + } + + static void + irc_set_away (server *serv, char *reason) + { +- if (!reason[0]) +- reason = " "; +- tcp_sendf (serv, "AWAY :%s\r\n", reason); ++ if (reason) ++ tcp_sendf (serv, "AWAY :%s\r\n", reason); ++ else ++ tcp_send_len (serv, "AWAY", 6); + } + + static void +@@ -146,7 +147,7 @@ irc_cycle (server *serv, char *channel, char *key) + static void + irc_kick (server *serv, char *channel, char *nick, char *reason) + { +- if (reason[0]) ++ if (reason) + tcp_sendf (serv, "KICK %s %s :%s\r\n", channel, nick, reason); + else + tcp_sendf (serv, "KICK %s %s\r\n", channel, nick); +@@ -235,18 +236,16 @@ irc_notice (server *serv, char *channel, char *text) + static void + irc_topic (server *serv, char *channel, char *topic) + { +- if (!topic) +- tcp_sendf (serv, "TOPIC %s :\r\n", channel); +- else if (topic[0]) +- tcp_sendf (serv, "TOPIC %s :%s\r\n", channel, topic); ++ if (topic) ++ tcp_sendf (serv, "TOPIC %s :%s\r\n", channel, topic); + else +- tcp_sendf (serv, "TOPIC %s\r\n", channel); ++ tcp_sendf (serv, "TOPIC %s :\r\n", channel); + } + + static void + irc_list_channels (server *serv, char *arg, int min_users) + { +- if (arg[0]) ++ if (arg) + { + tcp_sendf (serv, "LIST %s\r\n", arg); + return; +-- +cgit v0.8.3.1 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index dc2a038..a682fcc 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -12,6 +12,9 @@ Patch0: %{name}-0.23.92-config.patch # Patch to fix pressing "enter" in the middle of editing channel topic. # RH Bug #483839 Patch1: xchat-topic-update.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=550662 +Patch2: %{name}-crasher.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel @@ -52,6 +55,7 @@ common settings will be included in the main user interface. . %setup -q -n %{name}-%{version} %patch0 -p1 -b .config %patch1 -p1 -b .topic +%patch2 -p1 -b .crasher %build @@ -140,6 +144,9 @@ fi %changelog +* Wed Jan 13 2010 Brian Pepple - 0.26.1-7 +- Add patch to fix crash. (#550662) + * Mon Dec 7 2009 Stepan Kasal - 0.26.1-6 - rebuild against perl 5.10.1 From 6a373d62bcecef1bd4b18328687f79e30ad7ccb3 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Mon, 18 Jan 2010 14:51:11 +0000 Subject: [PATCH 047/105] - Add patch to fix regression with bing unable to set status 'back'. --- status_fix.patch | 22 ++++++++++++++++++++++ xchat-gnome.spec | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 status_fix.patch diff --git a/status_fix.patch b/status_fix.patch new file mode 100644 index 0000000..270f20b --- /dev/null +++ b/status_fix.patch @@ -0,0 +1,22 @@ +From ac131cab5e5429525aed592b504bae9d6ee92069 Mon Sep 17 00:00:00 2001 +From: Ritesh Khadgaray +Date: Fri, 15 Jan 2010 07:37:40 +0000 +Subject: Bug 592491 - xchat-gnome crashed with SIGSEGV in handle_command( + +fixed a regression. Was unable to set status "back". +--- +diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c +index a47f710..cc13892 100644 +--- a/src/common/proto-irc.c ++++ b/src/common/proto-irc.c +@@ -114,7 +114,7 @@ irc_quit (server *serv, char *reason) + static void + irc_set_back (server *serv) + { +- tcp_send_len (serv, "BACK\r\n", 6); ++ tcp_send_len (serv, "AWAY\r\n", 6); + } + + static void +-- +cgit v0.8.3.1 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a682fcc..b008633 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -14,6 +14,8 @@ Patch0: %{name}-0.23.92-config.patch Patch1: xchat-topic-update.patch # https://bugzilla.redhat.com/show_bug.cgi?id=550662 Patch2: %{name}-crasher.patch +# http://git.gnome.org/browse/xchat-gnome/commit/?id=ac131cab5e5429525aed592b504bae9d6ee92069 +Patch3: status_fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -56,6 +58,7 @@ common settings will be included in the main user interface. . %patch0 -p1 -b .config %patch1 -p1 -b .topic %patch2 -p1 -b .crasher +%patch3 -p1 -b .status %build @@ -144,6 +147,9 @@ fi %changelog +* Mon Jan 18 2010 Brian Pepple - 0.26.1-8 +- Add patch to fix regression with bing unable to set status 'back'. + * Wed Jan 13 2010 Brian Pepple - 0.26.1-7 - Add patch to fix crash. (#550662) From c21145399a4d828d8fa111004b7840c20e0e41c1 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 7 Mar 2010 21:02:43 +0000 Subject: [PATCH 048/105] - Add patch to fix DSOLinking. (#564820) --- xchat-gnome-DSOLink.patch | 44 +++++++++++++++++++++++++++++++++++++++ xchat-gnome.spec | 9 ++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 xchat-gnome-DSOLink.patch diff --git a/xchat-gnome-DSOLink.patch b/xchat-gnome-DSOLink.patch new file mode 100644 index 0000000..f92bec0 --- /dev/null +++ b/xchat-gnome-DSOLink.patch @@ -0,0 +1,44 @@ +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.am xchat-gnome-0.26.1/src/fe-gnome/Makefile.am +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.am 2007-04-24 18:43:05.000000000 -0400 ++++ xchat-gnome-0.26.1/src/fe-gnome/Makefile.am 2010-03-07 15:45:35.667276790 -0500 +@@ -113,6 +113,7 @@ xchat_gnome_CFLAGS = \ + $(AM_CFLAGS) + + xchat_gnome_LDFLAGS = \ ++ -lX11 \ + -export-dynamic \ + $(AM_LDFLAGS) + +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.in xchat-gnome-0.26.1/src/fe-gnome/Makefile.in +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.in 2009-04-12 13:48:06.000000000 -0400 ++++ xchat-gnome-0.26.1/src/fe-gnome/Makefile.in 2010-03-07 15:45:55.309526635 -0500 +@@ -449,6 +449,7 @@ xchat_gnome_CFLAGS = \ + $(AM_CFLAGS) + + xchat_gnome_LDFLAGS = \ ++ -lX11 \ + -export-dynamic \ + $(AM_LDFLAGS) + +diff -urp xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.am xchat-gnome-0.26.1/src/libcontrast/Makefile.am +--- xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.am 2007-04-24 18:43:04.000000000 -0400 ++++ xchat-gnome-0.26.1/src/libcontrast/Makefile.am 2010-03-07 15:56:15.164278726 -0500 +@@ -12,6 +12,7 @@ libcontrast_la_CFLAGS = \ + $(AM_CFLAGS) + + libcontrast_la_LDFLAGS = \ ++ -lm \ + $(AM_LDFLAGS) \ + -static + +diff -urp xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.in xchat-gnome-0.26.1/src/libcontrast/Makefile.in +--- xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.in 2009-04-12 13:48:06.000000000 -0400 ++++ xchat-gnome-0.26.1/src/libcontrast/Makefile.in 2010-03-07 15:56:35.529527068 -0500 +@@ -297,6 +297,7 @@ libcontrast_la_CFLAGS = \ + $(AM_CFLAGS) + + libcontrast_la_LDFLAGS = \ ++ -lm \ + $(AM_LDFLAGS) \ + -static + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index b008633..3770d02 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -16,6 +16,8 @@ Patch1: xchat-topic-update.patch Patch2: %{name}-crasher.patch # http://git.gnome.org/browse/xchat-gnome/commit/?id=ac131cab5e5429525aed592b504bae9d6ee92069 Patch3: status_fix.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=564820 +Patch4: %{name}-DSOLink.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -59,7 +61,7 @@ common settings will be included in the main user interface. . %patch1 -p1 -b .topic %patch2 -p1 -b .crasher %patch3 -p1 -b .status - +%patch4 -p1 -b .dsolink %build %configure --disable-tcl \ @@ -147,6 +149,9 @@ fi %changelog +* Sun Mar 7 2010 Brian Pepple - 0.26.1-9 +- Add patch to fix DSOLinking. (#564820) + * Mon Jan 18 2010 Brian Pepple - 0.26.1-8 - Add patch to fix regression with bing unable to set status 'back'. From 69a49ab09236abea0c0d30212f4b62f3d6ec8a92 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 28 Mar 2010 23:14:16 +0000 Subject: [PATCH 049/105] - Add patch for depreciated gtk macros. - Add patch to fix auto-accept dcc transfers. - Add patch for FreeNode port numbers. --- 0001-Added-port-numbers-for-Freenode.patch | 35 +++++ ...ansfer-timeouts-when-dcc_auto_send-2.patch | 37 +++++ xchat-gnome.spec | 16 +- xg-depreciated-macros.patch | 137 ++++++++++++++++++ 4 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 0001-Added-port-numbers-for-Freenode.patch create mode 100644 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch create mode 100644 xg-depreciated-macros.patch diff --git a/0001-Added-port-numbers-for-Freenode.patch b/0001-Added-port-numbers-for-Freenode.patch new file mode 100644 index 0000000..3e336fd --- /dev/null +++ b/0001-Added-port-numbers-for-Freenode.patch @@ -0,0 +1,35 @@ +From bc98c28e891408145bed2b18d3c02adbadadde31 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Sat, 30 Jan 2010 13:05:21 +0200 +Subject: [PATCH] Added port numbers for Freenode + +http://freenode.net/irc_servers.shtml +--- + src/common/servlist.c | 11 ++++++++++- + 1 files changed, 10 insertions(+), 1 deletions(-) + +diff --git a/src/common/servlist.c b/src/common/servlist.c +index c6839e0..3082966 100644 +--- a/src/common/servlist.c ++++ b/src/common/servlist.c +@@ -207,7 +207,16 @@ static const struct defaultserver def[] = + {0, "irc.vendetta.com"}, + + {"FreeNode", 0}, +- {0, "irc.freenode.net"}, ++ {0, "irc.freenode.net/6665"}, ++ {0, "irc.freenode.net/6666"}, ++ {0, "irc.freenode.net/6667"}, ++ {0, "irc.freenode.net/8000"}, ++ {0, "irc.freenode.net/8001"}, ++ {0, "irc.freenode.net/8002"}, ++#ifdef USE_OPENSSL ++ {0, "irc.freenode.net/+7000"}, ++ {0, "irc.freenode.net/+7070"}, ++#endif + + /* {"Freeworld", 0}, + {0, "kabel.freeworld.nu"}, +-- +1.6.6 + diff --git a/0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch b/0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch new file mode 100644 index 0000000..2124709 --- /dev/null +++ b/0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch @@ -0,0 +1,37 @@ +From 48af97ebe635389c8f176cc2ea5f9151474ca3eb Mon Sep 17 00:00:00 2001 +From: Adam Buchbinder +Date: Tue, 27 Oct 2009 11:04:00 -0400 +Subject: [PATCH] Fix DCC transfer timeouts when dcc_auto_send == 2. + +The default in xchat2 is to set dcc_auto_send to 2, which means +"browse for a download directory". However, xchat-gnome only uses +the values 0 and 1, and when the default is provided (inherited +from xchat2), the transfer simply waits for a confirmation popup +which never appears. + +The fix here is to make the default act the same as "0"; the user +will be prompted as to whether or not they want to save the file. + +This closes bug 599781. + +Signed-off-by: Adam Buchbinder +--- + src/fe-gnome/dcc-window.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/fe-gnome/dcc-window.c b/src/fe-gnome/dcc-window.c +index 463a974..92f2026 100644 +--- a/src/fe-gnome/dcc-window.c ++++ b/src/fe-gnome/dcc-window.c +@@ -207,7 +207,7 @@ dcc_window_add (DccWindow *window, struct DCC *dcc) + + /* If this is a recieve and auto-accept isn't turned on, pop up a + * confirmation dialog */ +- if ((dcc->type == TYPE_RECV) && (dcc->dccstat == STAT_QUEUED) && (prefs.autodccsend == FALSE)) { ++ if ((dcc->type == TYPE_RECV) && (dcc->dccstat == STAT_QUEUED) && (prefs.autodccsend != 1)) { + GtkWidget *dialog; + gint response; + +-- +1.6.0.4 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 3770d02..19bff3a 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -18,6 +18,11 @@ Patch2: %{name}-crasher.patch Patch3: status_fix.patch # https://bugzilla.redhat.com/show_bug.cgi?id=564820 Patch4: %{name}-DSOLink.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=608515 +Patch5: 0001-Added-port-numbers-for-Freenode.patch +Patch6: xg-depreciated-macros.patch +# https://bugzilla.gnome.org/599781 +Patch7: 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -62,6 +67,10 @@ common settings will be included in the main user interface. . %patch2 -p1 -b .crasher %patch3 -p1 -b .status %patch4 -p1 -b .dsolink +%patch5 -p1 -b .freenode +%patch6 -p1 -b .macros +%patch7 -p1 -b .dcc + %build %configure --disable-tcl \ @@ -149,6 +158,11 @@ fi %changelog +* Sun Mar 28 2010 Brian Pepple - 0.26.1-10 +- Add patch for depreciated gtk macros. +- Add patch to fix auto-accept dcc transfers. +- Add patch for FreeNode port numbers. + * Sun Mar 7 2010 Brian Pepple - 0.26.1-9 - Add patch to fix DSOLinking. (#564820) diff --git a/xg-depreciated-macros.patch b/xg-depreciated-macros.patch new file mode 100644 index 0000000..7a5dced --- /dev/null +++ b/xg-depreciated-macros.patch @@ -0,0 +1,137 @@ +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/fe-gnome.c xchat-gnome-0.26.1/src/fe-gnome/fe-gnome.c +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/fe-gnome.c 2008-09-07 09:18:45.000000000 -0400 ++++ xchat-gnome-0.26.1/src/fe-gnome/fe-gnome.c 2010-03-28 16:16:52.181405173 -0400 +@@ -753,7 +753,7 @@ fe_gui_info (session * sess, int info_ty + { + switch (info_type) { + case 0: +- if (!GTK_WIDGET_VISIBLE (GTK_WINDOW (gui.main_window))) { ++ if (!gtk_widget_get_visible (GTK_WIDGET (gui.main_window))) { + return 2; + } + if (gtk_window_is_active (GTK_WINDOW (gui.main_window))) { +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/find-bar.c xchat-gnome-0.26.1/src/fe-gnome/find-bar.c +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/find-bar.c 2007-03-09 10:42:57.000000000 -0500 ++++ xchat-gnome-0.26.1/src/fe-gnome/find-bar.c 2010-03-28 16:26:24.300405158 -0400 +@@ -247,7 +247,7 @@ find_bar_close (FindBar *bar) + { + gint position; + +- if (!GTK_WIDGET_VISIBLE (bar)) { ++ if (!gtk_widget_get_visible (GTK_WIDGET (bar))) { + return; + } + +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/text-entry.c xchat-gnome-0.26.1/src/fe-gnome/text-entry.c +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/text-entry.c 2008-09-07 10:02:45.000000000 -0400 ++++ xchat-gnome-0.26.1/src/fe-gnome/text-entry.c 2010-03-28 16:39:48.755153605 -0400 +@@ -667,7 +667,7 @@ text_entry_set_current (TextEntry *entry + char *selection = NULL, *text = NULL; + int start, end; + +- g_return_if_fail (GTK_WIDGET_REALIZED (widget)); ++ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (widget))); + + if (sess == priv->current) { + return; +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/userlist-gui.c xchat-gnome-0.26.1/src/fe-gnome/userlist-gui.c +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/userlist-gui.c 2008-10-13 17:02:16.000000000 -0400 ++++ xchat-gnome-0.26.1/src/fe-gnome/userlist-gui.c 2010-03-28 16:47:55.703154452 -0400 +@@ -261,12 +261,12 @@ userlist_gui_show (void) + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gui.userlist_toggle), TRUE); + +- if (!GTK_WIDGET_REALIZED (gui.userlist_window)) { ++ if (!gtk_widget_get_realized (GTK_WIDGET (gui.userlist_window))) { + gtk_widget_realize (gui.userlist_window); + } + gtk_widget_size_request (gui.userlist, &request); + +- if (GTK_WIDGET_REALIZED (gui.userlist_toggle)) ++ if (gtk_widget_get_realized (GTK_WIDGET (gui.userlist_toggle))) + anchor_widget = gui.userlist_toggle; + else + anchor_widget = gui.main_window; +diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/xtext.c xchat-gnome-0.26.1/src/fe-gnome/xtext.c +--- xchat-gnome-0.26.1.OLD/src/fe-gnome/xtext.c 2009-01-16 08:17:31.000000000 -0500 ++++ xchat-gnome-0.26.1/src/fe-gnome/xtext.c 2010-03-28 16:57:17.441402617 -0400 +@@ -1086,7 +1086,7 @@ gtk_xtext_size_allocate (GtkWidget * wid + xtext->avoid_trans = FALSE; + + widget->allocation = *allocation; +- if (GTK_WIDGET_REALIZED (widget)) ++ if (gtk_widget_get_realized (GTK_WIDGET (widget))) + { + xtext->buffer->window_width = allocation->width; + xtext->buffer->window_height = allocation->height; +@@ -4113,7 +4113,7 @@ gtk_xtext_set_palette (GtkXText * xtext, + xtext->palette[i] = palette[i].pixel; + } + +- if (GTK_WIDGET_REALIZED (xtext)) ++ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) + { + xtext_set_fg (xtext, xtext->fgc, XTEXT_FG); + xtext_set_bg (xtext, xtext->fgc, XTEXT_BG); +@@ -4211,7 +4211,7 @@ gtk_xtext_set_font (GtkXText *xtext, cha + + gtk_xtext_fix_indent (xtext->buffer); + +- if (GTK_WIDGET_REALIZED (xtext)) ++ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) + gtk_xtext_recalc_widths (xtext->buffer, TRUE); + + return TRUE; +@@ -4248,7 +4248,7 @@ gtk_xtext_set_background (GtkXText * xte + if (trans) + { + xtext->shaded = shaded; +- if (GTK_WIDGET_REALIZED (xtext)) ++ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) + gtk_xtext_load_trans (xtext); + return; + } +@@ -4260,14 +4260,14 @@ gtk_xtext_set_background (GtkXText * xte + if (pixmap != 0) + { + g_object_ref (pixmap); +- if (GTK_WIDGET_REALIZED (xtext)) ++ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) + { + gdk_gc_set_tile (xtext->bgc, pixmap); + gdk_gc_set_ts_origin (xtext->bgc, 0, 0); + xtext->ts_x = xtext->ts_y = 0; + gdk_gc_set_fill (xtext->bgc, GDK_TILED); + } +- } else if (GTK_WIDGET_REALIZED (xtext)) ++ } else if (gtk_widget_get_realized (GTK_WIDGET (xtext))) + { + g_object_unref (xtext->bgc); + val.subwindow_mode = GDK_INCLUDE_INFERIORS; +@@ -4516,7 +4516,7 @@ gtk_xtext_render_page (GtkXText * xtext) + int subline; + int startline = xtext->adj->value; + +- if(!GTK_WIDGET_REALIZED(xtext)) ++ if(!gtk_widget_get_realized (GTK_WIDGET (xtext))) + return; + + if (xtext->buffer->indent < MARGIN) +@@ -4636,7 +4636,7 @@ gtk_xtext_render_page (GtkXText * xtext) + void + gtk_xtext_refresh (GtkXText * xtext, int do_trans) + { +- if (GTK_WIDGET_REALIZED (GTK_WIDGET (xtext))) ++ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) + { + #if defined(USE_XLIB) || defined(WIN32) + if (xtext->transparent && do_trans) +@@ -5204,7 +5204,7 @@ gtk_xtext_buffer_show (GtkXText *xtext, + xtext->io_tag = 0; + } + +- if (!GTK_WIDGET_REALIZED (GTK_WIDGET (xtext))) ++ if (!gtk_widget_get_realized (GTK_WIDGET (xtext))) + gtk_widget_realize (GTK_WIDGET (xtext)); + + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &w, &h); From 2477be2f32dad8919008328e35c2e03eba9a31d8 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Sun, 25 Apr 2010 20:12:31 +0000 Subject: [PATCH 050/105] - Remove clean section. No longer needed. - Update scriptlets for gconf macros. --- xchat-gnome.spec | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 19bff3a..d331d48 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -42,6 +42,7 @@ BuildRequires: perl-devel BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils +BuildRequires: GConf2 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) @@ -91,28 +92,12 @@ desktop-file-install --vendor fedora --delete-original \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop -%clean -rm -rf $RPM_BUILD_ROOT - - %pre -if [ "$1" -gt 1 ]; then - export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" - for i in $SCHEMAS; do - gconftool-2 --makefile-uninstall-rule \ - %{_sysconfdir}/gconf/schemas/$i >/dev/null || : - done -fi +%gconf_schema_prepare apps_xchat notification urlscraper url_handler %post -export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` -SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" -for i in $SCHEMAS; do - gconftool-2 --makefile-install-rule \ - %{_sysconfdir}/gconf/schemas/$i > /dev/null || : -done +%gconf_schema_upgrade apps_xchat notification urlscraper url_handler scrollkeeper-update -q -o %{_datadir}/omf/%{name} || : touch --no-create %{_datadir}/icons/hicolor || : if [ -x %{_bindir}/gtk-update-icon-cache ]; then @@ -121,14 +106,7 @@ fi %preun -if [ "$1" -eq 0 ]; then - export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - SCHEMAS="apps_xchat.schemas notification.schemas urlscraper.schemas url_handler.schemas" - for i in $SCHEMAS; do - gconftool-2 --makefile-uninstall-rule \ - %{_sysconfdir}/gconf/schemas/$i > /dev/null || : - done -fi +%gconf_schema_remove apps_xchat notification urlscraper url_handler %postun @@ -158,6 +136,10 @@ fi %changelog +* Sun Apr 25 2010 Brian Pepple - 0.26.1-11 +- Remove clean section. No longer needed. +- Update scriptlets for gconf macros. + * Sun Mar 28 2010 Brian Pepple - 0.26.1-10 - Add patch for depreciated gtk macros. - Add patch to fix auto-accept dcc transfers. From 0e20d1ae6140330975e8f9cc2be8ba354bc9abb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcela=20Ma=C5=A1l=C3=A1=C5=88ov=C3=A1?= Date: Wed, 2 Jun 2010 09:22:32 +0000 Subject: [PATCH 051/105] - Mass rebuild with perl-5.12.0 --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index d331d48..240bde8 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -136,6 +136,9 @@ fi %changelog +* Wed Jun 02 2010 Marcela Maslanova - 0.26.1-12 +- Mass rebuild with perl-5.12.0 + * Sun Apr 25 2010 Brian Pepple - 0.26.1-11 - Remove clean section. No longer needed. - Update scriptlets for gconf macros. From 618b4ac57419dd8260094dbe1eeb2bed569427e7 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Tue, 27 Jul 2010 21:02:18 +0000 Subject: [PATCH 052/105] - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 240bde8..9496300 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -136,6 +136,9 @@ fi %changelog +* Tue Jul 27 2010 David Malcolm - 0.26.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + * Wed Jun 02 2010 Marcela Maslanova - 0.26.1-12 - Mass rebuild with perl-5.12.0 From a4932bb4d51d4d33d8b75e9f19fdd3e4d0f6efd4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 15:35:40 +0000 Subject: [PATCH 053/105] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- 2 files changed, 21 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 928c5f5..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: xchat-gnome -# $Id: Makefile,v 1.1 2005/11/12 14:44:36 bpepple Exp $ -NAME := xchat-gnome -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) From b484ee343ef91cf9ab27ea0ca62ddc169d43e981 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 15:35:48 +0000 Subject: [PATCH 054/105] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 02b1948..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: xchat-gnome -# $Id$ -NAME := xchat-gnome -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index d5b6362..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -FC-6 From 2be8b6f7d8fea5c944983a9fb056f9e13282584f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 31 Jul 2010 19:13:01 -0400 Subject: [PATCH 055/105] Add deprecated-symbol.patch - upstream commit 8d35b36baa8204b68c9520ec92327e34c1d7c580 - to fix FTBFS --- xchat-gnome-0.26.1-deprecated-symbol.patch | 22 ++++++++++++++++++++++ xchat-gnome.spec | 9 ++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.26.1-deprecated-symbol.patch diff --git a/xchat-gnome-0.26.1-deprecated-symbol.patch b/xchat-gnome-0.26.1-deprecated-symbol.patch new file mode 100644 index 0000000..5bf1e4e --- /dev/null +++ b/xchat-gnome-0.26.1-deprecated-symbol.patch @@ -0,0 +1,22 @@ +From 8d35b36baa8204b68c9520ec92327e34c1d7c580 Mon Sep 17 00:00:00 2001 +From: Ritesh Khadgaray +Date: Sun, 04 Jul 2010 09:52:07 +0000 +Subject: remove deprecated GTK+ symbols, GTK_WIDGET_SET_FLAGS. + +--- +diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c +index 92562a3..51503f8 100644 +--- a/src/fe-gnome/xtext.c ++++ b/src/fe-gnome/xtext.c +@@ -963,7 +963,7 @@ gtk_xtext_realize (GtkWidget * widget) + GdkColor col; + GdkColormap *cmap; + +- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); ++ gtk_widget_set_realized (widget, TRUE); + xtext = GTK_XTEXT (widget); + + attributes.x = widget->allocation.x; +-- +cgit v0.8.3.1 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 9496300..396be09 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 13%{?dist} +Release: 14%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -23,6 +23,8 @@ Patch5: 0001-Added-port-numbers-for-Freenode.patch Patch6: xg-depreciated-macros.patch # https://bugzilla.gnome.org/599781 Patch7: 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch +# FTBFS, upstream commit 8d35b36baa8204b68c9520ec92327e34c1d7c580 +Patch8: xchat-gnome-0.26.1-deprecated-symbol.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -71,6 +73,7 @@ common settings will be included in the main user interface. . %patch5 -p1 -b .freenode %patch6 -p1 -b .macros %patch7 -p1 -b .dcc +%patch8 -p1 -b .symbol %build @@ -136,6 +139,10 @@ fi %changelog +* Sat Jul 31 2010 Adam Williamson - 0.26.1-14 +- Add deprecated-symbol.patch - upstream commit + 8d35b36baa8204b68c9520ec92327e34c1d7c580 - to fix FTBFS + * Tue Jul 27 2010 David Malcolm - 0.26.1-13 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild From a7f192c49e87e9b1e7e5cd2f74755d1e258b80b1 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 8 Nov 2010 12:49:10 -0800 Subject: [PATCH 056/105] - rebuild for new libnotify --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 396be09..c0cac9f 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 14%{?dist} +Release: 15%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -139,6 +139,9 @@ fi %changelog +* Mon Nov 08 2010 Adam Williamson - 0.26.1-15 +- rebuild for new libnotify + * Sat Jul 31 2010 Adam Williamson - 0.26.1-14 - Add deprecated-symbol.patch - upstream commit 8d35b36baa8204b68c9520ec92327e34c1d7c580 - to fix FTBFS From abfb7c9834f1d023b19564e9f09d44a626a10601 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 8 Nov 2010 13:45:05 -0800 Subject: [PATCH 057/105] - patch for new libnotify --- xchat-gnome-0.26.1-libnotify.patch | 11 +++++++++++ xchat-gnome.spec | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.26.1-libnotify.patch diff --git a/xchat-gnome-0.26.1-libnotify.patch b/xchat-gnome-0.26.1-libnotify.patch new file mode 100644 index 0000000..40c29a4 --- /dev/null +++ b/xchat-gnome-0.26.1-libnotify.patch @@ -0,0 +1,11 @@ +--- xchat-gnome-0.26.1/plugins/notify-osd/notify-osd.c 2008-09-07 06:18:27.000000000 -0700 ++++ xchat-gnome-0.26.1/plugins/notify-osd/notify-osd.c.new 2010-11-08 13:42:40.856127590 -0800 +@@ -67,7 +67,7 @@ + gchar *escaped; + + escaped = g_markup_escape_text (message, strlen(message)); +- notify = notify_notification_new (summary, escaped, NULL, NULL); ++ notify = notify_notification_new (summary, escaped, NULL); + notify_notification_set_urgency (notify, NOTIFY_URGENCY_NORMAL); + notify_notification_set_icon_from_pixbuf (notify, notify_icon); + if (!notify_notification_show (notify, &error)) { diff --git a/xchat-gnome.spec b/xchat-gnome.spec index c0cac9f..464e21f 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -25,6 +25,8 @@ Patch6: xg-depreciated-macros.patch Patch7: 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch # FTBFS, upstream commit 8d35b36baa8204b68c9520ec92327e34c1d7c580 Patch8: xchat-gnome-0.26.1-deprecated-symbol.patch +# Patch for libnotify 0.70 (just drop one parameter from one function) +Patch9: xchat-gnome-0.26.1-libnotify.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -140,7 +142,7 @@ fi %changelog * Mon Nov 08 2010 Adam Williamson - 0.26.1-15 -- rebuild for new libnotify +- add libnotify.patch for new libnotify * Sat Jul 31 2010 Adam Williamson - 0.26.1-14 - Add deprecated-symbol.patch - upstream commit From e86ef6768501f4939928fe9e356f1d4955fac529 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 8 Nov 2010 13:51:59 -0800 Subject: [PATCH 058/105] - actually apply the patch --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 464e21f..00d38c9 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -76,6 +76,7 @@ common settings will be included in the main user interface. . %patch6 -p1 -b .macros %patch7 -p1 -b .dcc %patch8 -p1 -b .symbol +%patch9 -p1 -b .notify %build From 0a1bc55ba3863bba13b349823287dc7191d8b1db Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 7 Feb 2011 21:46:34 -0600 Subject: [PATCH 059/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 00d38c9..8cd2601 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 15%{?dist} +Release: 16%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -142,6 +142,9 @@ fi %changelog +* Mon Feb 07 2011 Fedora Release Engineering - 0.26.1-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Mon Nov 08 2010 Adam Williamson - 0.26.1-15 - add libnotify.patch for new libnotify From 021dd2cbf22bcd14b2e125ffb64876bfe0595428 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Mar 2011 18:53:19 -0500 Subject: [PATCH 060/105] Update for recent GTK/GNOME changes and NM 0.9 --- xchat-gnome-0.26.1-add-libeggsmclient.patch | 3886 +++++++++++++++++ xchat-gnome-0.26.1-kill-libgnomeui.patch | 321 ++ ...-gnome-0.26.1-recent-network-manager.patch | 149 + ...t-gnome-0.26.1-remove-deprecated-api.patch | 400 ++ xchat-gnome.spec | 17 +- 5 files changed, 4772 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.26.1-add-libeggsmclient.patch create mode 100644 xchat-gnome-0.26.1-kill-libgnomeui.patch create mode 100644 xchat-gnome-0.26.1-recent-network-manager.patch create mode 100644 xchat-gnome-0.26.1-remove-deprecated-api.patch diff --git a/xchat-gnome-0.26.1-add-libeggsmclient.patch b/xchat-gnome-0.26.1-add-libeggsmclient.patch new file mode 100644 index 0000000..c3d2abe --- /dev/null +++ b/xchat-gnome-0.26.1-add-libeggsmclient.patch @@ -0,0 +1,3886 @@ +From cbb13af76a23d0bd75630dd966a0af7a2caeca5b Mon Sep 17 00:00:00 2001 +From: Florian Müllner +Date: Sun, 17 Jan 2010 15:09:14 +0000 +Subject: Bug 584887 - Get rid of deprecated libgnome(ui) + +added libeggsmclient to source. +--- +diff --git a/src/libeggsmclient/Makefile.am b/src/libeggsmclient/Makefile.am +new file mode 100644 +index 0000000..5af58d4 +--- a/src/libeggsmclient/Makefile.am ++++ b/src/libeggsmclient/Makefile.am +@@ -0,0 +1,36 @@ ++platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP ++platform_libs = libeggdesktopfile.la ++platform_ltlibraries = libeggdesktopfile.la ++platform_sources = eggsmclient-xsmp.c ++ ++INCLUDES = \ ++ -DG_LOG_DOMAIN=\""EggSMClient"\" \ ++ $(platform_defines) \ ++ $(EGG_SMCLIENT_CFLAGS) ++ ++noinst_LTLIBRARIES = \ ++ libeggsmclient.la \ ++ $(platform_ltlibraries) ++ ++libeggsmclient_la_LIBADD = \ ++ $(EGG_SMCLIENT_LIBS) \ ++ $(platform_libs) ++ ++libeggsmclient_la_LDFLAGS = \ ++ $(platform_ldflags) ++ ++libeggsmclient_la_SOURCES = \ ++ eggsmclient.c \ ++ eggsmclient.h \ ++ eggsmclient-private.h \ ++ $(platform_sources) ++ ++libeggdesktopfile_la_LIBADD = \ ++ $(EGG_LIBS) ++ ++libeggdesktopfile_la_SOURCES = \ ++ eggdesktopfile.c \ ++ eggdesktopfile.h ++ ++EXTRA_DIST = \ ++ eggsmclient-xsmp.c +diff --git a/src/libeggsmclient/eggdesktopfile.c b/src/libeggsmclient/eggdesktopfile.c +new file mode 100644 +index 0000000..6f6b946 +--- a/src/libeggsmclient/eggdesktopfile.c ++++ b/src/libeggsmclient/eggdesktopfile.c +@@ -0,0 +1,1510 @@ ++/* eggdesktopfile.c - Freedesktop.Org Desktop Files ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * Based on gnome-desktop-item.c ++ * Copyright (C) 1999, 2000 Red Hat Inc. ++ * Copyright (C) 2001 George Lebl ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; see the file COPYING.LIB. If not, ++ * write to the Free Software Foundation, Inc., 59 Temple Place - ++ * Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "eggdesktopfile.h" ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++struct EggDesktopFile { ++ GKeyFile *key_file; ++ char *source; ++ ++ char *name, *icon; ++ EggDesktopFileType type; ++ char document_code; ++}; ++ ++/** ++ * egg_desktop_file_new: ++ * @desktop_file_path: path to a Freedesktop-style Desktop file ++ * @error: error pointer ++ * ++ * Creates a new #EggDesktopFile for @desktop_file. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new (const char *desktop_file_path, GError **error) ++{ ++ GKeyFile *key_file; ++ ++ key_file = g_key_file_new (); ++ if (!g_key_file_load_from_file (key_file, desktop_file_path, 0, error)) ++ { ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ return egg_desktop_file_new_from_key_file (key_file, desktop_file_path, ++ error); ++} ++ ++/** ++ * egg_desktop_file_new_from_data_dirs: ++ * @desktop_file_path: relative path to a Freedesktop-style Desktop file ++ * @error: error pointer ++ * ++ * Looks for @desktop_file_path in the paths returned from ++ * g_get_user_data_dir() and g_get_system_data_dirs(), and creates ++ * a new #EggDesktopFile from it. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, ++ GError **error) ++{ ++ EggDesktopFile *desktop_file; ++ GKeyFile *key_file; ++ char *full_path; ++ ++ key_file = g_key_file_new (); ++ if (!g_key_file_load_from_data_dirs (key_file, desktop_file_path, ++ &full_path, 0, error)) ++ { ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ desktop_file = egg_desktop_file_new_from_key_file (key_file, ++ full_path, ++ error); ++ g_free (full_path); ++ return desktop_file; ++} ++ ++/** ++ * egg_desktop_file_new_from_dirs: ++ * @desktop_file_path: relative path to a Freedesktop-style Desktop file ++ * @search_dirs: NULL-terminated array of directories to search ++ * @error: error pointer ++ * ++ * Looks for @desktop_file_path in the paths returned from ++ * g_get_user_data_dir() and g_get_system_data_dirs(), and creates ++ * a new #EggDesktopFile from it. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new_from_dirs (const char *desktop_file_path, ++ const char **search_dirs, ++ GError **error) ++{ ++ EggDesktopFile *desktop_file; ++ GKeyFile *key_file; ++ char *full_path; ++ ++ key_file = g_key_file_new (); ++ if (!g_key_file_load_from_dirs (key_file, desktop_file_path, search_dirs, ++ &full_path, 0, error)) ++ { ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ desktop_file = egg_desktop_file_new_from_key_file (key_file, ++ full_path, ++ error); ++ g_free (full_path); ++ return desktop_file; ++} ++ ++/** ++ * egg_desktop_file_new_from_key_file: ++ * @key_file: a #GKeyFile representing a desktop file ++ * @source: the path or URI that @key_file was loaded from, or %NULL ++ * @error: error pointer ++ * ++ * Creates a new #EggDesktopFile for @key_file. Assumes ownership of ++ * @key_file (on success or failure); you should consider @key_file to ++ * be freed after calling this function. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new_from_key_file (GKeyFile *key_file, ++ const char *source, ++ GError **error) ++{ ++ EggDesktopFile *desktop_file; ++ char *version, *type; ++ ++ if (!g_key_file_has_group (key_file, EGG_DESKTOP_FILE_GROUP)) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_INVALID, ++ _("File is not a valid .desktop file")); ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ version = g_key_file_get_value (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_VERSION, ++ NULL); ++ if (version) ++ { ++ double version_num; ++ char *end; ++ ++ version_num = g_ascii_strtod (version, &end); ++ if (*end) ++ { ++ g_warning ("Invalid Version string '%s' in %s", ++ version, source ? source : "(unknown)"); ++ } ++ else if (version_num > 1.0) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_INVALID, ++ _("Unrecognized desktop file Version '%s'"), version); ++ g_free (version); ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ g_free (version); ++ } ++ ++ desktop_file = g_new0 (EggDesktopFile, 1); ++ desktop_file->key_file = key_file; ++ ++ if (g_path_is_absolute (source)) ++ desktop_file->source = g_filename_to_uri (source, NULL, NULL); ++ else ++ desktop_file->source = g_strdup (source); ++ ++ desktop_file->name = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_NAME, error); ++ if (!desktop_file->name) ++ { ++ egg_desktop_file_free (desktop_file); ++ return NULL; ++ } ++ ++ type = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TYPE, error); ++ if (!type) ++ { ++ egg_desktop_file_free (desktop_file); ++ return NULL; ++ } ++ ++ if (!strcmp (type, "Application")) ++ { ++ char *exec, *p; ++ ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_APPLICATION; ++ ++ exec = g_key_file_get_string (key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ error); ++ if (!exec) ++ { ++ egg_desktop_file_free (desktop_file); ++ g_free (type); ++ return NULL; ++ } ++ ++ /* See if it takes paths or URIs or neither */ ++ for (p = exec; *p; p++) ++ { ++ if (*p == '%') ++ { ++ if (p[1] == '\0' || strchr ("FfUu", p[1])) ++ { ++ desktop_file->document_code = p[1]; ++ break; ++ } ++ p++; ++ } ++ } ++ ++ g_free (exec); ++ } ++ else if (!strcmp (type, "Link")) ++ { ++ char *url; ++ ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_LINK; ++ ++ url = g_key_file_get_string (key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_URL, ++ error); ++ if (!url) ++ { ++ egg_desktop_file_free (desktop_file); ++ g_free (type); ++ return NULL; ++ } ++ g_free (url); ++ } ++ else if (!strcmp (type, "Directory")) ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_DIRECTORY; ++ else ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED; ++ ++ g_free (type); ++ ++ /* Check the Icon key */ ++ desktop_file->icon = g_key_file_get_string (key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_ICON, ++ NULL); ++ if (desktop_file->icon && !g_path_is_absolute (desktop_file->icon)) ++ { ++ char *ext; ++ ++ /* Lots of .desktop files still get this wrong */ ++ ext = strrchr (desktop_file->icon, '.'); ++ if (ext && (!strcmp (ext, ".png") || ++ !strcmp (ext, ".xpm") || ++ !strcmp (ext, ".svg"))) ++ { ++ g_warning ("Desktop file '%s' has malformed Icon key '%s'" ++ "(should not include extension)", ++ source ? source : "(unknown)", ++ desktop_file->icon); ++ *ext = '\0'; ++ } ++ } ++ ++ return desktop_file; ++} ++ ++/** ++ * egg_desktop_file_free: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Frees @desktop_file. ++ **/ ++void ++egg_desktop_file_free (EggDesktopFile *desktop_file) ++{ ++ g_key_file_free (desktop_file->key_file); ++ g_free (desktop_file->source); ++ g_free (desktop_file->name); ++ g_free (desktop_file->icon); ++ g_free (desktop_file); ++} ++ ++/** ++ * egg_desktop_file_get_source: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the URI that @desktop_file was loaded from. ++ * ++ * Return value: @desktop_file's source URI ++ **/ ++const char * ++egg_desktop_file_get_source (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->source; ++} ++ ++/** ++ * egg_desktop_file_get_desktop_file_type: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the desktop file type of @desktop_file. ++ * ++ * Return value: @desktop_file's type ++ **/ ++EggDesktopFileType ++egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->type; ++} ++ ++/** ++ * egg_desktop_file_get_name: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the (localized) value of @desktop_file's "Name" key. ++ * ++ * Return value: the application/link name ++ **/ ++const char * ++egg_desktop_file_get_name (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->name; ++} ++ ++/** ++ * egg_desktop_file_get_icon: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the value of @desktop_file's "Icon" key. ++ * ++ * If the icon string is a full path (that is, if g_path_is_absolute() ++ * returns %TRUE when called on it), it points to a file containing an ++ * unthemed icon. If the icon string is not a full path, it is the ++ * name of a themed icon, which can be looked up with %GtkIconTheme, ++ * or passed directly to a theme-aware widget like %GtkImage or ++ * %GtkCellRendererPixbuf. ++ * ++ * Return value: the icon path or name ++ **/ ++const char * ++egg_desktop_file_get_icon (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->icon; ++} ++ ++gboolean ++egg_desktop_file_has_key (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_has_key (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++char * ++egg_desktop_file_get_string (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++char * ++egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ GError **error) ++{ ++ return g_key_file_get_locale_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, locale, ++ error); ++} ++ ++gboolean ++egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_get_boolean (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++double ++egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_get_double (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++char ** ++egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ gsize *length, ++ GError **error) ++{ ++ return g_key_file_get_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, length, ++ error); ++} ++ ++char ** ++egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ gsize *length, ++ GError **error) ++{ ++ return g_key_file_get_locale_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ locale, length, ++ error); ++} ++ ++/** ++ * egg_desktop_file_can_launch: ++ * @desktop_file: an #EggDesktopFile ++ * @desktop_environment: the name of the running desktop environment, ++ * or %NULL ++ * ++ * Tests if @desktop_file can/should be launched in the current ++ * environment. If @desktop_environment is non-%NULL, @desktop_file's ++ * "OnlyShowIn" and "NotShowIn" keys are checked to make sure that ++ * this desktop_file is appropriate for the named environment. ++ * ++ * Furthermore, if @desktop_file has type ++ * %EGG_DESKTOP_FILE_TYPE_APPLICATION, its "TryExec" key (if any) is ++ * also checked, to make sure the binary it points to exists. ++ * ++ * egg_desktop_file_can_launch() does NOT check the value of the ++ * "Hidden" key. ++ * ++ * Return value: %TRUE if @desktop_file can be launched ++ **/ ++gboolean ++egg_desktop_file_can_launch (EggDesktopFile *desktop_file, ++ const char *desktop_environment) ++{ ++ char *try_exec, *found_program; ++ char **only_show_in, **not_show_in; ++ gboolean found; ++ int i; ++ ++ if (desktop_file->type != EGG_DESKTOP_FILE_TYPE_APPLICATION && ++ desktop_file->type != EGG_DESKTOP_FILE_TYPE_LINK) ++ return FALSE; ++ ++ if (desktop_environment) ++ { ++ only_show_in = g_key_file_get_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN, ++ NULL, NULL); ++ if (only_show_in) ++ { ++ for (i = 0, found = FALSE; only_show_in[i] && !found; i++) ++ { ++ if (!strcmp (only_show_in[i], desktop_environment)) ++ found = TRUE; ++ } ++ ++ g_strfreev (only_show_in); ++ ++ if (!found) ++ return FALSE; ++ } ++ ++ not_show_in = g_key_file_get_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN, ++ NULL, NULL); ++ if (not_show_in) ++ { ++ for (i = 0, found = FALSE; not_show_in[i] && !found; i++) ++ { ++ if (!strcmp (not_show_in[i], desktop_environment)) ++ found = TRUE; ++ } ++ ++ g_strfreev (not_show_in); ++ ++ if (found) ++ return FALSE; ++ } ++ } ++ ++ if (desktop_file->type == EGG_DESKTOP_FILE_TYPE_APPLICATION) ++ { ++ try_exec = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TRY_EXEC, ++ NULL); ++ if (try_exec) ++ { ++ found_program = g_find_program_in_path (try_exec); ++ g_free (try_exec); ++ ++ if (!found_program) ++ return FALSE; ++ g_free (found_program); ++ } ++ } ++ ++ return TRUE; ++} ++ ++/** ++ * egg_desktop_file_accepts_documents: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Tests if @desktop_file represents an application that can accept ++ * documents on the command line. ++ * ++ * Return value: %TRUE or %FALSE ++ **/ ++gboolean ++egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->document_code != 0; ++} ++ ++/** ++ * egg_desktop_file_accepts_multiple: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Tests if @desktop_file can accept multiple documents at once. ++ * ++ * If this returns %FALSE, you can still pass multiple documents to ++ * egg_desktop_file_launch(), but that will result in multiple copies ++ * of the application being launched. See egg_desktop_file_launch() ++ * for more details. ++ * ++ * Return value: %TRUE or %FALSE ++ **/ ++gboolean ++egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file) ++{ ++ return (desktop_file->document_code == 'F' || ++ desktop_file->document_code == 'U'); ++} ++ ++/** ++ * egg_desktop_file_accepts_uris: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Tests if @desktop_file can accept (non-"file:") URIs as documents to ++ * open. ++ * ++ * Return value: %TRUE or %FALSE ++ **/ ++gboolean ++egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file) ++{ ++ return (desktop_file->document_code == 'U' || ++ desktop_file->document_code == 'u'); ++} ++ ++static void ++append_quoted_word (GString *str, ++ const char *s, ++ gboolean in_single_quotes, ++ gboolean in_double_quotes) ++{ ++ const char *p; ++ ++ if (!in_single_quotes && !in_double_quotes) ++ g_string_append_c (str, '\''); ++ else if (!in_single_quotes && in_double_quotes) ++ g_string_append (str, "\"'"); ++ ++ if (!strchr (s, '\'')) ++ g_string_append (str, s); ++ else ++ { ++ for (p = s; *p != '\0'; p++) ++ { ++ if (*p == '\'') ++ g_string_append (str, "'\\''"); ++ else ++ g_string_append_c (str, *p); ++ } ++ } ++ ++ if (!in_single_quotes && !in_double_quotes) ++ g_string_append_c (str, '\''); ++ else if (!in_single_quotes && in_double_quotes) ++ g_string_append (str, "'\""); ++} ++ ++static void ++do_percent_subst (EggDesktopFile *desktop_file, ++ char code, ++ GString *str, ++ GSList **documents, ++ gboolean in_single_quotes, ++ gboolean in_double_quotes) ++{ ++ GSList *d; ++ char *doc; ++ ++ switch (code) ++ { ++ case '%': ++ g_string_append_c (str, '%'); ++ break; ++ ++ case 'F': ++ case 'U': ++ for (d = *documents; d; d = d->next) ++ { ++ doc = d->data; ++ g_string_append (str, " "); ++ append_quoted_word (str, doc, in_single_quotes, in_double_quotes); ++ } ++ *documents = NULL; ++ break; ++ ++ case 'f': ++ case 'u': ++ if (*documents) ++ { ++ doc = (*documents)->data; ++ g_string_append (str, " "); ++ append_quoted_word (str, doc, in_single_quotes, in_double_quotes); ++ *documents = (*documents)->next; ++ } ++ break; ++ ++ case 'i': ++ if (desktop_file->icon) ++ { ++ g_string_append (str, "--icon "); ++ append_quoted_word (str, desktop_file->icon, ++ in_single_quotes, in_double_quotes); ++ } ++ break; ++ ++ case 'c': ++ if (desktop_file->name) ++ { ++ append_quoted_word (str, desktop_file->name, ++ in_single_quotes, in_double_quotes); ++ } ++ break; ++ ++ case 'k': ++ if (desktop_file->source) ++ { ++ append_quoted_word (str, desktop_file->source, ++ in_single_quotes, in_double_quotes); ++ } ++ break; ++ ++ case 'D': ++ case 'N': ++ case 'd': ++ case 'n': ++ case 'v': ++ case 'm': ++ /* Deprecated; skip */ ++ break; ++ ++ default: ++ g_warning ("Unrecognized %%-code '%%%c' in Exec", code); ++ break; ++ } ++} ++ ++static char * ++parse_exec (EggDesktopFile *desktop_file, ++ GSList **documents, ++ GError **error) ++{ ++ char *exec, *p, *command; ++ gboolean escape, single_quot, double_quot; ++ GString *gs; ++ ++ exec = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ error); ++ if (!exec) ++ return NULL; ++ ++ /* Build the command */ ++ gs = g_string_new (NULL); ++ escape = single_quot = double_quot = FALSE; ++ ++ for (p = exec; *p != '\0'; p++) ++ { ++ if (escape) ++ { ++ escape = FALSE; ++ g_string_append_c (gs, *p); ++ } ++ else if (*p == '\\') ++ { ++ if (!single_quot) ++ escape = TRUE; ++ g_string_append_c (gs, *p); ++ } ++ else if (*p == '\'') ++ { ++ g_string_append_c (gs, *p); ++ if (!single_quot && !double_quot) ++ single_quot = TRUE; ++ else if (single_quot) ++ single_quot = FALSE; ++ } ++ else if (*p == '"') ++ { ++ g_string_append_c (gs, *p); ++ if (!single_quot && !double_quot) ++ double_quot = TRUE; ++ else if (double_quot) ++ double_quot = FALSE; ++ } ++ else if (*p == '%' && p[1]) ++ { ++ do_percent_subst (desktop_file, p[1], gs, documents, ++ single_quot, double_quot); ++ p++; ++ } ++ else ++ g_string_append_c (gs, *p); ++ } ++ ++ g_free (exec); ++ command = g_string_free (gs, FALSE); ++ ++ /* Prepend "xdg-terminal " if needed (FIXME: use gvfs) */ ++ if (g_key_file_has_key (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TERMINAL, ++ NULL)) ++ { ++ GError *terminal_error = NULL; ++ gboolean use_terminal = ++ g_key_file_get_boolean (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TERMINAL, ++ &terminal_error); ++ if (terminal_error) ++ { ++ g_free (command); ++ g_propagate_error (error, terminal_error); ++ return NULL; ++ } ++ ++ if (use_terminal) ++ { ++ gs = g_string_new ("xdg-terminal "); ++ append_quoted_word (gs, command, FALSE, FALSE); ++ g_free (command); ++ command = g_string_free (gs, FALSE); ++ } ++ } ++ ++ return command; ++} ++ ++static GSList * ++translate_document_list (EggDesktopFile *desktop_file, GSList *documents) ++{ ++ gboolean accepts_uris = egg_desktop_file_accepts_uris (desktop_file); ++ GSList *ret, *d; ++ ++ for (d = documents, ret = NULL; d; d = d->next) ++ { ++ const char *document = d->data; ++ gboolean is_uri = !g_path_is_absolute (document); ++ char *translated; ++ ++ if (accepts_uris) ++ { ++ if (is_uri) ++ translated = g_strdup (document); ++ else ++ translated = g_filename_to_uri (document, NULL, NULL); ++ } ++ else ++ { ++ if (is_uri) ++ translated = g_filename_from_uri (document, NULL, NULL); ++ else ++ translated = g_strdup (document); ++ } ++ ++ if (translated) ++ ret = g_slist_prepend (ret, translated); ++ } ++ ++ return g_slist_reverse (ret); ++} ++ ++static void ++free_document_list (GSList *documents) ++{ ++ GSList *d; ++ ++ for (d = documents; d; d = d->next) ++ g_free (d->data); ++ g_slist_free (documents); ++} ++ ++/** ++ * egg_desktop_file_parse_exec: ++ * @desktop_file: a #EggDesktopFile ++ * @documents: a list of document paths or URIs ++ * @error: error pointer ++ * ++ * Parses @desktop_file's Exec key, inserting @documents into it, and ++ * returns the result. ++ * ++ * If @documents contains non-file: URIs and @desktop_file does not ++ * accept URIs, those URIs will be ignored. Likewise, if @documents ++ * contains more elements than @desktop_file accepts, the extra ++ * documents will be ignored. ++ * ++ * Return value: the parsed Exec string ++ **/ ++char * ++egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, ++ GSList *documents, ++ GError **error) ++{ ++ GSList *translated, *docs; ++ char *command; ++ ++ docs = translated = translate_document_list (desktop_file, documents); ++ command = parse_exec (desktop_file, &docs, error); ++ free_document_list (translated); ++ ++ return command; ++} ++ ++static gboolean ++parse_link (EggDesktopFile *desktop_file, ++ EggDesktopFile **app_desktop_file, ++ GSList **documents, ++ GError **error) ++{ ++ char *url; ++ GKeyFile *key_file; ++ ++ url = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_URL, ++ error); ++ if (!url) ++ return FALSE; ++ *documents = g_slist_prepend (NULL, url); ++ ++ /* FIXME: use gvfs */ ++ key_file = g_key_file_new (); ++ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_NAME, ++ "xdg-open"); ++ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TYPE, ++ "Application"); ++ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ "xdg-open %u"); ++ *app_desktop_file = egg_desktop_file_new_from_key_file (key_file, NULL, NULL); ++ return TRUE; ++} ++ ++#if GTK_CHECK_VERSION (2, 12, 0) ++static char * ++start_startup_notification (GdkDisplay *display, ++ EggDesktopFile *desktop_file, ++ const char *argv0, ++ int screen, ++ int workspace, ++ guint32 launch_time) ++{ ++ static int sequence = 0; ++ char *startup_id; ++ char *description, *wmclass; ++ char *screen_str, *workspace_str; ++ ++ if (g_key_file_has_key (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, ++ NULL)) ++ { ++ if (!g_key_file_get_boolean (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, ++ NULL)) ++ return NULL; ++ wmclass = NULL; ++ } ++ else ++ { ++ wmclass = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS, ++ NULL); ++ if (!wmclass) ++ return NULL; ++ } ++ ++ if (launch_time == (guint32)-1) ++ launch_time = gdk_x11_display_get_user_time (display); ++ startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu", ++ g_get_prgname (), ++ (unsigned long)getpid (), ++ g_get_host_name (), ++ argv0, ++ sequence++, ++ (unsigned long)launch_time); ++ ++ description = g_strdup_printf (_("Starting %s"), desktop_file->name); ++ screen_str = g_strdup_printf ("%d", screen); ++ workspace_str = workspace == -1 ? NULL : g_strdup_printf ("%d", workspace); ++ ++ gdk_x11_display_broadcast_startup_message (display, "new", ++ "ID", startup_id, ++ "NAME", desktop_file->name, ++ "SCREEN", screen_str, ++ "BIN", argv0, ++ "ICON", desktop_file->icon, ++ "DESKTOP", workspace_str, ++ "DESCRIPTION", description, ++ "WMCLASS", wmclass, ++ NULL); ++ ++ g_free (description); ++ g_free (wmclass); ++ g_free (screen_str); ++ g_free (workspace_str); ++ ++ return startup_id; ++} ++ ++static void ++end_startup_notification (GdkDisplay *display, ++ const char *startup_id) ++{ ++ gdk_x11_display_broadcast_startup_message (display, "remove", ++ "ID", startup_id, ++ NULL); ++} ++ ++#define EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH (30 /* seconds */) ++ ++typedef struct { ++ GdkDisplay *display; ++ char *startup_id; ++} StartupNotificationData; ++ ++static gboolean ++startup_notification_timeout (gpointer data) ++{ ++ StartupNotificationData *sn_data = data; ++ ++ end_startup_notification (sn_data->display, sn_data->startup_id); ++ g_object_unref (sn_data->display); ++ g_free (sn_data->startup_id); ++ g_free (sn_data); ++ ++ return FALSE; ++} ++ ++static void ++set_startup_notification_timeout (GdkDisplay *display, ++ const char *startup_id) ++{ ++ StartupNotificationData *sn_data; ++ ++ sn_data = g_new (StartupNotificationData, 1); ++ sn_data->display = g_object_ref (display); ++ sn_data->startup_id = g_strdup (startup_id); ++ ++ g_timeout_add_seconds (EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH, ++ startup_notification_timeout, sn_data); ++} ++#endif /* GTK 2.12 */ ++ ++static GPtrArray * ++array_putenv (GPtrArray *env, char *variable) ++{ ++ guint i, keylen; ++ ++ if (!env) ++ { ++ char **envp; ++ ++ env = g_ptr_array_new (); ++ ++ envp = g_listenv (); ++ for (i = 0; envp[i]; i++) ++ { ++ const char *value; ++ ++ value = g_getenv (envp[i]); ++ g_ptr_array_add (env, g_strdup_printf ("%s=%s", envp[i], ++ value ? value : "")); ++ } ++ g_strfreev (envp); ++ } ++ ++ keylen = strcspn (variable, "="); ++ ++ /* Remove old value of key */ ++ for (i = 0; i < env->len; i++) ++ { ++ char *envvar = env->pdata[i]; ++ ++ if (!strncmp (envvar, variable, keylen) && envvar[keylen] == '=') ++ { ++ g_free (envvar); ++ g_ptr_array_remove_index_fast (env, i); ++ break; ++ } ++ } ++ ++ /* Add new value */ ++ g_ptr_array_add (env, g_strdup (variable)); ++ ++ return env; ++} ++ ++static gboolean ++egg_desktop_file_launchv (EggDesktopFile *desktop_file, ++ GSList *documents, va_list args, ++ GError **error) ++{ ++ EggDesktopFileLaunchOption option; ++ GSList *translated_documents = NULL, *docs = NULL; ++ char *command, **argv; ++ int argc, i, screen_num; ++ gboolean success, current_success; ++ GdkDisplay *display; ++ char *startup_id; ++ ++ GPtrArray *env = NULL; ++ char **variables = NULL; ++ GdkScreen *screen = NULL; ++ int workspace = -1; ++ const char *directory = NULL; ++ guint32 launch_time = (guint32)-1; ++ GSpawnFlags flags = G_SPAWN_SEARCH_PATH; ++ GSpawnChildSetupFunc setup_func = NULL; ++ gpointer setup_data = NULL; ++ ++ GPid *ret_pid = NULL; ++ int *ret_stdin = NULL, *ret_stdout = NULL, *ret_stderr = NULL; ++ char **ret_startup_id = NULL; ++ ++ if (documents && desktop_file->document_code == 0) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ _("Application does not accept documents on command line")); ++ return FALSE; ++ } ++ ++ /* Read the options: technically it's incorrect for the caller to ++ * NULL-terminate the list of options (rather than 0-terminating ++ * it), but NULL-terminating lets us use G_GNUC_NULL_TERMINATED, ++ * it's more consistent with other glib/gtk methods, and it will ++ * work as long as sizeof (int) <= sizeof (NULL), and NULL is ++ * represented as 0. (Which is true everywhere we care about.) ++ */ ++ while ((option = va_arg (args, EggDesktopFileLaunchOption))) ++ { ++ switch (option) ++ { ++ case EGG_DESKTOP_FILE_LAUNCH_CLEARENV: ++ if (env) ++ g_ptr_array_free (env, TRUE); ++ env = g_ptr_array_new (); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_PUTENV: ++ variables = va_arg (args, char **); ++ for (i = 0; variables[i]; i++) ++ env = array_putenv (env, variables[i]); ++ break; ++ ++ case EGG_DESKTOP_FILE_LAUNCH_SCREEN: ++ screen = va_arg (args, GdkScreen *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: ++ workspace = va_arg (args, int); ++ break; ++ ++ case EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: ++ directory = va_arg (args, const char *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_TIME: ++ launch_time = va_arg (args, guint32); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_FLAGS: ++ flags |= va_arg (args, GSpawnFlags); ++ /* Make sure they didn't set any flags that don't make sense. */ ++ flags &= ~G_SPAWN_FILE_AND_ARGV_ZERO; ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC: ++ setup_func = va_arg (args, GSpawnChildSetupFunc); ++ setup_data = va_arg (args, gpointer); ++ break; ++ ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_PID: ++ ret_pid = va_arg (args, GPid *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE: ++ ret_stdin = va_arg (args, int *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE: ++ ret_stdout = va_arg (args, int *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE: ++ ret_stderr = va_arg (args, int *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID: ++ ret_startup_id = va_arg (args, char **); ++ break; ++ ++ default: ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION, ++ _("Unrecognized launch option: %d"), ++ GPOINTER_TO_INT (option)); ++ success = FALSE; ++ goto out; ++ } ++ } ++ ++ if (screen) ++ { ++ char *display_name = gdk_screen_make_display_name (screen); ++ char *display_env = g_strdup_printf ("DISPLAY=%s", display_name); ++ env = array_putenv (env, display_env); ++ g_free (display_name); ++ g_free (display_env); ++ ++ display = gdk_screen_get_display (screen); ++ } ++ else ++ { ++ display = gdk_display_get_default (); ++ screen = gdk_display_get_default_screen (display); ++ } ++ screen_num = gdk_screen_get_number (screen); ++ ++ translated_documents = translate_document_list (desktop_file, documents); ++ docs = translated_documents; ++ ++ success = FALSE; ++ ++ do ++ { ++ command = parse_exec (desktop_file, &docs, error); ++ if (!command) ++ goto out; ++ ++ if (!g_shell_parse_argv (command, &argc, &argv, error)) ++ { ++ g_free (command); ++ goto out; ++ } ++ g_free (command); ++ ++#if GTK_CHECK_VERSION (2, 12, 0) ++ startup_id = start_startup_notification (display, desktop_file, ++ argv[0], screen_num, ++ workspace, launch_time); ++ if (startup_id) ++ { ++ char *startup_id_env = g_strdup_printf ("DESKTOP_STARTUP_ID=%s", ++ startup_id); ++ env = array_putenv (env, startup_id_env); ++ g_free (startup_id_env); ++ } ++#else ++ startup_id = NULL; ++#endif /* GTK 2.12 */ ++ ++ if (env != NULL) ++ g_ptr_array_add (env, NULL); ++ ++ current_success = ++ g_spawn_async_with_pipes (directory, ++ argv, ++ env ? (char **)(env->pdata) : NULL, ++ flags, ++ setup_func, setup_data, ++ ret_pid, ++ ret_stdin, ret_stdout, ret_stderr, ++ error); ++ g_strfreev (argv); ++ ++ if (startup_id) ++ { ++#if GTK_CHECK_VERSION (2, 12, 0) ++ if (current_success) ++ { ++ set_startup_notification_timeout (display, startup_id); ++ ++ if (ret_startup_id) ++ *ret_startup_id = startup_id; ++ else ++ g_free (startup_id); ++ } ++ else ++#endif /* GTK 2.12 */ ++ g_free (startup_id); ++ } ++ else if (ret_startup_id) ++ *ret_startup_id = NULL; ++ ++ if (current_success) ++ { ++ /* If we successfully launch any instances of the app, make ++ * sure we return TRUE and don't set @error. ++ */ ++ success = TRUE; ++ error = NULL; ++ ++ /* Also, only set the output params on the first one */ ++ ret_pid = NULL; ++ ret_stdin = ret_stdout = ret_stderr = NULL; ++ ret_startup_id = NULL; ++ } ++ } ++ while (docs && current_success); ++ ++ out: ++ if (env) ++ { ++ g_ptr_array_foreach (env, (GFunc)g_free, NULL); ++ g_ptr_array_free (env, TRUE); ++ } ++ free_document_list (translated_documents); ++ ++ return success; ++} ++ ++/** ++ * egg_desktop_file_launch: ++ * @desktop_file: an #EggDesktopFile ++ * @documents: a list of URIs or paths to documents to open ++ * @error: error pointer ++ * @...: additional options ++ * ++ * Launches @desktop_file with the given arguments. Additional options ++ * can be specified as follows: ++ * ++ * %EGG_DESKTOP_FILE_LAUNCH_CLEARENV: (no arguments) ++ * clears the environment in the child process ++ * %EGG_DESKTOP_FILE_LAUNCH_PUTENV: (char **variables) ++ * adds the NAME=VALUE strings in the given %NULL-terminated ++ * array to the child process's environment ++ * %EGG_DESKTOP_FILE_LAUNCH_SCREEN: (GdkScreen *screen) ++ * causes the application to be launched on the given screen ++ * %EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: (int workspace) ++ * causes the application to be launched on the given workspace ++ * %EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: (char *dir) ++ * causes the application to be launched in the given directory ++ * %EGG_DESKTOP_FILE_LAUNCH_TIME: (guint32 launch_time) ++ * sets the "launch time" for the application. If the user ++ * interacts with another window after @launch_time but before ++ * the launched application creates its first window, the window ++ * manager may choose to not give focus to the new application. ++ * Passing 0 for @launch_time will explicitly request that the ++ * application not receive focus. ++ * %EGG_DESKTOP_FILE_LAUNCH_FLAGS (GSpawnFlags flags) ++ * Sets additional #GSpawnFlags to use. See g_spawn_async() for ++ * more details. ++ * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC (GSpawnChildSetupFunc, gpointer) ++ * Sets the child setup callback and the data to pass to it. ++ * (See g_spawn_async() for more details.) ++ * ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID (GPid **pid) ++ * On a successful launch, sets *@pid to the PID of the launched ++ * application. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID (char **startup_id) ++ * On a successful launch, sets *@startup_id to the Startup ++ * Notification "startup id" of the launched application. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE (int *fd) ++ * On a successful launch, sets *@fd to the file descriptor of ++ * a pipe connected to the application's stdin. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE (int *fd) ++ * On a successful launch, sets *@fd to the file descriptor of ++ * a pipe connected to the application's stdout. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE (int *fd) ++ * On a successful launch, sets *@fd to the file descriptor of ++ * a pipe connected to the application's stderr. ++ * ++ * The options should be terminated with a single %NULL. ++ * ++ * If @documents contains multiple documents, but ++ * egg_desktop_file_accepts_multiple() returns %FALSE for ++ * @desktop_file, then egg_desktop_file_launch() will actually launch ++ * multiple instances of the application. In that case, the return ++ * value (as well as any values passed via ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, etc) will only reflect the ++ * first instance of the application that was launched (but the ++ * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC will be called for each ++ * instance). ++ * ++ * Return value: %TRUE if the application was successfully launched. ++ **/ ++gboolean ++egg_desktop_file_launch (EggDesktopFile *desktop_file, ++ GSList *documents, GError **error, ++ ...) ++{ ++ va_list args; ++ gboolean success; ++ EggDesktopFile *app_desktop_file; ++ ++ switch (desktop_file->type) ++ { ++ case EGG_DESKTOP_FILE_TYPE_APPLICATION: ++ va_start (args, error); ++ success = egg_desktop_file_launchv (desktop_file, documents, ++ args, error); ++ va_end (args); ++ break; ++ ++ case EGG_DESKTOP_FILE_TYPE_LINK: ++ if (documents) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ _("Can't pass document URIs to a 'Type=Link' desktop entry")); ++ return FALSE; ++ } ++ ++ if (!parse_link (desktop_file, &app_desktop_file, &documents, error)) ++ return FALSE; ++ ++ va_start (args, error); ++ success = egg_desktop_file_launchv (app_desktop_file, documents, ++ args, error); ++ va_end (args); ++ ++ egg_desktop_file_free (app_desktop_file); ++ free_document_list (documents); ++ break; ++ ++ case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED: ++ case EGG_DESKTOP_FILE_TYPE_DIRECTORY: ++ default: ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ _("Not a launchable item")); ++ success = FALSE; ++ break; ++ } ++ ++ return success; ++} ++ ++ ++GQuark ++egg_desktop_file_error_quark (void) ++{ ++ return g_quark_from_static_string ("egg-desktop_file-error-quark"); ++} ++ ++ ++G_LOCK_DEFINE_STATIC (egg_desktop_file); ++static EggDesktopFile *egg_desktop_file; ++ ++static void ++egg_set_desktop_file_internal (const char *desktop_file_path, ++ gboolean set_defaults) ++{ ++ GError *error = NULL; ++ ++ G_LOCK (egg_desktop_file); ++ if (egg_desktop_file) ++ egg_desktop_file_free (egg_desktop_file); ++ ++ egg_desktop_file = egg_desktop_file_new (desktop_file_path, &error); ++ if (error) ++ { ++ g_warning ("Could not load desktop file '%s': %s", ++ desktop_file_path, error->message); ++ g_error_free (error); ++ } ++ ++ if (set_defaults && egg_desktop_file != NULL) { ++ /* Set localized application name and default window icon */ ++ if (egg_desktop_file->name) ++ g_set_application_name (egg_desktop_file->name); ++ if (egg_desktop_file->icon) ++ { ++ if (g_path_is_absolute (egg_desktop_file->icon)) ++ gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL); ++ else ++ gtk_window_set_default_icon_name (egg_desktop_file->icon); ++ } ++ } ++ ++ G_UNLOCK (egg_desktop_file); ++} ++ ++/** ++ * egg_set_desktop_file: ++ * @desktop_file_path: path to the application's desktop file ++ * ++ * Creates an #EggDesktopFile for the application from the data at ++ * @desktop_file_path. This will also call g_set_application_name() ++ * with the localized application name from the desktop file, and ++ * gtk_window_set_default_icon_name() or ++ * gtk_window_set_default_icon_from_file() with the application's ++ * icon. Other code may use additional information from the desktop ++ * file. ++ * See egg_set_desktop_file_without_defaults() for a variant of this ++ * function that does not set the application name and default window ++ * icon. ++ * ++ * Note that for thread safety reasons, this function can only ++ * be called once, and is mutually exclusive with calling ++ * egg_set_desktop_file_without_defaults(). ++ **/ ++void ++egg_set_desktop_file (const char *desktop_file_path) ++{ ++ egg_set_desktop_file_internal (desktop_file_path, TRUE); ++} ++ ++/** ++ * egg_set_desktop_file_without_defaults: ++ * @desktop_file_path: path to the application's desktop file ++ * ++ * Creates an #EggDesktopFile for the application from the data at ++ * @desktop_file_path. ++ * See egg_set_desktop_file() for a variant of this function that ++ * sets the application name and default window icon from the information ++ * in the desktop file. ++ * ++ * Note that for thread safety reasons, this function can only ++ * be called once, and is mutually exclusive with calling ++ * egg_set_desktop_file(). ++ **/ ++void ++egg_set_desktop_file_without_defaults (const char *desktop_file_path) ++{ ++ egg_set_desktop_file_internal (desktop_file_path, FALSE); ++} ++ ++/** ++ * egg_get_desktop_file: ++ * ++ * Gets the application's #EggDesktopFile, as set by ++ * egg_set_desktop_file(). ++ * ++ * Return value: the #EggDesktopFile, or %NULL if it hasn't been set. ++ **/ ++EggDesktopFile * ++egg_get_desktop_file (void) ++{ ++ EggDesktopFile *retval; ++ ++ G_LOCK (egg_desktop_file); ++ retval = egg_desktop_file; ++ G_UNLOCK (egg_desktop_file); ++ ++ return retval; ++} +diff --git a/src/libeggsmclient/eggdesktopfile.h b/src/libeggsmclient/eggdesktopfile.h +new file mode 100644 +index 0000000..18fe463 +--- a/src/libeggsmclient/eggdesktopfile.h ++++ b/src/libeggsmclient/eggdesktopfile.h +@@ -0,0 +1,160 @@ ++/* eggdesktopfile.h - Freedesktop.Org Desktop Files ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; see the file COPYING.LIB. If not, ++ * write to the Free Software Foundation, Inc., 59 Temple Place - ++ * Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#ifndef __EGG_DESKTOP_FILE_H__ ++#define __EGG_DESKTOP_FILE_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++typedef struct EggDesktopFile EggDesktopFile; ++ ++typedef enum { ++ EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED, ++ ++ EGG_DESKTOP_FILE_TYPE_APPLICATION, ++ EGG_DESKTOP_FILE_TYPE_LINK, ++ EGG_DESKTOP_FILE_TYPE_DIRECTORY ++} EggDesktopFileType; ++ ++EggDesktopFile *egg_desktop_file_new (const char *desktop_file_path, ++ GError **error); ++ ++EggDesktopFile *egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, ++ GError **error); ++EggDesktopFile *egg_desktop_file_new_from_dirs (const char *desktop_file_path, ++ const char **search_dirs, ++ GError **error); ++EggDesktopFile *egg_desktop_file_new_from_key_file (GKeyFile *key_file, ++ const char *source, ++ GError **error); ++ ++void egg_desktop_file_free (EggDesktopFile *desktop_file); ++ ++const char *egg_desktop_file_get_source (EggDesktopFile *desktop_file); ++ ++EggDesktopFileType egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file); ++ ++const char *egg_desktop_file_get_name (EggDesktopFile *desktop_file); ++const char *egg_desktop_file_get_icon (EggDesktopFile *desktop_file); ++ ++gboolean egg_desktop_file_can_launch (EggDesktopFile *desktop_file, ++ const char *desktop_environment); ++ ++gboolean egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file); ++gboolean egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file); ++gboolean egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file); ++ ++char *egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, ++ GSList *documents, ++ GError **error); ++ ++gboolean egg_desktop_file_launch (EggDesktopFile *desktop_file, ++ GSList *documents, ++ GError **error, ++ ...) G_GNUC_NULL_TERMINATED; ++ ++typedef enum { ++ EGG_DESKTOP_FILE_LAUNCH_CLEARENV = 1, ++ EGG_DESKTOP_FILE_LAUNCH_PUTENV, ++ EGG_DESKTOP_FILE_LAUNCH_SCREEN, ++ EGG_DESKTOP_FILE_LAUNCH_WORKSPACE, ++ EGG_DESKTOP_FILE_LAUNCH_DIRECTORY, ++ EGG_DESKTOP_FILE_LAUNCH_TIME, ++ EGG_DESKTOP_FILE_LAUNCH_FLAGS, ++ EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID ++} EggDesktopFileLaunchOption; ++ ++/* Standard Keys */ ++#define EGG_DESKTOP_FILE_GROUP "Desktop Entry" ++ ++#define EGG_DESKTOP_FILE_KEY_TYPE "Type" ++#define EGG_DESKTOP_FILE_KEY_VERSION "Version" ++#define EGG_DESKTOP_FILE_KEY_NAME "Name" ++#define EGG_DESKTOP_FILE_KEY_GENERIC_NAME "GenericName" ++#define EGG_DESKTOP_FILE_KEY_NO_DISPLAY "NoDisplay" ++#define EGG_DESKTOP_FILE_KEY_COMMENT "Comment" ++#define EGG_DESKTOP_FILE_KEY_ICON "Icon" ++#define EGG_DESKTOP_FILE_KEY_HIDDEN "Hidden" ++#define EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN "OnlyShowIn" ++#define EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN "NotShowIn" ++#define EGG_DESKTOP_FILE_KEY_TRY_EXEC "TryExec" ++#define EGG_DESKTOP_FILE_KEY_EXEC "Exec" ++#define EGG_DESKTOP_FILE_KEY_PATH "Path" ++#define EGG_DESKTOP_FILE_KEY_TERMINAL "Terminal" ++#define EGG_DESKTOP_FILE_KEY_MIME_TYPE "MimeType" ++#define EGG_DESKTOP_FILE_KEY_CATEGORIES "Categories" ++#define EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY "StartupNotify" ++#define EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS "StartupWMClass" ++#define EGG_DESKTOP_FILE_KEY_URL "URL" ++ ++/* Accessors */ ++gboolean egg_desktop_file_has_key (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error); ++char *egg_desktop_file_get_string (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) G_GNUC_MALLOC; ++char *egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ GError **error) G_GNUC_MALLOC; ++gboolean egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error); ++double egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error); ++char **egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ gsize *length, ++ GError **error) G_GNUC_MALLOC; ++char **egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ gsize *length, ++ GError **error) G_GNUC_MALLOC; ++ ++ ++/* Errors */ ++#define EGG_DESKTOP_FILE_ERROR egg_desktop_file_error_quark() ++ ++GQuark egg_desktop_file_error_quark (void); ++ ++typedef enum { ++ EGG_DESKTOP_FILE_ERROR_INVALID, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION ++} EggDesktopFileError; ++ ++/* Global application desktop file */ ++void egg_set_desktop_file (const char *desktop_file_path); ++void egg_set_desktop_file_without_defaults (const char *desktop_file_path); ++EggDesktopFile *egg_get_desktop_file (void); ++ ++ ++G_END_DECLS ++ ++#endif /* __EGG_DESKTOP_FILE_H__ */ +diff --git a/src/libeggsmclient/eggsmclient-private.h b/src/libeggsmclient/eggsmclient-private.h +new file mode 100644 +index 0000000..ccb10bf +--- a/src/libeggsmclient/eggsmclient-private.h ++++ b/src/libeggsmclient/eggsmclient-private.h +@@ -0,0 +1,53 @@ ++/* eggsmclient-private.h ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ */ ++ ++#ifndef __EGG_SM_CLIENT_PRIVATE_H__ ++#define __EGG_SM_CLIENT_PRIVATE_H__ ++ ++#include ++#include "eggsmclient.h" ++ ++G_BEGIN_DECLS ++ ++GKeyFile *egg_sm_client_save_state (EggSMClient *client); ++void egg_sm_client_quit_requested (EggSMClient *client); ++void egg_sm_client_quit_cancelled (EggSMClient *client); ++void egg_sm_client_quit (EggSMClient *client); ++ ++#if defined (GDK_WINDOWING_X11) ++# ifdef EGG_SM_CLIENT_BACKEND_XSMP ++GType egg_sm_client_xsmp_get_type (void); ++EggSMClient *egg_sm_client_xsmp_new (void); ++# endif ++# ifdef EGG_SM_CLIENT_BACKEND_DBUS ++GType egg_sm_client_dbus_get_type (void); ++EggSMClient *egg_sm_client_dbus_new (void); ++# endif ++#elif defined (GDK_WINDOWING_WIN32) ++GType egg_sm_client_win32_get_type (void); ++EggSMClient *egg_sm_client_win32_new (void); ++#elif defined (GDK_WINDOWING_QUARTZ) ++GType egg_sm_client_osx_get_type (void); ++EggSMClient *egg_sm_client_osx_new (void); ++#endif ++ ++G_END_DECLS ++ ++ ++#endif /* __EGG_SM_CLIENT_PRIVATE_H__ */ +diff --git a/src/libeggsmclient/eggsmclient-xsmp.c b/src/libeggsmclient/eggsmclient-xsmp.c +new file mode 100644 +index 0000000..8bebfba +--- a/src/libeggsmclient/eggsmclient-xsmp.c ++++ b/src/libeggsmclient/eggsmclient-xsmp.c +@@ -0,0 +1,1370 @@ ++/* ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * Inspired by various other pieces of code including GsmClient (C) ++ * 2001 Havoc Pennington, GnomeClient (C) 1998 Carsten Schaar, and twm ++ * session code (C) 1998 The Open Group. ++ * ++ * 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, ++ * 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. ++ * ++ * 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. ++ */ ++ ++#include "config.h" ++ ++#include "eggsmclient.h" ++#include "eggsmclient-private.h" ++ ++#include "eggdesktopfile.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define EGG_TYPE_SM_CLIENT_XSMP (egg_sm_client_xsmp_get_type ()) ++#define EGG_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP)) ++#define EGG_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) ++#define EGG_IS_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_XSMP)) ++#define EGG_IS_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_XSMP)) ++#define EGG_SM_CLIENT_XSMP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) ++ ++typedef struct _EggSMClientXSMP EggSMClientXSMP; ++typedef struct _EggSMClientXSMPClass EggSMClientXSMPClass; ++ ++/* These mostly correspond to the similarly-named states in section ++ * 9.1 of the XSMP spec. Some of the states there aren't represented ++ * here, because we don't need them. SHUTDOWN_CANCELLED is slightly ++ * different from the spec; we use it when the client is IDLE after a ++ * ShutdownCancelled message, but the application is still interacting ++ * and doesn't know the shutdown has been cancelled yet. ++ */ ++typedef enum ++{ ++ XSMP_STATE_IDLE, ++ XSMP_STATE_SAVE_YOURSELF, ++ XSMP_STATE_INTERACT_REQUEST, ++ XSMP_STATE_INTERACT, ++ XSMP_STATE_SAVE_YOURSELF_DONE, ++ XSMP_STATE_SHUTDOWN_CANCELLED, ++ XSMP_STATE_CONNECTION_CLOSED ++} EggSMClientXSMPState; ++ ++static const char *state_names[] = { ++ "idle", ++ "save-yourself", ++ "interact-request", ++ "interact", ++ "save-yourself-done", ++ "shutdown-cancelled", ++ "connection-closed" ++}; ++ ++#define EGG_SM_CLIENT_XSMP_STATE(xsmp) (state_names[(xsmp)->state]) ++ ++struct _EggSMClientXSMP ++{ ++ EggSMClient parent; ++ ++ SmcConn connection; ++ char *client_id; ++ ++ EggSMClientXSMPState state; ++ char **restart_command; ++ gboolean set_restart_command; ++ int restart_style; ++ ++ guint idle; ++ ++ /* Current SaveYourself state */ ++ guint expecting_initial_save_yourself : 1; ++ guint need_save_state : 1; ++ guint need_quit_requested : 1; ++ guint interact_errors : 1; ++ guint shutting_down : 1; ++ ++ /* Todo list */ ++ guint waiting_to_set_initial_properties : 1; ++ guint waiting_to_emit_quit : 1; ++ guint waiting_to_emit_quit_cancelled : 1; ++ guint waiting_to_save_myself : 1; ++ ++}; ++ ++struct _EggSMClientXSMPClass ++{ ++ EggSMClientClass parent_class; ++ ++}; ++ ++static void sm_client_xsmp_startup (EggSMClient *client, ++ const char *client_id); ++static void sm_client_xsmp_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv); ++static void sm_client_xsmp_will_quit (EggSMClient *client, ++ gboolean will_quit); ++static gboolean sm_client_xsmp_end_session (EggSMClient *client, ++ EggSMClientEndStyle style, ++ gboolean request_confirmation); ++ ++static void xsmp_save_yourself (SmcConn smc_conn, ++ SmPointer client_data, ++ int save_style, ++ Bool shutdown, ++ int interact_style, ++ Bool fast); ++static void xsmp_die (SmcConn smc_conn, ++ SmPointer client_data); ++static void xsmp_save_complete (SmcConn smc_conn, ++ SmPointer client_data); ++static void xsmp_shutdown_cancelled (SmcConn smc_conn, ++ SmPointer client_data); ++static void xsmp_interact (SmcConn smc_conn, ++ SmPointer client_data); ++ ++static SmProp *array_prop (const char *name, ++ ...); ++static SmProp *ptrarray_prop (const char *name, ++ GPtrArray *values); ++static SmProp *string_prop (const char *name, ++ const char *value); ++static SmProp *card8_prop (const char *name, ++ unsigned char value); ++ ++static void set_properties (EggSMClientXSMP *xsmp, ...); ++static void delete_properties (EggSMClientXSMP *xsmp, ...); ++ ++static GPtrArray *generate_command (char **restart_command, ++ const char *client_id, ++ const char *state_file); ++ ++static void save_state (EggSMClientXSMP *xsmp); ++static void do_save_yourself (EggSMClientXSMP *xsmp); ++static void update_pending_events (EggSMClientXSMP *xsmp); ++ ++static void ice_init (void); ++static gboolean process_ice_messages (IceConn ice_conn); ++static void smc_error_handler (SmcConn smc_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ SmPointer values); ++ ++G_DEFINE_TYPE (EggSMClientXSMP, egg_sm_client_xsmp, EGG_TYPE_SM_CLIENT) ++ ++static void ++egg_sm_client_xsmp_init (EggSMClientXSMP *xsmp) ++{ ++ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; ++ xsmp->connection = NULL; ++ xsmp->restart_style = SmRestartIfRunning; ++} ++ ++static void ++egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass) ++{ ++ EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); ++ ++ sm_client_class->startup = sm_client_xsmp_startup; ++ sm_client_class->set_restart_command = sm_client_xsmp_set_restart_command; ++ sm_client_class->will_quit = sm_client_xsmp_will_quit; ++ sm_client_class->end_session = sm_client_xsmp_end_session; ++} ++ ++EggSMClient * ++egg_sm_client_xsmp_new (void) ++{ ++ if (!g_getenv ("SESSION_MANAGER")) ++ return NULL; ++ ++ return g_object_new (EGG_TYPE_SM_CLIENT_XSMP, NULL); ++} ++ ++static gboolean ++sm_client_xsmp_set_initial_properties (gpointer user_data) ++{ ++ EggSMClientXSMP *xsmp = user_data; ++ EggDesktopFile *desktop_file; ++ GPtrArray *clone, *restart; ++ char pid_str[64]; ++ ++ if (xsmp->idle) ++ { ++ g_source_remove (xsmp->idle); ++ xsmp->idle = 0; ++ } ++ xsmp->waiting_to_set_initial_properties = FALSE; ++ ++ if (egg_sm_client_get_mode () == EGG_SM_CLIENT_MODE_NO_RESTART) ++ xsmp->restart_style = SmRestartNever; ++ ++ /* Parse info out of desktop file */ ++ desktop_file = egg_get_desktop_file (); ++ if (desktop_file) ++ { ++ GError *err = NULL; ++ char *cmdline, **argv; ++ int argc; ++ ++ if (xsmp->restart_style == SmRestartIfRunning) ++ { ++ if (egg_desktop_file_get_boolean (desktop_file, ++ "X-GNOME-AutoRestart", NULL)) ++ xsmp->restart_style = SmRestartImmediately; ++ } ++ ++ if (!xsmp->set_restart_command) ++ { ++ cmdline = egg_desktop_file_parse_exec (desktop_file, NULL, &err); ++ if (cmdline && g_shell_parse_argv (cmdline, &argc, &argv, &err)) ++ { ++ egg_sm_client_set_restart_command (EGG_SM_CLIENT (xsmp), ++ argc, (const char **)argv); ++ g_strfreev (argv); ++ } ++ else ++ { ++ g_warning ("Could not parse Exec line in desktop file: %s", ++ err->message); ++ g_error_free (err); ++ } ++ g_free (cmdline); ++ } ++ } ++ ++ if (!xsmp->set_restart_command) ++ xsmp->restart_command = g_strsplit (g_get_prgname (), " ", -1); ++ ++ clone = generate_command (xsmp->restart_command, NULL, NULL); ++ restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); ++ ++ g_debug ("Setting initial properties"); ++ ++ /* Program, CloneCommand, RestartCommand, and UserID are required. ++ * ProcessID isn't required, but the SM may be able to do something ++ * useful with it. ++ */ ++ g_snprintf (pid_str, sizeof (pid_str), "%lu", (gulong) getpid ()); ++ set_properties (xsmp, ++ string_prop (SmProgram, g_get_prgname ()), ++ ptrarray_prop (SmCloneCommand, clone), ++ ptrarray_prop (SmRestartCommand, restart), ++ string_prop (SmUserID, g_get_user_name ()), ++ string_prop (SmProcessID, pid_str), ++ card8_prop (SmRestartStyleHint, xsmp->restart_style), ++ NULL); ++ g_ptr_array_free (clone, TRUE); ++ g_ptr_array_free (restart, TRUE); ++ ++ if (desktop_file) ++ { ++ set_properties (xsmp, ++ string_prop ("_GSM_DesktopFile", egg_desktop_file_get_source (desktop_file)), ++ NULL); ++ } ++ ++ update_pending_events (xsmp); ++ return FALSE; ++} ++ ++/* This gets called from two different places: xsmp_die() (when the ++ * server asks us to disconnect) and process_ice_messages() (when the ++ * server disconnects unexpectedly). ++ */ ++static void ++sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp) ++{ ++ SmcConn connection; ++ ++ if (!xsmp->connection) ++ return; ++ ++ g_debug ("Disconnecting"); ++ ++ connection = xsmp->connection; ++ xsmp->connection = NULL; ++ SmcCloseConnection (connection, 0, NULL); ++ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; ++ ++ xsmp->waiting_to_save_myself = FALSE; ++ update_pending_events (xsmp); ++} ++ ++static void ++sm_client_xsmp_startup (EggSMClient *client, ++ const char *client_id) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ SmcCallbacks callbacks; ++ char *ret_client_id; ++ char error_string_ret[256]; ++ ++ xsmp->client_id = g_strdup (client_id); ++ ++ ice_init (); ++ SmcSetErrorHandler (smc_error_handler); ++ ++ callbacks.save_yourself.callback = xsmp_save_yourself; ++ callbacks.die.callback = xsmp_die; ++ callbacks.save_complete.callback = xsmp_save_complete; ++ callbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled; ++ ++ callbacks.save_yourself.client_data = xsmp; ++ callbacks.die.client_data = xsmp; ++ callbacks.save_complete.client_data = xsmp; ++ callbacks.shutdown_cancelled.client_data = xsmp; ++ ++ client_id = NULL; ++ error_string_ret[0] = '\0'; ++ xsmp->connection = ++ SmcOpenConnection (NULL, xsmp, SmProtoMajor, SmProtoMinor, ++ SmcSaveYourselfProcMask | SmcDieProcMask | ++ SmcSaveCompleteProcMask | ++ SmcShutdownCancelledProcMask, ++ &callbacks, ++ xsmp->client_id, &ret_client_id, ++ sizeof (error_string_ret), error_string_ret); ++ ++ if (!xsmp->connection) ++ { ++ g_warning ("Failed to connect to the session manager: %s\n", ++ error_string_ret[0] ? ++ error_string_ret : "no error message given"); ++ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; ++ return; ++ } ++ ++ /* We expect a pointless initial SaveYourself if either (a) we ++ * didn't have an initial client ID, or (b) we DID have an initial ++ * client ID, but the server rejected it and gave us a new one. ++ */ ++ if (!xsmp->client_id || ++ (ret_client_id && strcmp (xsmp->client_id, ret_client_id) != 0)) ++ xsmp->expecting_initial_save_yourself = TRUE; ++ ++ if (ret_client_id) ++ { ++ g_free (xsmp->client_id); ++ xsmp->client_id = g_strdup (ret_client_id); ++ free (ret_client_id); ++ ++ gdk_threads_enter (); ++ gdk_set_sm_client_id (xsmp->client_id); ++ gdk_threads_leave (); ++ ++ g_debug ("Got client ID \"%s\"", xsmp->client_id); ++ } ++ ++ xsmp->state = XSMP_STATE_IDLE; ++ ++ /* Do not set the initial properties until we reach the main loop, ++ * so that the application has a chance to call ++ * egg_set_desktop_file(). (This may also help the session manager ++ * have a better idea of when the application is fully up and ++ * running.) ++ */ ++ xsmp->waiting_to_set_initial_properties = TRUE; ++ xsmp->idle = g_idle_add (sm_client_xsmp_set_initial_properties, client); ++} ++ ++static void ++sm_client_xsmp_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ int i; ++ ++ g_strfreev (xsmp->restart_command); ++ ++ xsmp->restart_command = g_new (char *, argc + 1); ++ for (i = 0; i < argc; i++) ++ xsmp->restart_command[i] = g_strdup (argv[i]); ++ xsmp->restart_command[i] = NULL; ++ ++ xsmp->set_restart_command = TRUE; ++} ++ ++static void ++sm_client_xsmp_will_quit (EggSMClient *client, ++ gboolean will_quit) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ ++ if (xsmp->state == XSMP_STATE_CONNECTION_CLOSED) ++ { ++ /* The session manager has already exited! Schedule a quit ++ * signal. ++ */ ++ xsmp->waiting_to_emit_quit = TRUE; ++ update_pending_events (xsmp); ++ return; ++ } ++ else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ /* We received a ShutdownCancelled message while the application ++ * was interacting; Schedule a quit_cancelled signal. ++ */ ++ xsmp->waiting_to_emit_quit_cancelled = TRUE; ++ update_pending_events (xsmp); ++ return; ++ } ++ ++ g_return_if_fail (xsmp->state == XSMP_STATE_INTERACT); ++ ++ g_debug ("Sending InteractDone(%s)", will_quit ? "False" : "True"); ++ SmcInteractDone (xsmp->connection, !will_quit); ++ ++ if (will_quit && xsmp->need_save_state) ++ save_state (xsmp); ++ ++ g_debug ("Sending SaveYourselfDone(%s)", will_quit ? "True" : "False"); ++ SmcSaveYourselfDone (xsmp->connection, will_quit); ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++} ++ ++static gboolean ++sm_client_xsmp_end_session (EggSMClient *client, ++ EggSMClientEndStyle style, ++ gboolean request_confirmation) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ int save_type; ++ ++ /* To end the session via XSMP, we have to send a ++ * SaveYourselfRequest. We aren't allowed to do that if anything ++ * else is going on, but we don't want to expose this fact to the ++ * application. So we do our best to patch things up here... ++ * ++ * In the worst case, this method might block for some length of ++ * time in process_ice_messages, but the only time that code path is ++ * honestly likely to get hit is if the application tries to end the ++ * session as the very first thing it does, in which case it ++ * probably won't actually block anyway. It's not worth gunking up ++ * the API to try to deal nicely with the other 0.01% of cases where ++ * this happens. ++ */ ++ ++ while (xsmp->state != XSMP_STATE_IDLE || ++ xsmp->expecting_initial_save_yourself) ++ { ++ /* If we're already shutting down, we don't need to do anything. */ ++ if (xsmp->shutting_down) ++ return TRUE; ++ ++ switch (xsmp->state) ++ { ++ case XSMP_STATE_CONNECTION_CLOSED: ++ return FALSE; ++ ++ case XSMP_STATE_SAVE_YOURSELF: ++ /* Trying to log out from the save_state callback? Whatever. ++ * Abort the save_state. ++ */ ++ SmcSaveYourselfDone (xsmp->connection, FALSE); ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++ break; ++ ++ case XSMP_STATE_INTERACT_REQUEST: ++ case XSMP_STATE_INTERACT: ++ case XSMP_STATE_SHUTDOWN_CANCELLED: ++ /* Already in a shutdown-related state, just ignore ++ * the new shutdown request... ++ */ ++ return TRUE; ++ ++ case XSMP_STATE_IDLE: ++ if (xsmp->waiting_to_set_initial_properties) ++ sm_client_xsmp_set_initial_properties (xsmp); ++ ++ if (!xsmp->expecting_initial_save_yourself) ++ break; ++ /* else fall through */ ++ ++ case XSMP_STATE_SAVE_YOURSELF_DONE: ++ /* We need to wait for some response from the server.*/ ++ process_ice_messages (SmcGetIceConnection (xsmp->connection)); ++ break; ++ ++ default: ++ /* Hm... shouldn't happen */ ++ return FALSE; ++ } ++ } ++ ++ /* xfce4-session will do the wrong thing if we pass SmSaveGlobal and ++ * the user chooses to save the session. But gnome-session will do ++ * the wrong thing if we pass SmSaveBoth and the user chooses NOT to ++ * save the session... Sigh. ++ */ ++ if (!strcmp (SmcVendor (xsmp->connection), "xfce4-session")) ++ save_type = SmSaveBoth; ++ else ++ save_type = SmSaveGlobal; ++ ++ g_debug ("Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)", request_confirmation ? "!" : ""); ++ SmcRequestSaveYourself (xsmp->connection, ++ save_type, ++ True, /* shutdown */ ++ SmInteractStyleAny, ++ !request_confirmation, /* fast */ ++ True /* global */); ++ return TRUE; ++} ++ ++static gboolean ++idle_do_pending_events (gpointer data) ++{ ++ EggSMClientXSMP *xsmp = data; ++ EggSMClient *client = data; ++ ++ gdk_threads_enter (); ++ ++ xsmp->idle = 0; ++ ++ if (xsmp->waiting_to_emit_quit) ++ { ++ xsmp->waiting_to_emit_quit = FALSE; ++ egg_sm_client_quit (client); ++ goto out; ++ } ++ ++ if (xsmp->waiting_to_emit_quit_cancelled) ++ { ++ xsmp->waiting_to_emit_quit_cancelled = FALSE; ++ egg_sm_client_quit_cancelled (client); ++ xsmp->state = XSMP_STATE_IDLE; ++ } ++ ++ if (xsmp->waiting_to_save_myself) ++ { ++ xsmp->waiting_to_save_myself = FALSE; ++ do_save_yourself (xsmp); ++ } ++ ++ out: ++ gdk_threads_leave (); ++ return FALSE; ++} ++ ++static void ++update_pending_events (EggSMClientXSMP *xsmp) ++{ ++ gboolean want_idle = ++ xsmp->waiting_to_emit_quit || ++ xsmp->waiting_to_emit_quit_cancelled || ++ xsmp->waiting_to_save_myself; ++ ++ if (want_idle) ++ { ++ if (xsmp->idle == 0) ++ xsmp->idle = g_idle_add (idle_do_pending_events, xsmp); ++ } ++ else ++ { ++ if (xsmp->idle != 0) ++ g_source_remove (xsmp->idle); ++ xsmp->idle = 0; ++ } ++} ++ ++static void ++fix_broken_state (EggSMClientXSMP *xsmp, const char *message, ++ gboolean send_interact_done, ++ gboolean send_save_yourself_done) ++{ ++ g_warning ("Received XSMP %s message in state %s: client or server error", ++ message, EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ /* Forget any pending SaveYourself plans we had */ ++ xsmp->waiting_to_save_myself = FALSE; ++ update_pending_events (xsmp); ++ ++ if (send_interact_done) ++ SmcInteractDone (xsmp->connection, False); ++ if (send_save_yourself_done) ++ SmcSaveYourselfDone (xsmp->connection, True); ++ ++ xsmp->state = send_save_yourself_done ? XSMP_STATE_SAVE_YOURSELF_DONE : XSMP_STATE_IDLE; ++} ++ ++/* SM callbacks */ ++ ++static void ++xsmp_save_yourself (SmcConn smc_conn, ++ SmPointer client_data, ++ int save_type, ++ Bool shutdown, ++ int interact_style, ++ Bool fast) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ gboolean wants_quit_requested; ++ ++ g_debug ("Received SaveYourself(%s, %s, %s, %s) in state %s", ++ save_type == SmSaveLocal ? "SmSaveLocal" : ++ save_type == SmSaveGlobal ? "SmSaveGlobal" : "SmSaveBoth", ++ shutdown ? "Shutdown" : "!Shutdown", ++ interact_style == SmInteractStyleAny ? "SmInteractStyleAny" : ++ interact_style == SmInteractStyleErrors ? "SmInteractStyleErrors" : ++ "SmInteractStyleNone", fast ? "Fast" : "!Fast", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ if (xsmp->state != XSMP_STATE_IDLE && ++ xsmp->state != XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ fix_broken_state (xsmp, "SaveYourself", FALSE, TRUE); ++ return; ++ } ++ ++ if (xsmp->waiting_to_set_initial_properties) ++ sm_client_xsmp_set_initial_properties (xsmp); ++ ++ /* If this is the initial SaveYourself, ignore it; we've already set ++ * properties and there's no reason to actually save state too. ++ */ ++ if (xsmp->expecting_initial_save_yourself) ++ { ++ xsmp->expecting_initial_save_yourself = FALSE; ++ ++ if (save_type == SmSaveLocal && ++ interact_style == SmInteractStyleNone && ++ !shutdown && !fast) ++ { ++ g_debug ("Sending SaveYourselfDone(True) for initial SaveYourself"); ++ SmcSaveYourselfDone (xsmp->connection, True); ++ /* As explained in the comment at the end of ++ * do_save_yourself(), SAVE_YOURSELF_DONE is the correct ++ * state here, not IDLE. ++ */ ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++ return; ++ } ++ else ++ g_warning ("First SaveYourself was not the expected one!"); ++ } ++ ++ /* Even ignoring the "fast" flag completely, there are still 18 ++ * different combinations of save_type, shutdown and interact_style. ++ * We interpret them as follows: ++ * ++ * Type Shutdown Interact Interpretation ++ * G F A/E/N do nothing (1) ++ * G T N do nothing (1)* ++ * G T A/E quit_requested (2) ++ * L/B F A/E/N save_state (3) ++ * L/B T N save_state (3)* ++ * L/B T A/E quit_requested, then save_state (4) ++ * ++ * 1. Do nothing, because the SM asked us to do something ++ * uninteresting (save open files, but then don't quit ++ * afterward) or rude (save open files without asking the user ++ * for confirmation). ++ * ++ * 2. Request interaction and then emit ::quit_requested. This ++ * perhaps isn't quite correct for the SmInteractStyleErrors ++ * case, but we don't care. ++ * ++ * 3. Emit ::save_state. The SmSaveBoth SaveYourselfs in these ++ * rows essentially get demoted to SmSaveLocal, because their ++ * Global halves correspond to "do nothing". ++ * ++ * 4. Request interaction, emit ::quit_requested, and then emit ++ * ::save_state after interacting. This is the SmSaveBoth ++ * equivalent of #2, but we also promote SmSaveLocal shutdown ++ * SaveYourselfs to SmSaveBoth here, because we want to give ++ * the user a chance to save open files before quitting. ++ * ++ * (* It would be nice if we could do something useful when the ++ * session manager sends a SaveYourself with shutdown True and ++ * SmInteractStyleNone. But we can't, so we just pretend it didn't ++ * even tell us it was shutting down. The docs for ::quit mention ++ * that it might not always be preceded by ::quit_requested.) ++ */ ++ ++ /* As an optimization, we don't actually request interaction and ++ * emit ::quit_requested if the application isn't listening to the ++ * signal. ++ */ ++ wants_quit_requested = g_signal_has_handler_pending (xsmp, g_signal_lookup ("quit_requested", EGG_TYPE_SM_CLIENT), 0, FALSE); ++ ++ xsmp->need_save_state = (save_type != SmSaveGlobal); ++ xsmp->need_quit_requested = (shutdown && wants_quit_requested && ++ interact_style != SmInteractStyleNone); ++ xsmp->interact_errors = (interact_style == SmInteractStyleErrors); ++ ++ xsmp->shutting_down = shutdown; ++ ++ do_save_yourself (xsmp); ++} ++ ++static void ++do_save_yourself (EggSMClientXSMP *xsmp) ++{ ++ if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ /* The SM cancelled a previous SaveYourself, but we haven't yet ++ * had a chance to tell the application, so we can't start ++ * processing this SaveYourself yet. ++ */ ++ xsmp->waiting_to_save_myself = TRUE; ++ update_pending_events (xsmp); ++ return; ++ } ++ ++ if (xsmp->need_quit_requested) ++ { ++ xsmp->state = XSMP_STATE_INTERACT_REQUEST; ++ ++ g_debug ("Sending InteractRequest(%s)", ++ xsmp->interact_errors ? "Error" : "Normal"); ++ SmcInteractRequest (xsmp->connection, ++ xsmp->interact_errors ? SmDialogError : SmDialogNormal, ++ xsmp_interact, ++ xsmp); ++ return; ++ } ++ ++ if (xsmp->need_save_state) ++ { ++ save_state (xsmp); ++ ++ /* Though unlikely, the client could have been disconnected ++ * while the application was saving its state. ++ */ ++ if (!xsmp->connection) ++ return; ++ } ++ ++ g_debug ("Sending SaveYourselfDone(True)"); ++ SmcSaveYourselfDone (xsmp->connection, True); ++ ++ /* The client state diagram in the XSMP spec says that after a ++ * non-shutdown SaveYourself, we go directly back to "idle". But ++ * everything else in both the XSMP spec and the libSM docs ++ * disagrees. ++ */ ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++} ++ ++static void ++save_state (EggSMClientXSMP *xsmp) ++{ ++ GKeyFile *state_file; ++ char *state_file_path, *data; ++ EggDesktopFile *desktop_file; ++ GPtrArray *restart; ++ int offset, fd; ++ ++ /* We set xsmp->state before emitting save_state, but our caller is ++ * responsible for setting it back afterward. ++ */ ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF; ++ ++ state_file = egg_sm_client_save_state ((EggSMClient *)xsmp); ++ if (!state_file) ++ { ++ restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); ++ set_properties (xsmp, ++ ptrarray_prop (SmRestartCommand, restart), ++ NULL); ++ g_ptr_array_free (restart, TRUE); ++ delete_properties (xsmp, SmDiscardCommand, NULL); ++ return; ++ } ++ ++ desktop_file = egg_get_desktop_file (); ++ if (desktop_file) ++ { ++ GKeyFile *merged_file; ++ char *desktop_file_path; ++ ++ merged_file = g_key_file_new (); ++ desktop_file_path = ++ g_filename_from_uri (egg_desktop_file_get_source (desktop_file), ++ NULL, NULL); ++ if (desktop_file_path && ++ g_key_file_load_from_file (merged_file, desktop_file_path, ++ G_KEY_FILE_KEEP_COMMENTS | ++ G_KEY_FILE_KEEP_TRANSLATIONS, NULL)) ++ { ++ guint g, k, i; ++ char **groups, **keys, *value, *exec; ++ ++ groups = g_key_file_get_groups (state_file, NULL); ++ for (g = 0; groups[g]; g++) ++ { ++ keys = g_key_file_get_keys (state_file, groups[g], NULL, NULL); ++ for (k = 0; keys[k]; k++) ++ { ++ value = g_key_file_get_value (state_file, groups[g], ++ keys[k], NULL); ++ if (value) ++ { ++ g_key_file_set_value (merged_file, groups[g], ++ keys[k], value); ++ g_free (value); ++ } ++ } ++ g_strfreev (keys); ++ } ++ g_strfreev (groups); ++ ++ g_key_file_free (state_file); ++ state_file = merged_file; ++ ++ /* Update Exec key using "--sm-client-state-file %k" */ ++ restart = generate_command (xsmp->restart_command, ++ NULL, "%k"); ++ for (i = 0; i < restart->len; i++) ++ restart->pdata[i] = g_shell_quote (restart->pdata[i]); ++ g_ptr_array_add (restart, NULL); ++ exec = g_strjoinv (" ", (char **)restart->pdata); ++ g_strfreev ((char **)restart->pdata); ++ g_ptr_array_free (restart, FALSE); ++ ++ g_key_file_set_string (state_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ exec); ++ g_free (exec); ++ } ++ else ++ desktop_file = NULL; ++ ++ g_free (desktop_file_path); ++ } ++ ++ /* Now write state_file to disk. (We can't use mktemp(), because ++ * that requires the filename to end with "XXXXXX", and we want ++ * it to end with ".desktop".) ++ */ ++ ++ data = g_key_file_to_data (state_file, NULL, NULL); ++ g_key_file_free (state_file); ++ ++ offset = 0; ++ while (1) ++ { ++ state_file_path = g_strdup_printf ("%s%csession-state%c%s-%ld.%s", ++ g_get_user_config_dir (), ++ G_DIR_SEPARATOR, G_DIR_SEPARATOR, ++ g_get_prgname (), ++ (long)time (NULL) + offset, ++ desktop_file ? "desktop" : "state"); ++ ++ fd = open (state_file_path, O_WRONLY | O_CREAT | O_EXCL, 0644); ++ if (fd == -1) ++ { ++ if (errno == EEXIST) ++ { ++ offset++; ++ g_free (state_file_path); ++ continue; ++ } ++ else if (errno == ENOTDIR || errno == ENOENT) ++ { ++ char *sep = strrchr (state_file_path, G_DIR_SEPARATOR); ++ ++ *sep = '\0'; ++ if (g_mkdir_with_parents (state_file_path, 0755) != 0) ++ { ++ g_warning ("Could not create directory '%s'", ++ state_file_path); ++ g_free (state_file_path); ++ state_file_path = NULL; ++ break; ++ } ++ ++ continue; ++ } ++ ++ g_warning ("Could not create file '%s': %s", ++ state_file_path, g_strerror (errno)); ++ g_free (state_file_path); ++ state_file_path = NULL; ++ break; ++ } ++ ++ close (fd); ++ g_file_set_contents (state_file_path, data, -1, NULL); ++ break; ++ } ++ g_free (data); ++ ++ restart = generate_command (xsmp->restart_command, xsmp->client_id, ++ state_file_path); ++ set_properties (xsmp, ++ ptrarray_prop (SmRestartCommand, restart), ++ NULL); ++ g_ptr_array_free (restart, TRUE); ++ ++ if (state_file_path) ++ { ++ set_properties (xsmp, ++ array_prop (SmDiscardCommand, ++ "/bin/rm", "-rf", state_file_path, ++ NULL), ++ NULL); ++ g_free (state_file_path); ++ } ++} ++ ++static void ++xsmp_interact (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ EggSMClient *client = client_data; ++ ++ g_debug ("Received Interact message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ if (xsmp->state != XSMP_STATE_INTERACT_REQUEST) ++ { ++ fix_broken_state (xsmp, "Interact", TRUE, TRUE); ++ return; ++ } ++ ++ xsmp->state = XSMP_STATE_INTERACT; ++ egg_sm_client_quit_requested (client); ++} ++ ++static void ++xsmp_die (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ EggSMClient *client = client_data; ++ ++ g_debug ("Received Die message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ sm_client_xsmp_disconnect (xsmp); ++ egg_sm_client_quit (client); ++} ++ ++static void ++xsmp_save_complete (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ ++ g_debug ("Received SaveComplete message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) ++ xsmp->state = XSMP_STATE_IDLE; ++ else ++ fix_broken_state (xsmp, "SaveComplete", FALSE, FALSE); ++} ++ ++static void ++xsmp_shutdown_cancelled (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ EggSMClient *client = client_data; ++ ++ g_debug ("Received ShutdownCancelled message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ xsmp->shutting_down = FALSE; ++ ++ if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) ++ { ++ /* We've finished interacting and now the SM has agreed to ++ * cancel the shutdown. ++ */ ++ xsmp->state = XSMP_STATE_IDLE; ++ egg_sm_client_quit_cancelled (client); ++ } ++ else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ /* Hm... ok, so we got a shutdown SaveYourself, which got ++ * cancelled, but the application was still interacting, so we ++ * didn't tell it yet, and then *another* SaveYourself arrived, ++ * which we must still be waiting to tell the app about, except ++ * that now that SaveYourself has been cancelled too! Dizzy yet? ++ */ ++ xsmp->waiting_to_save_myself = FALSE; ++ update_pending_events (xsmp); ++ } ++ else ++ { ++ g_debug ("Sending SaveYourselfDone(False)"); ++ SmcSaveYourselfDone (xsmp->connection, False); ++ ++ if (xsmp->state == XSMP_STATE_INTERACT) ++ { ++ /* The application is currently interacting, so we can't ++ * tell it about the cancellation yet; we will wait until ++ * after it calls egg_sm_client_will_quit(). ++ */ ++ xsmp->state = XSMP_STATE_SHUTDOWN_CANCELLED; ++ } ++ else ++ { ++ /* The shutdown was cancelled before the application got a ++ * chance to interact. ++ */ ++ xsmp->state = XSMP_STATE_IDLE; ++ } ++ } ++} ++ ++/* Utilities */ ++ ++/* Create a restart/clone/Exec command based on @restart_command. ++ * If @client_id is non-%NULL, add "--sm-client-id @client_id". ++ * If @state_file is non-%NULL, add "--sm-client-state-file @state_file". ++ * ++ * None of the input strings are g_strdup()ed; the caller must keep ++ * them around until it is done with the returned GPtrArray, and must ++ * then free the array, but not its contents. ++ */ ++static GPtrArray * ++generate_command (char **restart_command, const char *client_id, ++ const char *state_file) ++{ ++ GPtrArray *cmd; ++ int i; ++ ++ cmd = g_ptr_array_new (); ++ g_ptr_array_add (cmd, restart_command[0]); ++ ++ if (client_id) ++ { ++ g_ptr_array_add (cmd, (char *)"--sm-client-id"); ++ g_ptr_array_add (cmd, (char *)client_id); ++ } ++ ++ if (state_file) ++ { ++ g_ptr_array_add (cmd, (char *)"--sm-client-state-file"); ++ g_ptr_array_add (cmd, (char *)state_file); ++ } ++ ++ for (i = 1; restart_command[i]; i++) ++ g_ptr_array_add (cmd, restart_command[i]); ++ ++ return cmd; ++} ++ ++/* Takes a NULL-terminated list of SmProp * values, created by ++ * array_prop, ptrarray_prop, string_prop, card8_prop, sets them, and ++ * frees them. ++ */ ++static void ++set_properties (EggSMClientXSMP *xsmp, ...) ++{ ++ GPtrArray *props; ++ SmProp *prop; ++ va_list ap; ++ guint i; ++ ++ props = g_ptr_array_new (); ++ ++ va_start (ap, xsmp); ++ while ((prop = va_arg (ap, SmProp *))) ++ g_ptr_array_add (props, prop); ++ va_end (ap); ++ ++ if (xsmp->connection) ++ { ++ SmcSetProperties (xsmp->connection, props->len, ++ (SmProp **)props->pdata); ++ } ++ ++ for (i = 0; i < props->len; i++) ++ { ++ prop = props->pdata[i]; ++ g_free (prop->vals); ++ g_free (prop); ++ } ++ g_ptr_array_free (props, TRUE); ++} ++ ++/* Takes a NULL-terminated list of property names and deletes them. */ ++static void ++delete_properties (EggSMClientXSMP *xsmp, ...) ++{ ++ GPtrArray *props; ++ char *prop; ++ va_list ap; ++ ++ if (!xsmp->connection) ++ return; ++ ++ props = g_ptr_array_new (); ++ ++ va_start (ap, xsmp); ++ while ((prop = va_arg (ap, char *))) ++ g_ptr_array_add (props, prop); ++ va_end (ap); ++ ++ SmcDeleteProperties (xsmp->connection, props->len, ++ (char **)props->pdata); ++ ++ g_ptr_array_free (props, TRUE); ++} ++ ++/* Takes an array of strings and creates a LISTofARRAY8 property. The ++ * strings are neither dupped nor freed; they need to remain valid ++ * until you're done with the SmProp. ++ */ ++static SmProp * ++array_prop (const char *name, ...) ++{ ++ SmProp *prop; ++ SmPropValue pv; ++ GArray *vals; ++ char *value; ++ va_list ap; ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmLISTofARRAY8; ++ ++ vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); ++ ++ va_start (ap, name); ++ while ((value = va_arg (ap, char *))) ++ { ++ pv.length = strlen (value); ++ pv.value = value; ++ g_array_append_val (vals, pv); ++ } ++ ++ prop->num_vals = vals->len; ++ prop->vals = (SmPropValue *)vals->data; ++ ++ g_array_free (vals, FALSE); ++ ++ return prop; ++} ++ ++/* Takes a GPtrArray of strings and creates a LISTofARRAY8 property. ++ * The array contents are neither dupped nor freed; they need to ++ * remain valid until you're done with the SmProp. ++ */ ++static SmProp * ++ptrarray_prop (const char *name, GPtrArray *values) ++{ ++ SmProp *prop; ++ SmPropValue pv; ++ GArray *vals; ++ guint i; ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmLISTofARRAY8; ++ ++ vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); ++ ++ for (i = 0; i < values->len; i++) ++ { ++ pv.length = strlen (values->pdata[i]); ++ pv.value = values->pdata[i]; ++ g_array_append_val (vals, pv); ++ } ++ ++ prop->num_vals = vals->len; ++ prop->vals = (SmPropValue *)vals->data; ++ ++ g_array_free (vals, FALSE); ++ ++ return prop; ++} ++ ++/* Takes a string and creates an ARRAY8 property. The string is ++ * neither dupped nor freed; it needs to remain valid until you're ++ * done with the SmProp. ++ */ ++static SmProp * ++string_prop (const char *name, const char *value) ++{ ++ SmProp *prop; ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmARRAY8; ++ ++ prop->num_vals = 1; ++ prop->vals = g_new (SmPropValue, 1); ++ ++ prop->vals[0].length = strlen (value); ++ prop->vals[0].value = (char *)value; ++ ++ return prop; ++} ++ ++/* Takes a char and creates a CARD8 property. */ ++static SmProp * ++card8_prop (const char *name, unsigned char value) ++{ ++ SmProp *prop; ++ char *card8val; ++ ++ /* To avoid having to allocate and free prop->vals[0], we cheat and ++ * make vals a 2-element-long array and then use the second element ++ * to store value. ++ */ ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmCARD8; ++ ++ prop->num_vals = 1; ++ prop->vals = g_new (SmPropValue, 2); ++ card8val = (char *)(&prop->vals[1]); ++ card8val[0] = value; ++ ++ prop->vals[0].length = 1; ++ prop->vals[0].value = card8val; ++ ++ return prop; ++} ++ ++/* ICE code. This makes no effort to play nice with anyone else trying ++ * to use libICE. Fortunately, no one uses libICE for anything other ++ * than SM. (DCOP uses ICE, but it has its own private copy of ++ * libICE.) ++ * ++ * When this moves to gtk, it will need to be cleverer, to avoid ++ * tripping over old apps that use GnomeClient or that use libSM ++ * directly. ++ */ ++ ++#include ++#include ++ ++static void ice_error_handler (IceConn ice_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ IcePointer values); ++static void ice_io_error_handler (IceConn ice_conn); ++static void ice_connection_watch (IceConn ice_conn, ++ IcePointer client_data, ++ Bool opening, ++ IcePointer *watch_data); ++ ++static void ++ice_init (void) ++{ ++ IceSetIOErrorHandler (ice_io_error_handler); ++ IceSetErrorHandler (ice_error_handler); ++ IceAddConnectionWatch (ice_connection_watch, NULL); ++} ++ ++static gboolean ++process_ice_messages (IceConn ice_conn) ++{ ++ IceProcessMessagesStatus status; ++ ++ gdk_threads_enter (); ++ status = IceProcessMessages (ice_conn, NULL, NULL); ++ gdk_threads_leave (); ++ ++ switch (status) ++ { ++ case IceProcessMessagesSuccess: ++ return TRUE; ++ ++ case IceProcessMessagesIOError: ++ sm_client_xsmp_disconnect (IceGetConnectionContext (ice_conn)); ++ return FALSE; ++ ++ case IceProcessMessagesConnectionClosed: ++ return FALSE; ++ ++ default: ++ g_assert_not_reached (); ++ } ++} ++ ++static gboolean ++ice_iochannel_watch (GIOChannel *channel, ++ GIOCondition condition, ++ gpointer client_data) ++{ ++ return process_ice_messages (client_data); ++} ++ ++static void ++ice_connection_watch (IceConn ice_conn, ++ IcePointer client_data, ++ Bool opening, ++ IcePointer *watch_data) ++{ ++ guint watch_id; ++ ++ if (opening) ++ { ++ GIOChannel *channel; ++ int fd = IceConnectionNumber (ice_conn); ++ ++ fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC); ++ channel = g_io_channel_unix_new (fd); ++ watch_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR, ++ ice_iochannel_watch, ice_conn); ++ g_io_channel_unref (channel); ++ ++ *watch_data = GUINT_TO_POINTER (watch_id); ++ } ++ else ++ { ++ watch_id = GPOINTER_TO_UINT (*watch_data); ++ g_source_remove (watch_id); ++ } ++} ++ ++static void ++ice_error_handler (IceConn ice_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ IcePointer values) ++{ ++ /* Do nothing */ ++} ++ ++static void ++ice_io_error_handler (IceConn ice_conn) ++{ ++ /* Do nothing */ ++} ++ ++static void ++smc_error_handler (SmcConn smc_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ SmPointer values) ++{ ++ /* Do nothing */ ++} +diff --git a/src/libeggsmclient/eggsmclient.c b/src/libeggsmclient/eggsmclient.c +new file mode 100644 +index 0000000..efa901d +--- a/src/libeggsmclient/eggsmclient.c ++++ b/src/libeggsmclient/eggsmclient.c +@@ -0,0 +1,589 @@ ++/* ++ * Copyright (C) 2007 Novell, 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, ++ * 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. ++ * ++ * 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. ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++ ++#include "eggsmclient.h" ++#include "eggsmclient-private.h" ++ ++static void egg_sm_client_debug_handler (const char *log_domain, ++ GLogLevelFlags log_level, ++ const char *message, ++ gpointer user_data); ++ ++enum { ++ SAVE_STATE, ++ QUIT_REQUESTED, ++ QUIT_CANCELLED, ++ QUIT, ++ LAST_SIGNAL ++}; ++ ++static guint signals[LAST_SIGNAL]; ++ ++struct _EggSMClientPrivate { ++ GKeyFile *state_file; ++}; ++ ++#define EGG_SM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) ++ ++G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT) ++ ++static EggSMClient *global_client; ++static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL; ++ ++static void ++egg_sm_client_init (EggSMClient *client) ++{ ++ ; ++} ++ ++static void ++egg_sm_client_class_init (EggSMClientClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ ++ g_type_class_add_private (klass, sizeof (EggSMClientPrivate)); ++ ++ /** ++ * EggSMClient::save_state: ++ * @client: the client ++ * @state_file: a #GKeyFile to save state information into ++ * ++ * Emitted when the session manager has requested that the ++ * application save information about its current state. The ++ * application should save its state into @state_file, and then the ++ * session manager may then restart the application in a future ++ * session and tell it to initialize itself from that state. ++ * ++ * You should not save any data into @state_file's "start group" ++ * (ie, the %NULL group). Instead, applications should save their ++ * data into groups with names that start with the application name, ++ * and libraries that connect to this signal should save their data ++ * into groups with names that start with the library name. ++ * ++ * Alternatively, rather than (or in addition to) using @state_file, ++ * the application can save its state by calling ++ * egg_sm_client_set_restart_command() during the processing of this ++ * signal (eg, to include a list of files to open). ++ **/ ++ signals[SAVE_STATE] = ++ g_signal_new ("save_state", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, save_state), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__POINTER, ++ G_TYPE_NONE, ++ 1, G_TYPE_POINTER); ++ ++ /** ++ * EggSMClient::quit_requested: ++ * @client: the client ++ * ++ * Emitted when the session manager requests that the application ++ * exit (generally because the user is logging out). The application ++ * should decide whether or not it is willing to quit (perhaps after ++ * asking the user what to do with documents that have unsaved ++ * changes) and then call egg_sm_client_will_quit(), passing %TRUE ++ * or %FALSE to give its answer to the session manager. (It does not ++ * need to give an answer before returning from the signal handler; ++ * it can interact with the user asynchronously and then give its ++ * answer later on.) If the application does not connect to this ++ * signal, then #EggSMClient will automatically return %TRUE on its ++ * behalf. ++ * ++ * The application should not save its session state as part of ++ * handling this signal; if the user has requested that the session ++ * be saved when logging out, then ::save_state will be emitted ++ * separately. ++ * ++ * If the application agrees to quit, it should then wait for either ++ * the ::quit_cancelled or ::quit signals to be emitted. ++ **/ ++ signals[QUIT_REQUESTED] = ++ g_signal_new ("quit_requested", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, quit_requested), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, ++ 0); ++ ++ /** ++ * EggSMClient::quit_cancelled: ++ * @client: the client ++ * ++ * Emitted when the session manager decides to cancel a logout after ++ * the application has already agreed to quit. After receiving this ++ * signal, the application can go back to what it was doing before ++ * receiving the ::quit_requested signal. ++ **/ ++ signals[QUIT_CANCELLED] = ++ g_signal_new ("quit_cancelled", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, quit_cancelled), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, ++ 0); ++ ++ /** ++ * EggSMClient::quit: ++ * @client: the client ++ * ++ * Emitted when the session manager wants the application to quit ++ * (generally because the user is logging out). The application ++ * should exit as soon as possible after receiving this signal; if ++ * it does not, the session manager may choose to forcibly kill it. ++ * ++ * Normally a GUI application would only be sent a ::quit if it ++ * agreed to quit in response to a ::quit_requested signal. However, ++ * this is not guaranteed; in some situations the session manager ++ * may decide to end the session without giving applications a ++ * chance to object. ++ **/ ++ signals[QUIT] = ++ g_signal_new ("quit", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, quit), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, ++ 0); ++} ++ ++static gboolean sm_client_disable = FALSE; ++static char *sm_client_state_file = NULL; ++static char *sm_client_id = NULL; ++static char *sm_config_prefix = NULL; ++ ++static gboolean ++sm_client_post_parse_func (GOptionContext *context, ++ GOptionGroup *group, ++ gpointer data, ++ GError **error) ++{ ++ EggSMClient *client = egg_sm_client_get (); ++ ++ if (sm_client_id == NULL) ++ { ++ const gchar *desktop_autostart_id; ++ ++ desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); ++ ++ if (desktop_autostart_id != NULL) ++ sm_client_id = g_strdup (desktop_autostart_id); ++ } ++ ++ /* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to ++ * use the same client id. */ ++ g_unsetenv ("DESKTOP_AUTOSTART_ID"); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->startup) ++ EGG_SM_CLIENT_GET_CLASS (client)->startup (client, sm_client_id); ++ return TRUE; ++} ++ ++/** ++ * egg_sm_client_get_option_group: ++ * ++ * Creates a %GOptionGroup containing the session-management-related ++ * options. You should add this group to the application's ++ * %GOptionContext if you want to use #EggSMClient. ++ * ++ * Return value: the %GOptionGroup ++ **/ ++GOptionGroup * ++egg_sm_client_get_option_group (void) ++{ ++ const GOptionEntry entries[] = { ++ { "sm-client-disable", 0, 0, ++ G_OPTION_ARG_NONE, &sm_client_disable, ++ N_("Disable connection to session manager"), NULL }, ++ { "sm-client-state-file", 0, 0, ++ G_OPTION_ARG_FILENAME, &sm_client_state_file, ++ N_("Specify file containing saved configuration"), N_("FILE") }, ++ { "sm-client-id", 0, 0, ++ G_OPTION_ARG_STRING, &sm_client_id, ++ N_("Specify session management ID"), N_("ID") }, ++ /* GnomeClient compatibility option */ ++ { "sm-disable", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &sm_client_disable, ++ NULL, NULL }, ++ /* GnomeClient compatibility option. This is a dummy option that only ++ * exists so that sessions saved by apps with GnomeClient can be restored ++ * later when they've switched to EggSMClient. See bug #575308. ++ */ ++ { "sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_STRING, &sm_config_prefix, ++ NULL, NULL }, ++ { NULL } ++ }; ++ GOptionGroup *group; ++ ++ /* Use our own debug handler for the "EggSMClient" domain. */ ++ g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, ++ egg_sm_client_debug_handler, NULL); ++ ++ group = g_option_group_new ("sm-client", ++ _("Session management options:"), ++ _("Show session management options"), ++ NULL, NULL); ++ g_option_group_add_entries (group, entries); ++ g_option_group_set_parse_hooks (group, NULL, sm_client_post_parse_func); ++ ++ return group; ++} ++ ++/** ++ * egg_sm_client_set_mode: ++ * @mode: an #EggSMClient mode ++ * ++ * Sets the "mode" of #EggSMClient as follows: ++ * ++ * %EGG_SM_CLIENT_MODE_DISABLED: Session management is completely ++ * disabled. The application will not even connect to the session ++ * manager. (egg_sm_client_get() will still return an #EggSMClient, ++ * but it will just be a dummy object.) ++ * ++ * %EGG_SM_CLIENT_MODE_NO_RESTART: The application will connect to ++ * the session manager (and thus will receive notification when the ++ * user is logging out, etc), but will request to not be ++ * automatically restarted with saved state in future sessions. ++ * ++ * %EGG_SM_CLIENT_MODE_NORMAL: The default. #EggSMCLient will ++ * function normally. ++ * ++ * This must be called before the application's main loop begins. ++ **/ ++void ++egg_sm_client_set_mode (EggSMClientMode mode) ++{ ++ global_client_mode = mode; ++} ++ ++/** ++ * egg_sm_client_get_mode: ++ * ++ * Gets the global #EggSMClientMode. See egg_sm_client_set_mode() ++ * for details. ++ * ++ * Return value: the global #EggSMClientMode ++ **/ ++EggSMClientMode ++egg_sm_client_get_mode (void) ++{ ++ return global_client_mode; ++} ++ ++/** ++ * egg_sm_client_get: ++ * ++ * Returns the master #EggSMClient for the application. ++ * ++ * On platforms that support saved sessions (ie, POSIX/X11), the ++ * application will only request to be restarted by the session ++ * manager if you call egg_set_desktop_file() to set an application ++ * desktop file. In particular, if the desktop file contains the key ++ * "X ++ * ++ * Return value: the master #EggSMClient. ++ **/ ++EggSMClient * ++egg_sm_client_get (void) ++{ ++ if (!global_client) ++ { ++ if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED && ++ !sm_client_disable) ++ { ++#if defined (GDK_WINDOWING_WIN32) ++ global_client = egg_sm_client_win32_new (); ++#elif defined (GDK_WINDOWING_QUARTZ) ++ global_client = egg_sm_client_osx_new (); ++#else ++ /* If both D-Bus and XSMP are compiled in, try XSMP first ++ * (since it supports state saving) and fall back to D-Bus ++ * if XSMP isn't available. ++ */ ++# ifdef EGG_SM_CLIENT_BACKEND_XSMP ++ global_client = egg_sm_client_xsmp_new (); ++# endif ++# ifdef EGG_SM_CLIENT_BACKEND_DBUS ++ if (!global_client) ++ global_client = egg_sm_client_dbus_new (); ++# endif ++#endif ++ } ++ ++ /* Fallback: create a dummy client, so that callers don't have ++ * to worry about a %NULL return value. ++ */ ++ if (!global_client) ++ global_client = g_object_new (EGG_TYPE_SM_CLIENT, NULL); ++ } ++ ++ return global_client; ++} ++ ++/** ++ * egg_sm_client_is_resumed: ++ * @client: the client ++ * ++ * Checks whether or not the current session has been resumed from ++ * a previous saved session. If so, the application should call ++ * egg_sm_client_get_state_file() and restore its state from the ++ * returned #GKeyFile. ++ * ++ * Return value: %TRUE if the session has been resumed ++ **/ ++gboolean ++egg_sm_client_is_resumed (EggSMClient *client) ++{ ++ g_return_val_if_fail (client == global_client, FALSE); ++ ++ return sm_client_state_file != NULL; ++} ++ ++/** ++ * egg_sm_client_get_state_file: ++ * @client: the client ++ * ++ * If the application was resumed by the session manager, this will ++ * return the #GKeyFile containing its state from the previous ++ * session. ++ * ++ * Note that other libraries and #EggSMClient itself may also store ++ * state in the key file, so if you call egg_sm_client_get_groups(), ++ * on it, the return value will likely include groups that you did not ++ * put there yourself. (It is also not guaranteed that the first ++ * group created by the application will still be the "start group" ++ * when it is resumed.) ++ * ++ * Return value: the #GKeyFile containing the application's earlier ++ * state, or %NULL on error. You should not free this key file; it ++ * is owned by @client. ++ **/ ++GKeyFile * ++egg_sm_client_get_state_file (EggSMClient *client) ++{ ++ EggSMClientPrivate *priv = EGG_SM_CLIENT_GET_PRIVATE (client); ++ char *state_file_path; ++ GError *err = NULL; ++ ++ g_return_val_if_fail (client == global_client, NULL); ++ ++ if (!sm_client_state_file) ++ return NULL; ++ if (priv->state_file) ++ return priv->state_file; ++ ++ if (!strncmp (sm_client_state_file, "file://", 7)) ++ state_file_path = g_filename_from_uri (sm_client_state_file, NULL, NULL); ++ else ++ state_file_path = g_strdup (sm_client_state_file); ++ ++ priv->state_file = g_key_file_new (); ++ if (!g_key_file_load_from_file (priv->state_file, state_file_path, 0, &err)) ++ { ++ g_warning ("Could not load SM state file '%s': %s", ++ sm_client_state_file, err->message); ++ g_clear_error (&err); ++ g_key_file_free (priv->state_file); ++ priv->state_file = NULL; ++ } ++ ++ g_free (state_file_path); ++ return priv->state_file; ++} ++ ++/** ++ * egg_sm_client_set_restart_command: ++ * @client: the client ++ * @argc: the length of @argv ++ * @argv: argument vector ++ * ++ * Sets the command used to restart @client if it does not have a ++ * .desktop file that can be used to find its restart command. ++ * ++ * This can also be used when handling the ::save_state signal, to ++ * save the current state via an updated command line. (Eg, providing ++ * a list of filenames to open when the application is resumed.) ++ **/ ++void ++egg_sm_client_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv) ++{ ++ g_return_if_fail (EGG_IS_SM_CLIENT (client)); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command) ++ EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command (client, argc, argv); ++} ++ ++/** ++ * egg_sm_client_will_quit: ++ * @client: the client ++ * @will_quit: whether or not the application is willing to quit ++ * ++ * This MUST be called in response to the ::quit_requested signal, to ++ * indicate whether or not the application is willing to quit. The ++ * application may call it either directly from the signal handler, or ++ * at some later point (eg, after asynchronously interacting with the ++ * user). ++ * ++ * If the application does not connect to ::quit_requested, ++ * #EggSMClient will call this method on its behalf (passing %TRUE ++ * for @will_quit). ++ * ++ * After calling this method, the application should wait to receive ++ * either ::quit_cancelled or ::quit. ++ **/ ++void ++egg_sm_client_will_quit (EggSMClient *client, ++ gboolean will_quit) ++{ ++ g_return_if_fail (EGG_IS_SM_CLIENT (client)); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->will_quit) ++ EGG_SM_CLIENT_GET_CLASS (client)->will_quit (client, will_quit); ++} ++ ++/** ++ * egg_sm_client_end_session: ++ * @style: a hint at how to end the session ++ * @request_confirmation: whether or not the user should get a chance ++ * to confirm the action ++ * ++ * Requests that the session manager end the current session. @style ++ * indicates how the session should be ended, and ++ * @request_confirmation indicates whether or not the user should be ++ * given a chance to confirm the logout/reboot/shutdown. Both of these ++ * flags are merely hints though; the session manager may choose to ++ * ignore them. ++ * ++ * Return value: %TRUE if the request was sent; %FALSE if it could not ++ * be (eg, because it could not connect to the session manager). ++ **/ ++gboolean ++egg_sm_client_end_session (EggSMClientEndStyle style, ++ gboolean request_confirmation) ++{ ++ EggSMClient *client = egg_sm_client_get (); ++ ++ g_return_val_if_fail (EGG_IS_SM_CLIENT (client), FALSE); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->end_session) ++ { ++ return EGG_SM_CLIENT_GET_CLASS (client)->end_session (client, style, ++ request_confirmation); ++ } ++ else ++ return FALSE; ++} ++ ++/* Signal-emitting callbacks from platform-specific code */ ++ ++GKeyFile * ++egg_sm_client_save_state (EggSMClient *client) ++{ ++ GKeyFile *state_file; ++ char *group; ++ ++ g_return_val_if_fail (client == global_client, NULL); ++ ++ state_file = g_key_file_new (); ++ ++ g_debug ("Emitting save_state"); ++ g_signal_emit (client, signals[SAVE_STATE], 0, state_file); ++ g_debug ("Done emitting save_state"); ++ ++ group = g_key_file_get_start_group (state_file); ++ if (group) ++ { ++ g_free (group); ++ return state_file; ++ } ++ else ++ { ++ g_key_file_free (state_file); ++ return NULL; ++ } ++} ++ ++void ++egg_sm_client_quit_requested (EggSMClient *client) ++{ ++ g_return_if_fail (client == global_client); ++ ++ if (!g_signal_has_handler_pending (client, signals[QUIT_REQUESTED], 0, FALSE)) ++ { ++ g_debug ("Not emitting quit_requested because no one is listening"); ++ egg_sm_client_will_quit (client, TRUE); ++ return; ++ } ++ ++ g_debug ("Emitting quit_requested"); ++ g_signal_emit (client, signals[QUIT_REQUESTED], 0); ++ g_debug ("Done emitting quit_requested"); ++} ++ ++void ++egg_sm_client_quit_cancelled (EggSMClient *client) ++{ ++ g_return_if_fail (client == global_client); ++ ++ g_debug ("Emitting quit_cancelled"); ++ g_signal_emit (client, signals[QUIT_CANCELLED], 0); ++ g_debug ("Done emitting quit_cancelled"); ++} ++ ++void ++egg_sm_client_quit (EggSMClient *client) ++{ ++ g_return_if_fail (client == global_client); ++ ++ g_debug ("Emitting quit"); ++ g_signal_emit (client, signals[QUIT], 0); ++ g_debug ("Done emitting quit"); ++ ++ /* FIXME: should we just call gtk_main_quit() here? */ ++} ++ ++static void ++egg_sm_client_debug_handler (const char *log_domain, ++ GLogLevelFlags log_level, ++ const char *message, ++ gpointer user_data) ++{ ++ static int debug = -1; ++ ++ if (debug < 0) ++ debug = (g_getenv ("EGG_SM_CLIENT_DEBUG") != NULL); ++ ++ if (debug) ++ g_log_default_handler (log_domain, log_level, message, NULL); ++} +diff --git a/src/libeggsmclient/eggsmclient.h b/src/libeggsmclient/eggsmclient.h +new file mode 100644 +index 0000000..e620b75 +--- a/src/libeggsmclient/eggsmclient.h ++++ b/src/libeggsmclient/eggsmclient.h +@@ -0,0 +1,117 @@ ++/* eggsmclient.h ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ */ ++ ++#ifndef __EGG_SM_CLIENT_H__ ++#define __EGG_SM_CLIENT_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++#define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ()) ++#define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient)) ++#define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass)) ++#define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT)) ++#define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT)) ++#define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass)) ++ ++typedef struct _EggSMClient EggSMClient; ++typedef struct _EggSMClientClass EggSMClientClass; ++typedef struct _EggSMClientPrivate EggSMClientPrivate; ++ ++typedef enum { ++ EGG_SM_CLIENT_END_SESSION_DEFAULT, ++ EGG_SM_CLIENT_LOGOUT, ++ EGG_SM_CLIENT_REBOOT, ++ EGG_SM_CLIENT_SHUTDOWN ++} EggSMClientEndStyle; ++ ++typedef enum { ++ EGG_SM_CLIENT_MODE_DISABLED, ++ EGG_SM_CLIENT_MODE_NO_RESTART, ++ EGG_SM_CLIENT_MODE_NORMAL ++} EggSMClientMode; ++ ++struct _EggSMClient ++{ ++ GObject parent; ++ ++}; ++ ++struct _EggSMClientClass ++{ ++ GObjectClass parent_class; ++ ++ /* signals */ ++ void (*save_state) (EggSMClient *client, ++ GKeyFile *state_file); ++ ++ void (*quit_requested) (EggSMClient *client); ++ void (*quit_cancelled) (EggSMClient *client); ++ void (*quit) (EggSMClient *client); ++ ++ /* virtual methods */ ++ void (*startup) (EggSMClient *client, ++ const char *client_id); ++ void (*set_restart_command) (EggSMClient *client, ++ int argc, ++ const char **argv); ++ void (*will_quit) (EggSMClient *client, ++ gboolean will_quit); ++ gboolean (*end_session) (EggSMClient *client, ++ EggSMClientEndStyle style, ++ gboolean request_confirmation); ++ ++ /* Padding for future expansion */ ++ void (*_egg_reserved1) (void); ++ void (*_egg_reserved2) (void); ++ void (*_egg_reserved3) (void); ++ void (*_egg_reserved4) (void); ++}; ++ ++GType egg_sm_client_get_type (void) G_GNUC_CONST; ++ ++GOptionGroup *egg_sm_client_get_option_group (void); ++ ++/* Initialization */ ++void egg_sm_client_set_mode (EggSMClientMode mode); ++EggSMClientMode egg_sm_client_get_mode (void); ++EggSMClient *egg_sm_client_get (void); ++ ++/* Resuming a saved session */ ++gboolean egg_sm_client_is_resumed (EggSMClient *client); ++GKeyFile *egg_sm_client_get_state_file (EggSMClient *client); ++ ++/* Alternate means of saving state */ ++void egg_sm_client_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv); ++ ++/* Handling "quit_requested" signal */ ++void egg_sm_client_will_quit (EggSMClient *client, ++ gboolean will_quit); ++ ++/* Initiate a logout/reboot/shutdown */ ++gboolean egg_sm_client_end_session (EggSMClientEndStyle style, ++ gboolean request_confirmation); ++ ++G_END_DECLS ++ ++ ++#endif /* __EGG_SM_CLIENT_H__ */ +-- +cgit v0.9 diff --git a/xchat-gnome-0.26.1-kill-libgnomeui.patch b/xchat-gnome-0.26.1-kill-libgnomeui.patch new file mode 100644 index 0000000..c30778f --- /dev/null +++ b/xchat-gnome-0.26.1-kill-libgnomeui.patch @@ -0,0 +1,321 @@ +From 3b6b529fb1529ad3d88cbee74df8ceba4dfd4a66 Mon Sep 17 00:00:00 2001 +From: Florian Müllner +Date: Wed, 13 Jan 2010 10:43:27 +0000 +Subject: Bug 584887 - Get rid of deprecated libgnome(ui) + +Replacing libgnome(ui) with EggSMClient and plain Glib/GTK+ +With few minor edits, committed +--- +diff --git a/configure.ac b/configure.ac +index d2a0f56..c3bf020 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -24,14 +24,13 @@ IT_PROG_INTLTOOL([0.35.0]) + GLIB_REQUIRED=2.18.0 + GTK_REQUIRED=2.14.0 + LIBGLADE_REQUIRED=2.3.2 +-LIBGNOME_REQUIRED=2.16.0 +-LIBGNOMEUI_REQUIRED=2.16.0 + GCONF_REQUIRED=2.8.0 + DBUS_REQUIRED=0.60 + DBUS_GLIB_REQUIRED=0.60 + LIBSEXY_REQUIRED=0.1.11 + LIBNOTIFY_REQUIRED=0.3.2 + LIBCANBERRAGTK_REQUIRED=0.3 ++SM_REQUIRED=1.0.0 + + AC_PROG_CC + AM_PROG_CC_C_O +@@ -65,12 +64,18 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ + gio-2.0 >= $GLIB_REQUIRED \ + gtk+-2.0 >= $GTK_REQUIRED \ + libglade-2.0 >= $LIBGLADE_REQUIRED \ +- libgnome-2.0 >= $LIBGNOME_REQUIRED \ +- libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ + gconf-2.0 >= $GCONF_REQUIRED \ + libsexy >= $LIBSEXY_REQUIRED \ + ]) + ++#EggSMClient replacing GnomeClient in libgnome ++PKG_CHECK_MODULES([EGG_SMCLIENT], [\ ++ gtk+-2.0 >= $GTK_REQUIRED \ ++ sm >= $SM_REQUIRED \ ++ ]) ++AC_SUBST(EGG_SMCLIENT_CFLAGS) ++AC_SUBST(EGG_SMCLIENT_LIBS) ++ + #D-Bus + AC_MSG_CHECKING([whether D-Bus support is requested]) + AC_ARG_ENABLE([dbus], +@@ -482,6 +487,7 @@ src/common/dbus/Makefile + src/common/Makefile + src/fe-gnome/Makefile + src/libcontrast/Makefile ++src/libeggsmclient/Makefile + src/Makefile + ]) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 1e9465d..0e763f6 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1 +1 @@ +-SUBDIRS = common libcontrast fe-gnome ++SUBDIRS = common libcontrast libeggsmclient fe-gnome +diff --git a/src/fe-gnome/Makefile.am b/src/fe-gnome/Makefile.am +index 098e78d..8faab84 100644 +--- a/src/fe-gnome/Makefile.am ++++ b/src/fe-gnome/Makefile.am +@@ -98,7 +98,7 @@ xchat_gnome_CPPFLAGS = \ + -DTOPSRCDIR="\"$(top_srcdir)\"" \ + -DSYSCONFDIR="\"$(sysconfdir)\"" \ + -DICONDIR="\"$(pkgdatadir)/icons\"" \ +- -DDATADIR="\"$(pkgdatadir)\"" \ ++ -DDATADIR="\"$(datadir)\"" \ + -DXCHATSHAREDIR="\"$(pkgdatadir)\"" \ + -DLIBDIR="\"$(pkglibdir)\"" \ + -DPREFIX="\"$(prefix)\"" \ +@@ -119,6 +119,7 @@ xchat_gnome_LDFLAGS = \ + xchat_gnome_LDADD = \ + $(top_builddir)/src/common/libxchatcommon.la \ + $(top_builddir)/src/libcontrast/libcontrast.la \ ++ $(top_builddir)/src/libeggsmclient/libeggsmclient.la \ + $(DEPENDENCIES_LIBS) \ + $(OPENSSL_LIBS) \ + $(LIBSEXY_LIBS) +diff --git a/src/fe-gnome/fe-gnome.c b/src/fe-gnome/fe-gnome.c +index fd32bd9..29ea0c3 100644 +--- a/src/fe-gnome/fe-gnome.c ++++ b/src/fe-gnome/fe-gnome.c +@@ -22,9 +22,11 @@ + #include + #include + #include ++#include + #include +-#include + #include ++#include "../libeggsmclient/eggsmclient.h" ++#include "../libeggsmclient/eggdesktopfile.h" + #include "gui.h" + #include "navigation-tree.h" + #include "main-window.h" +@@ -54,6 +56,8 @@ + #include "../common/cfgfiles.h" + #include "../common/plugin.h" + ++#define GNOME_DOT_GNOME ".gnome2" ++ + static gboolean opt_version = FALSE; + static gboolean opt_noplugins = FALSE; + static gchar *opt_cfgdir = NULL; +@@ -72,17 +76,47 @@ static GOptionEntry entries[] = { + + static void setup_sm (gint argc, + gchar *argv[]); +-static gint save_session (GnomeClient *client, +- gint phase, +- GnomeSaveStyle save_style, +- gint is_shutdown, +- GnomeInteractStyle interact_style, +- gint is_fast, +- gpointer client_data); +-static void kill_session (GnomeClient *client, ++static void quit_session (EggSMClient *client, + gpointer client_data); + static gboolean not_autoconnect (void); + ++static gchar * ++get_accels_filename (void) ++{ ++ const char *home; ++ ++ home = g_get_home_dir(); ++ if (!home) ++ return NULL; ++ return g_build_filename (home, GNOME_DOT_GNOME, "accels", PACKAGE, NULL); ++} ++ ++static void ++load_accels (void) ++{ ++ char *filename; ++ ++ filename = get_accels_filename (); ++ if (!filename) ++ return; ++ ++ gtk_accel_map_load (filename); ++ g_free (filename); ++} ++ ++static void ++save_accels (void) ++{ ++ char *filename; ++ ++ filename = get_accels_filename (); ++ if (!filename) ++ return; ++ ++ gtk_accel_map_save (filename); ++ g_free (filename); ++} ++ + int + fe_args (int argc, char *argv[]) + { +@@ -96,34 +130,33 @@ fe_args (int argc, char *argv[]) + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + #endif +- + context = g_option_context_new (NULL); + + g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); +- gui.program = gnome_program_init (PACKAGE, VERSION, +- LIBGNOMEUI_MODULE, argc, argv, +- GNOME_PARAM_GOPTION_CONTEXT, context, +- GNOME_PARAM_HUMAN_READABLE_NAME, "IRC Chat", +- GNOME_PROGRAM_STANDARD_PROPERTIES, +- NULL); +- +- if (error) { +- fprintf (stderr, _("xchat-gnome: %s\nTry `xchat-gnome --help' for more information\n"), error->message); ++ g_option_context_add_group (context, gtk_get_option_group (FALSE)); ++ g_option_context_add_group (context, egg_sm_client_get_option_group ()); ++ ++ gtk_init (&argc, &argv); ++ ++ if (! g_option_context_parse (context, &argc, &argv, &error)) { ++ g_printerr (_("Failed to parse arguments: %s\n"), error->message); + g_error_free (error); ++ g_option_context_free (context); + return 0; + } + ++ g_option_context_free (context); ++ + if (opt_version) { + g_print ("xchat-gnome %s\n", PACKAGE_VERSION); + return 0; + } + +- g_set_application_name (_("IRC Chat")); +- + if (opt_cfgdir) { + xdir_fs = opt_cfgdir; + } + ++ load_accels (); + setup_sm (argc, argv); + + return -1; +@@ -186,8 +219,6 @@ fe_main (void) + { + gtk_main (); + +- g_object_unref (gui.program); +- + /* sleep for 3 seconds so any QUIT messages are not lost. The */ + /* GUI is closed at this point, so the user doesn't even know! */ + +@@ -202,7 +233,7 @@ fe_main (void) + void + fe_cleanup (void) + { +- gnome_accelerators_sync (); ++ save_accels (); + } + + void +@@ -1035,45 +1066,21 @@ void fe_get_file (const char *title, + static void + setup_sm (gint argc, gchar *argv[]) + { +- GnomeClient *client; +- const gchar *prefix; ++ EggSMClient *client; ++ gchar *desktop_file; + +- client = gnome_master_client (); ++ client = egg_sm_client_get (); ++ desktop_file = g_build_filename (DATADIR, "applications", "xchat-gnome.desktop", NULL); ++ egg_set_desktop_file (desktop_file); ++ g_free (desktop_file); + +- g_signal_connect (G_OBJECT (client), "save_yourself", G_CALLBACK (save_session), argv[0]); +- g_signal_connect (G_OBJECT (client), "die", G_CALLBACK (kill_session), NULL); ++ g_signal_connect (G_OBJECT (client), "quit", G_CALLBACK (quit_session), NULL); + +- prefix = gnome_client_get_config_prefix (client); + /* FIXME: add discard command to remove saved state */ + } + +-static gint +-save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style, +- gint is_shutdown, GnomeInteractStyle interact_style, +- gint is_fast, gpointer client_data) +-{ +- gchar **argv; +- gint argc; +- const gchar *prefix; +- +- argv = g_new0 (gchar *, 2); +- argv[0] = client_data; +- argc = 1; +- +- gnome_client_set_restart_style (client, GNOME_RESTART_IF_RUNNING); +- gnome_client_set_restart_command (client, argc, argv); +- gnome_client_set_clone_command (client, argc, argv); +- +- prefix = gnome_client_get_config_prefix (client); +- /* FIXME: save state */ +- +- g_free (argv); +- +- return TRUE; +-} +- + static void +-kill_session (GnomeClient* client, gpointer client_data) ++quit_session (EggSMClient* client, gpointer client_data) + { + gtk_widget_hide (GTK_WIDGET (gui.main_window)); + gtk_widget_hide (GTK_WIDGET (gui.dcc)); +diff --git a/src/fe-gnome/gui.h b/src/fe-gnome/gui.h +index 0af43f4..b27d8ff 100644 +--- a/src/fe-gnome/gui.h ++++ b/src/fe-gnome/gui.h +@@ -24,7 +24,6 @@ + + #include + #include +-#include + #include "userlist.h" + #include "navigation-tree.h" + #include "dcc-window.h" +@@ -60,8 +59,6 @@ typedef struct + + NavModel *tree_model; + NavTree *server_tree; +- +- GnomeProgram *program; + } XChatGUI; + + extern XChatGUI gui; +diff --git a/src/fe-gnome/util.c b/src/fe-gnome/util.c +index 75d1e0c..a7540c5 100644 +--- a/src/fe-gnome/util.c ++++ b/src/fe-gnome/util.c +@@ -139,7 +139,7 @@ locate_data_file (const gchar *file_name) + path = uninstalled_path; + } else { + g_free (uninstalled_path); +- path = gnome_program_locate_file (gnome_program_get (), GNOME_FILE_DOMAIN_APP_DATADIR, file_name, FALSE, NULL); ++ path = g_build_filename (XCHATSHAREDIR, file_name, NULL); + } + + g_return_val_if_fail (path != NULL, NULL); +-- +cgit v0.9 diff --git a/xchat-gnome-0.26.1-recent-network-manager.patch b/xchat-gnome-0.26.1-recent-network-manager.patch new file mode 100644 index 0000000..2d0f225 --- /dev/null +++ b/xchat-gnome-0.26.1-recent-network-manager.patch @@ -0,0 +1,149 @@ +diff -up xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c +--- xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm 2009-03-15 09:08:06.000000000 -0500 ++++ xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c 2011-03-25 18:10:33.621834647 -0500 +@@ -23,7 +23,6 @@ + */ + + #include +-#define DBUS_API_SUBJECT_TO_CHANGE + #include + #include + #include +@@ -54,13 +53,18 @@ typedef enum + + typedef enum + { +- NM_STATE_UNKNOWN = 0, +- NM_STATE_ASLEEP, +- NM_STATE_CONFIGURE_AP, +- NM_STATE_CONFIGURE_DEV, +- NM_STATE_CONFIGURE_IP, +- NM_STATE_CONNECTED, +- NM_STATE_DISCONNECTED, ++ NM_STATE_UNKNOWN = 0, ++ NM_OLD_STATE_ASLEEP = 1, ++ NM_OLD_STATE_CONNECTING = 4, ++ NM_OLD_STATE_CONNECTED = 5, ++ NM_OLD_STATE_DISCONNECTED = 6, ++ NM_STATE_ASLEEP = 10, ++ NM_STATE_DISCONNECTED = 20, ++ NM_STATE_DISCONNECTING = 30, ++ NM_STATE_CONNECTING = 40, ++ NM_STATE_CONNECTED_LOCAL = 50, ++ NM_STATE_CONNECTED_SITE = 60, ++ NM_STATE_CONNECTED_GLOBAL = 70 + } NetworkManagerState; + + enum { +@@ -180,50 +184,6 @@ set_network_mode (NetworkStatus status) + } + } + +-static NetworkStatus +-check_device_state (const char *path) +-{ +- DBusMessage *message, *reply; +- DBusMessageIter iter; +- DBusError error; +- NetworkStatus network_mode; +- +- message = dbus_message_new_method_call (NM_SERVICE, path, NM_INTERFACE, "getLinkActive"); +- if (message == NULL) { +- g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); +- /* just guess that we're up */ +- return NETWORK_UP; +- } +- +- dbus_error_init (&error); +- reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error); +- +- if (dbus_error_is_set (&error)) { +- g_warning ("Net Monitor: Error retrieving device state: %s: %s\n", error.name, error.message); +- network_mode = NETWORK_UP; +- } else { +- dbus_message_iter_init (reply, &iter); +- +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_BOOLEAN) { +- dbus_bool_t active; +- +- dbus_message_iter_get_basic (&iter, &active); +- network_mode = active ? NETWORK_UP : NETWORK_DOWN; +- } else { +- g_warning ("Net Monitor: got bad reply from NetworkManager\n"); +- network_mode = NETWORK_UP; +- } +- } +- +- if (reply) +- dbus_message_unref (reply); +- +- if (message) +- dbus_message_unref (message); +- +- return network_mode; +-} +- + static void + determine_network_status () + { +@@ -232,7 +192,7 @@ determine_network_status () + DBusError error; + NetworkStatus network_mode = NETWORK_DOWN; + +- message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "getDevices"); ++ message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "state"); + if (message == NULL) { + g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); + /* just guess that we're up */ +@@ -248,24 +208,15 @@ determine_network_status () + network_mode = NETWORK_UP; + } else { + dbus_message_iter_init (reply, &iter); +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY) { +- DBusMessageIter child; +- +- dbus_message_iter_recurse (&iter, &child); +- +- while (dbus_message_iter_get_arg_type (&child) != DBUS_TYPE_INVALID) { +- const char *path; +- gboolean state; +- +- /* Check the state of this individual device. If any one +- * device is active, the network is up */ +- dbus_message_iter_get_basic (&child, &path); +- state = check_device_state (path); +- if (state == NETWORK_UP) +- network_mode = NETWORK_UP; ++ if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_UINT32) { ++ dbus_uint32_t state; + +- dbus_message_iter_next (&child); +- } ++ dbus_message_iter_get_basic (&iter, &state); ++ if (state == NM_OLD_STATE_CONNECTED || ++ state == NM_STATE_CONNECTED_LOCAL || ++ state == NM_STATE_CONNECTED_SITE || ++ state == NM_STATE_CONNECTED_GLOBAL) ++ network_mode = NETWORK_UP; + } else { + g_warning ("Net Monitor: got bad reply from NetworkManager\n"); + network_mode = NETWORK_UP; +@@ -284,16 +235,12 @@ determine_network_status () + static DBusHandlerResult + filter_func (DBusConnection *connection, DBusMessage *message, void *data) + { +- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNoLongerActive")) { ++ if (dbus_message_is_signal (message, NM_INTERFACE, "StateChanged") || ++ dbus_message_is_signal (message, NM_INTERFACE, "StateChange")) { + determine_network_status (); + return DBUS_HANDLER_RESULT_HANDLED; + } + +- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNowActive")) { +- set_network_mode (NETWORK_UP); +- return DBUS_HANDLER_RESULT_HANDLED; +- } +- + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + diff --git a/xchat-gnome-0.26.1-remove-deprecated-api.patch b/xchat-gnome-0.26.1-remove-deprecated-api.patch new file mode 100644 index 0000000..1f4bc87 --- /dev/null +++ b/xchat-gnome-0.26.1-remove-deprecated-api.patch @@ -0,0 +1,400 @@ +From 23aa5dd1a3033c0badd750bedea8ba1b7a677a74 Mon Sep 17 00:00:00 2001 +From: Robert Ancell +Date: Mon, 17 Jan 2011 12:10:30 +0000 +Subject: Bug 637427 - [PATCH] Stop using deprecated GDK/GTK API + +removed a bit of deprecated apis, and minor indentation fixes +--- +diff --git a/src/fe-gnome/channel-list-window.c b/src/fe-gnome/channel-list-window.c +index e7e7c31..652f549 100644 +--- a/src/fe-gnome/channel-list-window.c ++++ b/src/fe-gnome/channel-list-window.c +@@ -497,7 +497,7 @@ channel_list_window_finalize (GObject *object) + g_source_remove (win->refresh_timeout); + } + chanlists = g_slist_remove (chanlists, (gpointer) win); +- gtk_widget_hide_all (win->window); ++ gtk_widget_hide (win->window); + + g_object_unref (win->xml); + G_OBJECT_CLASS (channel_list_window_parent_class)->finalize (object); +diff --git a/src/fe-gnome/connect-dialog.c b/src/fe-gnome/connect-dialog.c +index 35b90a6..22895e8 100644 +--- a/src/fe-gnome/connect-dialog.c ++++ b/src/fe-gnome/connect-dialog.c +@@ -159,7 +159,9 @@ connect_dialog_init (ConnectDialog *dialog) + gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->toplevel); ++#if !GTK_CHECK_VERSION (2, 23, 0) + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); ++#endif + + g_signal_connect (G_OBJECT (dialog->server_list), "row-activated", G_CALLBACK (row_activated), dialog); + +diff --git a/src/fe-gnome/conversation-panel.c b/src/fe-gnome/conversation-panel.c +index fb013c7..59e1bcd 100644 +--- a/src/fe-gnome/conversation-panel.c ++++ b/src/fe-gnome/conversation-panel.c +@@ -584,13 +584,23 @@ conversation_panel_set_background (ConversationPanel *panel) + pixbuf = gdk_pixbuf_new_from_file (filename, NULL); + if (pixbuf) { + gint width, height; ++#if GTK_CHECK_VERSION (2, 23, 0) ++ cairo_t *context; ++#endif + GdkPixmap *image; + + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + + image = gdk_pixmap_new (NULL, width, height, 24); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ context = gdk_cairo_create (GDK_DRAWABLE (image)); ++ gdk_cairo_set_source_pixbuf (context, pixbuf, 0, 0); ++ cairo_paint (context); ++ cairo_destroy (context); ++#else + gdk_draw_pixbuf (image, NULL, pixbuf, 0, 0, 0, 0, width, height, GDK_RGB_DITHER_NONE, 0, 0); ++#endif + + gtk_xtext_set_background (GTK_XTEXT (panel->priv->xtext), image, FALSE); + g_object_unref (pixbuf); +diff --git a/src/fe-gnome/irc-network-editor.c b/src/fe-gnome/irc-network-editor.c +index 0f424d0..4fa132b 100644 +--- a/src/fe-gnome/irc-network-editor.c ++++ b/src/fe-gnome/irc-network-editor.c +@@ -322,13 +322,22 @@ irc_network_editor_init (IrcNetworkEditor *dialog) + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (dialog->autojoin_channels), 1, _("Key"), dialog->autojoin_key_renderer, "text", 1, NULL); + g_object_set (G_OBJECT (dialog->autojoin_key_renderer), "editable", TRUE, NULL); + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ dialog->encoding = gtk_combo_box_text_new (); ++#else + dialog->encoding = gtk_combo_box_new_text (); ++#endif ++ + gtk_widget_show (dialog->encoding); + gtk_table_attach_defaults (GTK_TABLE (dialog->network_settings_table), dialog->encoding, 1, 2, 5, 6); + + enc = (gchar **) encodings; + do { ++#if GTK_CHECK_VERSION (2, 23, 0) ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dialog->encoding), _(*enc)); ++#else + gtk_combo_box_append_text (GTK_COMBO_BOX (dialog->encoding), _(*enc)); ++#endif + enc++; + } while (*enc); + +diff --git a/src/fe-gnome/preferences-page-colors.c b/src/fe-gnome/preferences-page-colors.c +index 51afb4f..33186c9 100644 +--- a/src/fe-gnome/preferences-page-colors.c ++++ b/src/fe-gnome/preferences-page-colors.c +@@ -255,10 +255,18 @@ preferences_page_colors_new (gpointer prefs_dialog, GtkBuilder *xml) + gtk_list_store_set (p->page_store, &iter, 0, PREFERENCES_PAGE (page)->icon, 1, _("Colors"), 2, 1, -1); + + page->combo = gtk_combo_box_new_text (); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ page->combo = gtk_combo_box_text_new (); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("Black on White")); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("White on Black")); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("Custom")); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("System Theme Colors")); ++#else + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("Black on White")); + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("White on Black")); + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("Custom")); + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("System Theme Colors")); ++#endif + gtk_widget_show (page->combo); + gtk_label_set_mnemonic_widget (GTK_LABEL (page->color_label_1), page->combo); + gtk_box_pack_start (GTK_BOX (page->foreground_background_hbox), page->combo, FALSE, TRUE, 0); +diff --git a/src/fe-gnome/text-entry.c b/src/fe-gnome/text-entry.c +index 24c192b..ad24c6c 100644 +--- a/src/fe-gnome/text-entry.c ++++ b/src/fe-gnome/text-entry.c +@@ -624,19 +624,35 @@ get_color_icon (int c, GtkStyle *style) + { + GtkWidget *image; + GdkPixmap *pixmap; ++#if GTK_CHECK_VERSION (2, 23, 0) ++ cairo_t *context; ++#else + GdkGC *color; ++#endif + + pixmap = gdk_pixmap_new (NULL, 16, 16, 24); + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ context = gdk_cairo_create (GDK_DRAWABLE (pixmap)); ++ gdk_cairo_set_source_color (context, &style->dark[GTK_STATE_NORMAL]); ++ cairo_rectangle (context, 0, 0, 16, 16); ++ cairo_fill (context); ++ gdk_cairo_set_source_color (context, &colors[c]); ++ cairo_rectangle (context, 1, 1, 14, 14); ++ cairo_fill (context); ++ cairo_destroy (context); ++#else + color = gdk_gc_new (GDK_DRAWABLE (pixmap)); + gdk_gc_set_foreground (color, &style->dark[GTK_STATE_NORMAL]); + gdk_draw_rectangle (GDK_DRAWABLE (pixmap), color, TRUE, 0, 0, 16, 16); + gdk_gc_set_foreground (color, &colors[c]); + gdk_draw_rectangle (GDK_DRAWABLE (pixmap), color, TRUE, 1, 1, 14, 14); + g_object_unref (color); ++#endif + + image = gtk_image_new_from_pixmap (pixmap, NULL); + g_object_unref (pixmap); ++ + return image; + } + +diff --git a/src/fe-gnome/userlist-gui.c b/src/fe-gnome/userlist-gui.c +index c6671df..3e1dd66 100644 +--- a/src/fe-gnome/userlist-gui.c ++++ b/src/fe-gnome/userlist-gui.c +@@ -402,7 +402,12 @@ userlist_button_release (GtkWidget *widget, GdkEventButton *button, gpointer dat + gint x, y, width, height; + + gdk_window_get_root_origin (gui.userlist_window->window, &x, &y); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (gui.userlist_window->window); ++ height = gdk_window_get_height (gui.userlist_window->window); ++#else + gdk_drawable_get_size (gui.userlist_window->window, &width, &height); ++#endif + + /* If the event happened on top of the userlist window, we don't want to + * close it */ +diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c +index a7e2caf..06b00c5 100644 +--- a/src/fe-gnome/xtext.c ++++ b/src/fe-gnome/xtext.c +@@ -978,28 +978,28 @@ gtk_xtext_realize (GtkWidget * widget) + attributes.visual = gtk_widget_get_visual (widget); + + widget->window = gdk_window_new (widget->parent->window, &attributes, +- GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | +- GDK_WA_COLORMAP); ++ GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | ++ GDK_WA_COLORMAP); + + gdk_window_set_user_data (widget->window, widget); + +- xtext->depth = gdk_drawable_get_visual (widget->window)->depth; ++ xtext->depth = gdk_drawable_get_depth (widget->window); + + val.subwindow_mode = GDK_INCLUDE_INFERIORS; + val.graphics_exposures = 0; + + xtext->bgc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->fgc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->light_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->dark_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->thin_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->marker_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + + /* for the separator bar (light) */ + col.red = 0xffff; col.green = 0xffff; col.blue = 0xffff; +@@ -1041,9 +1041,9 @@ gtk_xtext_realize (GtkWidget * widget) + gdk_gc_set_fill (xtext->bgc, GDK_TILED); + } + +-#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) +- xtext->hand_cursor = gdk_cursor_new (GDK_HAND1); +- xtext->resize_cursor = gdk_cursor_new (GDK_LEFT_SIDE); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ xtext->hand_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_HAND1); ++ xtext->resize_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_LEFT_SIDE); + #else + xtext->hand_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_HAND1); + xtext->resize_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_LEFT_SIDE); +@@ -1718,7 +1718,11 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext) + int p_y, win_height; + + gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ win_height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height); ++#endif + + if (p_y > win_height && + xtext->adj->value < (xtext->adj->upper - xtext->adj->page_size)) +@@ -1758,7 +1762,11 @@ gtk_xtext_selection_update (GtkXText * xtext, GdkEventMotion * event, int p_y, g + int win_height; + int moved; + ++#if GTK_CHECK_VERSION (2, 16, 0) ++ win_height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height); ++#endif + + /* selecting past top of window, scroll up! */ + if (p_y < 0 && xtext->adj->value >= 0) +@@ -2372,8 +2380,8 @@ gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret) + + static void + gtk_xtext_selection_get (GtkWidget * widget, +- GtkSelectionData * selection_data_ptr, +- guint info, guint time) ++ GtkSelectionData * selection_data_ptr, ++ guint info, guint time) + { + GtkXText *xtext = GTK_XTEXT (widget); + char *stripped; +@@ -2398,16 +2406,16 @@ gtk_xtext_selection_get (GtkWidget * widget, + gint format; + gint new_length; + +-#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) +- gdk_string_to_compound_text ( ++ gdk_string_to_compound_text_for_display ( ++#if GTK_CHECK_VERSION (2, 23, 0) ++ gdk_window_get_display (widget->window), + #else +- gdk_string_to_compound_text_for_display ( +- gdk_drawable_get_display (widget->window), ++ gdk_drawable_get_display (widget->window), + #endif +- stripped, &encoding, &format, &new_text, +- &new_length); ++ stripped, &encoding, &format, &new_text, ++ &new_length); + gtk_selection_data_set (selection_data_ptr, encoding, format, +- new_text, new_length); ++ new_text, new_length); + gdk_free_compound_text (new_text); + } + break; +@@ -3750,7 +3758,13 @@ gtk_xtext_load_trans (GtkXText * xtext) + if (xtext->shaded) + { + int width, height; ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif ++ + xtext->pixmap = shade_pixmap (xtext, rootpix, x, y, width+105, height); + if (xtext->pixmap == NULL) + { +@@ -3763,8 +3777,8 @@ gtk_xtext_load_trans (GtkXText * xtext) + } else + { + noshade: +-#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) +- xtext->pixmap = gdk_pixmap_foreign_new (rootpix); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_window_get_display (GTK_WIDGET (xtext)->window), rootpix); + #else + xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_drawable_get_display (GTK_WIDGET (xtext)->window), rootpix); + #endif +@@ -3910,7 +3924,11 @@ gtk_xtext_find_subline (GtkXText *xtext, textentry *ent, int line) + if (line <= RECORD_WRAPS) + return ent->wrap_offset[line - 1]; + ++#if GTK_CHECK_VERSION (2, 16, 0) ++ win_width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &win_width, 0); ++#endif + win_width -= MARGIN; + + /* indent = ent->indent; +@@ -4329,7 +4347,12 @@ gtk_xtext_calc_lines (xtext_buffer *buf, int fire_signal) + int height; + int lines; + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (buf->xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (buf->xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (buf->xtext)->window, &width, &height); ++#endif + width -= MARGIN; + + if (width < 30 || height < buf->xtext->fontsize || width < buf->indent + 30) +@@ -4424,7 +4447,12 @@ gtk_xtext_render_ents (GtkXText * xtext, textentry * enta, textentry * entb) + if (xtext->buffer->indent < MARGIN) + xtext->buffer->indent = MARGIN; /* 2 pixels is our left margin */ + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif + width -= MARGIN; + + if (width < 32 || height < xtext->fontsize || width < xtext->buffer->indent + 30) +@@ -4511,7 +4539,12 @@ gtk_xtext_render_page (GtkXText * xtext) + if (xtext->buffer->indent < MARGIN) + xtext->buffer->indent = MARGIN; /* 2 pixels is our left margin */ + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif + + if (width < 34 || height < xtext->fontsize || width < xtext->buffer->indent + 32) + return; +@@ -4563,8 +4596,11 @@ gtk_xtext_render_page (GtkXText * xtext) + #endif + #endif + { ++ ++#if !GTK_CHECK_VERSION (2, 13, 0) + /* so the obscured regions are exposed */ + gdk_gc_set_exposures (xtext->fgc, TRUE); ++#endif + if (overlap < 1) /* DOWN */ + { + int remainder; +@@ -4719,7 +4755,12 @@ gtk_xtext_check_ent_visibility (GtkXText * xtext, textentry *find_ent, int add) + int width; + int height; + ++#if GTK_CHECK_VERSION (2, 16, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif + + lines_max = ((height + xtext->pixel_offset) / xtext->fontsize) + add; + ent = xtext->buffer->pagetop_ent; +@@ -5191,8 +5232,12 @@ gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render) + + if (!gtk_widget_get_realized (GTK_WIDGET (xtext))) + gtk_widget_realize (GTK_WIDGET (xtext)); +- ++#if GTK_CHECK_VERSION (2, 23, 0) ++ w = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ h = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &w, &h); ++#endif + + /* after a font change */ + if (buf->needs_recalc) +-- +cgit v0.9 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 8cd2601..33cc0a1 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 16%{?dist} +Release: 17%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -27,6 +27,13 @@ Patch7: 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch Patch8: xchat-gnome-0.26.1-deprecated-symbol.patch # Patch for libnotify 0.70 (just drop one parameter from one function) Patch9: xchat-gnome-0.26.1-libnotify.patch +# Patch to work with recent NetworkManager (0.7+) +Patch10: xchat-gnome-0.26.1-recent-network-manager.patch +# Kill libgnomeui +Patch11: xchat-gnome-0.26.1-add-libeggsmclient.patch +Patch12: xchat-gnome-0.26.1-kill-libgnomeui.patch +# Convert deprecated GDK functions to cairo +Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -77,9 +84,14 @@ common settings will be included in the main user interface. . %patch7 -p1 -b .dcc %patch8 -p1 -b .symbol %patch9 -p1 -b .notify +%patch10 -p1 -b .recent-nm +%patch11 -p1 -b .add-libegg +%patch12 -p1 -b .kill-libgnomeui +%patch13 -p1 -b .gdk-deprecations %build +autoreconf -i %configure --disable-tcl \ --disable-scrollkeeper \ --disable-schemas-install \ @@ -142,6 +154,9 @@ fi %changelog +* Fri Mar 25 2011 Dan Williams - 0.26.1-17 +- Update for NetworkManager 0.9 + * Mon Feb 07 2011 Fedora Release Engineering - 0.26.1-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From f4addec10fc87c898ed086d13dc8b3999011885a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Mar 2011 18:54:39 -0500 Subject: [PATCH 061/105] Update for recent GTK/GNOME changes and NM 0.9 --- xchat-gnome-0.26.1-add-libeggsmclient.patch | 3886 +++++++++++++++++ xchat-gnome-0.26.1-kill-libgnomeui.patch | 321 ++ ...-gnome-0.26.1-recent-network-manager.patch | 149 + ...t-gnome-0.26.1-remove-deprecated-api.patch | 400 ++ xchat-gnome.spec | 18 +- 5 files changed, 4773 insertions(+), 1 deletion(-) create mode 100644 xchat-gnome-0.26.1-add-libeggsmclient.patch create mode 100644 xchat-gnome-0.26.1-kill-libgnomeui.patch create mode 100644 xchat-gnome-0.26.1-recent-network-manager.patch create mode 100644 xchat-gnome-0.26.1-remove-deprecated-api.patch diff --git a/xchat-gnome-0.26.1-add-libeggsmclient.patch b/xchat-gnome-0.26.1-add-libeggsmclient.patch new file mode 100644 index 0000000..c3d2abe --- /dev/null +++ b/xchat-gnome-0.26.1-add-libeggsmclient.patch @@ -0,0 +1,3886 @@ +From cbb13af76a23d0bd75630dd966a0af7a2caeca5b Mon Sep 17 00:00:00 2001 +From: Florian Müllner +Date: Sun, 17 Jan 2010 15:09:14 +0000 +Subject: Bug 584887 - Get rid of deprecated libgnome(ui) + +added libeggsmclient to source. +--- +diff --git a/src/libeggsmclient/Makefile.am b/src/libeggsmclient/Makefile.am +new file mode 100644 +index 0000000..5af58d4 +--- a/src/libeggsmclient/Makefile.am ++++ b/src/libeggsmclient/Makefile.am +@@ -0,0 +1,36 @@ ++platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP ++platform_libs = libeggdesktopfile.la ++platform_ltlibraries = libeggdesktopfile.la ++platform_sources = eggsmclient-xsmp.c ++ ++INCLUDES = \ ++ -DG_LOG_DOMAIN=\""EggSMClient"\" \ ++ $(platform_defines) \ ++ $(EGG_SMCLIENT_CFLAGS) ++ ++noinst_LTLIBRARIES = \ ++ libeggsmclient.la \ ++ $(platform_ltlibraries) ++ ++libeggsmclient_la_LIBADD = \ ++ $(EGG_SMCLIENT_LIBS) \ ++ $(platform_libs) ++ ++libeggsmclient_la_LDFLAGS = \ ++ $(platform_ldflags) ++ ++libeggsmclient_la_SOURCES = \ ++ eggsmclient.c \ ++ eggsmclient.h \ ++ eggsmclient-private.h \ ++ $(platform_sources) ++ ++libeggdesktopfile_la_LIBADD = \ ++ $(EGG_LIBS) ++ ++libeggdesktopfile_la_SOURCES = \ ++ eggdesktopfile.c \ ++ eggdesktopfile.h ++ ++EXTRA_DIST = \ ++ eggsmclient-xsmp.c +diff --git a/src/libeggsmclient/eggdesktopfile.c b/src/libeggsmclient/eggdesktopfile.c +new file mode 100644 +index 0000000..6f6b946 +--- a/src/libeggsmclient/eggdesktopfile.c ++++ b/src/libeggsmclient/eggdesktopfile.c +@@ -0,0 +1,1510 @@ ++/* eggdesktopfile.c - Freedesktop.Org Desktop Files ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * Based on gnome-desktop-item.c ++ * Copyright (C) 1999, 2000 Red Hat Inc. ++ * Copyright (C) 2001 George Lebl ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; see the file COPYING.LIB. If not, ++ * write to the Free Software Foundation, Inc., 59 Temple Place - ++ * Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "eggdesktopfile.h" ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++struct EggDesktopFile { ++ GKeyFile *key_file; ++ char *source; ++ ++ char *name, *icon; ++ EggDesktopFileType type; ++ char document_code; ++}; ++ ++/** ++ * egg_desktop_file_new: ++ * @desktop_file_path: path to a Freedesktop-style Desktop file ++ * @error: error pointer ++ * ++ * Creates a new #EggDesktopFile for @desktop_file. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new (const char *desktop_file_path, GError **error) ++{ ++ GKeyFile *key_file; ++ ++ key_file = g_key_file_new (); ++ if (!g_key_file_load_from_file (key_file, desktop_file_path, 0, error)) ++ { ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ return egg_desktop_file_new_from_key_file (key_file, desktop_file_path, ++ error); ++} ++ ++/** ++ * egg_desktop_file_new_from_data_dirs: ++ * @desktop_file_path: relative path to a Freedesktop-style Desktop file ++ * @error: error pointer ++ * ++ * Looks for @desktop_file_path in the paths returned from ++ * g_get_user_data_dir() and g_get_system_data_dirs(), and creates ++ * a new #EggDesktopFile from it. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, ++ GError **error) ++{ ++ EggDesktopFile *desktop_file; ++ GKeyFile *key_file; ++ char *full_path; ++ ++ key_file = g_key_file_new (); ++ if (!g_key_file_load_from_data_dirs (key_file, desktop_file_path, ++ &full_path, 0, error)) ++ { ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ desktop_file = egg_desktop_file_new_from_key_file (key_file, ++ full_path, ++ error); ++ g_free (full_path); ++ return desktop_file; ++} ++ ++/** ++ * egg_desktop_file_new_from_dirs: ++ * @desktop_file_path: relative path to a Freedesktop-style Desktop file ++ * @search_dirs: NULL-terminated array of directories to search ++ * @error: error pointer ++ * ++ * Looks for @desktop_file_path in the paths returned from ++ * g_get_user_data_dir() and g_get_system_data_dirs(), and creates ++ * a new #EggDesktopFile from it. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new_from_dirs (const char *desktop_file_path, ++ const char **search_dirs, ++ GError **error) ++{ ++ EggDesktopFile *desktop_file; ++ GKeyFile *key_file; ++ char *full_path; ++ ++ key_file = g_key_file_new (); ++ if (!g_key_file_load_from_dirs (key_file, desktop_file_path, search_dirs, ++ &full_path, 0, error)) ++ { ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ desktop_file = egg_desktop_file_new_from_key_file (key_file, ++ full_path, ++ error); ++ g_free (full_path); ++ return desktop_file; ++} ++ ++/** ++ * egg_desktop_file_new_from_key_file: ++ * @key_file: a #GKeyFile representing a desktop file ++ * @source: the path or URI that @key_file was loaded from, or %NULL ++ * @error: error pointer ++ * ++ * Creates a new #EggDesktopFile for @key_file. Assumes ownership of ++ * @key_file (on success or failure); you should consider @key_file to ++ * be freed after calling this function. ++ * ++ * Return value: the new #EggDesktopFile, or %NULL on error. ++ **/ ++EggDesktopFile * ++egg_desktop_file_new_from_key_file (GKeyFile *key_file, ++ const char *source, ++ GError **error) ++{ ++ EggDesktopFile *desktop_file; ++ char *version, *type; ++ ++ if (!g_key_file_has_group (key_file, EGG_DESKTOP_FILE_GROUP)) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_INVALID, ++ _("File is not a valid .desktop file")); ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ ++ version = g_key_file_get_value (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_VERSION, ++ NULL); ++ if (version) ++ { ++ double version_num; ++ char *end; ++ ++ version_num = g_ascii_strtod (version, &end); ++ if (*end) ++ { ++ g_warning ("Invalid Version string '%s' in %s", ++ version, source ? source : "(unknown)"); ++ } ++ else if (version_num > 1.0) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_INVALID, ++ _("Unrecognized desktop file Version '%s'"), version); ++ g_free (version); ++ g_key_file_free (key_file); ++ return NULL; ++ } ++ g_free (version); ++ } ++ ++ desktop_file = g_new0 (EggDesktopFile, 1); ++ desktop_file->key_file = key_file; ++ ++ if (g_path_is_absolute (source)) ++ desktop_file->source = g_filename_to_uri (source, NULL, NULL); ++ else ++ desktop_file->source = g_strdup (source); ++ ++ desktop_file->name = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_NAME, error); ++ if (!desktop_file->name) ++ { ++ egg_desktop_file_free (desktop_file); ++ return NULL; ++ } ++ ++ type = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TYPE, error); ++ if (!type) ++ { ++ egg_desktop_file_free (desktop_file); ++ return NULL; ++ } ++ ++ if (!strcmp (type, "Application")) ++ { ++ char *exec, *p; ++ ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_APPLICATION; ++ ++ exec = g_key_file_get_string (key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ error); ++ if (!exec) ++ { ++ egg_desktop_file_free (desktop_file); ++ g_free (type); ++ return NULL; ++ } ++ ++ /* See if it takes paths or URIs or neither */ ++ for (p = exec; *p; p++) ++ { ++ if (*p == '%') ++ { ++ if (p[1] == '\0' || strchr ("FfUu", p[1])) ++ { ++ desktop_file->document_code = p[1]; ++ break; ++ } ++ p++; ++ } ++ } ++ ++ g_free (exec); ++ } ++ else if (!strcmp (type, "Link")) ++ { ++ char *url; ++ ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_LINK; ++ ++ url = g_key_file_get_string (key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_URL, ++ error); ++ if (!url) ++ { ++ egg_desktop_file_free (desktop_file); ++ g_free (type); ++ return NULL; ++ } ++ g_free (url); ++ } ++ else if (!strcmp (type, "Directory")) ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_DIRECTORY; ++ else ++ desktop_file->type = EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED; ++ ++ g_free (type); ++ ++ /* Check the Icon key */ ++ desktop_file->icon = g_key_file_get_string (key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_ICON, ++ NULL); ++ if (desktop_file->icon && !g_path_is_absolute (desktop_file->icon)) ++ { ++ char *ext; ++ ++ /* Lots of .desktop files still get this wrong */ ++ ext = strrchr (desktop_file->icon, '.'); ++ if (ext && (!strcmp (ext, ".png") || ++ !strcmp (ext, ".xpm") || ++ !strcmp (ext, ".svg"))) ++ { ++ g_warning ("Desktop file '%s' has malformed Icon key '%s'" ++ "(should not include extension)", ++ source ? source : "(unknown)", ++ desktop_file->icon); ++ *ext = '\0'; ++ } ++ } ++ ++ return desktop_file; ++} ++ ++/** ++ * egg_desktop_file_free: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Frees @desktop_file. ++ **/ ++void ++egg_desktop_file_free (EggDesktopFile *desktop_file) ++{ ++ g_key_file_free (desktop_file->key_file); ++ g_free (desktop_file->source); ++ g_free (desktop_file->name); ++ g_free (desktop_file->icon); ++ g_free (desktop_file); ++} ++ ++/** ++ * egg_desktop_file_get_source: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the URI that @desktop_file was loaded from. ++ * ++ * Return value: @desktop_file's source URI ++ **/ ++const char * ++egg_desktop_file_get_source (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->source; ++} ++ ++/** ++ * egg_desktop_file_get_desktop_file_type: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the desktop file type of @desktop_file. ++ * ++ * Return value: @desktop_file's type ++ **/ ++EggDesktopFileType ++egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->type; ++} ++ ++/** ++ * egg_desktop_file_get_name: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the (localized) value of @desktop_file's "Name" key. ++ * ++ * Return value: the application/link name ++ **/ ++const char * ++egg_desktop_file_get_name (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->name; ++} ++ ++/** ++ * egg_desktop_file_get_icon: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Gets the value of @desktop_file's "Icon" key. ++ * ++ * If the icon string is a full path (that is, if g_path_is_absolute() ++ * returns %TRUE when called on it), it points to a file containing an ++ * unthemed icon. If the icon string is not a full path, it is the ++ * name of a themed icon, which can be looked up with %GtkIconTheme, ++ * or passed directly to a theme-aware widget like %GtkImage or ++ * %GtkCellRendererPixbuf. ++ * ++ * Return value: the icon path or name ++ **/ ++const char * ++egg_desktop_file_get_icon (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->icon; ++} ++ ++gboolean ++egg_desktop_file_has_key (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_has_key (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++char * ++egg_desktop_file_get_string (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++char * ++egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ GError **error) ++{ ++ return g_key_file_get_locale_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, locale, ++ error); ++} ++ ++gboolean ++egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_get_boolean (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++double ++egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) ++{ ++ return g_key_file_get_double (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ error); ++} ++ ++char ** ++egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ gsize *length, ++ GError **error) ++{ ++ return g_key_file_get_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, length, ++ error); ++} ++ ++char ** ++egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ gsize *length, ++ GError **error) ++{ ++ return g_key_file_get_locale_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, key, ++ locale, length, ++ error); ++} ++ ++/** ++ * egg_desktop_file_can_launch: ++ * @desktop_file: an #EggDesktopFile ++ * @desktop_environment: the name of the running desktop environment, ++ * or %NULL ++ * ++ * Tests if @desktop_file can/should be launched in the current ++ * environment. If @desktop_environment is non-%NULL, @desktop_file's ++ * "OnlyShowIn" and "NotShowIn" keys are checked to make sure that ++ * this desktop_file is appropriate for the named environment. ++ * ++ * Furthermore, if @desktop_file has type ++ * %EGG_DESKTOP_FILE_TYPE_APPLICATION, its "TryExec" key (if any) is ++ * also checked, to make sure the binary it points to exists. ++ * ++ * egg_desktop_file_can_launch() does NOT check the value of the ++ * "Hidden" key. ++ * ++ * Return value: %TRUE if @desktop_file can be launched ++ **/ ++gboolean ++egg_desktop_file_can_launch (EggDesktopFile *desktop_file, ++ const char *desktop_environment) ++{ ++ char *try_exec, *found_program; ++ char **only_show_in, **not_show_in; ++ gboolean found; ++ int i; ++ ++ if (desktop_file->type != EGG_DESKTOP_FILE_TYPE_APPLICATION && ++ desktop_file->type != EGG_DESKTOP_FILE_TYPE_LINK) ++ return FALSE; ++ ++ if (desktop_environment) ++ { ++ only_show_in = g_key_file_get_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN, ++ NULL, NULL); ++ if (only_show_in) ++ { ++ for (i = 0, found = FALSE; only_show_in[i] && !found; i++) ++ { ++ if (!strcmp (only_show_in[i], desktop_environment)) ++ found = TRUE; ++ } ++ ++ g_strfreev (only_show_in); ++ ++ if (!found) ++ return FALSE; ++ } ++ ++ not_show_in = g_key_file_get_string_list (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN, ++ NULL, NULL); ++ if (not_show_in) ++ { ++ for (i = 0, found = FALSE; not_show_in[i] && !found; i++) ++ { ++ if (!strcmp (not_show_in[i], desktop_environment)) ++ found = TRUE; ++ } ++ ++ g_strfreev (not_show_in); ++ ++ if (found) ++ return FALSE; ++ } ++ } ++ ++ if (desktop_file->type == EGG_DESKTOP_FILE_TYPE_APPLICATION) ++ { ++ try_exec = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TRY_EXEC, ++ NULL); ++ if (try_exec) ++ { ++ found_program = g_find_program_in_path (try_exec); ++ g_free (try_exec); ++ ++ if (!found_program) ++ return FALSE; ++ g_free (found_program); ++ } ++ } ++ ++ return TRUE; ++} ++ ++/** ++ * egg_desktop_file_accepts_documents: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Tests if @desktop_file represents an application that can accept ++ * documents on the command line. ++ * ++ * Return value: %TRUE or %FALSE ++ **/ ++gboolean ++egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file) ++{ ++ return desktop_file->document_code != 0; ++} ++ ++/** ++ * egg_desktop_file_accepts_multiple: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Tests if @desktop_file can accept multiple documents at once. ++ * ++ * If this returns %FALSE, you can still pass multiple documents to ++ * egg_desktop_file_launch(), but that will result in multiple copies ++ * of the application being launched. See egg_desktop_file_launch() ++ * for more details. ++ * ++ * Return value: %TRUE or %FALSE ++ **/ ++gboolean ++egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file) ++{ ++ return (desktop_file->document_code == 'F' || ++ desktop_file->document_code == 'U'); ++} ++ ++/** ++ * egg_desktop_file_accepts_uris: ++ * @desktop_file: an #EggDesktopFile ++ * ++ * Tests if @desktop_file can accept (non-"file:") URIs as documents to ++ * open. ++ * ++ * Return value: %TRUE or %FALSE ++ **/ ++gboolean ++egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file) ++{ ++ return (desktop_file->document_code == 'U' || ++ desktop_file->document_code == 'u'); ++} ++ ++static void ++append_quoted_word (GString *str, ++ const char *s, ++ gboolean in_single_quotes, ++ gboolean in_double_quotes) ++{ ++ const char *p; ++ ++ if (!in_single_quotes && !in_double_quotes) ++ g_string_append_c (str, '\''); ++ else if (!in_single_quotes && in_double_quotes) ++ g_string_append (str, "\"'"); ++ ++ if (!strchr (s, '\'')) ++ g_string_append (str, s); ++ else ++ { ++ for (p = s; *p != '\0'; p++) ++ { ++ if (*p == '\'') ++ g_string_append (str, "'\\''"); ++ else ++ g_string_append_c (str, *p); ++ } ++ } ++ ++ if (!in_single_quotes && !in_double_quotes) ++ g_string_append_c (str, '\''); ++ else if (!in_single_quotes && in_double_quotes) ++ g_string_append (str, "'\""); ++} ++ ++static void ++do_percent_subst (EggDesktopFile *desktop_file, ++ char code, ++ GString *str, ++ GSList **documents, ++ gboolean in_single_quotes, ++ gboolean in_double_quotes) ++{ ++ GSList *d; ++ char *doc; ++ ++ switch (code) ++ { ++ case '%': ++ g_string_append_c (str, '%'); ++ break; ++ ++ case 'F': ++ case 'U': ++ for (d = *documents; d; d = d->next) ++ { ++ doc = d->data; ++ g_string_append (str, " "); ++ append_quoted_word (str, doc, in_single_quotes, in_double_quotes); ++ } ++ *documents = NULL; ++ break; ++ ++ case 'f': ++ case 'u': ++ if (*documents) ++ { ++ doc = (*documents)->data; ++ g_string_append (str, " "); ++ append_quoted_word (str, doc, in_single_quotes, in_double_quotes); ++ *documents = (*documents)->next; ++ } ++ break; ++ ++ case 'i': ++ if (desktop_file->icon) ++ { ++ g_string_append (str, "--icon "); ++ append_quoted_word (str, desktop_file->icon, ++ in_single_quotes, in_double_quotes); ++ } ++ break; ++ ++ case 'c': ++ if (desktop_file->name) ++ { ++ append_quoted_word (str, desktop_file->name, ++ in_single_quotes, in_double_quotes); ++ } ++ break; ++ ++ case 'k': ++ if (desktop_file->source) ++ { ++ append_quoted_word (str, desktop_file->source, ++ in_single_quotes, in_double_quotes); ++ } ++ break; ++ ++ case 'D': ++ case 'N': ++ case 'd': ++ case 'n': ++ case 'v': ++ case 'm': ++ /* Deprecated; skip */ ++ break; ++ ++ default: ++ g_warning ("Unrecognized %%-code '%%%c' in Exec", code); ++ break; ++ } ++} ++ ++static char * ++parse_exec (EggDesktopFile *desktop_file, ++ GSList **documents, ++ GError **error) ++{ ++ char *exec, *p, *command; ++ gboolean escape, single_quot, double_quot; ++ GString *gs; ++ ++ exec = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ error); ++ if (!exec) ++ return NULL; ++ ++ /* Build the command */ ++ gs = g_string_new (NULL); ++ escape = single_quot = double_quot = FALSE; ++ ++ for (p = exec; *p != '\0'; p++) ++ { ++ if (escape) ++ { ++ escape = FALSE; ++ g_string_append_c (gs, *p); ++ } ++ else if (*p == '\\') ++ { ++ if (!single_quot) ++ escape = TRUE; ++ g_string_append_c (gs, *p); ++ } ++ else if (*p == '\'') ++ { ++ g_string_append_c (gs, *p); ++ if (!single_quot && !double_quot) ++ single_quot = TRUE; ++ else if (single_quot) ++ single_quot = FALSE; ++ } ++ else if (*p == '"') ++ { ++ g_string_append_c (gs, *p); ++ if (!single_quot && !double_quot) ++ double_quot = TRUE; ++ else if (double_quot) ++ double_quot = FALSE; ++ } ++ else if (*p == '%' && p[1]) ++ { ++ do_percent_subst (desktop_file, p[1], gs, documents, ++ single_quot, double_quot); ++ p++; ++ } ++ else ++ g_string_append_c (gs, *p); ++ } ++ ++ g_free (exec); ++ command = g_string_free (gs, FALSE); ++ ++ /* Prepend "xdg-terminal " if needed (FIXME: use gvfs) */ ++ if (g_key_file_has_key (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TERMINAL, ++ NULL)) ++ { ++ GError *terminal_error = NULL; ++ gboolean use_terminal = ++ g_key_file_get_boolean (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TERMINAL, ++ &terminal_error); ++ if (terminal_error) ++ { ++ g_free (command); ++ g_propagate_error (error, terminal_error); ++ return NULL; ++ } ++ ++ if (use_terminal) ++ { ++ gs = g_string_new ("xdg-terminal "); ++ append_quoted_word (gs, command, FALSE, FALSE); ++ g_free (command); ++ command = g_string_free (gs, FALSE); ++ } ++ } ++ ++ return command; ++} ++ ++static GSList * ++translate_document_list (EggDesktopFile *desktop_file, GSList *documents) ++{ ++ gboolean accepts_uris = egg_desktop_file_accepts_uris (desktop_file); ++ GSList *ret, *d; ++ ++ for (d = documents, ret = NULL; d; d = d->next) ++ { ++ const char *document = d->data; ++ gboolean is_uri = !g_path_is_absolute (document); ++ char *translated; ++ ++ if (accepts_uris) ++ { ++ if (is_uri) ++ translated = g_strdup (document); ++ else ++ translated = g_filename_to_uri (document, NULL, NULL); ++ } ++ else ++ { ++ if (is_uri) ++ translated = g_filename_from_uri (document, NULL, NULL); ++ else ++ translated = g_strdup (document); ++ } ++ ++ if (translated) ++ ret = g_slist_prepend (ret, translated); ++ } ++ ++ return g_slist_reverse (ret); ++} ++ ++static void ++free_document_list (GSList *documents) ++{ ++ GSList *d; ++ ++ for (d = documents; d; d = d->next) ++ g_free (d->data); ++ g_slist_free (documents); ++} ++ ++/** ++ * egg_desktop_file_parse_exec: ++ * @desktop_file: a #EggDesktopFile ++ * @documents: a list of document paths or URIs ++ * @error: error pointer ++ * ++ * Parses @desktop_file's Exec key, inserting @documents into it, and ++ * returns the result. ++ * ++ * If @documents contains non-file: URIs and @desktop_file does not ++ * accept URIs, those URIs will be ignored. Likewise, if @documents ++ * contains more elements than @desktop_file accepts, the extra ++ * documents will be ignored. ++ * ++ * Return value: the parsed Exec string ++ **/ ++char * ++egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, ++ GSList *documents, ++ GError **error) ++{ ++ GSList *translated, *docs; ++ char *command; ++ ++ docs = translated = translate_document_list (desktop_file, documents); ++ command = parse_exec (desktop_file, &docs, error); ++ free_document_list (translated); ++ ++ return command; ++} ++ ++static gboolean ++parse_link (EggDesktopFile *desktop_file, ++ EggDesktopFile **app_desktop_file, ++ GSList **documents, ++ GError **error) ++{ ++ char *url; ++ GKeyFile *key_file; ++ ++ url = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_URL, ++ error); ++ if (!url) ++ return FALSE; ++ *documents = g_slist_prepend (NULL, url); ++ ++ /* FIXME: use gvfs */ ++ key_file = g_key_file_new (); ++ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_NAME, ++ "xdg-open"); ++ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_TYPE, ++ "Application"); ++ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ "xdg-open %u"); ++ *app_desktop_file = egg_desktop_file_new_from_key_file (key_file, NULL, NULL); ++ return TRUE; ++} ++ ++#if GTK_CHECK_VERSION (2, 12, 0) ++static char * ++start_startup_notification (GdkDisplay *display, ++ EggDesktopFile *desktop_file, ++ const char *argv0, ++ int screen, ++ int workspace, ++ guint32 launch_time) ++{ ++ static int sequence = 0; ++ char *startup_id; ++ char *description, *wmclass; ++ char *screen_str, *workspace_str; ++ ++ if (g_key_file_has_key (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, ++ NULL)) ++ { ++ if (!g_key_file_get_boolean (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, ++ NULL)) ++ return NULL; ++ wmclass = NULL; ++ } ++ else ++ { ++ wmclass = g_key_file_get_string (desktop_file->key_file, ++ EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS, ++ NULL); ++ if (!wmclass) ++ return NULL; ++ } ++ ++ if (launch_time == (guint32)-1) ++ launch_time = gdk_x11_display_get_user_time (display); ++ startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu", ++ g_get_prgname (), ++ (unsigned long)getpid (), ++ g_get_host_name (), ++ argv0, ++ sequence++, ++ (unsigned long)launch_time); ++ ++ description = g_strdup_printf (_("Starting %s"), desktop_file->name); ++ screen_str = g_strdup_printf ("%d", screen); ++ workspace_str = workspace == -1 ? NULL : g_strdup_printf ("%d", workspace); ++ ++ gdk_x11_display_broadcast_startup_message (display, "new", ++ "ID", startup_id, ++ "NAME", desktop_file->name, ++ "SCREEN", screen_str, ++ "BIN", argv0, ++ "ICON", desktop_file->icon, ++ "DESKTOP", workspace_str, ++ "DESCRIPTION", description, ++ "WMCLASS", wmclass, ++ NULL); ++ ++ g_free (description); ++ g_free (wmclass); ++ g_free (screen_str); ++ g_free (workspace_str); ++ ++ return startup_id; ++} ++ ++static void ++end_startup_notification (GdkDisplay *display, ++ const char *startup_id) ++{ ++ gdk_x11_display_broadcast_startup_message (display, "remove", ++ "ID", startup_id, ++ NULL); ++} ++ ++#define EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH (30 /* seconds */) ++ ++typedef struct { ++ GdkDisplay *display; ++ char *startup_id; ++} StartupNotificationData; ++ ++static gboolean ++startup_notification_timeout (gpointer data) ++{ ++ StartupNotificationData *sn_data = data; ++ ++ end_startup_notification (sn_data->display, sn_data->startup_id); ++ g_object_unref (sn_data->display); ++ g_free (sn_data->startup_id); ++ g_free (sn_data); ++ ++ return FALSE; ++} ++ ++static void ++set_startup_notification_timeout (GdkDisplay *display, ++ const char *startup_id) ++{ ++ StartupNotificationData *sn_data; ++ ++ sn_data = g_new (StartupNotificationData, 1); ++ sn_data->display = g_object_ref (display); ++ sn_data->startup_id = g_strdup (startup_id); ++ ++ g_timeout_add_seconds (EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH, ++ startup_notification_timeout, sn_data); ++} ++#endif /* GTK 2.12 */ ++ ++static GPtrArray * ++array_putenv (GPtrArray *env, char *variable) ++{ ++ guint i, keylen; ++ ++ if (!env) ++ { ++ char **envp; ++ ++ env = g_ptr_array_new (); ++ ++ envp = g_listenv (); ++ for (i = 0; envp[i]; i++) ++ { ++ const char *value; ++ ++ value = g_getenv (envp[i]); ++ g_ptr_array_add (env, g_strdup_printf ("%s=%s", envp[i], ++ value ? value : "")); ++ } ++ g_strfreev (envp); ++ } ++ ++ keylen = strcspn (variable, "="); ++ ++ /* Remove old value of key */ ++ for (i = 0; i < env->len; i++) ++ { ++ char *envvar = env->pdata[i]; ++ ++ if (!strncmp (envvar, variable, keylen) && envvar[keylen] == '=') ++ { ++ g_free (envvar); ++ g_ptr_array_remove_index_fast (env, i); ++ break; ++ } ++ } ++ ++ /* Add new value */ ++ g_ptr_array_add (env, g_strdup (variable)); ++ ++ return env; ++} ++ ++static gboolean ++egg_desktop_file_launchv (EggDesktopFile *desktop_file, ++ GSList *documents, va_list args, ++ GError **error) ++{ ++ EggDesktopFileLaunchOption option; ++ GSList *translated_documents = NULL, *docs = NULL; ++ char *command, **argv; ++ int argc, i, screen_num; ++ gboolean success, current_success; ++ GdkDisplay *display; ++ char *startup_id; ++ ++ GPtrArray *env = NULL; ++ char **variables = NULL; ++ GdkScreen *screen = NULL; ++ int workspace = -1; ++ const char *directory = NULL; ++ guint32 launch_time = (guint32)-1; ++ GSpawnFlags flags = G_SPAWN_SEARCH_PATH; ++ GSpawnChildSetupFunc setup_func = NULL; ++ gpointer setup_data = NULL; ++ ++ GPid *ret_pid = NULL; ++ int *ret_stdin = NULL, *ret_stdout = NULL, *ret_stderr = NULL; ++ char **ret_startup_id = NULL; ++ ++ if (documents && desktop_file->document_code == 0) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ _("Application does not accept documents on command line")); ++ return FALSE; ++ } ++ ++ /* Read the options: technically it's incorrect for the caller to ++ * NULL-terminate the list of options (rather than 0-terminating ++ * it), but NULL-terminating lets us use G_GNUC_NULL_TERMINATED, ++ * it's more consistent with other glib/gtk methods, and it will ++ * work as long as sizeof (int) <= sizeof (NULL), and NULL is ++ * represented as 0. (Which is true everywhere we care about.) ++ */ ++ while ((option = va_arg (args, EggDesktopFileLaunchOption))) ++ { ++ switch (option) ++ { ++ case EGG_DESKTOP_FILE_LAUNCH_CLEARENV: ++ if (env) ++ g_ptr_array_free (env, TRUE); ++ env = g_ptr_array_new (); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_PUTENV: ++ variables = va_arg (args, char **); ++ for (i = 0; variables[i]; i++) ++ env = array_putenv (env, variables[i]); ++ break; ++ ++ case EGG_DESKTOP_FILE_LAUNCH_SCREEN: ++ screen = va_arg (args, GdkScreen *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: ++ workspace = va_arg (args, int); ++ break; ++ ++ case EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: ++ directory = va_arg (args, const char *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_TIME: ++ launch_time = va_arg (args, guint32); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_FLAGS: ++ flags |= va_arg (args, GSpawnFlags); ++ /* Make sure they didn't set any flags that don't make sense. */ ++ flags &= ~G_SPAWN_FILE_AND_ARGV_ZERO; ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC: ++ setup_func = va_arg (args, GSpawnChildSetupFunc); ++ setup_data = va_arg (args, gpointer); ++ break; ++ ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_PID: ++ ret_pid = va_arg (args, GPid *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE: ++ ret_stdin = va_arg (args, int *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE: ++ ret_stdout = va_arg (args, int *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE: ++ ret_stderr = va_arg (args, int *); ++ break; ++ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID: ++ ret_startup_id = va_arg (args, char **); ++ break; ++ ++ default: ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION, ++ _("Unrecognized launch option: %d"), ++ GPOINTER_TO_INT (option)); ++ success = FALSE; ++ goto out; ++ } ++ } ++ ++ if (screen) ++ { ++ char *display_name = gdk_screen_make_display_name (screen); ++ char *display_env = g_strdup_printf ("DISPLAY=%s", display_name); ++ env = array_putenv (env, display_env); ++ g_free (display_name); ++ g_free (display_env); ++ ++ display = gdk_screen_get_display (screen); ++ } ++ else ++ { ++ display = gdk_display_get_default (); ++ screen = gdk_display_get_default_screen (display); ++ } ++ screen_num = gdk_screen_get_number (screen); ++ ++ translated_documents = translate_document_list (desktop_file, documents); ++ docs = translated_documents; ++ ++ success = FALSE; ++ ++ do ++ { ++ command = parse_exec (desktop_file, &docs, error); ++ if (!command) ++ goto out; ++ ++ if (!g_shell_parse_argv (command, &argc, &argv, error)) ++ { ++ g_free (command); ++ goto out; ++ } ++ g_free (command); ++ ++#if GTK_CHECK_VERSION (2, 12, 0) ++ startup_id = start_startup_notification (display, desktop_file, ++ argv[0], screen_num, ++ workspace, launch_time); ++ if (startup_id) ++ { ++ char *startup_id_env = g_strdup_printf ("DESKTOP_STARTUP_ID=%s", ++ startup_id); ++ env = array_putenv (env, startup_id_env); ++ g_free (startup_id_env); ++ } ++#else ++ startup_id = NULL; ++#endif /* GTK 2.12 */ ++ ++ if (env != NULL) ++ g_ptr_array_add (env, NULL); ++ ++ current_success = ++ g_spawn_async_with_pipes (directory, ++ argv, ++ env ? (char **)(env->pdata) : NULL, ++ flags, ++ setup_func, setup_data, ++ ret_pid, ++ ret_stdin, ret_stdout, ret_stderr, ++ error); ++ g_strfreev (argv); ++ ++ if (startup_id) ++ { ++#if GTK_CHECK_VERSION (2, 12, 0) ++ if (current_success) ++ { ++ set_startup_notification_timeout (display, startup_id); ++ ++ if (ret_startup_id) ++ *ret_startup_id = startup_id; ++ else ++ g_free (startup_id); ++ } ++ else ++#endif /* GTK 2.12 */ ++ g_free (startup_id); ++ } ++ else if (ret_startup_id) ++ *ret_startup_id = NULL; ++ ++ if (current_success) ++ { ++ /* If we successfully launch any instances of the app, make ++ * sure we return TRUE and don't set @error. ++ */ ++ success = TRUE; ++ error = NULL; ++ ++ /* Also, only set the output params on the first one */ ++ ret_pid = NULL; ++ ret_stdin = ret_stdout = ret_stderr = NULL; ++ ret_startup_id = NULL; ++ } ++ } ++ while (docs && current_success); ++ ++ out: ++ if (env) ++ { ++ g_ptr_array_foreach (env, (GFunc)g_free, NULL); ++ g_ptr_array_free (env, TRUE); ++ } ++ free_document_list (translated_documents); ++ ++ return success; ++} ++ ++/** ++ * egg_desktop_file_launch: ++ * @desktop_file: an #EggDesktopFile ++ * @documents: a list of URIs or paths to documents to open ++ * @error: error pointer ++ * @...: additional options ++ * ++ * Launches @desktop_file with the given arguments. Additional options ++ * can be specified as follows: ++ * ++ * %EGG_DESKTOP_FILE_LAUNCH_CLEARENV: (no arguments) ++ * clears the environment in the child process ++ * %EGG_DESKTOP_FILE_LAUNCH_PUTENV: (char **variables) ++ * adds the NAME=VALUE strings in the given %NULL-terminated ++ * array to the child process's environment ++ * %EGG_DESKTOP_FILE_LAUNCH_SCREEN: (GdkScreen *screen) ++ * causes the application to be launched on the given screen ++ * %EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: (int workspace) ++ * causes the application to be launched on the given workspace ++ * %EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: (char *dir) ++ * causes the application to be launched in the given directory ++ * %EGG_DESKTOP_FILE_LAUNCH_TIME: (guint32 launch_time) ++ * sets the "launch time" for the application. If the user ++ * interacts with another window after @launch_time but before ++ * the launched application creates its first window, the window ++ * manager may choose to not give focus to the new application. ++ * Passing 0 for @launch_time will explicitly request that the ++ * application not receive focus. ++ * %EGG_DESKTOP_FILE_LAUNCH_FLAGS (GSpawnFlags flags) ++ * Sets additional #GSpawnFlags to use. See g_spawn_async() for ++ * more details. ++ * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC (GSpawnChildSetupFunc, gpointer) ++ * Sets the child setup callback and the data to pass to it. ++ * (See g_spawn_async() for more details.) ++ * ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID (GPid **pid) ++ * On a successful launch, sets *@pid to the PID of the launched ++ * application. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID (char **startup_id) ++ * On a successful launch, sets *@startup_id to the Startup ++ * Notification "startup id" of the launched application. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE (int *fd) ++ * On a successful launch, sets *@fd to the file descriptor of ++ * a pipe connected to the application's stdin. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE (int *fd) ++ * On a successful launch, sets *@fd to the file descriptor of ++ * a pipe connected to the application's stdout. ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE (int *fd) ++ * On a successful launch, sets *@fd to the file descriptor of ++ * a pipe connected to the application's stderr. ++ * ++ * The options should be terminated with a single %NULL. ++ * ++ * If @documents contains multiple documents, but ++ * egg_desktop_file_accepts_multiple() returns %FALSE for ++ * @desktop_file, then egg_desktop_file_launch() will actually launch ++ * multiple instances of the application. In that case, the return ++ * value (as well as any values passed via ++ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, etc) will only reflect the ++ * first instance of the application that was launched (but the ++ * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC will be called for each ++ * instance). ++ * ++ * Return value: %TRUE if the application was successfully launched. ++ **/ ++gboolean ++egg_desktop_file_launch (EggDesktopFile *desktop_file, ++ GSList *documents, GError **error, ++ ...) ++{ ++ va_list args; ++ gboolean success; ++ EggDesktopFile *app_desktop_file; ++ ++ switch (desktop_file->type) ++ { ++ case EGG_DESKTOP_FILE_TYPE_APPLICATION: ++ va_start (args, error); ++ success = egg_desktop_file_launchv (desktop_file, documents, ++ args, error); ++ va_end (args); ++ break; ++ ++ case EGG_DESKTOP_FILE_TYPE_LINK: ++ if (documents) ++ { ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ _("Can't pass document URIs to a 'Type=Link' desktop entry")); ++ return FALSE; ++ } ++ ++ if (!parse_link (desktop_file, &app_desktop_file, &documents, error)) ++ return FALSE; ++ ++ va_start (args, error); ++ success = egg_desktop_file_launchv (app_desktop_file, documents, ++ args, error); ++ va_end (args); ++ ++ egg_desktop_file_free (app_desktop_file); ++ free_document_list (documents); ++ break; ++ ++ case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED: ++ case EGG_DESKTOP_FILE_TYPE_DIRECTORY: ++ default: ++ g_set_error (error, EGG_DESKTOP_FILE_ERROR, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ _("Not a launchable item")); ++ success = FALSE; ++ break; ++ } ++ ++ return success; ++} ++ ++ ++GQuark ++egg_desktop_file_error_quark (void) ++{ ++ return g_quark_from_static_string ("egg-desktop_file-error-quark"); ++} ++ ++ ++G_LOCK_DEFINE_STATIC (egg_desktop_file); ++static EggDesktopFile *egg_desktop_file; ++ ++static void ++egg_set_desktop_file_internal (const char *desktop_file_path, ++ gboolean set_defaults) ++{ ++ GError *error = NULL; ++ ++ G_LOCK (egg_desktop_file); ++ if (egg_desktop_file) ++ egg_desktop_file_free (egg_desktop_file); ++ ++ egg_desktop_file = egg_desktop_file_new (desktop_file_path, &error); ++ if (error) ++ { ++ g_warning ("Could not load desktop file '%s': %s", ++ desktop_file_path, error->message); ++ g_error_free (error); ++ } ++ ++ if (set_defaults && egg_desktop_file != NULL) { ++ /* Set localized application name and default window icon */ ++ if (egg_desktop_file->name) ++ g_set_application_name (egg_desktop_file->name); ++ if (egg_desktop_file->icon) ++ { ++ if (g_path_is_absolute (egg_desktop_file->icon)) ++ gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL); ++ else ++ gtk_window_set_default_icon_name (egg_desktop_file->icon); ++ } ++ } ++ ++ G_UNLOCK (egg_desktop_file); ++} ++ ++/** ++ * egg_set_desktop_file: ++ * @desktop_file_path: path to the application's desktop file ++ * ++ * Creates an #EggDesktopFile for the application from the data at ++ * @desktop_file_path. This will also call g_set_application_name() ++ * with the localized application name from the desktop file, and ++ * gtk_window_set_default_icon_name() or ++ * gtk_window_set_default_icon_from_file() with the application's ++ * icon. Other code may use additional information from the desktop ++ * file. ++ * See egg_set_desktop_file_without_defaults() for a variant of this ++ * function that does not set the application name and default window ++ * icon. ++ * ++ * Note that for thread safety reasons, this function can only ++ * be called once, and is mutually exclusive with calling ++ * egg_set_desktop_file_without_defaults(). ++ **/ ++void ++egg_set_desktop_file (const char *desktop_file_path) ++{ ++ egg_set_desktop_file_internal (desktop_file_path, TRUE); ++} ++ ++/** ++ * egg_set_desktop_file_without_defaults: ++ * @desktop_file_path: path to the application's desktop file ++ * ++ * Creates an #EggDesktopFile for the application from the data at ++ * @desktop_file_path. ++ * See egg_set_desktop_file() for a variant of this function that ++ * sets the application name and default window icon from the information ++ * in the desktop file. ++ * ++ * Note that for thread safety reasons, this function can only ++ * be called once, and is mutually exclusive with calling ++ * egg_set_desktop_file(). ++ **/ ++void ++egg_set_desktop_file_without_defaults (const char *desktop_file_path) ++{ ++ egg_set_desktop_file_internal (desktop_file_path, FALSE); ++} ++ ++/** ++ * egg_get_desktop_file: ++ * ++ * Gets the application's #EggDesktopFile, as set by ++ * egg_set_desktop_file(). ++ * ++ * Return value: the #EggDesktopFile, or %NULL if it hasn't been set. ++ **/ ++EggDesktopFile * ++egg_get_desktop_file (void) ++{ ++ EggDesktopFile *retval; ++ ++ G_LOCK (egg_desktop_file); ++ retval = egg_desktop_file; ++ G_UNLOCK (egg_desktop_file); ++ ++ return retval; ++} +diff --git a/src/libeggsmclient/eggdesktopfile.h b/src/libeggsmclient/eggdesktopfile.h +new file mode 100644 +index 0000000..18fe463 +--- a/src/libeggsmclient/eggdesktopfile.h ++++ b/src/libeggsmclient/eggdesktopfile.h +@@ -0,0 +1,160 @@ ++/* eggdesktopfile.h - Freedesktop.Org Desktop Files ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; see the file COPYING.LIB. If not, ++ * write to the Free Software Foundation, Inc., 59 Temple Place - ++ * Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#ifndef __EGG_DESKTOP_FILE_H__ ++#define __EGG_DESKTOP_FILE_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++typedef struct EggDesktopFile EggDesktopFile; ++ ++typedef enum { ++ EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED, ++ ++ EGG_DESKTOP_FILE_TYPE_APPLICATION, ++ EGG_DESKTOP_FILE_TYPE_LINK, ++ EGG_DESKTOP_FILE_TYPE_DIRECTORY ++} EggDesktopFileType; ++ ++EggDesktopFile *egg_desktop_file_new (const char *desktop_file_path, ++ GError **error); ++ ++EggDesktopFile *egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, ++ GError **error); ++EggDesktopFile *egg_desktop_file_new_from_dirs (const char *desktop_file_path, ++ const char **search_dirs, ++ GError **error); ++EggDesktopFile *egg_desktop_file_new_from_key_file (GKeyFile *key_file, ++ const char *source, ++ GError **error); ++ ++void egg_desktop_file_free (EggDesktopFile *desktop_file); ++ ++const char *egg_desktop_file_get_source (EggDesktopFile *desktop_file); ++ ++EggDesktopFileType egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file); ++ ++const char *egg_desktop_file_get_name (EggDesktopFile *desktop_file); ++const char *egg_desktop_file_get_icon (EggDesktopFile *desktop_file); ++ ++gboolean egg_desktop_file_can_launch (EggDesktopFile *desktop_file, ++ const char *desktop_environment); ++ ++gboolean egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file); ++gboolean egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file); ++gboolean egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file); ++ ++char *egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, ++ GSList *documents, ++ GError **error); ++ ++gboolean egg_desktop_file_launch (EggDesktopFile *desktop_file, ++ GSList *documents, ++ GError **error, ++ ...) G_GNUC_NULL_TERMINATED; ++ ++typedef enum { ++ EGG_DESKTOP_FILE_LAUNCH_CLEARENV = 1, ++ EGG_DESKTOP_FILE_LAUNCH_PUTENV, ++ EGG_DESKTOP_FILE_LAUNCH_SCREEN, ++ EGG_DESKTOP_FILE_LAUNCH_WORKSPACE, ++ EGG_DESKTOP_FILE_LAUNCH_DIRECTORY, ++ EGG_DESKTOP_FILE_LAUNCH_TIME, ++ EGG_DESKTOP_FILE_LAUNCH_FLAGS, ++ EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE, ++ EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID ++} EggDesktopFileLaunchOption; ++ ++/* Standard Keys */ ++#define EGG_DESKTOP_FILE_GROUP "Desktop Entry" ++ ++#define EGG_DESKTOP_FILE_KEY_TYPE "Type" ++#define EGG_DESKTOP_FILE_KEY_VERSION "Version" ++#define EGG_DESKTOP_FILE_KEY_NAME "Name" ++#define EGG_DESKTOP_FILE_KEY_GENERIC_NAME "GenericName" ++#define EGG_DESKTOP_FILE_KEY_NO_DISPLAY "NoDisplay" ++#define EGG_DESKTOP_FILE_KEY_COMMENT "Comment" ++#define EGG_DESKTOP_FILE_KEY_ICON "Icon" ++#define EGG_DESKTOP_FILE_KEY_HIDDEN "Hidden" ++#define EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN "OnlyShowIn" ++#define EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN "NotShowIn" ++#define EGG_DESKTOP_FILE_KEY_TRY_EXEC "TryExec" ++#define EGG_DESKTOP_FILE_KEY_EXEC "Exec" ++#define EGG_DESKTOP_FILE_KEY_PATH "Path" ++#define EGG_DESKTOP_FILE_KEY_TERMINAL "Terminal" ++#define EGG_DESKTOP_FILE_KEY_MIME_TYPE "MimeType" ++#define EGG_DESKTOP_FILE_KEY_CATEGORIES "Categories" ++#define EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY "StartupNotify" ++#define EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS "StartupWMClass" ++#define EGG_DESKTOP_FILE_KEY_URL "URL" ++ ++/* Accessors */ ++gboolean egg_desktop_file_has_key (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error); ++char *egg_desktop_file_get_string (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error) G_GNUC_MALLOC; ++char *egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ GError **error) G_GNUC_MALLOC; ++gboolean egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error); ++double egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, ++ const char *key, ++ GError **error); ++char **egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ gsize *length, ++ GError **error) G_GNUC_MALLOC; ++char **egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, ++ const char *key, ++ const char *locale, ++ gsize *length, ++ GError **error) G_GNUC_MALLOC; ++ ++ ++/* Errors */ ++#define EGG_DESKTOP_FILE_ERROR egg_desktop_file_error_quark() ++ ++GQuark egg_desktop_file_error_quark (void); ++ ++typedef enum { ++ EGG_DESKTOP_FILE_ERROR_INVALID, ++ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, ++ EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION ++} EggDesktopFileError; ++ ++/* Global application desktop file */ ++void egg_set_desktop_file (const char *desktop_file_path); ++void egg_set_desktop_file_without_defaults (const char *desktop_file_path); ++EggDesktopFile *egg_get_desktop_file (void); ++ ++ ++G_END_DECLS ++ ++#endif /* __EGG_DESKTOP_FILE_H__ */ +diff --git a/src/libeggsmclient/eggsmclient-private.h b/src/libeggsmclient/eggsmclient-private.h +new file mode 100644 +index 0000000..ccb10bf +--- a/src/libeggsmclient/eggsmclient-private.h ++++ b/src/libeggsmclient/eggsmclient-private.h +@@ -0,0 +1,53 @@ ++/* eggsmclient-private.h ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ */ ++ ++#ifndef __EGG_SM_CLIENT_PRIVATE_H__ ++#define __EGG_SM_CLIENT_PRIVATE_H__ ++ ++#include ++#include "eggsmclient.h" ++ ++G_BEGIN_DECLS ++ ++GKeyFile *egg_sm_client_save_state (EggSMClient *client); ++void egg_sm_client_quit_requested (EggSMClient *client); ++void egg_sm_client_quit_cancelled (EggSMClient *client); ++void egg_sm_client_quit (EggSMClient *client); ++ ++#if defined (GDK_WINDOWING_X11) ++# ifdef EGG_SM_CLIENT_BACKEND_XSMP ++GType egg_sm_client_xsmp_get_type (void); ++EggSMClient *egg_sm_client_xsmp_new (void); ++# endif ++# ifdef EGG_SM_CLIENT_BACKEND_DBUS ++GType egg_sm_client_dbus_get_type (void); ++EggSMClient *egg_sm_client_dbus_new (void); ++# endif ++#elif defined (GDK_WINDOWING_WIN32) ++GType egg_sm_client_win32_get_type (void); ++EggSMClient *egg_sm_client_win32_new (void); ++#elif defined (GDK_WINDOWING_QUARTZ) ++GType egg_sm_client_osx_get_type (void); ++EggSMClient *egg_sm_client_osx_new (void); ++#endif ++ ++G_END_DECLS ++ ++ ++#endif /* __EGG_SM_CLIENT_PRIVATE_H__ */ +diff --git a/src/libeggsmclient/eggsmclient-xsmp.c b/src/libeggsmclient/eggsmclient-xsmp.c +new file mode 100644 +index 0000000..8bebfba +--- a/src/libeggsmclient/eggsmclient-xsmp.c ++++ b/src/libeggsmclient/eggsmclient-xsmp.c +@@ -0,0 +1,1370 @@ ++/* ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * Inspired by various other pieces of code including GsmClient (C) ++ * 2001 Havoc Pennington, GnomeClient (C) 1998 Carsten Schaar, and twm ++ * session code (C) 1998 The Open Group. ++ * ++ * 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, ++ * 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. ++ * ++ * 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. ++ */ ++ ++#include "config.h" ++ ++#include "eggsmclient.h" ++#include "eggsmclient-private.h" ++ ++#include "eggdesktopfile.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define EGG_TYPE_SM_CLIENT_XSMP (egg_sm_client_xsmp_get_type ()) ++#define EGG_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP)) ++#define EGG_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) ++#define EGG_IS_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_XSMP)) ++#define EGG_IS_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_XSMP)) ++#define EGG_SM_CLIENT_XSMP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) ++ ++typedef struct _EggSMClientXSMP EggSMClientXSMP; ++typedef struct _EggSMClientXSMPClass EggSMClientXSMPClass; ++ ++/* These mostly correspond to the similarly-named states in section ++ * 9.1 of the XSMP spec. Some of the states there aren't represented ++ * here, because we don't need them. SHUTDOWN_CANCELLED is slightly ++ * different from the spec; we use it when the client is IDLE after a ++ * ShutdownCancelled message, but the application is still interacting ++ * and doesn't know the shutdown has been cancelled yet. ++ */ ++typedef enum ++{ ++ XSMP_STATE_IDLE, ++ XSMP_STATE_SAVE_YOURSELF, ++ XSMP_STATE_INTERACT_REQUEST, ++ XSMP_STATE_INTERACT, ++ XSMP_STATE_SAVE_YOURSELF_DONE, ++ XSMP_STATE_SHUTDOWN_CANCELLED, ++ XSMP_STATE_CONNECTION_CLOSED ++} EggSMClientXSMPState; ++ ++static const char *state_names[] = { ++ "idle", ++ "save-yourself", ++ "interact-request", ++ "interact", ++ "save-yourself-done", ++ "shutdown-cancelled", ++ "connection-closed" ++}; ++ ++#define EGG_SM_CLIENT_XSMP_STATE(xsmp) (state_names[(xsmp)->state]) ++ ++struct _EggSMClientXSMP ++{ ++ EggSMClient parent; ++ ++ SmcConn connection; ++ char *client_id; ++ ++ EggSMClientXSMPState state; ++ char **restart_command; ++ gboolean set_restart_command; ++ int restart_style; ++ ++ guint idle; ++ ++ /* Current SaveYourself state */ ++ guint expecting_initial_save_yourself : 1; ++ guint need_save_state : 1; ++ guint need_quit_requested : 1; ++ guint interact_errors : 1; ++ guint shutting_down : 1; ++ ++ /* Todo list */ ++ guint waiting_to_set_initial_properties : 1; ++ guint waiting_to_emit_quit : 1; ++ guint waiting_to_emit_quit_cancelled : 1; ++ guint waiting_to_save_myself : 1; ++ ++}; ++ ++struct _EggSMClientXSMPClass ++{ ++ EggSMClientClass parent_class; ++ ++}; ++ ++static void sm_client_xsmp_startup (EggSMClient *client, ++ const char *client_id); ++static void sm_client_xsmp_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv); ++static void sm_client_xsmp_will_quit (EggSMClient *client, ++ gboolean will_quit); ++static gboolean sm_client_xsmp_end_session (EggSMClient *client, ++ EggSMClientEndStyle style, ++ gboolean request_confirmation); ++ ++static void xsmp_save_yourself (SmcConn smc_conn, ++ SmPointer client_data, ++ int save_style, ++ Bool shutdown, ++ int interact_style, ++ Bool fast); ++static void xsmp_die (SmcConn smc_conn, ++ SmPointer client_data); ++static void xsmp_save_complete (SmcConn smc_conn, ++ SmPointer client_data); ++static void xsmp_shutdown_cancelled (SmcConn smc_conn, ++ SmPointer client_data); ++static void xsmp_interact (SmcConn smc_conn, ++ SmPointer client_data); ++ ++static SmProp *array_prop (const char *name, ++ ...); ++static SmProp *ptrarray_prop (const char *name, ++ GPtrArray *values); ++static SmProp *string_prop (const char *name, ++ const char *value); ++static SmProp *card8_prop (const char *name, ++ unsigned char value); ++ ++static void set_properties (EggSMClientXSMP *xsmp, ...); ++static void delete_properties (EggSMClientXSMP *xsmp, ...); ++ ++static GPtrArray *generate_command (char **restart_command, ++ const char *client_id, ++ const char *state_file); ++ ++static void save_state (EggSMClientXSMP *xsmp); ++static void do_save_yourself (EggSMClientXSMP *xsmp); ++static void update_pending_events (EggSMClientXSMP *xsmp); ++ ++static void ice_init (void); ++static gboolean process_ice_messages (IceConn ice_conn); ++static void smc_error_handler (SmcConn smc_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ SmPointer values); ++ ++G_DEFINE_TYPE (EggSMClientXSMP, egg_sm_client_xsmp, EGG_TYPE_SM_CLIENT) ++ ++static void ++egg_sm_client_xsmp_init (EggSMClientXSMP *xsmp) ++{ ++ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; ++ xsmp->connection = NULL; ++ xsmp->restart_style = SmRestartIfRunning; ++} ++ ++static void ++egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass) ++{ ++ EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); ++ ++ sm_client_class->startup = sm_client_xsmp_startup; ++ sm_client_class->set_restart_command = sm_client_xsmp_set_restart_command; ++ sm_client_class->will_quit = sm_client_xsmp_will_quit; ++ sm_client_class->end_session = sm_client_xsmp_end_session; ++} ++ ++EggSMClient * ++egg_sm_client_xsmp_new (void) ++{ ++ if (!g_getenv ("SESSION_MANAGER")) ++ return NULL; ++ ++ return g_object_new (EGG_TYPE_SM_CLIENT_XSMP, NULL); ++} ++ ++static gboolean ++sm_client_xsmp_set_initial_properties (gpointer user_data) ++{ ++ EggSMClientXSMP *xsmp = user_data; ++ EggDesktopFile *desktop_file; ++ GPtrArray *clone, *restart; ++ char pid_str[64]; ++ ++ if (xsmp->idle) ++ { ++ g_source_remove (xsmp->idle); ++ xsmp->idle = 0; ++ } ++ xsmp->waiting_to_set_initial_properties = FALSE; ++ ++ if (egg_sm_client_get_mode () == EGG_SM_CLIENT_MODE_NO_RESTART) ++ xsmp->restart_style = SmRestartNever; ++ ++ /* Parse info out of desktop file */ ++ desktop_file = egg_get_desktop_file (); ++ if (desktop_file) ++ { ++ GError *err = NULL; ++ char *cmdline, **argv; ++ int argc; ++ ++ if (xsmp->restart_style == SmRestartIfRunning) ++ { ++ if (egg_desktop_file_get_boolean (desktop_file, ++ "X-GNOME-AutoRestart", NULL)) ++ xsmp->restart_style = SmRestartImmediately; ++ } ++ ++ if (!xsmp->set_restart_command) ++ { ++ cmdline = egg_desktop_file_parse_exec (desktop_file, NULL, &err); ++ if (cmdline && g_shell_parse_argv (cmdline, &argc, &argv, &err)) ++ { ++ egg_sm_client_set_restart_command (EGG_SM_CLIENT (xsmp), ++ argc, (const char **)argv); ++ g_strfreev (argv); ++ } ++ else ++ { ++ g_warning ("Could not parse Exec line in desktop file: %s", ++ err->message); ++ g_error_free (err); ++ } ++ g_free (cmdline); ++ } ++ } ++ ++ if (!xsmp->set_restart_command) ++ xsmp->restart_command = g_strsplit (g_get_prgname (), " ", -1); ++ ++ clone = generate_command (xsmp->restart_command, NULL, NULL); ++ restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); ++ ++ g_debug ("Setting initial properties"); ++ ++ /* Program, CloneCommand, RestartCommand, and UserID are required. ++ * ProcessID isn't required, but the SM may be able to do something ++ * useful with it. ++ */ ++ g_snprintf (pid_str, sizeof (pid_str), "%lu", (gulong) getpid ()); ++ set_properties (xsmp, ++ string_prop (SmProgram, g_get_prgname ()), ++ ptrarray_prop (SmCloneCommand, clone), ++ ptrarray_prop (SmRestartCommand, restart), ++ string_prop (SmUserID, g_get_user_name ()), ++ string_prop (SmProcessID, pid_str), ++ card8_prop (SmRestartStyleHint, xsmp->restart_style), ++ NULL); ++ g_ptr_array_free (clone, TRUE); ++ g_ptr_array_free (restart, TRUE); ++ ++ if (desktop_file) ++ { ++ set_properties (xsmp, ++ string_prop ("_GSM_DesktopFile", egg_desktop_file_get_source (desktop_file)), ++ NULL); ++ } ++ ++ update_pending_events (xsmp); ++ return FALSE; ++} ++ ++/* This gets called from two different places: xsmp_die() (when the ++ * server asks us to disconnect) and process_ice_messages() (when the ++ * server disconnects unexpectedly). ++ */ ++static void ++sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp) ++{ ++ SmcConn connection; ++ ++ if (!xsmp->connection) ++ return; ++ ++ g_debug ("Disconnecting"); ++ ++ connection = xsmp->connection; ++ xsmp->connection = NULL; ++ SmcCloseConnection (connection, 0, NULL); ++ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; ++ ++ xsmp->waiting_to_save_myself = FALSE; ++ update_pending_events (xsmp); ++} ++ ++static void ++sm_client_xsmp_startup (EggSMClient *client, ++ const char *client_id) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ SmcCallbacks callbacks; ++ char *ret_client_id; ++ char error_string_ret[256]; ++ ++ xsmp->client_id = g_strdup (client_id); ++ ++ ice_init (); ++ SmcSetErrorHandler (smc_error_handler); ++ ++ callbacks.save_yourself.callback = xsmp_save_yourself; ++ callbacks.die.callback = xsmp_die; ++ callbacks.save_complete.callback = xsmp_save_complete; ++ callbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled; ++ ++ callbacks.save_yourself.client_data = xsmp; ++ callbacks.die.client_data = xsmp; ++ callbacks.save_complete.client_data = xsmp; ++ callbacks.shutdown_cancelled.client_data = xsmp; ++ ++ client_id = NULL; ++ error_string_ret[0] = '\0'; ++ xsmp->connection = ++ SmcOpenConnection (NULL, xsmp, SmProtoMajor, SmProtoMinor, ++ SmcSaveYourselfProcMask | SmcDieProcMask | ++ SmcSaveCompleteProcMask | ++ SmcShutdownCancelledProcMask, ++ &callbacks, ++ xsmp->client_id, &ret_client_id, ++ sizeof (error_string_ret), error_string_ret); ++ ++ if (!xsmp->connection) ++ { ++ g_warning ("Failed to connect to the session manager: %s\n", ++ error_string_ret[0] ? ++ error_string_ret : "no error message given"); ++ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; ++ return; ++ } ++ ++ /* We expect a pointless initial SaveYourself if either (a) we ++ * didn't have an initial client ID, or (b) we DID have an initial ++ * client ID, but the server rejected it and gave us a new one. ++ */ ++ if (!xsmp->client_id || ++ (ret_client_id && strcmp (xsmp->client_id, ret_client_id) != 0)) ++ xsmp->expecting_initial_save_yourself = TRUE; ++ ++ if (ret_client_id) ++ { ++ g_free (xsmp->client_id); ++ xsmp->client_id = g_strdup (ret_client_id); ++ free (ret_client_id); ++ ++ gdk_threads_enter (); ++ gdk_set_sm_client_id (xsmp->client_id); ++ gdk_threads_leave (); ++ ++ g_debug ("Got client ID \"%s\"", xsmp->client_id); ++ } ++ ++ xsmp->state = XSMP_STATE_IDLE; ++ ++ /* Do not set the initial properties until we reach the main loop, ++ * so that the application has a chance to call ++ * egg_set_desktop_file(). (This may also help the session manager ++ * have a better idea of when the application is fully up and ++ * running.) ++ */ ++ xsmp->waiting_to_set_initial_properties = TRUE; ++ xsmp->idle = g_idle_add (sm_client_xsmp_set_initial_properties, client); ++} ++ ++static void ++sm_client_xsmp_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ int i; ++ ++ g_strfreev (xsmp->restart_command); ++ ++ xsmp->restart_command = g_new (char *, argc + 1); ++ for (i = 0; i < argc; i++) ++ xsmp->restart_command[i] = g_strdup (argv[i]); ++ xsmp->restart_command[i] = NULL; ++ ++ xsmp->set_restart_command = TRUE; ++} ++ ++static void ++sm_client_xsmp_will_quit (EggSMClient *client, ++ gboolean will_quit) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ ++ if (xsmp->state == XSMP_STATE_CONNECTION_CLOSED) ++ { ++ /* The session manager has already exited! Schedule a quit ++ * signal. ++ */ ++ xsmp->waiting_to_emit_quit = TRUE; ++ update_pending_events (xsmp); ++ return; ++ } ++ else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ /* We received a ShutdownCancelled message while the application ++ * was interacting; Schedule a quit_cancelled signal. ++ */ ++ xsmp->waiting_to_emit_quit_cancelled = TRUE; ++ update_pending_events (xsmp); ++ return; ++ } ++ ++ g_return_if_fail (xsmp->state == XSMP_STATE_INTERACT); ++ ++ g_debug ("Sending InteractDone(%s)", will_quit ? "False" : "True"); ++ SmcInteractDone (xsmp->connection, !will_quit); ++ ++ if (will_quit && xsmp->need_save_state) ++ save_state (xsmp); ++ ++ g_debug ("Sending SaveYourselfDone(%s)", will_quit ? "True" : "False"); ++ SmcSaveYourselfDone (xsmp->connection, will_quit); ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++} ++ ++static gboolean ++sm_client_xsmp_end_session (EggSMClient *client, ++ EggSMClientEndStyle style, ++ gboolean request_confirmation) ++{ ++ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; ++ int save_type; ++ ++ /* To end the session via XSMP, we have to send a ++ * SaveYourselfRequest. We aren't allowed to do that if anything ++ * else is going on, but we don't want to expose this fact to the ++ * application. So we do our best to patch things up here... ++ * ++ * In the worst case, this method might block for some length of ++ * time in process_ice_messages, but the only time that code path is ++ * honestly likely to get hit is if the application tries to end the ++ * session as the very first thing it does, in which case it ++ * probably won't actually block anyway. It's not worth gunking up ++ * the API to try to deal nicely with the other 0.01% of cases where ++ * this happens. ++ */ ++ ++ while (xsmp->state != XSMP_STATE_IDLE || ++ xsmp->expecting_initial_save_yourself) ++ { ++ /* If we're already shutting down, we don't need to do anything. */ ++ if (xsmp->shutting_down) ++ return TRUE; ++ ++ switch (xsmp->state) ++ { ++ case XSMP_STATE_CONNECTION_CLOSED: ++ return FALSE; ++ ++ case XSMP_STATE_SAVE_YOURSELF: ++ /* Trying to log out from the save_state callback? Whatever. ++ * Abort the save_state. ++ */ ++ SmcSaveYourselfDone (xsmp->connection, FALSE); ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++ break; ++ ++ case XSMP_STATE_INTERACT_REQUEST: ++ case XSMP_STATE_INTERACT: ++ case XSMP_STATE_SHUTDOWN_CANCELLED: ++ /* Already in a shutdown-related state, just ignore ++ * the new shutdown request... ++ */ ++ return TRUE; ++ ++ case XSMP_STATE_IDLE: ++ if (xsmp->waiting_to_set_initial_properties) ++ sm_client_xsmp_set_initial_properties (xsmp); ++ ++ if (!xsmp->expecting_initial_save_yourself) ++ break; ++ /* else fall through */ ++ ++ case XSMP_STATE_SAVE_YOURSELF_DONE: ++ /* We need to wait for some response from the server.*/ ++ process_ice_messages (SmcGetIceConnection (xsmp->connection)); ++ break; ++ ++ default: ++ /* Hm... shouldn't happen */ ++ return FALSE; ++ } ++ } ++ ++ /* xfce4-session will do the wrong thing if we pass SmSaveGlobal and ++ * the user chooses to save the session. But gnome-session will do ++ * the wrong thing if we pass SmSaveBoth and the user chooses NOT to ++ * save the session... Sigh. ++ */ ++ if (!strcmp (SmcVendor (xsmp->connection), "xfce4-session")) ++ save_type = SmSaveBoth; ++ else ++ save_type = SmSaveGlobal; ++ ++ g_debug ("Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)", request_confirmation ? "!" : ""); ++ SmcRequestSaveYourself (xsmp->connection, ++ save_type, ++ True, /* shutdown */ ++ SmInteractStyleAny, ++ !request_confirmation, /* fast */ ++ True /* global */); ++ return TRUE; ++} ++ ++static gboolean ++idle_do_pending_events (gpointer data) ++{ ++ EggSMClientXSMP *xsmp = data; ++ EggSMClient *client = data; ++ ++ gdk_threads_enter (); ++ ++ xsmp->idle = 0; ++ ++ if (xsmp->waiting_to_emit_quit) ++ { ++ xsmp->waiting_to_emit_quit = FALSE; ++ egg_sm_client_quit (client); ++ goto out; ++ } ++ ++ if (xsmp->waiting_to_emit_quit_cancelled) ++ { ++ xsmp->waiting_to_emit_quit_cancelled = FALSE; ++ egg_sm_client_quit_cancelled (client); ++ xsmp->state = XSMP_STATE_IDLE; ++ } ++ ++ if (xsmp->waiting_to_save_myself) ++ { ++ xsmp->waiting_to_save_myself = FALSE; ++ do_save_yourself (xsmp); ++ } ++ ++ out: ++ gdk_threads_leave (); ++ return FALSE; ++} ++ ++static void ++update_pending_events (EggSMClientXSMP *xsmp) ++{ ++ gboolean want_idle = ++ xsmp->waiting_to_emit_quit || ++ xsmp->waiting_to_emit_quit_cancelled || ++ xsmp->waiting_to_save_myself; ++ ++ if (want_idle) ++ { ++ if (xsmp->idle == 0) ++ xsmp->idle = g_idle_add (idle_do_pending_events, xsmp); ++ } ++ else ++ { ++ if (xsmp->idle != 0) ++ g_source_remove (xsmp->idle); ++ xsmp->idle = 0; ++ } ++} ++ ++static void ++fix_broken_state (EggSMClientXSMP *xsmp, const char *message, ++ gboolean send_interact_done, ++ gboolean send_save_yourself_done) ++{ ++ g_warning ("Received XSMP %s message in state %s: client or server error", ++ message, EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ /* Forget any pending SaveYourself plans we had */ ++ xsmp->waiting_to_save_myself = FALSE; ++ update_pending_events (xsmp); ++ ++ if (send_interact_done) ++ SmcInteractDone (xsmp->connection, False); ++ if (send_save_yourself_done) ++ SmcSaveYourselfDone (xsmp->connection, True); ++ ++ xsmp->state = send_save_yourself_done ? XSMP_STATE_SAVE_YOURSELF_DONE : XSMP_STATE_IDLE; ++} ++ ++/* SM callbacks */ ++ ++static void ++xsmp_save_yourself (SmcConn smc_conn, ++ SmPointer client_data, ++ int save_type, ++ Bool shutdown, ++ int interact_style, ++ Bool fast) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ gboolean wants_quit_requested; ++ ++ g_debug ("Received SaveYourself(%s, %s, %s, %s) in state %s", ++ save_type == SmSaveLocal ? "SmSaveLocal" : ++ save_type == SmSaveGlobal ? "SmSaveGlobal" : "SmSaveBoth", ++ shutdown ? "Shutdown" : "!Shutdown", ++ interact_style == SmInteractStyleAny ? "SmInteractStyleAny" : ++ interact_style == SmInteractStyleErrors ? "SmInteractStyleErrors" : ++ "SmInteractStyleNone", fast ? "Fast" : "!Fast", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ if (xsmp->state != XSMP_STATE_IDLE && ++ xsmp->state != XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ fix_broken_state (xsmp, "SaveYourself", FALSE, TRUE); ++ return; ++ } ++ ++ if (xsmp->waiting_to_set_initial_properties) ++ sm_client_xsmp_set_initial_properties (xsmp); ++ ++ /* If this is the initial SaveYourself, ignore it; we've already set ++ * properties and there's no reason to actually save state too. ++ */ ++ if (xsmp->expecting_initial_save_yourself) ++ { ++ xsmp->expecting_initial_save_yourself = FALSE; ++ ++ if (save_type == SmSaveLocal && ++ interact_style == SmInteractStyleNone && ++ !shutdown && !fast) ++ { ++ g_debug ("Sending SaveYourselfDone(True) for initial SaveYourself"); ++ SmcSaveYourselfDone (xsmp->connection, True); ++ /* As explained in the comment at the end of ++ * do_save_yourself(), SAVE_YOURSELF_DONE is the correct ++ * state here, not IDLE. ++ */ ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++ return; ++ } ++ else ++ g_warning ("First SaveYourself was not the expected one!"); ++ } ++ ++ /* Even ignoring the "fast" flag completely, there are still 18 ++ * different combinations of save_type, shutdown and interact_style. ++ * We interpret them as follows: ++ * ++ * Type Shutdown Interact Interpretation ++ * G F A/E/N do nothing (1) ++ * G T N do nothing (1)* ++ * G T A/E quit_requested (2) ++ * L/B F A/E/N save_state (3) ++ * L/B T N save_state (3)* ++ * L/B T A/E quit_requested, then save_state (4) ++ * ++ * 1. Do nothing, because the SM asked us to do something ++ * uninteresting (save open files, but then don't quit ++ * afterward) or rude (save open files without asking the user ++ * for confirmation). ++ * ++ * 2. Request interaction and then emit ::quit_requested. This ++ * perhaps isn't quite correct for the SmInteractStyleErrors ++ * case, but we don't care. ++ * ++ * 3. Emit ::save_state. The SmSaveBoth SaveYourselfs in these ++ * rows essentially get demoted to SmSaveLocal, because their ++ * Global halves correspond to "do nothing". ++ * ++ * 4. Request interaction, emit ::quit_requested, and then emit ++ * ::save_state after interacting. This is the SmSaveBoth ++ * equivalent of #2, but we also promote SmSaveLocal shutdown ++ * SaveYourselfs to SmSaveBoth here, because we want to give ++ * the user a chance to save open files before quitting. ++ * ++ * (* It would be nice if we could do something useful when the ++ * session manager sends a SaveYourself with shutdown True and ++ * SmInteractStyleNone. But we can't, so we just pretend it didn't ++ * even tell us it was shutting down. The docs for ::quit mention ++ * that it might not always be preceded by ::quit_requested.) ++ */ ++ ++ /* As an optimization, we don't actually request interaction and ++ * emit ::quit_requested if the application isn't listening to the ++ * signal. ++ */ ++ wants_quit_requested = g_signal_has_handler_pending (xsmp, g_signal_lookup ("quit_requested", EGG_TYPE_SM_CLIENT), 0, FALSE); ++ ++ xsmp->need_save_state = (save_type != SmSaveGlobal); ++ xsmp->need_quit_requested = (shutdown && wants_quit_requested && ++ interact_style != SmInteractStyleNone); ++ xsmp->interact_errors = (interact_style == SmInteractStyleErrors); ++ ++ xsmp->shutting_down = shutdown; ++ ++ do_save_yourself (xsmp); ++} ++ ++static void ++do_save_yourself (EggSMClientXSMP *xsmp) ++{ ++ if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ /* The SM cancelled a previous SaveYourself, but we haven't yet ++ * had a chance to tell the application, so we can't start ++ * processing this SaveYourself yet. ++ */ ++ xsmp->waiting_to_save_myself = TRUE; ++ update_pending_events (xsmp); ++ return; ++ } ++ ++ if (xsmp->need_quit_requested) ++ { ++ xsmp->state = XSMP_STATE_INTERACT_REQUEST; ++ ++ g_debug ("Sending InteractRequest(%s)", ++ xsmp->interact_errors ? "Error" : "Normal"); ++ SmcInteractRequest (xsmp->connection, ++ xsmp->interact_errors ? SmDialogError : SmDialogNormal, ++ xsmp_interact, ++ xsmp); ++ return; ++ } ++ ++ if (xsmp->need_save_state) ++ { ++ save_state (xsmp); ++ ++ /* Though unlikely, the client could have been disconnected ++ * while the application was saving its state. ++ */ ++ if (!xsmp->connection) ++ return; ++ } ++ ++ g_debug ("Sending SaveYourselfDone(True)"); ++ SmcSaveYourselfDone (xsmp->connection, True); ++ ++ /* The client state diagram in the XSMP spec says that after a ++ * non-shutdown SaveYourself, we go directly back to "idle". But ++ * everything else in both the XSMP spec and the libSM docs ++ * disagrees. ++ */ ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; ++} ++ ++static void ++save_state (EggSMClientXSMP *xsmp) ++{ ++ GKeyFile *state_file; ++ char *state_file_path, *data; ++ EggDesktopFile *desktop_file; ++ GPtrArray *restart; ++ int offset, fd; ++ ++ /* We set xsmp->state before emitting save_state, but our caller is ++ * responsible for setting it back afterward. ++ */ ++ xsmp->state = XSMP_STATE_SAVE_YOURSELF; ++ ++ state_file = egg_sm_client_save_state ((EggSMClient *)xsmp); ++ if (!state_file) ++ { ++ restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); ++ set_properties (xsmp, ++ ptrarray_prop (SmRestartCommand, restart), ++ NULL); ++ g_ptr_array_free (restart, TRUE); ++ delete_properties (xsmp, SmDiscardCommand, NULL); ++ return; ++ } ++ ++ desktop_file = egg_get_desktop_file (); ++ if (desktop_file) ++ { ++ GKeyFile *merged_file; ++ char *desktop_file_path; ++ ++ merged_file = g_key_file_new (); ++ desktop_file_path = ++ g_filename_from_uri (egg_desktop_file_get_source (desktop_file), ++ NULL, NULL); ++ if (desktop_file_path && ++ g_key_file_load_from_file (merged_file, desktop_file_path, ++ G_KEY_FILE_KEEP_COMMENTS | ++ G_KEY_FILE_KEEP_TRANSLATIONS, NULL)) ++ { ++ guint g, k, i; ++ char **groups, **keys, *value, *exec; ++ ++ groups = g_key_file_get_groups (state_file, NULL); ++ for (g = 0; groups[g]; g++) ++ { ++ keys = g_key_file_get_keys (state_file, groups[g], NULL, NULL); ++ for (k = 0; keys[k]; k++) ++ { ++ value = g_key_file_get_value (state_file, groups[g], ++ keys[k], NULL); ++ if (value) ++ { ++ g_key_file_set_value (merged_file, groups[g], ++ keys[k], value); ++ g_free (value); ++ } ++ } ++ g_strfreev (keys); ++ } ++ g_strfreev (groups); ++ ++ g_key_file_free (state_file); ++ state_file = merged_file; ++ ++ /* Update Exec key using "--sm-client-state-file %k" */ ++ restart = generate_command (xsmp->restart_command, ++ NULL, "%k"); ++ for (i = 0; i < restart->len; i++) ++ restart->pdata[i] = g_shell_quote (restart->pdata[i]); ++ g_ptr_array_add (restart, NULL); ++ exec = g_strjoinv (" ", (char **)restart->pdata); ++ g_strfreev ((char **)restart->pdata); ++ g_ptr_array_free (restart, FALSE); ++ ++ g_key_file_set_string (state_file, EGG_DESKTOP_FILE_GROUP, ++ EGG_DESKTOP_FILE_KEY_EXEC, ++ exec); ++ g_free (exec); ++ } ++ else ++ desktop_file = NULL; ++ ++ g_free (desktop_file_path); ++ } ++ ++ /* Now write state_file to disk. (We can't use mktemp(), because ++ * that requires the filename to end with "XXXXXX", and we want ++ * it to end with ".desktop".) ++ */ ++ ++ data = g_key_file_to_data (state_file, NULL, NULL); ++ g_key_file_free (state_file); ++ ++ offset = 0; ++ while (1) ++ { ++ state_file_path = g_strdup_printf ("%s%csession-state%c%s-%ld.%s", ++ g_get_user_config_dir (), ++ G_DIR_SEPARATOR, G_DIR_SEPARATOR, ++ g_get_prgname (), ++ (long)time (NULL) + offset, ++ desktop_file ? "desktop" : "state"); ++ ++ fd = open (state_file_path, O_WRONLY | O_CREAT | O_EXCL, 0644); ++ if (fd == -1) ++ { ++ if (errno == EEXIST) ++ { ++ offset++; ++ g_free (state_file_path); ++ continue; ++ } ++ else if (errno == ENOTDIR || errno == ENOENT) ++ { ++ char *sep = strrchr (state_file_path, G_DIR_SEPARATOR); ++ ++ *sep = '\0'; ++ if (g_mkdir_with_parents (state_file_path, 0755) != 0) ++ { ++ g_warning ("Could not create directory '%s'", ++ state_file_path); ++ g_free (state_file_path); ++ state_file_path = NULL; ++ break; ++ } ++ ++ continue; ++ } ++ ++ g_warning ("Could not create file '%s': %s", ++ state_file_path, g_strerror (errno)); ++ g_free (state_file_path); ++ state_file_path = NULL; ++ break; ++ } ++ ++ close (fd); ++ g_file_set_contents (state_file_path, data, -1, NULL); ++ break; ++ } ++ g_free (data); ++ ++ restart = generate_command (xsmp->restart_command, xsmp->client_id, ++ state_file_path); ++ set_properties (xsmp, ++ ptrarray_prop (SmRestartCommand, restart), ++ NULL); ++ g_ptr_array_free (restart, TRUE); ++ ++ if (state_file_path) ++ { ++ set_properties (xsmp, ++ array_prop (SmDiscardCommand, ++ "/bin/rm", "-rf", state_file_path, ++ NULL), ++ NULL); ++ g_free (state_file_path); ++ } ++} ++ ++static void ++xsmp_interact (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ EggSMClient *client = client_data; ++ ++ g_debug ("Received Interact message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ if (xsmp->state != XSMP_STATE_INTERACT_REQUEST) ++ { ++ fix_broken_state (xsmp, "Interact", TRUE, TRUE); ++ return; ++ } ++ ++ xsmp->state = XSMP_STATE_INTERACT; ++ egg_sm_client_quit_requested (client); ++} ++ ++static void ++xsmp_die (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ EggSMClient *client = client_data; ++ ++ g_debug ("Received Die message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ sm_client_xsmp_disconnect (xsmp); ++ egg_sm_client_quit (client); ++} ++ ++static void ++xsmp_save_complete (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ ++ g_debug ("Received SaveComplete message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) ++ xsmp->state = XSMP_STATE_IDLE; ++ else ++ fix_broken_state (xsmp, "SaveComplete", FALSE, FALSE); ++} ++ ++static void ++xsmp_shutdown_cancelled (SmcConn smc_conn, ++ SmPointer client_data) ++{ ++ EggSMClientXSMP *xsmp = client_data; ++ EggSMClient *client = client_data; ++ ++ g_debug ("Received ShutdownCancelled message in state %s", ++ EGG_SM_CLIENT_XSMP_STATE (xsmp)); ++ ++ xsmp->shutting_down = FALSE; ++ ++ if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) ++ { ++ /* We've finished interacting and now the SM has agreed to ++ * cancel the shutdown. ++ */ ++ xsmp->state = XSMP_STATE_IDLE; ++ egg_sm_client_quit_cancelled (client); ++ } ++ else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) ++ { ++ /* Hm... ok, so we got a shutdown SaveYourself, which got ++ * cancelled, but the application was still interacting, so we ++ * didn't tell it yet, and then *another* SaveYourself arrived, ++ * which we must still be waiting to tell the app about, except ++ * that now that SaveYourself has been cancelled too! Dizzy yet? ++ */ ++ xsmp->waiting_to_save_myself = FALSE; ++ update_pending_events (xsmp); ++ } ++ else ++ { ++ g_debug ("Sending SaveYourselfDone(False)"); ++ SmcSaveYourselfDone (xsmp->connection, False); ++ ++ if (xsmp->state == XSMP_STATE_INTERACT) ++ { ++ /* The application is currently interacting, so we can't ++ * tell it about the cancellation yet; we will wait until ++ * after it calls egg_sm_client_will_quit(). ++ */ ++ xsmp->state = XSMP_STATE_SHUTDOWN_CANCELLED; ++ } ++ else ++ { ++ /* The shutdown was cancelled before the application got a ++ * chance to interact. ++ */ ++ xsmp->state = XSMP_STATE_IDLE; ++ } ++ } ++} ++ ++/* Utilities */ ++ ++/* Create a restart/clone/Exec command based on @restart_command. ++ * If @client_id is non-%NULL, add "--sm-client-id @client_id". ++ * If @state_file is non-%NULL, add "--sm-client-state-file @state_file". ++ * ++ * None of the input strings are g_strdup()ed; the caller must keep ++ * them around until it is done with the returned GPtrArray, and must ++ * then free the array, but not its contents. ++ */ ++static GPtrArray * ++generate_command (char **restart_command, const char *client_id, ++ const char *state_file) ++{ ++ GPtrArray *cmd; ++ int i; ++ ++ cmd = g_ptr_array_new (); ++ g_ptr_array_add (cmd, restart_command[0]); ++ ++ if (client_id) ++ { ++ g_ptr_array_add (cmd, (char *)"--sm-client-id"); ++ g_ptr_array_add (cmd, (char *)client_id); ++ } ++ ++ if (state_file) ++ { ++ g_ptr_array_add (cmd, (char *)"--sm-client-state-file"); ++ g_ptr_array_add (cmd, (char *)state_file); ++ } ++ ++ for (i = 1; restart_command[i]; i++) ++ g_ptr_array_add (cmd, restart_command[i]); ++ ++ return cmd; ++} ++ ++/* Takes a NULL-terminated list of SmProp * values, created by ++ * array_prop, ptrarray_prop, string_prop, card8_prop, sets them, and ++ * frees them. ++ */ ++static void ++set_properties (EggSMClientXSMP *xsmp, ...) ++{ ++ GPtrArray *props; ++ SmProp *prop; ++ va_list ap; ++ guint i; ++ ++ props = g_ptr_array_new (); ++ ++ va_start (ap, xsmp); ++ while ((prop = va_arg (ap, SmProp *))) ++ g_ptr_array_add (props, prop); ++ va_end (ap); ++ ++ if (xsmp->connection) ++ { ++ SmcSetProperties (xsmp->connection, props->len, ++ (SmProp **)props->pdata); ++ } ++ ++ for (i = 0; i < props->len; i++) ++ { ++ prop = props->pdata[i]; ++ g_free (prop->vals); ++ g_free (prop); ++ } ++ g_ptr_array_free (props, TRUE); ++} ++ ++/* Takes a NULL-terminated list of property names and deletes them. */ ++static void ++delete_properties (EggSMClientXSMP *xsmp, ...) ++{ ++ GPtrArray *props; ++ char *prop; ++ va_list ap; ++ ++ if (!xsmp->connection) ++ return; ++ ++ props = g_ptr_array_new (); ++ ++ va_start (ap, xsmp); ++ while ((prop = va_arg (ap, char *))) ++ g_ptr_array_add (props, prop); ++ va_end (ap); ++ ++ SmcDeleteProperties (xsmp->connection, props->len, ++ (char **)props->pdata); ++ ++ g_ptr_array_free (props, TRUE); ++} ++ ++/* Takes an array of strings and creates a LISTofARRAY8 property. The ++ * strings are neither dupped nor freed; they need to remain valid ++ * until you're done with the SmProp. ++ */ ++static SmProp * ++array_prop (const char *name, ...) ++{ ++ SmProp *prop; ++ SmPropValue pv; ++ GArray *vals; ++ char *value; ++ va_list ap; ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmLISTofARRAY8; ++ ++ vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); ++ ++ va_start (ap, name); ++ while ((value = va_arg (ap, char *))) ++ { ++ pv.length = strlen (value); ++ pv.value = value; ++ g_array_append_val (vals, pv); ++ } ++ ++ prop->num_vals = vals->len; ++ prop->vals = (SmPropValue *)vals->data; ++ ++ g_array_free (vals, FALSE); ++ ++ return prop; ++} ++ ++/* Takes a GPtrArray of strings and creates a LISTofARRAY8 property. ++ * The array contents are neither dupped nor freed; they need to ++ * remain valid until you're done with the SmProp. ++ */ ++static SmProp * ++ptrarray_prop (const char *name, GPtrArray *values) ++{ ++ SmProp *prop; ++ SmPropValue pv; ++ GArray *vals; ++ guint i; ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmLISTofARRAY8; ++ ++ vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); ++ ++ for (i = 0; i < values->len; i++) ++ { ++ pv.length = strlen (values->pdata[i]); ++ pv.value = values->pdata[i]; ++ g_array_append_val (vals, pv); ++ } ++ ++ prop->num_vals = vals->len; ++ prop->vals = (SmPropValue *)vals->data; ++ ++ g_array_free (vals, FALSE); ++ ++ return prop; ++} ++ ++/* Takes a string and creates an ARRAY8 property. The string is ++ * neither dupped nor freed; it needs to remain valid until you're ++ * done with the SmProp. ++ */ ++static SmProp * ++string_prop (const char *name, const char *value) ++{ ++ SmProp *prop; ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmARRAY8; ++ ++ prop->num_vals = 1; ++ prop->vals = g_new (SmPropValue, 1); ++ ++ prop->vals[0].length = strlen (value); ++ prop->vals[0].value = (char *)value; ++ ++ return prop; ++} ++ ++/* Takes a char and creates a CARD8 property. */ ++static SmProp * ++card8_prop (const char *name, unsigned char value) ++{ ++ SmProp *prop; ++ char *card8val; ++ ++ /* To avoid having to allocate and free prop->vals[0], we cheat and ++ * make vals a 2-element-long array and then use the second element ++ * to store value. ++ */ ++ ++ prop = g_new (SmProp, 1); ++ prop->name = (char *)name; ++ prop->type = (char *)SmCARD8; ++ ++ prop->num_vals = 1; ++ prop->vals = g_new (SmPropValue, 2); ++ card8val = (char *)(&prop->vals[1]); ++ card8val[0] = value; ++ ++ prop->vals[0].length = 1; ++ prop->vals[0].value = card8val; ++ ++ return prop; ++} ++ ++/* ICE code. This makes no effort to play nice with anyone else trying ++ * to use libICE. Fortunately, no one uses libICE for anything other ++ * than SM. (DCOP uses ICE, but it has its own private copy of ++ * libICE.) ++ * ++ * When this moves to gtk, it will need to be cleverer, to avoid ++ * tripping over old apps that use GnomeClient or that use libSM ++ * directly. ++ */ ++ ++#include ++#include ++ ++static void ice_error_handler (IceConn ice_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ IcePointer values); ++static void ice_io_error_handler (IceConn ice_conn); ++static void ice_connection_watch (IceConn ice_conn, ++ IcePointer client_data, ++ Bool opening, ++ IcePointer *watch_data); ++ ++static void ++ice_init (void) ++{ ++ IceSetIOErrorHandler (ice_io_error_handler); ++ IceSetErrorHandler (ice_error_handler); ++ IceAddConnectionWatch (ice_connection_watch, NULL); ++} ++ ++static gboolean ++process_ice_messages (IceConn ice_conn) ++{ ++ IceProcessMessagesStatus status; ++ ++ gdk_threads_enter (); ++ status = IceProcessMessages (ice_conn, NULL, NULL); ++ gdk_threads_leave (); ++ ++ switch (status) ++ { ++ case IceProcessMessagesSuccess: ++ return TRUE; ++ ++ case IceProcessMessagesIOError: ++ sm_client_xsmp_disconnect (IceGetConnectionContext (ice_conn)); ++ return FALSE; ++ ++ case IceProcessMessagesConnectionClosed: ++ return FALSE; ++ ++ default: ++ g_assert_not_reached (); ++ } ++} ++ ++static gboolean ++ice_iochannel_watch (GIOChannel *channel, ++ GIOCondition condition, ++ gpointer client_data) ++{ ++ return process_ice_messages (client_data); ++} ++ ++static void ++ice_connection_watch (IceConn ice_conn, ++ IcePointer client_data, ++ Bool opening, ++ IcePointer *watch_data) ++{ ++ guint watch_id; ++ ++ if (opening) ++ { ++ GIOChannel *channel; ++ int fd = IceConnectionNumber (ice_conn); ++ ++ fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC); ++ channel = g_io_channel_unix_new (fd); ++ watch_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR, ++ ice_iochannel_watch, ice_conn); ++ g_io_channel_unref (channel); ++ ++ *watch_data = GUINT_TO_POINTER (watch_id); ++ } ++ else ++ { ++ watch_id = GPOINTER_TO_UINT (*watch_data); ++ g_source_remove (watch_id); ++ } ++} ++ ++static void ++ice_error_handler (IceConn ice_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ IcePointer values) ++{ ++ /* Do nothing */ ++} ++ ++static void ++ice_io_error_handler (IceConn ice_conn) ++{ ++ /* Do nothing */ ++} ++ ++static void ++smc_error_handler (SmcConn smc_conn, ++ Bool swap, ++ int offending_minor_opcode, ++ unsigned long offending_sequence, ++ int error_class, ++ int severity, ++ SmPointer values) ++{ ++ /* Do nothing */ ++} +diff --git a/src/libeggsmclient/eggsmclient.c b/src/libeggsmclient/eggsmclient.c +new file mode 100644 +index 0000000..efa901d +--- a/src/libeggsmclient/eggsmclient.c ++++ b/src/libeggsmclient/eggsmclient.c +@@ -0,0 +1,589 @@ ++/* ++ * Copyright (C) 2007 Novell, 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, ++ * 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. ++ * ++ * 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. ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++ ++#include "eggsmclient.h" ++#include "eggsmclient-private.h" ++ ++static void egg_sm_client_debug_handler (const char *log_domain, ++ GLogLevelFlags log_level, ++ const char *message, ++ gpointer user_data); ++ ++enum { ++ SAVE_STATE, ++ QUIT_REQUESTED, ++ QUIT_CANCELLED, ++ QUIT, ++ LAST_SIGNAL ++}; ++ ++static guint signals[LAST_SIGNAL]; ++ ++struct _EggSMClientPrivate { ++ GKeyFile *state_file; ++}; ++ ++#define EGG_SM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) ++ ++G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT) ++ ++static EggSMClient *global_client; ++static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL; ++ ++static void ++egg_sm_client_init (EggSMClient *client) ++{ ++ ; ++} ++ ++static void ++egg_sm_client_class_init (EggSMClientClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ ++ g_type_class_add_private (klass, sizeof (EggSMClientPrivate)); ++ ++ /** ++ * EggSMClient::save_state: ++ * @client: the client ++ * @state_file: a #GKeyFile to save state information into ++ * ++ * Emitted when the session manager has requested that the ++ * application save information about its current state. The ++ * application should save its state into @state_file, and then the ++ * session manager may then restart the application in a future ++ * session and tell it to initialize itself from that state. ++ * ++ * You should not save any data into @state_file's "start group" ++ * (ie, the %NULL group). Instead, applications should save their ++ * data into groups with names that start with the application name, ++ * and libraries that connect to this signal should save their data ++ * into groups with names that start with the library name. ++ * ++ * Alternatively, rather than (or in addition to) using @state_file, ++ * the application can save its state by calling ++ * egg_sm_client_set_restart_command() during the processing of this ++ * signal (eg, to include a list of files to open). ++ **/ ++ signals[SAVE_STATE] = ++ g_signal_new ("save_state", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, save_state), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__POINTER, ++ G_TYPE_NONE, ++ 1, G_TYPE_POINTER); ++ ++ /** ++ * EggSMClient::quit_requested: ++ * @client: the client ++ * ++ * Emitted when the session manager requests that the application ++ * exit (generally because the user is logging out). The application ++ * should decide whether or not it is willing to quit (perhaps after ++ * asking the user what to do with documents that have unsaved ++ * changes) and then call egg_sm_client_will_quit(), passing %TRUE ++ * or %FALSE to give its answer to the session manager. (It does not ++ * need to give an answer before returning from the signal handler; ++ * it can interact with the user asynchronously and then give its ++ * answer later on.) If the application does not connect to this ++ * signal, then #EggSMClient will automatically return %TRUE on its ++ * behalf. ++ * ++ * The application should not save its session state as part of ++ * handling this signal; if the user has requested that the session ++ * be saved when logging out, then ::save_state will be emitted ++ * separately. ++ * ++ * If the application agrees to quit, it should then wait for either ++ * the ::quit_cancelled or ::quit signals to be emitted. ++ **/ ++ signals[QUIT_REQUESTED] = ++ g_signal_new ("quit_requested", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, quit_requested), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, ++ 0); ++ ++ /** ++ * EggSMClient::quit_cancelled: ++ * @client: the client ++ * ++ * Emitted when the session manager decides to cancel a logout after ++ * the application has already agreed to quit. After receiving this ++ * signal, the application can go back to what it was doing before ++ * receiving the ::quit_requested signal. ++ **/ ++ signals[QUIT_CANCELLED] = ++ g_signal_new ("quit_cancelled", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, quit_cancelled), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, ++ 0); ++ ++ /** ++ * EggSMClient::quit: ++ * @client: the client ++ * ++ * Emitted when the session manager wants the application to quit ++ * (generally because the user is logging out). The application ++ * should exit as soon as possible after receiving this signal; if ++ * it does not, the session manager may choose to forcibly kill it. ++ * ++ * Normally a GUI application would only be sent a ::quit if it ++ * agreed to quit in response to a ::quit_requested signal. However, ++ * this is not guaranteed; in some situations the session manager ++ * may decide to end the session without giving applications a ++ * chance to object. ++ **/ ++ signals[QUIT] = ++ g_signal_new ("quit", ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (EggSMClientClass, quit), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, ++ 0); ++} ++ ++static gboolean sm_client_disable = FALSE; ++static char *sm_client_state_file = NULL; ++static char *sm_client_id = NULL; ++static char *sm_config_prefix = NULL; ++ ++static gboolean ++sm_client_post_parse_func (GOptionContext *context, ++ GOptionGroup *group, ++ gpointer data, ++ GError **error) ++{ ++ EggSMClient *client = egg_sm_client_get (); ++ ++ if (sm_client_id == NULL) ++ { ++ const gchar *desktop_autostart_id; ++ ++ desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); ++ ++ if (desktop_autostart_id != NULL) ++ sm_client_id = g_strdup (desktop_autostart_id); ++ } ++ ++ /* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to ++ * use the same client id. */ ++ g_unsetenv ("DESKTOP_AUTOSTART_ID"); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->startup) ++ EGG_SM_CLIENT_GET_CLASS (client)->startup (client, sm_client_id); ++ return TRUE; ++} ++ ++/** ++ * egg_sm_client_get_option_group: ++ * ++ * Creates a %GOptionGroup containing the session-management-related ++ * options. You should add this group to the application's ++ * %GOptionContext if you want to use #EggSMClient. ++ * ++ * Return value: the %GOptionGroup ++ **/ ++GOptionGroup * ++egg_sm_client_get_option_group (void) ++{ ++ const GOptionEntry entries[] = { ++ { "sm-client-disable", 0, 0, ++ G_OPTION_ARG_NONE, &sm_client_disable, ++ N_("Disable connection to session manager"), NULL }, ++ { "sm-client-state-file", 0, 0, ++ G_OPTION_ARG_FILENAME, &sm_client_state_file, ++ N_("Specify file containing saved configuration"), N_("FILE") }, ++ { "sm-client-id", 0, 0, ++ G_OPTION_ARG_STRING, &sm_client_id, ++ N_("Specify session management ID"), N_("ID") }, ++ /* GnomeClient compatibility option */ ++ { "sm-disable", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &sm_client_disable, ++ NULL, NULL }, ++ /* GnomeClient compatibility option. This is a dummy option that only ++ * exists so that sessions saved by apps with GnomeClient can be restored ++ * later when they've switched to EggSMClient. See bug #575308. ++ */ ++ { "sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_STRING, &sm_config_prefix, ++ NULL, NULL }, ++ { NULL } ++ }; ++ GOptionGroup *group; ++ ++ /* Use our own debug handler for the "EggSMClient" domain. */ ++ g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, ++ egg_sm_client_debug_handler, NULL); ++ ++ group = g_option_group_new ("sm-client", ++ _("Session management options:"), ++ _("Show session management options"), ++ NULL, NULL); ++ g_option_group_add_entries (group, entries); ++ g_option_group_set_parse_hooks (group, NULL, sm_client_post_parse_func); ++ ++ return group; ++} ++ ++/** ++ * egg_sm_client_set_mode: ++ * @mode: an #EggSMClient mode ++ * ++ * Sets the "mode" of #EggSMClient as follows: ++ * ++ * %EGG_SM_CLIENT_MODE_DISABLED: Session management is completely ++ * disabled. The application will not even connect to the session ++ * manager. (egg_sm_client_get() will still return an #EggSMClient, ++ * but it will just be a dummy object.) ++ * ++ * %EGG_SM_CLIENT_MODE_NO_RESTART: The application will connect to ++ * the session manager (and thus will receive notification when the ++ * user is logging out, etc), but will request to not be ++ * automatically restarted with saved state in future sessions. ++ * ++ * %EGG_SM_CLIENT_MODE_NORMAL: The default. #EggSMCLient will ++ * function normally. ++ * ++ * This must be called before the application's main loop begins. ++ **/ ++void ++egg_sm_client_set_mode (EggSMClientMode mode) ++{ ++ global_client_mode = mode; ++} ++ ++/** ++ * egg_sm_client_get_mode: ++ * ++ * Gets the global #EggSMClientMode. See egg_sm_client_set_mode() ++ * for details. ++ * ++ * Return value: the global #EggSMClientMode ++ **/ ++EggSMClientMode ++egg_sm_client_get_mode (void) ++{ ++ return global_client_mode; ++} ++ ++/** ++ * egg_sm_client_get: ++ * ++ * Returns the master #EggSMClient for the application. ++ * ++ * On platforms that support saved sessions (ie, POSIX/X11), the ++ * application will only request to be restarted by the session ++ * manager if you call egg_set_desktop_file() to set an application ++ * desktop file. In particular, if the desktop file contains the key ++ * "X ++ * ++ * Return value: the master #EggSMClient. ++ **/ ++EggSMClient * ++egg_sm_client_get (void) ++{ ++ if (!global_client) ++ { ++ if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED && ++ !sm_client_disable) ++ { ++#if defined (GDK_WINDOWING_WIN32) ++ global_client = egg_sm_client_win32_new (); ++#elif defined (GDK_WINDOWING_QUARTZ) ++ global_client = egg_sm_client_osx_new (); ++#else ++ /* If both D-Bus and XSMP are compiled in, try XSMP first ++ * (since it supports state saving) and fall back to D-Bus ++ * if XSMP isn't available. ++ */ ++# ifdef EGG_SM_CLIENT_BACKEND_XSMP ++ global_client = egg_sm_client_xsmp_new (); ++# endif ++# ifdef EGG_SM_CLIENT_BACKEND_DBUS ++ if (!global_client) ++ global_client = egg_sm_client_dbus_new (); ++# endif ++#endif ++ } ++ ++ /* Fallback: create a dummy client, so that callers don't have ++ * to worry about a %NULL return value. ++ */ ++ if (!global_client) ++ global_client = g_object_new (EGG_TYPE_SM_CLIENT, NULL); ++ } ++ ++ return global_client; ++} ++ ++/** ++ * egg_sm_client_is_resumed: ++ * @client: the client ++ * ++ * Checks whether or not the current session has been resumed from ++ * a previous saved session. If so, the application should call ++ * egg_sm_client_get_state_file() and restore its state from the ++ * returned #GKeyFile. ++ * ++ * Return value: %TRUE if the session has been resumed ++ **/ ++gboolean ++egg_sm_client_is_resumed (EggSMClient *client) ++{ ++ g_return_val_if_fail (client == global_client, FALSE); ++ ++ return sm_client_state_file != NULL; ++} ++ ++/** ++ * egg_sm_client_get_state_file: ++ * @client: the client ++ * ++ * If the application was resumed by the session manager, this will ++ * return the #GKeyFile containing its state from the previous ++ * session. ++ * ++ * Note that other libraries and #EggSMClient itself may also store ++ * state in the key file, so if you call egg_sm_client_get_groups(), ++ * on it, the return value will likely include groups that you did not ++ * put there yourself. (It is also not guaranteed that the first ++ * group created by the application will still be the "start group" ++ * when it is resumed.) ++ * ++ * Return value: the #GKeyFile containing the application's earlier ++ * state, or %NULL on error. You should not free this key file; it ++ * is owned by @client. ++ **/ ++GKeyFile * ++egg_sm_client_get_state_file (EggSMClient *client) ++{ ++ EggSMClientPrivate *priv = EGG_SM_CLIENT_GET_PRIVATE (client); ++ char *state_file_path; ++ GError *err = NULL; ++ ++ g_return_val_if_fail (client == global_client, NULL); ++ ++ if (!sm_client_state_file) ++ return NULL; ++ if (priv->state_file) ++ return priv->state_file; ++ ++ if (!strncmp (sm_client_state_file, "file://", 7)) ++ state_file_path = g_filename_from_uri (sm_client_state_file, NULL, NULL); ++ else ++ state_file_path = g_strdup (sm_client_state_file); ++ ++ priv->state_file = g_key_file_new (); ++ if (!g_key_file_load_from_file (priv->state_file, state_file_path, 0, &err)) ++ { ++ g_warning ("Could not load SM state file '%s': %s", ++ sm_client_state_file, err->message); ++ g_clear_error (&err); ++ g_key_file_free (priv->state_file); ++ priv->state_file = NULL; ++ } ++ ++ g_free (state_file_path); ++ return priv->state_file; ++} ++ ++/** ++ * egg_sm_client_set_restart_command: ++ * @client: the client ++ * @argc: the length of @argv ++ * @argv: argument vector ++ * ++ * Sets the command used to restart @client if it does not have a ++ * .desktop file that can be used to find its restart command. ++ * ++ * This can also be used when handling the ::save_state signal, to ++ * save the current state via an updated command line. (Eg, providing ++ * a list of filenames to open when the application is resumed.) ++ **/ ++void ++egg_sm_client_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv) ++{ ++ g_return_if_fail (EGG_IS_SM_CLIENT (client)); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command) ++ EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command (client, argc, argv); ++} ++ ++/** ++ * egg_sm_client_will_quit: ++ * @client: the client ++ * @will_quit: whether or not the application is willing to quit ++ * ++ * This MUST be called in response to the ::quit_requested signal, to ++ * indicate whether or not the application is willing to quit. The ++ * application may call it either directly from the signal handler, or ++ * at some later point (eg, after asynchronously interacting with the ++ * user). ++ * ++ * If the application does not connect to ::quit_requested, ++ * #EggSMClient will call this method on its behalf (passing %TRUE ++ * for @will_quit). ++ * ++ * After calling this method, the application should wait to receive ++ * either ::quit_cancelled or ::quit. ++ **/ ++void ++egg_sm_client_will_quit (EggSMClient *client, ++ gboolean will_quit) ++{ ++ g_return_if_fail (EGG_IS_SM_CLIENT (client)); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->will_quit) ++ EGG_SM_CLIENT_GET_CLASS (client)->will_quit (client, will_quit); ++} ++ ++/** ++ * egg_sm_client_end_session: ++ * @style: a hint at how to end the session ++ * @request_confirmation: whether or not the user should get a chance ++ * to confirm the action ++ * ++ * Requests that the session manager end the current session. @style ++ * indicates how the session should be ended, and ++ * @request_confirmation indicates whether or not the user should be ++ * given a chance to confirm the logout/reboot/shutdown. Both of these ++ * flags are merely hints though; the session manager may choose to ++ * ignore them. ++ * ++ * Return value: %TRUE if the request was sent; %FALSE if it could not ++ * be (eg, because it could not connect to the session manager). ++ **/ ++gboolean ++egg_sm_client_end_session (EggSMClientEndStyle style, ++ gboolean request_confirmation) ++{ ++ EggSMClient *client = egg_sm_client_get (); ++ ++ g_return_val_if_fail (EGG_IS_SM_CLIENT (client), FALSE); ++ ++ if (EGG_SM_CLIENT_GET_CLASS (client)->end_session) ++ { ++ return EGG_SM_CLIENT_GET_CLASS (client)->end_session (client, style, ++ request_confirmation); ++ } ++ else ++ return FALSE; ++} ++ ++/* Signal-emitting callbacks from platform-specific code */ ++ ++GKeyFile * ++egg_sm_client_save_state (EggSMClient *client) ++{ ++ GKeyFile *state_file; ++ char *group; ++ ++ g_return_val_if_fail (client == global_client, NULL); ++ ++ state_file = g_key_file_new (); ++ ++ g_debug ("Emitting save_state"); ++ g_signal_emit (client, signals[SAVE_STATE], 0, state_file); ++ g_debug ("Done emitting save_state"); ++ ++ group = g_key_file_get_start_group (state_file); ++ if (group) ++ { ++ g_free (group); ++ return state_file; ++ } ++ else ++ { ++ g_key_file_free (state_file); ++ return NULL; ++ } ++} ++ ++void ++egg_sm_client_quit_requested (EggSMClient *client) ++{ ++ g_return_if_fail (client == global_client); ++ ++ if (!g_signal_has_handler_pending (client, signals[QUIT_REQUESTED], 0, FALSE)) ++ { ++ g_debug ("Not emitting quit_requested because no one is listening"); ++ egg_sm_client_will_quit (client, TRUE); ++ return; ++ } ++ ++ g_debug ("Emitting quit_requested"); ++ g_signal_emit (client, signals[QUIT_REQUESTED], 0); ++ g_debug ("Done emitting quit_requested"); ++} ++ ++void ++egg_sm_client_quit_cancelled (EggSMClient *client) ++{ ++ g_return_if_fail (client == global_client); ++ ++ g_debug ("Emitting quit_cancelled"); ++ g_signal_emit (client, signals[QUIT_CANCELLED], 0); ++ g_debug ("Done emitting quit_cancelled"); ++} ++ ++void ++egg_sm_client_quit (EggSMClient *client) ++{ ++ g_return_if_fail (client == global_client); ++ ++ g_debug ("Emitting quit"); ++ g_signal_emit (client, signals[QUIT], 0); ++ g_debug ("Done emitting quit"); ++ ++ /* FIXME: should we just call gtk_main_quit() here? */ ++} ++ ++static void ++egg_sm_client_debug_handler (const char *log_domain, ++ GLogLevelFlags log_level, ++ const char *message, ++ gpointer user_data) ++{ ++ static int debug = -1; ++ ++ if (debug < 0) ++ debug = (g_getenv ("EGG_SM_CLIENT_DEBUG") != NULL); ++ ++ if (debug) ++ g_log_default_handler (log_domain, log_level, message, NULL); ++} +diff --git a/src/libeggsmclient/eggsmclient.h b/src/libeggsmclient/eggsmclient.h +new file mode 100644 +index 0000000..e620b75 +--- a/src/libeggsmclient/eggsmclient.h ++++ b/src/libeggsmclient/eggsmclient.h +@@ -0,0 +1,117 @@ ++/* eggsmclient.h ++ * Copyright (C) 2007 Novell, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser 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, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ */ ++ ++#ifndef __EGG_SM_CLIENT_H__ ++#define __EGG_SM_CLIENT_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++#define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ()) ++#define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient)) ++#define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass)) ++#define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT)) ++#define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT)) ++#define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass)) ++ ++typedef struct _EggSMClient EggSMClient; ++typedef struct _EggSMClientClass EggSMClientClass; ++typedef struct _EggSMClientPrivate EggSMClientPrivate; ++ ++typedef enum { ++ EGG_SM_CLIENT_END_SESSION_DEFAULT, ++ EGG_SM_CLIENT_LOGOUT, ++ EGG_SM_CLIENT_REBOOT, ++ EGG_SM_CLIENT_SHUTDOWN ++} EggSMClientEndStyle; ++ ++typedef enum { ++ EGG_SM_CLIENT_MODE_DISABLED, ++ EGG_SM_CLIENT_MODE_NO_RESTART, ++ EGG_SM_CLIENT_MODE_NORMAL ++} EggSMClientMode; ++ ++struct _EggSMClient ++{ ++ GObject parent; ++ ++}; ++ ++struct _EggSMClientClass ++{ ++ GObjectClass parent_class; ++ ++ /* signals */ ++ void (*save_state) (EggSMClient *client, ++ GKeyFile *state_file); ++ ++ void (*quit_requested) (EggSMClient *client); ++ void (*quit_cancelled) (EggSMClient *client); ++ void (*quit) (EggSMClient *client); ++ ++ /* virtual methods */ ++ void (*startup) (EggSMClient *client, ++ const char *client_id); ++ void (*set_restart_command) (EggSMClient *client, ++ int argc, ++ const char **argv); ++ void (*will_quit) (EggSMClient *client, ++ gboolean will_quit); ++ gboolean (*end_session) (EggSMClient *client, ++ EggSMClientEndStyle style, ++ gboolean request_confirmation); ++ ++ /* Padding for future expansion */ ++ void (*_egg_reserved1) (void); ++ void (*_egg_reserved2) (void); ++ void (*_egg_reserved3) (void); ++ void (*_egg_reserved4) (void); ++}; ++ ++GType egg_sm_client_get_type (void) G_GNUC_CONST; ++ ++GOptionGroup *egg_sm_client_get_option_group (void); ++ ++/* Initialization */ ++void egg_sm_client_set_mode (EggSMClientMode mode); ++EggSMClientMode egg_sm_client_get_mode (void); ++EggSMClient *egg_sm_client_get (void); ++ ++/* Resuming a saved session */ ++gboolean egg_sm_client_is_resumed (EggSMClient *client); ++GKeyFile *egg_sm_client_get_state_file (EggSMClient *client); ++ ++/* Alternate means of saving state */ ++void egg_sm_client_set_restart_command (EggSMClient *client, ++ int argc, ++ const char **argv); ++ ++/* Handling "quit_requested" signal */ ++void egg_sm_client_will_quit (EggSMClient *client, ++ gboolean will_quit); ++ ++/* Initiate a logout/reboot/shutdown */ ++gboolean egg_sm_client_end_session (EggSMClientEndStyle style, ++ gboolean request_confirmation); ++ ++G_END_DECLS ++ ++ ++#endif /* __EGG_SM_CLIENT_H__ */ +-- +cgit v0.9 diff --git a/xchat-gnome-0.26.1-kill-libgnomeui.patch b/xchat-gnome-0.26.1-kill-libgnomeui.patch new file mode 100644 index 0000000..c30778f --- /dev/null +++ b/xchat-gnome-0.26.1-kill-libgnomeui.patch @@ -0,0 +1,321 @@ +From 3b6b529fb1529ad3d88cbee74df8ceba4dfd4a66 Mon Sep 17 00:00:00 2001 +From: Florian Müllner +Date: Wed, 13 Jan 2010 10:43:27 +0000 +Subject: Bug 584887 - Get rid of deprecated libgnome(ui) + +Replacing libgnome(ui) with EggSMClient and plain Glib/GTK+ +With few minor edits, committed +--- +diff --git a/configure.ac b/configure.ac +index d2a0f56..c3bf020 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -24,14 +24,13 @@ IT_PROG_INTLTOOL([0.35.0]) + GLIB_REQUIRED=2.18.0 + GTK_REQUIRED=2.14.0 + LIBGLADE_REQUIRED=2.3.2 +-LIBGNOME_REQUIRED=2.16.0 +-LIBGNOMEUI_REQUIRED=2.16.0 + GCONF_REQUIRED=2.8.0 + DBUS_REQUIRED=0.60 + DBUS_GLIB_REQUIRED=0.60 + LIBSEXY_REQUIRED=0.1.11 + LIBNOTIFY_REQUIRED=0.3.2 + LIBCANBERRAGTK_REQUIRED=0.3 ++SM_REQUIRED=1.0.0 + + AC_PROG_CC + AM_PROG_CC_C_O +@@ -65,12 +64,18 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ + gio-2.0 >= $GLIB_REQUIRED \ + gtk+-2.0 >= $GTK_REQUIRED \ + libglade-2.0 >= $LIBGLADE_REQUIRED \ +- libgnome-2.0 >= $LIBGNOME_REQUIRED \ +- libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ + gconf-2.0 >= $GCONF_REQUIRED \ + libsexy >= $LIBSEXY_REQUIRED \ + ]) + ++#EggSMClient replacing GnomeClient in libgnome ++PKG_CHECK_MODULES([EGG_SMCLIENT], [\ ++ gtk+-2.0 >= $GTK_REQUIRED \ ++ sm >= $SM_REQUIRED \ ++ ]) ++AC_SUBST(EGG_SMCLIENT_CFLAGS) ++AC_SUBST(EGG_SMCLIENT_LIBS) ++ + #D-Bus + AC_MSG_CHECKING([whether D-Bus support is requested]) + AC_ARG_ENABLE([dbus], +@@ -482,6 +487,7 @@ src/common/dbus/Makefile + src/common/Makefile + src/fe-gnome/Makefile + src/libcontrast/Makefile ++src/libeggsmclient/Makefile + src/Makefile + ]) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 1e9465d..0e763f6 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1 +1 @@ +-SUBDIRS = common libcontrast fe-gnome ++SUBDIRS = common libcontrast libeggsmclient fe-gnome +diff --git a/src/fe-gnome/Makefile.am b/src/fe-gnome/Makefile.am +index 098e78d..8faab84 100644 +--- a/src/fe-gnome/Makefile.am ++++ b/src/fe-gnome/Makefile.am +@@ -98,7 +98,7 @@ xchat_gnome_CPPFLAGS = \ + -DTOPSRCDIR="\"$(top_srcdir)\"" \ + -DSYSCONFDIR="\"$(sysconfdir)\"" \ + -DICONDIR="\"$(pkgdatadir)/icons\"" \ +- -DDATADIR="\"$(pkgdatadir)\"" \ ++ -DDATADIR="\"$(datadir)\"" \ + -DXCHATSHAREDIR="\"$(pkgdatadir)\"" \ + -DLIBDIR="\"$(pkglibdir)\"" \ + -DPREFIX="\"$(prefix)\"" \ +@@ -119,6 +119,7 @@ xchat_gnome_LDFLAGS = \ + xchat_gnome_LDADD = \ + $(top_builddir)/src/common/libxchatcommon.la \ + $(top_builddir)/src/libcontrast/libcontrast.la \ ++ $(top_builddir)/src/libeggsmclient/libeggsmclient.la \ + $(DEPENDENCIES_LIBS) \ + $(OPENSSL_LIBS) \ + $(LIBSEXY_LIBS) +diff --git a/src/fe-gnome/fe-gnome.c b/src/fe-gnome/fe-gnome.c +index fd32bd9..29ea0c3 100644 +--- a/src/fe-gnome/fe-gnome.c ++++ b/src/fe-gnome/fe-gnome.c +@@ -22,9 +22,11 @@ + #include + #include + #include ++#include + #include +-#include + #include ++#include "../libeggsmclient/eggsmclient.h" ++#include "../libeggsmclient/eggdesktopfile.h" + #include "gui.h" + #include "navigation-tree.h" + #include "main-window.h" +@@ -54,6 +56,8 @@ + #include "../common/cfgfiles.h" + #include "../common/plugin.h" + ++#define GNOME_DOT_GNOME ".gnome2" ++ + static gboolean opt_version = FALSE; + static gboolean opt_noplugins = FALSE; + static gchar *opt_cfgdir = NULL; +@@ -72,17 +76,47 @@ static GOptionEntry entries[] = { + + static void setup_sm (gint argc, + gchar *argv[]); +-static gint save_session (GnomeClient *client, +- gint phase, +- GnomeSaveStyle save_style, +- gint is_shutdown, +- GnomeInteractStyle interact_style, +- gint is_fast, +- gpointer client_data); +-static void kill_session (GnomeClient *client, ++static void quit_session (EggSMClient *client, + gpointer client_data); + static gboolean not_autoconnect (void); + ++static gchar * ++get_accels_filename (void) ++{ ++ const char *home; ++ ++ home = g_get_home_dir(); ++ if (!home) ++ return NULL; ++ return g_build_filename (home, GNOME_DOT_GNOME, "accels", PACKAGE, NULL); ++} ++ ++static void ++load_accels (void) ++{ ++ char *filename; ++ ++ filename = get_accels_filename (); ++ if (!filename) ++ return; ++ ++ gtk_accel_map_load (filename); ++ g_free (filename); ++} ++ ++static void ++save_accels (void) ++{ ++ char *filename; ++ ++ filename = get_accels_filename (); ++ if (!filename) ++ return; ++ ++ gtk_accel_map_save (filename); ++ g_free (filename); ++} ++ + int + fe_args (int argc, char *argv[]) + { +@@ -96,34 +130,33 @@ fe_args (int argc, char *argv[]) + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + #endif +- + context = g_option_context_new (NULL); + + g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); +- gui.program = gnome_program_init (PACKAGE, VERSION, +- LIBGNOMEUI_MODULE, argc, argv, +- GNOME_PARAM_GOPTION_CONTEXT, context, +- GNOME_PARAM_HUMAN_READABLE_NAME, "IRC Chat", +- GNOME_PROGRAM_STANDARD_PROPERTIES, +- NULL); +- +- if (error) { +- fprintf (stderr, _("xchat-gnome: %s\nTry `xchat-gnome --help' for more information\n"), error->message); ++ g_option_context_add_group (context, gtk_get_option_group (FALSE)); ++ g_option_context_add_group (context, egg_sm_client_get_option_group ()); ++ ++ gtk_init (&argc, &argv); ++ ++ if (! g_option_context_parse (context, &argc, &argv, &error)) { ++ g_printerr (_("Failed to parse arguments: %s\n"), error->message); + g_error_free (error); ++ g_option_context_free (context); + return 0; + } + ++ g_option_context_free (context); ++ + if (opt_version) { + g_print ("xchat-gnome %s\n", PACKAGE_VERSION); + return 0; + } + +- g_set_application_name (_("IRC Chat")); +- + if (opt_cfgdir) { + xdir_fs = opt_cfgdir; + } + ++ load_accels (); + setup_sm (argc, argv); + + return -1; +@@ -186,8 +219,6 @@ fe_main (void) + { + gtk_main (); + +- g_object_unref (gui.program); +- + /* sleep for 3 seconds so any QUIT messages are not lost. The */ + /* GUI is closed at this point, so the user doesn't even know! */ + +@@ -202,7 +233,7 @@ fe_main (void) + void + fe_cleanup (void) + { +- gnome_accelerators_sync (); ++ save_accels (); + } + + void +@@ -1035,45 +1066,21 @@ void fe_get_file (const char *title, + static void + setup_sm (gint argc, gchar *argv[]) + { +- GnomeClient *client; +- const gchar *prefix; ++ EggSMClient *client; ++ gchar *desktop_file; + +- client = gnome_master_client (); ++ client = egg_sm_client_get (); ++ desktop_file = g_build_filename (DATADIR, "applications", "xchat-gnome.desktop", NULL); ++ egg_set_desktop_file (desktop_file); ++ g_free (desktop_file); + +- g_signal_connect (G_OBJECT (client), "save_yourself", G_CALLBACK (save_session), argv[0]); +- g_signal_connect (G_OBJECT (client), "die", G_CALLBACK (kill_session), NULL); ++ g_signal_connect (G_OBJECT (client), "quit", G_CALLBACK (quit_session), NULL); + +- prefix = gnome_client_get_config_prefix (client); + /* FIXME: add discard command to remove saved state */ + } + +-static gint +-save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style, +- gint is_shutdown, GnomeInteractStyle interact_style, +- gint is_fast, gpointer client_data) +-{ +- gchar **argv; +- gint argc; +- const gchar *prefix; +- +- argv = g_new0 (gchar *, 2); +- argv[0] = client_data; +- argc = 1; +- +- gnome_client_set_restart_style (client, GNOME_RESTART_IF_RUNNING); +- gnome_client_set_restart_command (client, argc, argv); +- gnome_client_set_clone_command (client, argc, argv); +- +- prefix = gnome_client_get_config_prefix (client); +- /* FIXME: save state */ +- +- g_free (argv); +- +- return TRUE; +-} +- + static void +-kill_session (GnomeClient* client, gpointer client_data) ++quit_session (EggSMClient* client, gpointer client_data) + { + gtk_widget_hide (GTK_WIDGET (gui.main_window)); + gtk_widget_hide (GTK_WIDGET (gui.dcc)); +diff --git a/src/fe-gnome/gui.h b/src/fe-gnome/gui.h +index 0af43f4..b27d8ff 100644 +--- a/src/fe-gnome/gui.h ++++ b/src/fe-gnome/gui.h +@@ -24,7 +24,6 @@ + + #include + #include +-#include + #include "userlist.h" + #include "navigation-tree.h" + #include "dcc-window.h" +@@ -60,8 +59,6 @@ typedef struct + + NavModel *tree_model; + NavTree *server_tree; +- +- GnomeProgram *program; + } XChatGUI; + + extern XChatGUI gui; +diff --git a/src/fe-gnome/util.c b/src/fe-gnome/util.c +index 75d1e0c..a7540c5 100644 +--- a/src/fe-gnome/util.c ++++ b/src/fe-gnome/util.c +@@ -139,7 +139,7 @@ locate_data_file (const gchar *file_name) + path = uninstalled_path; + } else { + g_free (uninstalled_path); +- path = gnome_program_locate_file (gnome_program_get (), GNOME_FILE_DOMAIN_APP_DATADIR, file_name, FALSE, NULL); ++ path = g_build_filename (XCHATSHAREDIR, file_name, NULL); + } + + g_return_val_if_fail (path != NULL, NULL); +-- +cgit v0.9 diff --git a/xchat-gnome-0.26.1-recent-network-manager.patch b/xchat-gnome-0.26.1-recent-network-manager.patch new file mode 100644 index 0000000..2d0f225 --- /dev/null +++ b/xchat-gnome-0.26.1-recent-network-manager.patch @@ -0,0 +1,149 @@ +diff -up xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c +--- xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm 2009-03-15 09:08:06.000000000 -0500 ++++ xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c 2011-03-25 18:10:33.621834647 -0500 +@@ -23,7 +23,6 @@ + */ + + #include +-#define DBUS_API_SUBJECT_TO_CHANGE + #include + #include + #include +@@ -54,13 +53,18 @@ typedef enum + + typedef enum + { +- NM_STATE_UNKNOWN = 0, +- NM_STATE_ASLEEP, +- NM_STATE_CONFIGURE_AP, +- NM_STATE_CONFIGURE_DEV, +- NM_STATE_CONFIGURE_IP, +- NM_STATE_CONNECTED, +- NM_STATE_DISCONNECTED, ++ NM_STATE_UNKNOWN = 0, ++ NM_OLD_STATE_ASLEEP = 1, ++ NM_OLD_STATE_CONNECTING = 4, ++ NM_OLD_STATE_CONNECTED = 5, ++ NM_OLD_STATE_DISCONNECTED = 6, ++ NM_STATE_ASLEEP = 10, ++ NM_STATE_DISCONNECTED = 20, ++ NM_STATE_DISCONNECTING = 30, ++ NM_STATE_CONNECTING = 40, ++ NM_STATE_CONNECTED_LOCAL = 50, ++ NM_STATE_CONNECTED_SITE = 60, ++ NM_STATE_CONNECTED_GLOBAL = 70 + } NetworkManagerState; + + enum { +@@ -180,50 +184,6 @@ set_network_mode (NetworkStatus status) + } + } + +-static NetworkStatus +-check_device_state (const char *path) +-{ +- DBusMessage *message, *reply; +- DBusMessageIter iter; +- DBusError error; +- NetworkStatus network_mode; +- +- message = dbus_message_new_method_call (NM_SERVICE, path, NM_INTERFACE, "getLinkActive"); +- if (message == NULL) { +- g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); +- /* just guess that we're up */ +- return NETWORK_UP; +- } +- +- dbus_error_init (&error); +- reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error); +- +- if (dbus_error_is_set (&error)) { +- g_warning ("Net Monitor: Error retrieving device state: %s: %s\n", error.name, error.message); +- network_mode = NETWORK_UP; +- } else { +- dbus_message_iter_init (reply, &iter); +- +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_BOOLEAN) { +- dbus_bool_t active; +- +- dbus_message_iter_get_basic (&iter, &active); +- network_mode = active ? NETWORK_UP : NETWORK_DOWN; +- } else { +- g_warning ("Net Monitor: got bad reply from NetworkManager\n"); +- network_mode = NETWORK_UP; +- } +- } +- +- if (reply) +- dbus_message_unref (reply); +- +- if (message) +- dbus_message_unref (message); +- +- return network_mode; +-} +- + static void + determine_network_status () + { +@@ -232,7 +192,7 @@ determine_network_status () + DBusError error; + NetworkStatus network_mode = NETWORK_DOWN; + +- message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "getDevices"); ++ message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "state"); + if (message == NULL) { + g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); + /* just guess that we're up */ +@@ -248,24 +208,15 @@ determine_network_status () + network_mode = NETWORK_UP; + } else { + dbus_message_iter_init (reply, &iter); +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY) { +- DBusMessageIter child; +- +- dbus_message_iter_recurse (&iter, &child); +- +- while (dbus_message_iter_get_arg_type (&child) != DBUS_TYPE_INVALID) { +- const char *path; +- gboolean state; +- +- /* Check the state of this individual device. If any one +- * device is active, the network is up */ +- dbus_message_iter_get_basic (&child, &path); +- state = check_device_state (path); +- if (state == NETWORK_UP) +- network_mode = NETWORK_UP; ++ if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_UINT32) { ++ dbus_uint32_t state; + +- dbus_message_iter_next (&child); +- } ++ dbus_message_iter_get_basic (&iter, &state); ++ if (state == NM_OLD_STATE_CONNECTED || ++ state == NM_STATE_CONNECTED_LOCAL || ++ state == NM_STATE_CONNECTED_SITE || ++ state == NM_STATE_CONNECTED_GLOBAL) ++ network_mode = NETWORK_UP; + } else { + g_warning ("Net Monitor: got bad reply from NetworkManager\n"); + network_mode = NETWORK_UP; +@@ -284,16 +235,12 @@ determine_network_status () + static DBusHandlerResult + filter_func (DBusConnection *connection, DBusMessage *message, void *data) + { +- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNoLongerActive")) { ++ if (dbus_message_is_signal (message, NM_INTERFACE, "StateChanged") || ++ dbus_message_is_signal (message, NM_INTERFACE, "StateChange")) { + determine_network_status (); + return DBUS_HANDLER_RESULT_HANDLED; + } + +- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNowActive")) { +- set_network_mode (NETWORK_UP); +- return DBUS_HANDLER_RESULT_HANDLED; +- } +- + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + diff --git a/xchat-gnome-0.26.1-remove-deprecated-api.patch b/xchat-gnome-0.26.1-remove-deprecated-api.patch new file mode 100644 index 0000000..1f4bc87 --- /dev/null +++ b/xchat-gnome-0.26.1-remove-deprecated-api.patch @@ -0,0 +1,400 @@ +From 23aa5dd1a3033c0badd750bedea8ba1b7a677a74 Mon Sep 17 00:00:00 2001 +From: Robert Ancell +Date: Mon, 17 Jan 2011 12:10:30 +0000 +Subject: Bug 637427 - [PATCH] Stop using deprecated GDK/GTK API + +removed a bit of deprecated apis, and minor indentation fixes +--- +diff --git a/src/fe-gnome/channel-list-window.c b/src/fe-gnome/channel-list-window.c +index e7e7c31..652f549 100644 +--- a/src/fe-gnome/channel-list-window.c ++++ b/src/fe-gnome/channel-list-window.c +@@ -497,7 +497,7 @@ channel_list_window_finalize (GObject *object) + g_source_remove (win->refresh_timeout); + } + chanlists = g_slist_remove (chanlists, (gpointer) win); +- gtk_widget_hide_all (win->window); ++ gtk_widget_hide (win->window); + + g_object_unref (win->xml); + G_OBJECT_CLASS (channel_list_window_parent_class)->finalize (object); +diff --git a/src/fe-gnome/connect-dialog.c b/src/fe-gnome/connect-dialog.c +index 35b90a6..22895e8 100644 +--- a/src/fe-gnome/connect-dialog.c ++++ b/src/fe-gnome/connect-dialog.c +@@ -159,7 +159,9 @@ connect_dialog_init (ConnectDialog *dialog) + gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->toplevel); ++#if !GTK_CHECK_VERSION (2, 23, 0) + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); ++#endif + + g_signal_connect (G_OBJECT (dialog->server_list), "row-activated", G_CALLBACK (row_activated), dialog); + +diff --git a/src/fe-gnome/conversation-panel.c b/src/fe-gnome/conversation-panel.c +index fb013c7..59e1bcd 100644 +--- a/src/fe-gnome/conversation-panel.c ++++ b/src/fe-gnome/conversation-panel.c +@@ -584,13 +584,23 @@ conversation_panel_set_background (ConversationPanel *panel) + pixbuf = gdk_pixbuf_new_from_file (filename, NULL); + if (pixbuf) { + gint width, height; ++#if GTK_CHECK_VERSION (2, 23, 0) ++ cairo_t *context; ++#endif + GdkPixmap *image; + + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + + image = gdk_pixmap_new (NULL, width, height, 24); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ context = gdk_cairo_create (GDK_DRAWABLE (image)); ++ gdk_cairo_set_source_pixbuf (context, pixbuf, 0, 0); ++ cairo_paint (context); ++ cairo_destroy (context); ++#else + gdk_draw_pixbuf (image, NULL, pixbuf, 0, 0, 0, 0, width, height, GDK_RGB_DITHER_NONE, 0, 0); ++#endif + + gtk_xtext_set_background (GTK_XTEXT (panel->priv->xtext), image, FALSE); + g_object_unref (pixbuf); +diff --git a/src/fe-gnome/irc-network-editor.c b/src/fe-gnome/irc-network-editor.c +index 0f424d0..4fa132b 100644 +--- a/src/fe-gnome/irc-network-editor.c ++++ b/src/fe-gnome/irc-network-editor.c +@@ -322,13 +322,22 @@ irc_network_editor_init (IrcNetworkEditor *dialog) + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (dialog->autojoin_channels), 1, _("Key"), dialog->autojoin_key_renderer, "text", 1, NULL); + g_object_set (G_OBJECT (dialog->autojoin_key_renderer), "editable", TRUE, NULL); + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ dialog->encoding = gtk_combo_box_text_new (); ++#else + dialog->encoding = gtk_combo_box_new_text (); ++#endif ++ + gtk_widget_show (dialog->encoding); + gtk_table_attach_defaults (GTK_TABLE (dialog->network_settings_table), dialog->encoding, 1, 2, 5, 6); + + enc = (gchar **) encodings; + do { ++#if GTK_CHECK_VERSION (2, 23, 0) ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dialog->encoding), _(*enc)); ++#else + gtk_combo_box_append_text (GTK_COMBO_BOX (dialog->encoding), _(*enc)); ++#endif + enc++; + } while (*enc); + +diff --git a/src/fe-gnome/preferences-page-colors.c b/src/fe-gnome/preferences-page-colors.c +index 51afb4f..33186c9 100644 +--- a/src/fe-gnome/preferences-page-colors.c ++++ b/src/fe-gnome/preferences-page-colors.c +@@ -255,10 +255,18 @@ preferences_page_colors_new (gpointer prefs_dialog, GtkBuilder *xml) + gtk_list_store_set (p->page_store, &iter, 0, PREFERENCES_PAGE (page)->icon, 1, _("Colors"), 2, 1, -1); + + page->combo = gtk_combo_box_new_text (); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ page->combo = gtk_combo_box_text_new (); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("Black on White")); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("White on Black")); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("Custom")); ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("System Theme Colors")); ++#else + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("Black on White")); + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("White on Black")); + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("Custom")); + gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("System Theme Colors")); ++#endif + gtk_widget_show (page->combo); + gtk_label_set_mnemonic_widget (GTK_LABEL (page->color_label_1), page->combo); + gtk_box_pack_start (GTK_BOX (page->foreground_background_hbox), page->combo, FALSE, TRUE, 0); +diff --git a/src/fe-gnome/text-entry.c b/src/fe-gnome/text-entry.c +index 24c192b..ad24c6c 100644 +--- a/src/fe-gnome/text-entry.c ++++ b/src/fe-gnome/text-entry.c +@@ -624,19 +624,35 @@ get_color_icon (int c, GtkStyle *style) + { + GtkWidget *image; + GdkPixmap *pixmap; ++#if GTK_CHECK_VERSION (2, 23, 0) ++ cairo_t *context; ++#else + GdkGC *color; ++#endif + + pixmap = gdk_pixmap_new (NULL, 16, 16, 24); + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ context = gdk_cairo_create (GDK_DRAWABLE (pixmap)); ++ gdk_cairo_set_source_color (context, &style->dark[GTK_STATE_NORMAL]); ++ cairo_rectangle (context, 0, 0, 16, 16); ++ cairo_fill (context); ++ gdk_cairo_set_source_color (context, &colors[c]); ++ cairo_rectangle (context, 1, 1, 14, 14); ++ cairo_fill (context); ++ cairo_destroy (context); ++#else + color = gdk_gc_new (GDK_DRAWABLE (pixmap)); + gdk_gc_set_foreground (color, &style->dark[GTK_STATE_NORMAL]); + gdk_draw_rectangle (GDK_DRAWABLE (pixmap), color, TRUE, 0, 0, 16, 16); + gdk_gc_set_foreground (color, &colors[c]); + gdk_draw_rectangle (GDK_DRAWABLE (pixmap), color, TRUE, 1, 1, 14, 14); + g_object_unref (color); ++#endif + + image = gtk_image_new_from_pixmap (pixmap, NULL); + g_object_unref (pixmap); ++ + return image; + } + +diff --git a/src/fe-gnome/userlist-gui.c b/src/fe-gnome/userlist-gui.c +index c6671df..3e1dd66 100644 +--- a/src/fe-gnome/userlist-gui.c ++++ b/src/fe-gnome/userlist-gui.c +@@ -402,7 +402,12 @@ userlist_button_release (GtkWidget *widget, GdkEventButton *button, gpointer dat + gint x, y, width, height; + + gdk_window_get_root_origin (gui.userlist_window->window, &x, &y); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (gui.userlist_window->window); ++ height = gdk_window_get_height (gui.userlist_window->window); ++#else + gdk_drawable_get_size (gui.userlist_window->window, &width, &height); ++#endif + + /* If the event happened on top of the userlist window, we don't want to + * close it */ +diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c +index a7e2caf..06b00c5 100644 +--- a/src/fe-gnome/xtext.c ++++ b/src/fe-gnome/xtext.c +@@ -978,28 +978,28 @@ gtk_xtext_realize (GtkWidget * widget) + attributes.visual = gtk_widget_get_visual (widget); + + widget->window = gdk_window_new (widget->parent->window, &attributes, +- GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | +- GDK_WA_COLORMAP); ++ GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | ++ GDK_WA_COLORMAP); + + gdk_window_set_user_data (widget->window, widget); + +- xtext->depth = gdk_drawable_get_visual (widget->window)->depth; ++ xtext->depth = gdk_drawable_get_depth (widget->window); + + val.subwindow_mode = GDK_INCLUDE_INFERIORS; + val.graphics_exposures = 0; + + xtext->bgc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->fgc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->light_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->dark_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->thin_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + xtext->marker_gc = gdk_gc_new_with_values (widget->window, &val, +- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); ++ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); + + /* for the separator bar (light) */ + col.red = 0xffff; col.green = 0xffff; col.blue = 0xffff; +@@ -1041,9 +1041,9 @@ gtk_xtext_realize (GtkWidget * widget) + gdk_gc_set_fill (xtext->bgc, GDK_TILED); + } + +-#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) +- xtext->hand_cursor = gdk_cursor_new (GDK_HAND1); +- xtext->resize_cursor = gdk_cursor_new (GDK_LEFT_SIDE); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ xtext->hand_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_HAND1); ++ xtext->resize_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_LEFT_SIDE); + #else + xtext->hand_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_HAND1); + xtext->resize_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_LEFT_SIDE); +@@ -1718,7 +1718,11 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext) + int p_y, win_height; + + gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ win_height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height); ++#endif + + if (p_y > win_height && + xtext->adj->value < (xtext->adj->upper - xtext->adj->page_size)) +@@ -1758,7 +1762,11 @@ gtk_xtext_selection_update (GtkXText * xtext, GdkEventMotion * event, int p_y, g + int win_height; + int moved; + ++#if GTK_CHECK_VERSION (2, 16, 0) ++ win_height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height); ++#endif + + /* selecting past top of window, scroll up! */ + if (p_y < 0 && xtext->adj->value >= 0) +@@ -2372,8 +2380,8 @@ gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret) + + static void + gtk_xtext_selection_get (GtkWidget * widget, +- GtkSelectionData * selection_data_ptr, +- guint info, guint time) ++ GtkSelectionData * selection_data_ptr, ++ guint info, guint time) + { + GtkXText *xtext = GTK_XTEXT (widget); + char *stripped; +@@ -2398,16 +2406,16 @@ gtk_xtext_selection_get (GtkWidget * widget, + gint format; + gint new_length; + +-#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) +- gdk_string_to_compound_text ( ++ gdk_string_to_compound_text_for_display ( ++#if GTK_CHECK_VERSION (2, 23, 0) ++ gdk_window_get_display (widget->window), + #else +- gdk_string_to_compound_text_for_display ( +- gdk_drawable_get_display (widget->window), ++ gdk_drawable_get_display (widget->window), + #endif +- stripped, &encoding, &format, &new_text, +- &new_length); ++ stripped, &encoding, &format, &new_text, ++ &new_length); + gtk_selection_data_set (selection_data_ptr, encoding, format, +- new_text, new_length); ++ new_text, new_length); + gdk_free_compound_text (new_text); + } + break; +@@ -3750,7 +3758,13 @@ gtk_xtext_load_trans (GtkXText * xtext) + if (xtext->shaded) + { + int width, height; ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif ++ + xtext->pixmap = shade_pixmap (xtext, rootpix, x, y, width+105, height); + if (xtext->pixmap == NULL) + { +@@ -3763,8 +3777,8 @@ gtk_xtext_load_trans (GtkXText * xtext) + } else + { + noshade: +-#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) +- xtext->pixmap = gdk_pixmap_foreign_new (rootpix); ++#if GTK_CHECK_VERSION (2, 23, 0) ++ xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_window_get_display (GTK_WIDGET (xtext)->window), rootpix); + #else + xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_drawable_get_display (GTK_WIDGET (xtext)->window), rootpix); + #endif +@@ -3910,7 +3924,11 @@ gtk_xtext_find_subline (GtkXText *xtext, textentry *ent, int line) + if (line <= RECORD_WRAPS) + return ent->wrap_offset[line - 1]; + ++#if GTK_CHECK_VERSION (2, 16, 0) ++ win_width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &win_width, 0); ++#endif + win_width -= MARGIN; + + /* indent = ent->indent; +@@ -4329,7 +4347,12 @@ gtk_xtext_calc_lines (xtext_buffer *buf, int fire_signal) + int height; + int lines; + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (buf->xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (buf->xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (buf->xtext)->window, &width, &height); ++#endif + width -= MARGIN; + + if (width < 30 || height < buf->xtext->fontsize || width < buf->indent + 30) +@@ -4424,7 +4447,12 @@ gtk_xtext_render_ents (GtkXText * xtext, textentry * enta, textentry * entb) + if (xtext->buffer->indent < MARGIN) + xtext->buffer->indent = MARGIN; /* 2 pixels is our left margin */ + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif + width -= MARGIN; + + if (width < 32 || height < xtext->fontsize || width < xtext->buffer->indent + 30) +@@ -4511,7 +4539,12 @@ gtk_xtext_render_page (GtkXText * xtext) + if (xtext->buffer->indent < MARGIN) + xtext->buffer->indent = MARGIN; /* 2 pixels is our left margin */ + ++#if GTK_CHECK_VERSION (2, 23, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif + + if (width < 34 || height < xtext->fontsize || width < xtext->buffer->indent + 32) + return; +@@ -4563,8 +4596,11 @@ gtk_xtext_render_page (GtkXText * xtext) + #endif + #endif + { ++ ++#if !GTK_CHECK_VERSION (2, 13, 0) + /* so the obscured regions are exposed */ + gdk_gc_set_exposures (xtext->fgc, TRUE); ++#endif + if (overlap < 1) /* DOWN */ + { + int remainder; +@@ -4719,7 +4755,12 @@ gtk_xtext_check_ent_visibility (GtkXText * xtext, textentry *find_ent, int add) + int width; + int height; + ++#if GTK_CHECK_VERSION (2, 16, 0) ++ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); ++#endif + + lines_max = ((height + xtext->pixel_offset) / xtext->fontsize) + add; + ent = xtext->buffer->pagetop_ent; +@@ -5191,8 +5232,12 @@ gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render) + + if (!gtk_widget_get_realized (GTK_WIDGET (xtext))) + gtk_widget_realize (GTK_WIDGET (xtext)); +- ++#if GTK_CHECK_VERSION (2, 23, 0) ++ w = gdk_window_get_width (GTK_WIDGET (xtext)->window); ++ h = gdk_window_get_height (GTK_WIDGET (xtext)->window); ++#else + gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &w, &h); ++#endif + + /* after a font change */ + if (buf->needs_recalc) +-- +cgit v0.9 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 8cd2601..7397ee7 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,6 +1,6 @@ Name: xchat-gnome Version: 0.26.1 -Release: 16%{?dist} +Release: 17%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -27,6 +27,13 @@ Patch7: 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch Patch8: xchat-gnome-0.26.1-deprecated-symbol.patch # Patch for libnotify 0.70 (just drop one parameter from one function) Patch9: xchat-gnome-0.26.1-libnotify.patch +# Patch to work with recent NetworkManager (0.7+) +Patch10: xchat-gnome-0.26.1-recent-network-manager.patch +# Kill libgnomeui +Patch11: xchat-gnome-0.26.1-add-libeggsmclient.patch +Patch12: xchat-gnome-0.26.1-kill-libgnomeui.patch +# Convert deprecated GDK functions to cairo +Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -77,9 +84,14 @@ common settings will be included in the main user interface. . %patch7 -p1 -b .dcc %patch8 -p1 -b .symbol %patch9 -p1 -b .notify +%patch10 -p1 -b .recent-nm +%patch11 -p1 -b .add-libegg +%patch12 -p1 -b .kill-libgnomeui +%patch13 -p1 -b .gdk-deprecations %build +autoreconf -i %configure --disable-tcl \ --disable-scrollkeeper \ --disable-schemas-install \ @@ -142,6 +154,10 @@ fi %changelog +* Fri Mar 25 2011 Dan Williams - 0.26.1-17 +- Update for NetworkManager 0.9 +- Update for recent GTK/GNOME API changes + * Mon Feb 07 2011 Fedora Release Engineering - 0.26.1-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From f684297617e4c691bcfac1a6df8cc4224c99560c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 31 Mar 2011 14:50:54 -0500 Subject: [PATCH 062/105] Update changelog --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 33cc0a1..7397ee7 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -156,6 +156,7 @@ fi %changelog * Fri Mar 25 2011 Dan Williams - 0.26.1-17 - Update for NetworkManager 0.9 +- Update for recent GTK/GNOME API changes * Mon Feb 07 2011 Fedora Release Engineering - 0.26.1-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From 94a56c1b84c62b6a56d8717e034b69a0ed50b41c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 31 Mar 2011 15:26:03 -0500 Subject: [PATCH 063/105] Add missing BuildRequires --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 7397ee7..5891181 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -54,6 +54,7 @@ BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils BuildRequires: GConf2 +BuildRequires: libtool autoconf automake Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) From 30280d981e6f7022aa01806453ad77df5cfd506d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 31 Mar 2011 15:34:49 -0500 Subject: [PATCH 064/105] One more missing buildreq --- xchat-gnome.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 5891181..ca04beb 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -54,7 +54,7 @@ BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils BuildRequires: GConf2 -BuildRequires: libtool autoconf automake +BuildRequires: libtool autoconf automake gnome-common Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) From eca1332ff5b9d412c218bde2aa741d69f142911c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 31 Mar 2011 15:45:13 -0500 Subject: [PATCH 065/105] Update BuildRequires --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 7397ee7..ca04beb 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -54,6 +54,7 @@ BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils BuildRequires: GConf2 +BuildRequires: libtool autoconf automake gnome-common Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) From 076b08e8dcb743a61881e203bf53cdd78d859e00 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 15:42:29 -0400 Subject: [PATCH 066/105] Update to 0.26.2, as tagged in upstream git. --- xchat-gnome-nm09.patch | 149 +++++++++++++++++++++++++++++++++++++++++ xchat-gnome.spec | 49 +++++--------- 2 files changed, 167 insertions(+), 31 deletions(-) create mode 100644 xchat-gnome-nm09.patch diff --git a/xchat-gnome-nm09.patch b/xchat-gnome-nm09.patch new file mode 100644 index 0000000..2d0f225 --- /dev/null +++ b/xchat-gnome-nm09.patch @@ -0,0 +1,149 @@ +diff -up xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c +--- xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm 2009-03-15 09:08:06.000000000 -0500 ++++ xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c 2011-03-25 18:10:33.621834647 -0500 +@@ -23,7 +23,6 @@ + */ + + #include +-#define DBUS_API_SUBJECT_TO_CHANGE + #include + #include + #include +@@ -54,13 +53,18 @@ typedef enum + + typedef enum + { +- NM_STATE_UNKNOWN = 0, +- NM_STATE_ASLEEP, +- NM_STATE_CONFIGURE_AP, +- NM_STATE_CONFIGURE_DEV, +- NM_STATE_CONFIGURE_IP, +- NM_STATE_CONNECTED, +- NM_STATE_DISCONNECTED, ++ NM_STATE_UNKNOWN = 0, ++ NM_OLD_STATE_ASLEEP = 1, ++ NM_OLD_STATE_CONNECTING = 4, ++ NM_OLD_STATE_CONNECTED = 5, ++ NM_OLD_STATE_DISCONNECTED = 6, ++ NM_STATE_ASLEEP = 10, ++ NM_STATE_DISCONNECTED = 20, ++ NM_STATE_DISCONNECTING = 30, ++ NM_STATE_CONNECTING = 40, ++ NM_STATE_CONNECTED_LOCAL = 50, ++ NM_STATE_CONNECTED_SITE = 60, ++ NM_STATE_CONNECTED_GLOBAL = 70 + } NetworkManagerState; + + enum { +@@ -180,50 +184,6 @@ set_network_mode (NetworkStatus status) + } + } + +-static NetworkStatus +-check_device_state (const char *path) +-{ +- DBusMessage *message, *reply; +- DBusMessageIter iter; +- DBusError error; +- NetworkStatus network_mode; +- +- message = dbus_message_new_method_call (NM_SERVICE, path, NM_INTERFACE, "getLinkActive"); +- if (message == NULL) { +- g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); +- /* just guess that we're up */ +- return NETWORK_UP; +- } +- +- dbus_error_init (&error); +- reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error); +- +- if (dbus_error_is_set (&error)) { +- g_warning ("Net Monitor: Error retrieving device state: %s: %s\n", error.name, error.message); +- network_mode = NETWORK_UP; +- } else { +- dbus_message_iter_init (reply, &iter); +- +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_BOOLEAN) { +- dbus_bool_t active; +- +- dbus_message_iter_get_basic (&iter, &active); +- network_mode = active ? NETWORK_UP : NETWORK_DOWN; +- } else { +- g_warning ("Net Monitor: got bad reply from NetworkManager\n"); +- network_mode = NETWORK_UP; +- } +- } +- +- if (reply) +- dbus_message_unref (reply); +- +- if (message) +- dbus_message_unref (message); +- +- return network_mode; +-} +- + static void + determine_network_status () + { +@@ -232,7 +192,7 @@ determine_network_status () + DBusError error; + NetworkStatus network_mode = NETWORK_DOWN; + +- message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "getDevices"); ++ message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "state"); + if (message == NULL) { + g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); + /* just guess that we're up */ +@@ -248,24 +208,15 @@ determine_network_status () + network_mode = NETWORK_UP; + } else { + dbus_message_iter_init (reply, &iter); +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY) { +- DBusMessageIter child; +- +- dbus_message_iter_recurse (&iter, &child); +- +- while (dbus_message_iter_get_arg_type (&child) != DBUS_TYPE_INVALID) { +- const char *path; +- gboolean state; +- +- /* Check the state of this individual device. If any one +- * device is active, the network is up */ +- dbus_message_iter_get_basic (&child, &path); +- state = check_device_state (path); +- if (state == NETWORK_UP) +- network_mode = NETWORK_UP; ++ if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_UINT32) { ++ dbus_uint32_t state; + +- dbus_message_iter_next (&child); +- } ++ dbus_message_iter_get_basic (&iter, &state); ++ if (state == NM_OLD_STATE_CONNECTED || ++ state == NM_STATE_CONNECTED_LOCAL || ++ state == NM_STATE_CONNECTED_SITE || ++ state == NM_STATE_CONNECTED_GLOBAL) ++ network_mode = NETWORK_UP; + } else { + g_warning ("Net Monitor: got bad reply from NetworkManager\n"); + network_mode = NETWORK_UP; +@@ -284,16 +235,12 @@ determine_network_status () + static DBusHandlerResult + filter_func (DBusConnection *connection, DBusMessage *message, void *data) + { +- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNoLongerActive")) { ++ if (dbus_message_is_signal (message, NM_INTERFACE, "StateChanged") || ++ dbus_message_is_signal (message, NM_INTERFACE, "StateChange")) { + determine_network_status (); + return DBUS_HANDLER_RESULT_HANDLED; + } + +- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNowActive")) { +- set_network_mode (NETWORK_UP); +- return DBUS_HANDLER_RESULT_HANDLED; +- } +- + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index ca04beb..be58e3c 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -1,32 +1,23 @@ +%global gitrev 40c5bf988 + Name: xchat-gnome -Version: 0.26.1 -Release: 17%{?dist} +Version: 0.26.2 +Release: 0.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet License: GPLv2+ -URL: http://%{name}.navi.cx/ -Source0: http://ftp.acc.umu.se/pub/gnome/sources/%{name}/0.26/%{name}-%{version}.tar.bz2 +URL: http://live.gnome.org/Xchat-Gnome +# Generated from git, tarball wasn't released. +# To generate: +# git clone git://git.gnome.org/xchat-gnome +# git archive --format=tar --prefix=xchat-gnome-0.26.2/ XCHAT_GNOME_0_26_2 > xchat-gnome-0.26.2-%{gitrev}.ta +# bzip2 xchat-gnome-0.26.2-%{gitrev}.tar +Source0: http://ftp.gnome.org/pub/gnome/sources/%{name}/0.26/%{name}-%{version}-%{gitrev}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 Patch0: %{name}-0.23.92-config.patch -# Patch to fix pressing "enter" in the middle of editing channel topic. -# RH Bug #483839 -Patch1: xchat-topic-update.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=550662 -Patch2: %{name}-crasher.patch -# http://git.gnome.org/browse/xchat-gnome/commit/?id=ac131cab5e5429525aed592b504bae9d6ee92069 -Patch3: status_fix.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=564820 -Patch4: %{name}-DSOLink.patch -# https://bugzilla.gnome.org/show_bug.cgi?id=608515 -Patch5: 0001-Added-port-numbers-for-Freenode.patch -Patch6: xg-depreciated-macros.patch -# https://bugzilla.gnome.org/599781 -Patch7: 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch -# FTBFS, upstream commit 8d35b36baa8204b68c9520ec92327e34c1d7c580 -Patch8: xchat-gnome-0.26.1-deprecated-symbol.patch # Patch for libnotify 0.70 (just drop one parameter from one function) -Patch9: xchat-gnome-0.26.1-libnotify.patch +Patch1: xchat-gnome-0.26.1-libnotify.patch # Patch to work with recent NetworkManager (0.7+) Patch10: xchat-gnome-0.26.1-recent-network-manager.patch # Kill libgnomeui @@ -76,15 +67,7 @@ common settings will be included in the main user interface. . %prep %setup -q -n %{name}-%{version} %patch0 -p1 -b .config -%patch1 -p1 -b .topic -%patch2 -p1 -b .crasher -%patch3 -p1 -b .status -%patch4 -p1 -b .dsolink -%patch5 -p1 -b .freenode -%patch6 -p1 -b .macros -%patch7 -p1 -b .dcc -%patch8 -p1 -b .symbol -%patch9 -p1 -b .notify +%patch1 -p1 -b .notify %patch10 -p1 -b .recent-nm %patch11 -p1 -b .add-libegg %patch12 -p1 -b .kill-libgnomeui @@ -92,10 +75,11 @@ common settings will be included in the main user interface. . %build -autoreconf -i +./autogen.sh %configure --disable-tcl \ --disable-scrollkeeper \ --disable-schemas-install \ + --disable-maintainer-mode \ --disable-static make %{?_smp_mflags} @@ -155,6 +139,9 @@ fi %changelog +* Thu Apr 07 2011 Bill Nottingham - 0.26.2-1 +- update to 0.26.2 + * Fri Mar 25 2011 Dan Williams - 0.26.1-17 - Update for NetworkManager 0.9 - Update for recent GTK/GNOME API changes From 19509473d0f528282cef9e8444d243359cb03b5a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 16:07:00 -0400 Subject: [PATCH 067/105] Remove accidentally-added patch. --- xchat-gnome-nm09.patch | 149 ----------------------------------------- 1 file changed, 149 deletions(-) delete mode 100644 xchat-gnome-nm09.patch diff --git a/xchat-gnome-nm09.patch b/xchat-gnome-nm09.patch deleted file mode 100644 index 2d0f225..0000000 --- a/xchat-gnome-nm09.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -up xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c ---- xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm 2009-03-15 09:08:06.000000000 -0500 -+++ xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c 2011-03-25 18:10:33.621834647 -0500 -@@ -23,7 +23,6 @@ - */ - - #include --#define DBUS_API_SUBJECT_TO_CHANGE - #include - #include - #include -@@ -54,13 +53,18 @@ typedef enum - - typedef enum - { -- NM_STATE_UNKNOWN = 0, -- NM_STATE_ASLEEP, -- NM_STATE_CONFIGURE_AP, -- NM_STATE_CONFIGURE_DEV, -- NM_STATE_CONFIGURE_IP, -- NM_STATE_CONNECTED, -- NM_STATE_DISCONNECTED, -+ NM_STATE_UNKNOWN = 0, -+ NM_OLD_STATE_ASLEEP = 1, -+ NM_OLD_STATE_CONNECTING = 4, -+ NM_OLD_STATE_CONNECTED = 5, -+ NM_OLD_STATE_DISCONNECTED = 6, -+ NM_STATE_ASLEEP = 10, -+ NM_STATE_DISCONNECTED = 20, -+ NM_STATE_DISCONNECTING = 30, -+ NM_STATE_CONNECTING = 40, -+ NM_STATE_CONNECTED_LOCAL = 50, -+ NM_STATE_CONNECTED_SITE = 60, -+ NM_STATE_CONNECTED_GLOBAL = 70 - } NetworkManagerState; - - enum { -@@ -180,50 +184,6 @@ set_network_mode (NetworkStatus status) - } - } - --static NetworkStatus --check_device_state (const char *path) --{ -- DBusMessage *message, *reply; -- DBusMessageIter iter; -- DBusError error; -- NetworkStatus network_mode; -- -- message = dbus_message_new_method_call (NM_SERVICE, path, NM_INTERFACE, "getLinkActive"); -- if (message == NULL) { -- g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); -- /* just guess that we're up */ -- return NETWORK_UP; -- } -- -- dbus_error_init (&error); -- reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error); -- -- if (dbus_error_is_set (&error)) { -- g_warning ("Net Monitor: Error retrieving device state: %s: %s\n", error.name, error.message); -- network_mode = NETWORK_UP; -- } else { -- dbus_message_iter_init (reply, &iter); -- -- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_BOOLEAN) { -- dbus_bool_t active; -- -- dbus_message_iter_get_basic (&iter, &active); -- network_mode = active ? NETWORK_UP : NETWORK_DOWN; -- } else { -- g_warning ("Net Monitor: got bad reply from NetworkManager\n"); -- network_mode = NETWORK_UP; -- } -- } -- -- if (reply) -- dbus_message_unref (reply); -- -- if (message) -- dbus_message_unref (message); -- -- return network_mode; --} -- - static void - determine_network_status () - { -@@ -232,7 +192,7 @@ determine_network_status () - DBusError error; - NetworkStatus network_mode = NETWORK_DOWN; - -- message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "getDevices"); -+ message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "state"); - if (message == NULL) { - g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); - /* just guess that we're up */ -@@ -248,24 +208,15 @@ determine_network_status () - network_mode = NETWORK_UP; - } else { - dbus_message_iter_init (reply, &iter); -- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY) { -- DBusMessageIter child; -- -- dbus_message_iter_recurse (&iter, &child); -- -- while (dbus_message_iter_get_arg_type (&child) != DBUS_TYPE_INVALID) { -- const char *path; -- gboolean state; -- -- /* Check the state of this individual device. If any one -- * device is active, the network is up */ -- dbus_message_iter_get_basic (&child, &path); -- state = check_device_state (path); -- if (state == NETWORK_UP) -- network_mode = NETWORK_UP; -+ if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_UINT32) { -+ dbus_uint32_t state; - -- dbus_message_iter_next (&child); -- } -+ dbus_message_iter_get_basic (&iter, &state); -+ if (state == NM_OLD_STATE_CONNECTED || -+ state == NM_STATE_CONNECTED_LOCAL || -+ state == NM_STATE_CONNECTED_SITE || -+ state == NM_STATE_CONNECTED_GLOBAL) -+ network_mode = NETWORK_UP; - } else { - g_warning ("Net Monitor: got bad reply from NetworkManager\n"); - network_mode = NETWORK_UP; -@@ -284,16 +235,12 @@ determine_network_status () - static DBusHandlerResult - filter_func (DBusConnection *connection, DBusMessage *message, void *data) - { -- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNoLongerActive")) { -+ if (dbus_message_is_signal (message, NM_INTERFACE, "StateChanged") || -+ dbus_message_is_signal (message, NM_INTERFACE, "StateChange")) { - determine_network_status (); - return DBUS_HANDLER_RESULT_HANDLED; - } - -- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNowActive")) { -- set_network_mode (NETWORK_UP); -- return DBUS_HANDLER_RESULT_HANDLED; -- } -- - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - From ec413d1292789b1ea1cdc1ddb8a36a9c48ea354a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 15:44:11 -0400 Subject: [PATCH 068/105] Remove obsolete patches. --- 0001-Added-port-numbers-for-Freenode.patch | 35 ----- ...ansfer-timeouts-when-dcc_auto_send-2.patch | 37 ----- status_fix.patch | 22 --- xchat-gnome-0.26.1-deprecated-symbol.patch | 22 --- xchat-gnome-DSOLink.patch | 44 ------ xchat-gnome-crasher.patch | 103 ------------- xchat-gnome.spec | 2 +- xchat-topic-update.patch | 20 --- xg-depreciated-macros.patch | 137 ------------------ 9 files changed, 1 insertion(+), 421 deletions(-) delete mode 100644 0001-Added-port-numbers-for-Freenode.patch delete mode 100644 0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch delete mode 100644 status_fix.patch delete mode 100644 xchat-gnome-0.26.1-deprecated-symbol.patch delete mode 100644 xchat-gnome-DSOLink.patch delete mode 100644 xchat-gnome-crasher.patch delete mode 100644 xchat-topic-update.patch delete mode 100644 xg-depreciated-macros.patch diff --git a/0001-Added-port-numbers-for-Freenode.patch b/0001-Added-port-numbers-for-Freenode.patch deleted file mode 100644 index 3e336fd..0000000 --- a/0001-Added-port-numbers-for-Freenode.patch +++ /dev/null @@ -1,35 +0,0 @@ -From bc98c28e891408145bed2b18d3c02adbadadde31 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Sat, 30 Jan 2010 13:05:21 +0200 -Subject: [PATCH] Added port numbers for Freenode - -http://freenode.net/irc_servers.shtml ---- - src/common/servlist.c | 11 ++++++++++- - 1 files changed, 10 insertions(+), 1 deletions(-) - -diff --git a/src/common/servlist.c b/src/common/servlist.c -index c6839e0..3082966 100644 ---- a/src/common/servlist.c -+++ b/src/common/servlist.c -@@ -207,7 +207,16 @@ static const struct defaultserver def[] = - {0, "irc.vendetta.com"}, - - {"FreeNode", 0}, -- {0, "irc.freenode.net"}, -+ {0, "irc.freenode.net/6665"}, -+ {0, "irc.freenode.net/6666"}, -+ {0, "irc.freenode.net/6667"}, -+ {0, "irc.freenode.net/8000"}, -+ {0, "irc.freenode.net/8001"}, -+ {0, "irc.freenode.net/8002"}, -+#ifdef USE_OPENSSL -+ {0, "irc.freenode.net/+7000"}, -+ {0, "irc.freenode.net/+7070"}, -+#endif - - /* {"Freeworld", 0}, - {0, "kabel.freeworld.nu"}, --- -1.6.6 - diff --git a/0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch b/0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch deleted file mode 100644 index 2124709..0000000 --- a/0001-Fix-DCC-transfer-timeouts-when-dcc_auto_send-2.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 48af97ebe635389c8f176cc2ea5f9151474ca3eb Mon Sep 17 00:00:00 2001 -From: Adam Buchbinder -Date: Tue, 27 Oct 2009 11:04:00 -0400 -Subject: [PATCH] Fix DCC transfer timeouts when dcc_auto_send == 2. - -The default in xchat2 is to set dcc_auto_send to 2, which means -"browse for a download directory". However, xchat-gnome only uses -the values 0 and 1, and when the default is provided (inherited -from xchat2), the transfer simply waits for a confirmation popup -which never appears. - -The fix here is to make the default act the same as "0"; the user -will be prompted as to whether or not they want to save the file. - -This closes bug 599781. - -Signed-off-by: Adam Buchbinder ---- - src/fe-gnome/dcc-window.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/fe-gnome/dcc-window.c b/src/fe-gnome/dcc-window.c -index 463a974..92f2026 100644 ---- a/src/fe-gnome/dcc-window.c -+++ b/src/fe-gnome/dcc-window.c -@@ -207,7 +207,7 @@ dcc_window_add (DccWindow *window, struct DCC *dcc) - - /* If this is a recieve and auto-accept isn't turned on, pop up a - * confirmation dialog */ -- if ((dcc->type == TYPE_RECV) && (dcc->dccstat == STAT_QUEUED) && (prefs.autodccsend == FALSE)) { -+ if ((dcc->type == TYPE_RECV) && (dcc->dccstat == STAT_QUEUED) && (prefs.autodccsend != 1)) { - GtkWidget *dialog; - gint response; - --- -1.6.0.4 - diff --git a/status_fix.patch b/status_fix.patch deleted file mode 100644 index 270f20b..0000000 --- a/status_fix.patch +++ /dev/null @@ -1,22 +0,0 @@ -From ac131cab5e5429525aed592b504bae9d6ee92069 Mon Sep 17 00:00:00 2001 -From: Ritesh Khadgaray -Date: Fri, 15 Jan 2010 07:37:40 +0000 -Subject: Bug 592491 - xchat-gnome crashed with SIGSEGV in handle_command( - -fixed a regression. Was unable to set status "back". ---- -diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c -index a47f710..cc13892 100644 ---- a/src/common/proto-irc.c -+++ b/src/common/proto-irc.c -@@ -114,7 +114,7 @@ irc_quit (server *serv, char *reason) - static void - irc_set_back (server *serv) - { -- tcp_send_len (serv, "BACK\r\n", 6); -+ tcp_send_len (serv, "AWAY\r\n", 6); - } - - static void --- -cgit v0.8.3.1 diff --git a/xchat-gnome-0.26.1-deprecated-symbol.patch b/xchat-gnome-0.26.1-deprecated-symbol.patch deleted file mode 100644 index 5bf1e4e..0000000 --- a/xchat-gnome-0.26.1-deprecated-symbol.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 8d35b36baa8204b68c9520ec92327e34c1d7c580 Mon Sep 17 00:00:00 2001 -From: Ritesh Khadgaray -Date: Sun, 04 Jul 2010 09:52:07 +0000 -Subject: remove deprecated GTK+ symbols, GTK_WIDGET_SET_FLAGS. - ---- -diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c -index 92562a3..51503f8 100644 ---- a/src/fe-gnome/xtext.c -+++ b/src/fe-gnome/xtext.c -@@ -963,7 +963,7 @@ gtk_xtext_realize (GtkWidget * widget) - GdkColor col; - GdkColormap *cmap; - -- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); -+ gtk_widget_set_realized (widget, TRUE); - xtext = GTK_XTEXT (widget); - - attributes.x = widget->allocation.x; --- -cgit v0.8.3.1 - diff --git a/xchat-gnome-DSOLink.patch b/xchat-gnome-DSOLink.patch deleted file mode 100644 index f92bec0..0000000 --- a/xchat-gnome-DSOLink.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.am xchat-gnome-0.26.1/src/fe-gnome/Makefile.am ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.am 2007-04-24 18:43:05.000000000 -0400 -+++ xchat-gnome-0.26.1/src/fe-gnome/Makefile.am 2010-03-07 15:45:35.667276790 -0500 -@@ -113,6 +113,7 @@ xchat_gnome_CFLAGS = \ - $(AM_CFLAGS) - - xchat_gnome_LDFLAGS = \ -+ -lX11 \ - -export-dynamic \ - $(AM_LDFLAGS) - -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.in xchat-gnome-0.26.1/src/fe-gnome/Makefile.in ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/Makefile.in 2009-04-12 13:48:06.000000000 -0400 -+++ xchat-gnome-0.26.1/src/fe-gnome/Makefile.in 2010-03-07 15:45:55.309526635 -0500 -@@ -449,6 +449,7 @@ xchat_gnome_CFLAGS = \ - $(AM_CFLAGS) - - xchat_gnome_LDFLAGS = \ -+ -lX11 \ - -export-dynamic \ - $(AM_LDFLAGS) - -diff -urp xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.am xchat-gnome-0.26.1/src/libcontrast/Makefile.am ---- xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.am 2007-04-24 18:43:04.000000000 -0400 -+++ xchat-gnome-0.26.1/src/libcontrast/Makefile.am 2010-03-07 15:56:15.164278726 -0500 -@@ -12,6 +12,7 @@ libcontrast_la_CFLAGS = \ - $(AM_CFLAGS) - - libcontrast_la_LDFLAGS = \ -+ -lm \ - $(AM_LDFLAGS) \ - -static - -diff -urp xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.in xchat-gnome-0.26.1/src/libcontrast/Makefile.in ---- xchat-gnome-0.26.1.OLD/src/libcontrast/Makefile.in 2009-04-12 13:48:06.000000000 -0400 -+++ xchat-gnome-0.26.1/src/libcontrast/Makefile.in 2010-03-07 15:56:35.529527068 -0500 -@@ -297,6 +297,7 @@ libcontrast_la_CFLAGS = \ - $(AM_CFLAGS) - - libcontrast_la_LDFLAGS = \ -+ -lm \ - $(AM_LDFLAGS) \ - -static - diff --git a/xchat-gnome-crasher.patch b/xchat-gnome-crasher.patch deleted file mode 100644 index ead398e..0000000 --- a/xchat-gnome-crasher.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 1418579a815af27190b56ac3595ec8bae5b71647 Mon Sep 17 00:00:00 2001 -From: Ritesh Khadgaray -Date: Wed, 13 Jan 2010 17:26:02 +0000 -Subject: Bug 592491 - xchat-gnome crashed with SIGSEGV in handle_command( - -Probable fix. This should also fix -rh bug 550662 - [abrt] crash detected in xchat-gnome-0.26.1-5.fc12 ---- -diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c -index f1ab1a8..a47f710 100644 ---- a/src/common/proto-irc.c -+++ b/src/common/proto-irc.c -@@ -44,7 +44,7 @@ - static void - irc_login (server *serv, char *user, char *realname) - { -- if (serv->password[0]) -+ if (serv->password) - tcp_sendf (serv, "PASS %s\r\n", serv->password); - - tcp_sendf (serv, -@@ -87,7 +87,7 @@ irc_ns_ghost (server *serv, char *usname, char *pass) - static void - irc_join (server *serv, char *channel, char *key) - { -- if (key[0]) -+ if (key) - tcp_sendf (serv, "JOIN %s %s\r\n", channel, key); - else - tcp_sendf (serv, "JOIN %s\r\n", channel); -@@ -96,7 +96,7 @@ irc_join (server *serv, char *channel, char *key) - static void - irc_part (server *serv, char *channel, char *reason) - { -- if (reason[0]) -+ if (reason) - tcp_sendf (serv, "PART %s :%s\r\n", channel, reason); - else - tcp_sendf (serv, "PART %s\r\n", channel); -@@ -105,7 +105,7 @@ irc_part (server *serv, char *channel, char *reason) - static void - irc_quit (server *serv, char *reason) - { -- if (reason[0]) -+ if (reason) - tcp_sendf (serv, "QUIT :%s\r\n", reason); - else - tcp_send_len (serv, "QUIT\r\n", 6); -@@ -114,15 +114,16 @@ irc_quit (server *serv, char *reason) - static void - irc_set_back (server *serv) - { -- tcp_send_len (serv, "AWAY\r\n", 6); -+ tcp_send_len (serv, "BACK\r\n", 6); - } - - static void - irc_set_away (server *serv, char *reason) - { -- if (!reason[0]) -- reason = " "; -- tcp_sendf (serv, "AWAY :%s\r\n", reason); -+ if (reason) -+ tcp_sendf (serv, "AWAY :%s\r\n", reason); -+ else -+ tcp_send_len (serv, "AWAY", 6); - } - - static void -@@ -146,7 +147,7 @@ irc_cycle (server *serv, char *channel, char *key) - static void - irc_kick (server *serv, char *channel, char *nick, char *reason) - { -- if (reason[0]) -+ if (reason) - tcp_sendf (serv, "KICK %s %s :%s\r\n", channel, nick, reason); - else - tcp_sendf (serv, "KICK %s %s\r\n", channel, nick); -@@ -235,18 +236,16 @@ irc_notice (server *serv, char *channel, char *text) - static void - irc_topic (server *serv, char *channel, char *topic) - { -- if (!topic) -- tcp_sendf (serv, "TOPIC %s :\r\n", channel); -- else if (topic[0]) -- tcp_sendf (serv, "TOPIC %s :%s\r\n", channel, topic); -+ if (topic) -+ tcp_sendf (serv, "TOPIC %s :%s\r\n", channel, topic); - else -- tcp_sendf (serv, "TOPIC %s\r\n", channel); -+ tcp_sendf (serv, "TOPIC %s :\r\n", channel); - } - - static void - irc_list_channels (server *serv, char *arg, int min_users) - { -- if (arg[0]) -+ if (arg) - { - tcp_sendf (serv, "LIST %s\r\n", arg); - return; --- -cgit v0.8.3.1 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index be58e3c..502ce58 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -15,7 +15,7 @@ URL: http://live.gnome.org/Xchat-Gnome # bzip2 xchat-gnome-0.26.2-%{gitrev}.tar Source0: http://ftp.gnome.org/pub/gnome/sources/%{name}/0.26/%{name}-%{version}-%{gitrev}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 -Patch0: %{name}-0.23.92-config.patch +Patch0: xchat-gnome-0.23.92-config.patch # Patch for libnotify 0.70 (just drop one parameter from one function) Patch1: xchat-gnome-0.26.1-libnotify.patch # Patch to work with recent NetworkManager (0.7+) diff --git a/xchat-topic-update.patch b/xchat-topic-update.patch deleted file mode 100644 index b572469..0000000 --- a/xchat-topic-update.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 6d1a939a14de918de4a79c010d82796f8035bcfa Mon Sep 17 00:00:00 2001 -From: Josselin Mouette <^Css@malsain.org> -Date: Thu, 18 Jun 2009 09:41:33 +0000 -Subject: Bug 536916 – Pressing "Enter" in the middle of editing channel topic truncates it. - ---- -diff --git a/src/fe-gnome/topic-label.c b/src/fe-gnome/topic-label.c -index a7d1883..977d29c 100644 ---- a/src/fe-gnome/topic-label.c -+++ b/src/fe-gnome/topic-label.c -@@ -315,6 +315,7 @@ static void - topic_entry_activate (GtkTextBuffer *textbuffer, GtkTextIter *arg1, gchar *text, gint len, GtkDialog *dialog) - { - if (strncmp (text, "\n", len) == 0) { -+ g_signal_stop_emission_by_name (G_OBJECT (textbuffer), "insert-text"); - gtk_dialog_response (dialog, GTK_RESPONSE_OK); - } - } --- -cgit v0.8.2 diff --git a/xg-depreciated-macros.patch b/xg-depreciated-macros.patch deleted file mode 100644 index 7a5dced..0000000 --- a/xg-depreciated-macros.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/fe-gnome.c xchat-gnome-0.26.1/src/fe-gnome/fe-gnome.c ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/fe-gnome.c 2008-09-07 09:18:45.000000000 -0400 -+++ xchat-gnome-0.26.1/src/fe-gnome/fe-gnome.c 2010-03-28 16:16:52.181405173 -0400 -@@ -753,7 +753,7 @@ fe_gui_info (session * sess, int info_ty - { - switch (info_type) { - case 0: -- if (!GTK_WIDGET_VISIBLE (GTK_WINDOW (gui.main_window))) { -+ if (!gtk_widget_get_visible (GTK_WIDGET (gui.main_window))) { - return 2; - } - if (gtk_window_is_active (GTK_WINDOW (gui.main_window))) { -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/find-bar.c xchat-gnome-0.26.1/src/fe-gnome/find-bar.c ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/find-bar.c 2007-03-09 10:42:57.000000000 -0500 -+++ xchat-gnome-0.26.1/src/fe-gnome/find-bar.c 2010-03-28 16:26:24.300405158 -0400 -@@ -247,7 +247,7 @@ find_bar_close (FindBar *bar) - { - gint position; - -- if (!GTK_WIDGET_VISIBLE (bar)) { -+ if (!gtk_widget_get_visible (GTK_WIDGET (bar))) { - return; - } - -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/text-entry.c xchat-gnome-0.26.1/src/fe-gnome/text-entry.c ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/text-entry.c 2008-09-07 10:02:45.000000000 -0400 -+++ xchat-gnome-0.26.1/src/fe-gnome/text-entry.c 2010-03-28 16:39:48.755153605 -0400 -@@ -667,7 +667,7 @@ text_entry_set_current (TextEntry *entry - char *selection = NULL, *text = NULL; - int start, end; - -- g_return_if_fail (GTK_WIDGET_REALIZED (widget)); -+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (widget))); - - if (sess == priv->current) { - return; -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/userlist-gui.c xchat-gnome-0.26.1/src/fe-gnome/userlist-gui.c ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/userlist-gui.c 2008-10-13 17:02:16.000000000 -0400 -+++ xchat-gnome-0.26.1/src/fe-gnome/userlist-gui.c 2010-03-28 16:47:55.703154452 -0400 -@@ -261,12 +261,12 @@ userlist_gui_show (void) - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gui.userlist_toggle), TRUE); - -- if (!GTK_WIDGET_REALIZED (gui.userlist_window)) { -+ if (!gtk_widget_get_realized (GTK_WIDGET (gui.userlist_window))) { - gtk_widget_realize (gui.userlist_window); - } - gtk_widget_size_request (gui.userlist, &request); - -- if (GTK_WIDGET_REALIZED (gui.userlist_toggle)) -+ if (gtk_widget_get_realized (GTK_WIDGET (gui.userlist_toggle))) - anchor_widget = gui.userlist_toggle; - else - anchor_widget = gui.main_window; -diff -urp xchat-gnome-0.26.1.OLD/src/fe-gnome/xtext.c xchat-gnome-0.26.1/src/fe-gnome/xtext.c ---- xchat-gnome-0.26.1.OLD/src/fe-gnome/xtext.c 2009-01-16 08:17:31.000000000 -0500 -+++ xchat-gnome-0.26.1/src/fe-gnome/xtext.c 2010-03-28 16:57:17.441402617 -0400 -@@ -1086,7 +1086,7 @@ gtk_xtext_size_allocate (GtkWidget * wid - xtext->avoid_trans = FALSE; - - widget->allocation = *allocation; -- if (GTK_WIDGET_REALIZED (widget)) -+ if (gtk_widget_get_realized (GTK_WIDGET (widget))) - { - xtext->buffer->window_width = allocation->width; - xtext->buffer->window_height = allocation->height; -@@ -4113,7 +4113,7 @@ gtk_xtext_set_palette (GtkXText * xtext, - xtext->palette[i] = palette[i].pixel; - } - -- if (GTK_WIDGET_REALIZED (xtext)) -+ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) - { - xtext_set_fg (xtext, xtext->fgc, XTEXT_FG); - xtext_set_bg (xtext, xtext->fgc, XTEXT_BG); -@@ -4211,7 +4211,7 @@ gtk_xtext_set_font (GtkXText *xtext, cha - - gtk_xtext_fix_indent (xtext->buffer); - -- if (GTK_WIDGET_REALIZED (xtext)) -+ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) - gtk_xtext_recalc_widths (xtext->buffer, TRUE); - - return TRUE; -@@ -4248,7 +4248,7 @@ gtk_xtext_set_background (GtkXText * xte - if (trans) - { - xtext->shaded = shaded; -- if (GTK_WIDGET_REALIZED (xtext)) -+ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) - gtk_xtext_load_trans (xtext); - return; - } -@@ -4260,14 +4260,14 @@ gtk_xtext_set_background (GtkXText * xte - if (pixmap != 0) - { - g_object_ref (pixmap); -- if (GTK_WIDGET_REALIZED (xtext)) -+ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) - { - gdk_gc_set_tile (xtext->bgc, pixmap); - gdk_gc_set_ts_origin (xtext->bgc, 0, 0); - xtext->ts_x = xtext->ts_y = 0; - gdk_gc_set_fill (xtext->bgc, GDK_TILED); - } -- } else if (GTK_WIDGET_REALIZED (xtext)) -+ } else if (gtk_widget_get_realized (GTK_WIDGET (xtext))) - { - g_object_unref (xtext->bgc); - val.subwindow_mode = GDK_INCLUDE_INFERIORS; -@@ -4516,7 +4516,7 @@ gtk_xtext_render_page (GtkXText * xtext) - int subline; - int startline = xtext->adj->value; - -- if(!GTK_WIDGET_REALIZED(xtext)) -+ if(!gtk_widget_get_realized (GTK_WIDGET (xtext))) - return; - - if (xtext->buffer->indent < MARGIN) -@@ -4636,7 +4636,7 @@ gtk_xtext_render_page (GtkXText * xtext) - void - gtk_xtext_refresh (GtkXText * xtext, int do_trans) - { -- if (GTK_WIDGET_REALIZED (GTK_WIDGET (xtext))) -+ if (gtk_widget_get_realized (GTK_WIDGET (xtext))) - { - #if defined(USE_XLIB) || defined(WIN32) - if (xtext->transparent && do_trans) -@@ -5204,7 +5204,7 @@ gtk_xtext_buffer_show (GtkXText *xtext, - xtext->io_tag = 0; - } - -- if (!GTK_WIDGET_REALIZED (GTK_WIDGET (xtext))) -+ if (!gtk_widget_get_realized (GTK_WIDGET (xtext))) - gtk_widget_realize (GTK_WIDGET (xtext)); - - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &w, &h); From 1592d97bd06118a783813e6b7b3d3e7f56a6ea0e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 15:58:58 -0400 Subject: [PATCH 069/105] Upload tarball. --- .gitignore | 2 +- sources | 2 +- xchat-gnome.spec | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index dc6a32d..98dbaf8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -xchat-gnome-0.26.1.tar.bz2 +/xchat-gnome-0.26.2-40c5bf988.tar.bz2 diff --git a/sources b/sources index bb6869b..2a15fb8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c9ce3d6e549736edfc1a1dc0282fb363 xchat-gnome-0.26.1.tar.bz2 +b65f089b921499b1c65172a618999248 xchat-gnome-0.26.2-40c5bf988.tar.bz2 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 502ce58..76db919 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -140,7 +140,8 @@ fi %changelog * Thu Apr 07 2011 Bill Nottingham - 0.26.2-1 -- update to 0.26.2 +- update to 0.26.2 (fixes #660840) +- add patch from dcbw for NetworkManager 0.9 (#437645) * Fri Mar 25 2011 Dan Williams - 0.26.1-17 - Update for NetworkManager 0.9 From 3dfece47b8b949ec1f7e9d03405262ef9e3cfa99 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 16:07:57 -0400 Subject: [PATCH 070/105] Fix duplicate changelog. --- xchat-gnome.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 76db919..e80f432 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -141,10 +141,9 @@ fi %changelog * Thu Apr 07 2011 Bill Nottingham - 0.26.2-1 - update to 0.26.2 (fixes #660840) -- add patch from dcbw for NetworkManager 0.9 (#437645) * Fri Mar 25 2011 Dan Williams - 0.26.1-17 -- Update for NetworkManager 0.9 +- Update for NetworkManager 0.9 (#437645) - Update for recent GTK/GNOME API changes * Mon Feb 07 2011 Fedora Release Engineering - 0.26.1-16 From 802ce9caf85085549d84295391d53481fab6267d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 16:27:51 -0400 Subject: [PATCH 071/105] More upstreamed patches. --- xchat-gnome-0.26.1-add-libeggsmclient.patch | 3886 ------------------- xchat-gnome-0.26.1-kill-libgnomeui.patch | 321 -- xchat-gnome.spec | 6 - 3 files changed, 4213 deletions(-) delete mode 100644 xchat-gnome-0.26.1-add-libeggsmclient.patch delete mode 100644 xchat-gnome-0.26.1-kill-libgnomeui.patch diff --git a/xchat-gnome-0.26.1-add-libeggsmclient.patch b/xchat-gnome-0.26.1-add-libeggsmclient.patch deleted file mode 100644 index c3d2abe..0000000 --- a/xchat-gnome-0.26.1-add-libeggsmclient.patch +++ /dev/null @@ -1,3886 +0,0 @@ -From cbb13af76a23d0bd75630dd966a0af7a2caeca5b Mon Sep 17 00:00:00 2001 -From: Florian Müllner -Date: Sun, 17 Jan 2010 15:09:14 +0000 -Subject: Bug 584887 - Get rid of deprecated libgnome(ui) - -added libeggsmclient to source. ---- -diff --git a/src/libeggsmclient/Makefile.am b/src/libeggsmclient/Makefile.am -new file mode 100644 -index 0000000..5af58d4 ---- a/src/libeggsmclient/Makefile.am -+++ b/src/libeggsmclient/Makefile.am -@@ -0,0 +1,36 @@ -+platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP -+platform_libs = libeggdesktopfile.la -+platform_ltlibraries = libeggdesktopfile.la -+platform_sources = eggsmclient-xsmp.c -+ -+INCLUDES = \ -+ -DG_LOG_DOMAIN=\""EggSMClient"\" \ -+ $(platform_defines) \ -+ $(EGG_SMCLIENT_CFLAGS) -+ -+noinst_LTLIBRARIES = \ -+ libeggsmclient.la \ -+ $(platform_ltlibraries) -+ -+libeggsmclient_la_LIBADD = \ -+ $(EGG_SMCLIENT_LIBS) \ -+ $(platform_libs) -+ -+libeggsmclient_la_LDFLAGS = \ -+ $(platform_ldflags) -+ -+libeggsmclient_la_SOURCES = \ -+ eggsmclient.c \ -+ eggsmclient.h \ -+ eggsmclient-private.h \ -+ $(platform_sources) -+ -+libeggdesktopfile_la_LIBADD = \ -+ $(EGG_LIBS) -+ -+libeggdesktopfile_la_SOURCES = \ -+ eggdesktopfile.c \ -+ eggdesktopfile.h -+ -+EXTRA_DIST = \ -+ eggsmclient-xsmp.c -diff --git a/src/libeggsmclient/eggdesktopfile.c b/src/libeggsmclient/eggdesktopfile.c -new file mode 100644 -index 0000000..6f6b946 ---- a/src/libeggsmclient/eggdesktopfile.c -+++ b/src/libeggsmclient/eggdesktopfile.c -@@ -0,0 +1,1510 @@ -+/* eggdesktopfile.c - Freedesktop.Org Desktop Files -+ * Copyright (C) 2007 Novell, Inc. -+ * -+ * Based on gnome-desktop-item.c -+ * Copyright (C) 1999, 2000 Red Hat Inc. -+ * Copyright (C) 2001 George Lebl -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser 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, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; see the file COPYING.LIB. If not, -+ * write to the Free Software Foundation, Inc., 59 Temple Place - -+ * Suite 330, Boston, MA 02111-1307, USA. -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include "eggdesktopfile.h" -+ -+#include -+#include -+ -+#include -+#include -+#include -+ -+struct EggDesktopFile { -+ GKeyFile *key_file; -+ char *source; -+ -+ char *name, *icon; -+ EggDesktopFileType type; -+ char document_code; -+}; -+ -+/** -+ * egg_desktop_file_new: -+ * @desktop_file_path: path to a Freedesktop-style Desktop file -+ * @error: error pointer -+ * -+ * Creates a new #EggDesktopFile for @desktop_file. -+ * -+ * Return value: the new #EggDesktopFile, or %NULL on error. -+ **/ -+EggDesktopFile * -+egg_desktop_file_new (const char *desktop_file_path, GError **error) -+{ -+ GKeyFile *key_file; -+ -+ key_file = g_key_file_new (); -+ if (!g_key_file_load_from_file (key_file, desktop_file_path, 0, error)) -+ { -+ g_key_file_free (key_file); -+ return NULL; -+ } -+ -+ return egg_desktop_file_new_from_key_file (key_file, desktop_file_path, -+ error); -+} -+ -+/** -+ * egg_desktop_file_new_from_data_dirs: -+ * @desktop_file_path: relative path to a Freedesktop-style Desktop file -+ * @error: error pointer -+ * -+ * Looks for @desktop_file_path in the paths returned from -+ * g_get_user_data_dir() and g_get_system_data_dirs(), and creates -+ * a new #EggDesktopFile from it. -+ * -+ * Return value: the new #EggDesktopFile, or %NULL on error. -+ **/ -+EggDesktopFile * -+egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, -+ GError **error) -+{ -+ EggDesktopFile *desktop_file; -+ GKeyFile *key_file; -+ char *full_path; -+ -+ key_file = g_key_file_new (); -+ if (!g_key_file_load_from_data_dirs (key_file, desktop_file_path, -+ &full_path, 0, error)) -+ { -+ g_key_file_free (key_file); -+ return NULL; -+ } -+ -+ desktop_file = egg_desktop_file_new_from_key_file (key_file, -+ full_path, -+ error); -+ g_free (full_path); -+ return desktop_file; -+} -+ -+/** -+ * egg_desktop_file_new_from_dirs: -+ * @desktop_file_path: relative path to a Freedesktop-style Desktop file -+ * @search_dirs: NULL-terminated array of directories to search -+ * @error: error pointer -+ * -+ * Looks for @desktop_file_path in the paths returned from -+ * g_get_user_data_dir() and g_get_system_data_dirs(), and creates -+ * a new #EggDesktopFile from it. -+ * -+ * Return value: the new #EggDesktopFile, or %NULL on error. -+ **/ -+EggDesktopFile * -+egg_desktop_file_new_from_dirs (const char *desktop_file_path, -+ const char **search_dirs, -+ GError **error) -+{ -+ EggDesktopFile *desktop_file; -+ GKeyFile *key_file; -+ char *full_path; -+ -+ key_file = g_key_file_new (); -+ if (!g_key_file_load_from_dirs (key_file, desktop_file_path, search_dirs, -+ &full_path, 0, error)) -+ { -+ g_key_file_free (key_file); -+ return NULL; -+ } -+ -+ desktop_file = egg_desktop_file_new_from_key_file (key_file, -+ full_path, -+ error); -+ g_free (full_path); -+ return desktop_file; -+} -+ -+/** -+ * egg_desktop_file_new_from_key_file: -+ * @key_file: a #GKeyFile representing a desktop file -+ * @source: the path or URI that @key_file was loaded from, or %NULL -+ * @error: error pointer -+ * -+ * Creates a new #EggDesktopFile for @key_file. Assumes ownership of -+ * @key_file (on success or failure); you should consider @key_file to -+ * be freed after calling this function. -+ * -+ * Return value: the new #EggDesktopFile, or %NULL on error. -+ **/ -+EggDesktopFile * -+egg_desktop_file_new_from_key_file (GKeyFile *key_file, -+ const char *source, -+ GError **error) -+{ -+ EggDesktopFile *desktop_file; -+ char *version, *type; -+ -+ if (!g_key_file_has_group (key_file, EGG_DESKTOP_FILE_GROUP)) -+ { -+ g_set_error (error, EGG_DESKTOP_FILE_ERROR, -+ EGG_DESKTOP_FILE_ERROR_INVALID, -+ _("File is not a valid .desktop file")); -+ g_key_file_free (key_file); -+ return NULL; -+ } -+ -+ version = g_key_file_get_value (key_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_VERSION, -+ NULL); -+ if (version) -+ { -+ double version_num; -+ char *end; -+ -+ version_num = g_ascii_strtod (version, &end); -+ if (*end) -+ { -+ g_warning ("Invalid Version string '%s' in %s", -+ version, source ? source : "(unknown)"); -+ } -+ else if (version_num > 1.0) -+ { -+ g_set_error (error, EGG_DESKTOP_FILE_ERROR, -+ EGG_DESKTOP_FILE_ERROR_INVALID, -+ _("Unrecognized desktop file Version '%s'"), version); -+ g_free (version); -+ g_key_file_free (key_file); -+ return NULL; -+ } -+ g_free (version); -+ } -+ -+ desktop_file = g_new0 (EggDesktopFile, 1); -+ desktop_file->key_file = key_file; -+ -+ if (g_path_is_absolute (source)) -+ desktop_file->source = g_filename_to_uri (source, NULL, NULL); -+ else -+ desktop_file->source = g_strdup (source); -+ -+ desktop_file->name = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_NAME, error); -+ if (!desktop_file->name) -+ { -+ egg_desktop_file_free (desktop_file); -+ return NULL; -+ } -+ -+ type = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_TYPE, error); -+ if (!type) -+ { -+ egg_desktop_file_free (desktop_file); -+ return NULL; -+ } -+ -+ if (!strcmp (type, "Application")) -+ { -+ char *exec, *p; -+ -+ desktop_file->type = EGG_DESKTOP_FILE_TYPE_APPLICATION; -+ -+ exec = g_key_file_get_string (key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_EXEC, -+ error); -+ if (!exec) -+ { -+ egg_desktop_file_free (desktop_file); -+ g_free (type); -+ return NULL; -+ } -+ -+ /* See if it takes paths or URIs or neither */ -+ for (p = exec; *p; p++) -+ { -+ if (*p == '%') -+ { -+ if (p[1] == '\0' || strchr ("FfUu", p[1])) -+ { -+ desktop_file->document_code = p[1]; -+ break; -+ } -+ p++; -+ } -+ } -+ -+ g_free (exec); -+ } -+ else if (!strcmp (type, "Link")) -+ { -+ char *url; -+ -+ desktop_file->type = EGG_DESKTOP_FILE_TYPE_LINK; -+ -+ url = g_key_file_get_string (key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_URL, -+ error); -+ if (!url) -+ { -+ egg_desktop_file_free (desktop_file); -+ g_free (type); -+ return NULL; -+ } -+ g_free (url); -+ } -+ else if (!strcmp (type, "Directory")) -+ desktop_file->type = EGG_DESKTOP_FILE_TYPE_DIRECTORY; -+ else -+ desktop_file->type = EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED; -+ -+ g_free (type); -+ -+ /* Check the Icon key */ -+ desktop_file->icon = g_key_file_get_string (key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_ICON, -+ NULL); -+ if (desktop_file->icon && !g_path_is_absolute (desktop_file->icon)) -+ { -+ char *ext; -+ -+ /* Lots of .desktop files still get this wrong */ -+ ext = strrchr (desktop_file->icon, '.'); -+ if (ext && (!strcmp (ext, ".png") || -+ !strcmp (ext, ".xpm") || -+ !strcmp (ext, ".svg"))) -+ { -+ g_warning ("Desktop file '%s' has malformed Icon key '%s'" -+ "(should not include extension)", -+ source ? source : "(unknown)", -+ desktop_file->icon); -+ *ext = '\0'; -+ } -+ } -+ -+ return desktop_file; -+} -+ -+/** -+ * egg_desktop_file_free: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Frees @desktop_file. -+ **/ -+void -+egg_desktop_file_free (EggDesktopFile *desktop_file) -+{ -+ g_key_file_free (desktop_file->key_file); -+ g_free (desktop_file->source); -+ g_free (desktop_file->name); -+ g_free (desktop_file->icon); -+ g_free (desktop_file); -+} -+ -+/** -+ * egg_desktop_file_get_source: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Gets the URI that @desktop_file was loaded from. -+ * -+ * Return value: @desktop_file's source URI -+ **/ -+const char * -+egg_desktop_file_get_source (EggDesktopFile *desktop_file) -+{ -+ return desktop_file->source; -+} -+ -+/** -+ * egg_desktop_file_get_desktop_file_type: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Gets the desktop file type of @desktop_file. -+ * -+ * Return value: @desktop_file's type -+ **/ -+EggDesktopFileType -+egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file) -+{ -+ return desktop_file->type; -+} -+ -+/** -+ * egg_desktop_file_get_name: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Gets the (localized) value of @desktop_file's "Name" key. -+ * -+ * Return value: the application/link name -+ **/ -+const char * -+egg_desktop_file_get_name (EggDesktopFile *desktop_file) -+{ -+ return desktop_file->name; -+} -+ -+/** -+ * egg_desktop_file_get_icon: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Gets the value of @desktop_file's "Icon" key. -+ * -+ * If the icon string is a full path (that is, if g_path_is_absolute() -+ * returns %TRUE when called on it), it points to a file containing an -+ * unthemed icon. If the icon string is not a full path, it is the -+ * name of a themed icon, which can be looked up with %GtkIconTheme, -+ * or passed directly to a theme-aware widget like %GtkImage or -+ * %GtkCellRendererPixbuf. -+ * -+ * Return value: the icon path or name -+ **/ -+const char * -+egg_desktop_file_get_icon (EggDesktopFile *desktop_file) -+{ -+ return desktop_file->icon; -+} -+ -+gboolean -+egg_desktop_file_has_key (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error) -+{ -+ return g_key_file_has_key (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, -+ error); -+} -+ -+char * -+egg_desktop_file_get_string (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error) -+{ -+ return g_key_file_get_string (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, -+ error); -+} -+ -+char * -+egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, -+ const char *key, -+ const char *locale, -+ GError **error) -+{ -+ return g_key_file_get_locale_string (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, locale, -+ error); -+} -+ -+gboolean -+egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error) -+{ -+ return g_key_file_get_boolean (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, -+ error); -+} -+ -+double -+egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error) -+{ -+ return g_key_file_get_double (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, -+ error); -+} -+ -+char ** -+egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, -+ const char *key, -+ gsize *length, -+ GError **error) -+{ -+ return g_key_file_get_string_list (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, length, -+ error); -+} -+ -+char ** -+egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, -+ const char *key, -+ const char *locale, -+ gsize *length, -+ GError **error) -+{ -+ return g_key_file_get_locale_string_list (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, key, -+ locale, length, -+ error); -+} -+ -+/** -+ * egg_desktop_file_can_launch: -+ * @desktop_file: an #EggDesktopFile -+ * @desktop_environment: the name of the running desktop environment, -+ * or %NULL -+ * -+ * Tests if @desktop_file can/should be launched in the current -+ * environment. If @desktop_environment is non-%NULL, @desktop_file's -+ * "OnlyShowIn" and "NotShowIn" keys are checked to make sure that -+ * this desktop_file is appropriate for the named environment. -+ * -+ * Furthermore, if @desktop_file has type -+ * %EGG_DESKTOP_FILE_TYPE_APPLICATION, its "TryExec" key (if any) is -+ * also checked, to make sure the binary it points to exists. -+ * -+ * egg_desktop_file_can_launch() does NOT check the value of the -+ * "Hidden" key. -+ * -+ * Return value: %TRUE if @desktop_file can be launched -+ **/ -+gboolean -+egg_desktop_file_can_launch (EggDesktopFile *desktop_file, -+ const char *desktop_environment) -+{ -+ char *try_exec, *found_program; -+ char **only_show_in, **not_show_in; -+ gboolean found; -+ int i; -+ -+ if (desktop_file->type != EGG_DESKTOP_FILE_TYPE_APPLICATION && -+ desktop_file->type != EGG_DESKTOP_FILE_TYPE_LINK) -+ return FALSE; -+ -+ if (desktop_environment) -+ { -+ only_show_in = g_key_file_get_string_list (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN, -+ NULL, NULL); -+ if (only_show_in) -+ { -+ for (i = 0, found = FALSE; only_show_in[i] && !found; i++) -+ { -+ if (!strcmp (only_show_in[i], desktop_environment)) -+ found = TRUE; -+ } -+ -+ g_strfreev (only_show_in); -+ -+ if (!found) -+ return FALSE; -+ } -+ -+ not_show_in = g_key_file_get_string_list (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN, -+ NULL, NULL); -+ if (not_show_in) -+ { -+ for (i = 0, found = FALSE; not_show_in[i] && !found; i++) -+ { -+ if (!strcmp (not_show_in[i], desktop_environment)) -+ found = TRUE; -+ } -+ -+ g_strfreev (not_show_in); -+ -+ if (found) -+ return FALSE; -+ } -+ } -+ -+ if (desktop_file->type == EGG_DESKTOP_FILE_TYPE_APPLICATION) -+ { -+ try_exec = g_key_file_get_string (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_TRY_EXEC, -+ NULL); -+ if (try_exec) -+ { -+ found_program = g_find_program_in_path (try_exec); -+ g_free (try_exec); -+ -+ if (!found_program) -+ return FALSE; -+ g_free (found_program); -+ } -+ } -+ -+ return TRUE; -+} -+ -+/** -+ * egg_desktop_file_accepts_documents: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Tests if @desktop_file represents an application that can accept -+ * documents on the command line. -+ * -+ * Return value: %TRUE or %FALSE -+ **/ -+gboolean -+egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file) -+{ -+ return desktop_file->document_code != 0; -+} -+ -+/** -+ * egg_desktop_file_accepts_multiple: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Tests if @desktop_file can accept multiple documents at once. -+ * -+ * If this returns %FALSE, you can still pass multiple documents to -+ * egg_desktop_file_launch(), but that will result in multiple copies -+ * of the application being launched. See egg_desktop_file_launch() -+ * for more details. -+ * -+ * Return value: %TRUE or %FALSE -+ **/ -+gboolean -+egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file) -+{ -+ return (desktop_file->document_code == 'F' || -+ desktop_file->document_code == 'U'); -+} -+ -+/** -+ * egg_desktop_file_accepts_uris: -+ * @desktop_file: an #EggDesktopFile -+ * -+ * Tests if @desktop_file can accept (non-"file:") URIs as documents to -+ * open. -+ * -+ * Return value: %TRUE or %FALSE -+ **/ -+gboolean -+egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file) -+{ -+ return (desktop_file->document_code == 'U' || -+ desktop_file->document_code == 'u'); -+} -+ -+static void -+append_quoted_word (GString *str, -+ const char *s, -+ gboolean in_single_quotes, -+ gboolean in_double_quotes) -+{ -+ const char *p; -+ -+ if (!in_single_quotes && !in_double_quotes) -+ g_string_append_c (str, '\''); -+ else if (!in_single_quotes && in_double_quotes) -+ g_string_append (str, "\"'"); -+ -+ if (!strchr (s, '\'')) -+ g_string_append (str, s); -+ else -+ { -+ for (p = s; *p != '\0'; p++) -+ { -+ if (*p == '\'') -+ g_string_append (str, "'\\''"); -+ else -+ g_string_append_c (str, *p); -+ } -+ } -+ -+ if (!in_single_quotes && !in_double_quotes) -+ g_string_append_c (str, '\''); -+ else if (!in_single_quotes && in_double_quotes) -+ g_string_append (str, "'\""); -+} -+ -+static void -+do_percent_subst (EggDesktopFile *desktop_file, -+ char code, -+ GString *str, -+ GSList **documents, -+ gboolean in_single_quotes, -+ gboolean in_double_quotes) -+{ -+ GSList *d; -+ char *doc; -+ -+ switch (code) -+ { -+ case '%': -+ g_string_append_c (str, '%'); -+ break; -+ -+ case 'F': -+ case 'U': -+ for (d = *documents; d; d = d->next) -+ { -+ doc = d->data; -+ g_string_append (str, " "); -+ append_quoted_word (str, doc, in_single_quotes, in_double_quotes); -+ } -+ *documents = NULL; -+ break; -+ -+ case 'f': -+ case 'u': -+ if (*documents) -+ { -+ doc = (*documents)->data; -+ g_string_append (str, " "); -+ append_quoted_word (str, doc, in_single_quotes, in_double_quotes); -+ *documents = (*documents)->next; -+ } -+ break; -+ -+ case 'i': -+ if (desktop_file->icon) -+ { -+ g_string_append (str, "--icon "); -+ append_quoted_word (str, desktop_file->icon, -+ in_single_quotes, in_double_quotes); -+ } -+ break; -+ -+ case 'c': -+ if (desktop_file->name) -+ { -+ append_quoted_word (str, desktop_file->name, -+ in_single_quotes, in_double_quotes); -+ } -+ break; -+ -+ case 'k': -+ if (desktop_file->source) -+ { -+ append_quoted_word (str, desktop_file->source, -+ in_single_quotes, in_double_quotes); -+ } -+ break; -+ -+ case 'D': -+ case 'N': -+ case 'd': -+ case 'n': -+ case 'v': -+ case 'm': -+ /* Deprecated; skip */ -+ break; -+ -+ default: -+ g_warning ("Unrecognized %%-code '%%%c' in Exec", code); -+ break; -+ } -+} -+ -+static char * -+parse_exec (EggDesktopFile *desktop_file, -+ GSList **documents, -+ GError **error) -+{ -+ char *exec, *p, *command; -+ gboolean escape, single_quot, double_quot; -+ GString *gs; -+ -+ exec = g_key_file_get_string (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_EXEC, -+ error); -+ if (!exec) -+ return NULL; -+ -+ /* Build the command */ -+ gs = g_string_new (NULL); -+ escape = single_quot = double_quot = FALSE; -+ -+ for (p = exec; *p != '\0'; p++) -+ { -+ if (escape) -+ { -+ escape = FALSE; -+ g_string_append_c (gs, *p); -+ } -+ else if (*p == '\\') -+ { -+ if (!single_quot) -+ escape = TRUE; -+ g_string_append_c (gs, *p); -+ } -+ else if (*p == '\'') -+ { -+ g_string_append_c (gs, *p); -+ if (!single_quot && !double_quot) -+ single_quot = TRUE; -+ else if (single_quot) -+ single_quot = FALSE; -+ } -+ else if (*p == '"') -+ { -+ g_string_append_c (gs, *p); -+ if (!single_quot && !double_quot) -+ double_quot = TRUE; -+ else if (double_quot) -+ double_quot = FALSE; -+ } -+ else if (*p == '%' && p[1]) -+ { -+ do_percent_subst (desktop_file, p[1], gs, documents, -+ single_quot, double_quot); -+ p++; -+ } -+ else -+ g_string_append_c (gs, *p); -+ } -+ -+ g_free (exec); -+ command = g_string_free (gs, FALSE); -+ -+ /* Prepend "xdg-terminal " if needed (FIXME: use gvfs) */ -+ if (g_key_file_has_key (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_TERMINAL, -+ NULL)) -+ { -+ GError *terminal_error = NULL; -+ gboolean use_terminal = -+ g_key_file_get_boolean (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_TERMINAL, -+ &terminal_error); -+ if (terminal_error) -+ { -+ g_free (command); -+ g_propagate_error (error, terminal_error); -+ return NULL; -+ } -+ -+ if (use_terminal) -+ { -+ gs = g_string_new ("xdg-terminal "); -+ append_quoted_word (gs, command, FALSE, FALSE); -+ g_free (command); -+ command = g_string_free (gs, FALSE); -+ } -+ } -+ -+ return command; -+} -+ -+static GSList * -+translate_document_list (EggDesktopFile *desktop_file, GSList *documents) -+{ -+ gboolean accepts_uris = egg_desktop_file_accepts_uris (desktop_file); -+ GSList *ret, *d; -+ -+ for (d = documents, ret = NULL; d; d = d->next) -+ { -+ const char *document = d->data; -+ gboolean is_uri = !g_path_is_absolute (document); -+ char *translated; -+ -+ if (accepts_uris) -+ { -+ if (is_uri) -+ translated = g_strdup (document); -+ else -+ translated = g_filename_to_uri (document, NULL, NULL); -+ } -+ else -+ { -+ if (is_uri) -+ translated = g_filename_from_uri (document, NULL, NULL); -+ else -+ translated = g_strdup (document); -+ } -+ -+ if (translated) -+ ret = g_slist_prepend (ret, translated); -+ } -+ -+ return g_slist_reverse (ret); -+} -+ -+static void -+free_document_list (GSList *documents) -+{ -+ GSList *d; -+ -+ for (d = documents; d; d = d->next) -+ g_free (d->data); -+ g_slist_free (documents); -+} -+ -+/** -+ * egg_desktop_file_parse_exec: -+ * @desktop_file: a #EggDesktopFile -+ * @documents: a list of document paths or URIs -+ * @error: error pointer -+ * -+ * Parses @desktop_file's Exec key, inserting @documents into it, and -+ * returns the result. -+ * -+ * If @documents contains non-file: URIs and @desktop_file does not -+ * accept URIs, those URIs will be ignored. Likewise, if @documents -+ * contains more elements than @desktop_file accepts, the extra -+ * documents will be ignored. -+ * -+ * Return value: the parsed Exec string -+ **/ -+char * -+egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, -+ GSList *documents, -+ GError **error) -+{ -+ GSList *translated, *docs; -+ char *command; -+ -+ docs = translated = translate_document_list (desktop_file, documents); -+ command = parse_exec (desktop_file, &docs, error); -+ free_document_list (translated); -+ -+ return command; -+} -+ -+static gboolean -+parse_link (EggDesktopFile *desktop_file, -+ EggDesktopFile **app_desktop_file, -+ GSList **documents, -+ GError **error) -+{ -+ char *url; -+ GKeyFile *key_file; -+ -+ url = g_key_file_get_string (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_URL, -+ error); -+ if (!url) -+ return FALSE; -+ *documents = g_slist_prepend (NULL, url); -+ -+ /* FIXME: use gvfs */ -+ key_file = g_key_file_new (); -+ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_NAME, -+ "xdg-open"); -+ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_TYPE, -+ "Application"); -+ g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_EXEC, -+ "xdg-open %u"); -+ *app_desktop_file = egg_desktop_file_new_from_key_file (key_file, NULL, NULL); -+ return TRUE; -+} -+ -+#if GTK_CHECK_VERSION (2, 12, 0) -+static char * -+start_startup_notification (GdkDisplay *display, -+ EggDesktopFile *desktop_file, -+ const char *argv0, -+ int screen, -+ int workspace, -+ guint32 launch_time) -+{ -+ static int sequence = 0; -+ char *startup_id; -+ char *description, *wmclass; -+ char *screen_str, *workspace_str; -+ -+ if (g_key_file_has_key (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, -+ NULL)) -+ { -+ if (!g_key_file_get_boolean (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, -+ NULL)) -+ return NULL; -+ wmclass = NULL; -+ } -+ else -+ { -+ wmclass = g_key_file_get_string (desktop_file->key_file, -+ EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS, -+ NULL); -+ if (!wmclass) -+ return NULL; -+ } -+ -+ if (launch_time == (guint32)-1) -+ launch_time = gdk_x11_display_get_user_time (display); -+ startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu", -+ g_get_prgname (), -+ (unsigned long)getpid (), -+ g_get_host_name (), -+ argv0, -+ sequence++, -+ (unsigned long)launch_time); -+ -+ description = g_strdup_printf (_("Starting %s"), desktop_file->name); -+ screen_str = g_strdup_printf ("%d", screen); -+ workspace_str = workspace == -1 ? NULL : g_strdup_printf ("%d", workspace); -+ -+ gdk_x11_display_broadcast_startup_message (display, "new", -+ "ID", startup_id, -+ "NAME", desktop_file->name, -+ "SCREEN", screen_str, -+ "BIN", argv0, -+ "ICON", desktop_file->icon, -+ "DESKTOP", workspace_str, -+ "DESCRIPTION", description, -+ "WMCLASS", wmclass, -+ NULL); -+ -+ g_free (description); -+ g_free (wmclass); -+ g_free (screen_str); -+ g_free (workspace_str); -+ -+ return startup_id; -+} -+ -+static void -+end_startup_notification (GdkDisplay *display, -+ const char *startup_id) -+{ -+ gdk_x11_display_broadcast_startup_message (display, "remove", -+ "ID", startup_id, -+ NULL); -+} -+ -+#define EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH (30 /* seconds */) -+ -+typedef struct { -+ GdkDisplay *display; -+ char *startup_id; -+} StartupNotificationData; -+ -+static gboolean -+startup_notification_timeout (gpointer data) -+{ -+ StartupNotificationData *sn_data = data; -+ -+ end_startup_notification (sn_data->display, sn_data->startup_id); -+ g_object_unref (sn_data->display); -+ g_free (sn_data->startup_id); -+ g_free (sn_data); -+ -+ return FALSE; -+} -+ -+static void -+set_startup_notification_timeout (GdkDisplay *display, -+ const char *startup_id) -+{ -+ StartupNotificationData *sn_data; -+ -+ sn_data = g_new (StartupNotificationData, 1); -+ sn_data->display = g_object_ref (display); -+ sn_data->startup_id = g_strdup (startup_id); -+ -+ g_timeout_add_seconds (EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH, -+ startup_notification_timeout, sn_data); -+} -+#endif /* GTK 2.12 */ -+ -+static GPtrArray * -+array_putenv (GPtrArray *env, char *variable) -+{ -+ guint i, keylen; -+ -+ if (!env) -+ { -+ char **envp; -+ -+ env = g_ptr_array_new (); -+ -+ envp = g_listenv (); -+ for (i = 0; envp[i]; i++) -+ { -+ const char *value; -+ -+ value = g_getenv (envp[i]); -+ g_ptr_array_add (env, g_strdup_printf ("%s=%s", envp[i], -+ value ? value : "")); -+ } -+ g_strfreev (envp); -+ } -+ -+ keylen = strcspn (variable, "="); -+ -+ /* Remove old value of key */ -+ for (i = 0; i < env->len; i++) -+ { -+ char *envvar = env->pdata[i]; -+ -+ if (!strncmp (envvar, variable, keylen) && envvar[keylen] == '=') -+ { -+ g_free (envvar); -+ g_ptr_array_remove_index_fast (env, i); -+ break; -+ } -+ } -+ -+ /* Add new value */ -+ g_ptr_array_add (env, g_strdup (variable)); -+ -+ return env; -+} -+ -+static gboolean -+egg_desktop_file_launchv (EggDesktopFile *desktop_file, -+ GSList *documents, va_list args, -+ GError **error) -+{ -+ EggDesktopFileLaunchOption option; -+ GSList *translated_documents = NULL, *docs = NULL; -+ char *command, **argv; -+ int argc, i, screen_num; -+ gboolean success, current_success; -+ GdkDisplay *display; -+ char *startup_id; -+ -+ GPtrArray *env = NULL; -+ char **variables = NULL; -+ GdkScreen *screen = NULL; -+ int workspace = -1; -+ const char *directory = NULL; -+ guint32 launch_time = (guint32)-1; -+ GSpawnFlags flags = G_SPAWN_SEARCH_PATH; -+ GSpawnChildSetupFunc setup_func = NULL; -+ gpointer setup_data = NULL; -+ -+ GPid *ret_pid = NULL; -+ int *ret_stdin = NULL, *ret_stdout = NULL, *ret_stderr = NULL; -+ char **ret_startup_id = NULL; -+ -+ if (documents && desktop_file->document_code == 0) -+ { -+ g_set_error (error, EGG_DESKTOP_FILE_ERROR, -+ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, -+ _("Application does not accept documents on command line")); -+ return FALSE; -+ } -+ -+ /* Read the options: technically it's incorrect for the caller to -+ * NULL-terminate the list of options (rather than 0-terminating -+ * it), but NULL-terminating lets us use G_GNUC_NULL_TERMINATED, -+ * it's more consistent with other glib/gtk methods, and it will -+ * work as long as sizeof (int) <= sizeof (NULL), and NULL is -+ * represented as 0. (Which is true everywhere we care about.) -+ */ -+ while ((option = va_arg (args, EggDesktopFileLaunchOption))) -+ { -+ switch (option) -+ { -+ case EGG_DESKTOP_FILE_LAUNCH_CLEARENV: -+ if (env) -+ g_ptr_array_free (env, TRUE); -+ env = g_ptr_array_new (); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_PUTENV: -+ variables = va_arg (args, char **); -+ for (i = 0; variables[i]; i++) -+ env = array_putenv (env, variables[i]); -+ break; -+ -+ case EGG_DESKTOP_FILE_LAUNCH_SCREEN: -+ screen = va_arg (args, GdkScreen *); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: -+ workspace = va_arg (args, int); -+ break; -+ -+ case EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: -+ directory = va_arg (args, const char *); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_TIME: -+ launch_time = va_arg (args, guint32); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_FLAGS: -+ flags |= va_arg (args, GSpawnFlags); -+ /* Make sure they didn't set any flags that don't make sense. */ -+ flags &= ~G_SPAWN_FILE_AND_ARGV_ZERO; -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC: -+ setup_func = va_arg (args, GSpawnChildSetupFunc); -+ setup_data = va_arg (args, gpointer); -+ break; -+ -+ case EGG_DESKTOP_FILE_LAUNCH_RETURN_PID: -+ ret_pid = va_arg (args, GPid *); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE: -+ ret_stdin = va_arg (args, int *); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE: -+ ret_stdout = va_arg (args, int *); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE: -+ ret_stderr = va_arg (args, int *); -+ break; -+ case EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID: -+ ret_startup_id = va_arg (args, char **); -+ break; -+ -+ default: -+ g_set_error (error, EGG_DESKTOP_FILE_ERROR, -+ EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION, -+ _("Unrecognized launch option: %d"), -+ GPOINTER_TO_INT (option)); -+ success = FALSE; -+ goto out; -+ } -+ } -+ -+ if (screen) -+ { -+ char *display_name = gdk_screen_make_display_name (screen); -+ char *display_env = g_strdup_printf ("DISPLAY=%s", display_name); -+ env = array_putenv (env, display_env); -+ g_free (display_name); -+ g_free (display_env); -+ -+ display = gdk_screen_get_display (screen); -+ } -+ else -+ { -+ display = gdk_display_get_default (); -+ screen = gdk_display_get_default_screen (display); -+ } -+ screen_num = gdk_screen_get_number (screen); -+ -+ translated_documents = translate_document_list (desktop_file, documents); -+ docs = translated_documents; -+ -+ success = FALSE; -+ -+ do -+ { -+ command = parse_exec (desktop_file, &docs, error); -+ if (!command) -+ goto out; -+ -+ if (!g_shell_parse_argv (command, &argc, &argv, error)) -+ { -+ g_free (command); -+ goto out; -+ } -+ g_free (command); -+ -+#if GTK_CHECK_VERSION (2, 12, 0) -+ startup_id = start_startup_notification (display, desktop_file, -+ argv[0], screen_num, -+ workspace, launch_time); -+ if (startup_id) -+ { -+ char *startup_id_env = g_strdup_printf ("DESKTOP_STARTUP_ID=%s", -+ startup_id); -+ env = array_putenv (env, startup_id_env); -+ g_free (startup_id_env); -+ } -+#else -+ startup_id = NULL; -+#endif /* GTK 2.12 */ -+ -+ if (env != NULL) -+ g_ptr_array_add (env, NULL); -+ -+ current_success = -+ g_spawn_async_with_pipes (directory, -+ argv, -+ env ? (char **)(env->pdata) : NULL, -+ flags, -+ setup_func, setup_data, -+ ret_pid, -+ ret_stdin, ret_stdout, ret_stderr, -+ error); -+ g_strfreev (argv); -+ -+ if (startup_id) -+ { -+#if GTK_CHECK_VERSION (2, 12, 0) -+ if (current_success) -+ { -+ set_startup_notification_timeout (display, startup_id); -+ -+ if (ret_startup_id) -+ *ret_startup_id = startup_id; -+ else -+ g_free (startup_id); -+ } -+ else -+#endif /* GTK 2.12 */ -+ g_free (startup_id); -+ } -+ else if (ret_startup_id) -+ *ret_startup_id = NULL; -+ -+ if (current_success) -+ { -+ /* If we successfully launch any instances of the app, make -+ * sure we return TRUE and don't set @error. -+ */ -+ success = TRUE; -+ error = NULL; -+ -+ /* Also, only set the output params on the first one */ -+ ret_pid = NULL; -+ ret_stdin = ret_stdout = ret_stderr = NULL; -+ ret_startup_id = NULL; -+ } -+ } -+ while (docs && current_success); -+ -+ out: -+ if (env) -+ { -+ g_ptr_array_foreach (env, (GFunc)g_free, NULL); -+ g_ptr_array_free (env, TRUE); -+ } -+ free_document_list (translated_documents); -+ -+ return success; -+} -+ -+/** -+ * egg_desktop_file_launch: -+ * @desktop_file: an #EggDesktopFile -+ * @documents: a list of URIs or paths to documents to open -+ * @error: error pointer -+ * @...: additional options -+ * -+ * Launches @desktop_file with the given arguments. Additional options -+ * can be specified as follows: -+ * -+ * %EGG_DESKTOP_FILE_LAUNCH_CLEARENV: (no arguments) -+ * clears the environment in the child process -+ * %EGG_DESKTOP_FILE_LAUNCH_PUTENV: (char **variables) -+ * adds the NAME=VALUE strings in the given %NULL-terminated -+ * array to the child process's environment -+ * %EGG_DESKTOP_FILE_LAUNCH_SCREEN: (GdkScreen *screen) -+ * causes the application to be launched on the given screen -+ * %EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: (int workspace) -+ * causes the application to be launched on the given workspace -+ * %EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: (char *dir) -+ * causes the application to be launched in the given directory -+ * %EGG_DESKTOP_FILE_LAUNCH_TIME: (guint32 launch_time) -+ * sets the "launch time" for the application. If the user -+ * interacts with another window after @launch_time but before -+ * the launched application creates its first window, the window -+ * manager may choose to not give focus to the new application. -+ * Passing 0 for @launch_time will explicitly request that the -+ * application not receive focus. -+ * %EGG_DESKTOP_FILE_LAUNCH_FLAGS (GSpawnFlags flags) -+ * Sets additional #GSpawnFlags to use. See g_spawn_async() for -+ * more details. -+ * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC (GSpawnChildSetupFunc, gpointer) -+ * Sets the child setup callback and the data to pass to it. -+ * (See g_spawn_async() for more details.) -+ * -+ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID (GPid **pid) -+ * On a successful launch, sets *@pid to the PID of the launched -+ * application. -+ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID (char **startup_id) -+ * On a successful launch, sets *@startup_id to the Startup -+ * Notification "startup id" of the launched application. -+ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE (int *fd) -+ * On a successful launch, sets *@fd to the file descriptor of -+ * a pipe connected to the application's stdin. -+ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE (int *fd) -+ * On a successful launch, sets *@fd to the file descriptor of -+ * a pipe connected to the application's stdout. -+ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE (int *fd) -+ * On a successful launch, sets *@fd to the file descriptor of -+ * a pipe connected to the application's stderr. -+ * -+ * The options should be terminated with a single %NULL. -+ * -+ * If @documents contains multiple documents, but -+ * egg_desktop_file_accepts_multiple() returns %FALSE for -+ * @desktop_file, then egg_desktop_file_launch() will actually launch -+ * multiple instances of the application. In that case, the return -+ * value (as well as any values passed via -+ * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, etc) will only reflect the -+ * first instance of the application that was launched (but the -+ * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC will be called for each -+ * instance). -+ * -+ * Return value: %TRUE if the application was successfully launched. -+ **/ -+gboolean -+egg_desktop_file_launch (EggDesktopFile *desktop_file, -+ GSList *documents, GError **error, -+ ...) -+{ -+ va_list args; -+ gboolean success; -+ EggDesktopFile *app_desktop_file; -+ -+ switch (desktop_file->type) -+ { -+ case EGG_DESKTOP_FILE_TYPE_APPLICATION: -+ va_start (args, error); -+ success = egg_desktop_file_launchv (desktop_file, documents, -+ args, error); -+ va_end (args); -+ break; -+ -+ case EGG_DESKTOP_FILE_TYPE_LINK: -+ if (documents) -+ { -+ g_set_error (error, EGG_DESKTOP_FILE_ERROR, -+ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, -+ _("Can't pass document URIs to a 'Type=Link' desktop entry")); -+ return FALSE; -+ } -+ -+ if (!parse_link (desktop_file, &app_desktop_file, &documents, error)) -+ return FALSE; -+ -+ va_start (args, error); -+ success = egg_desktop_file_launchv (app_desktop_file, documents, -+ args, error); -+ va_end (args); -+ -+ egg_desktop_file_free (app_desktop_file); -+ free_document_list (documents); -+ break; -+ -+ case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED: -+ case EGG_DESKTOP_FILE_TYPE_DIRECTORY: -+ default: -+ g_set_error (error, EGG_DESKTOP_FILE_ERROR, -+ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, -+ _("Not a launchable item")); -+ success = FALSE; -+ break; -+ } -+ -+ return success; -+} -+ -+ -+GQuark -+egg_desktop_file_error_quark (void) -+{ -+ return g_quark_from_static_string ("egg-desktop_file-error-quark"); -+} -+ -+ -+G_LOCK_DEFINE_STATIC (egg_desktop_file); -+static EggDesktopFile *egg_desktop_file; -+ -+static void -+egg_set_desktop_file_internal (const char *desktop_file_path, -+ gboolean set_defaults) -+{ -+ GError *error = NULL; -+ -+ G_LOCK (egg_desktop_file); -+ if (egg_desktop_file) -+ egg_desktop_file_free (egg_desktop_file); -+ -+ egg_desktop_file = egg_desktop_file_new (desktop_file_path, &error); -+ if (error) -+ { -+ g_warning ("Could not load desktop file '%s': %s", -+ desktop_file_path, error->message); -+ g_error_free (error); -+ } -+ -+ if (set_defaults && egg_desktop_file != NULL) { -+ /* Set localized application name and default window icon */ -+ if (egg_desktop_file->name) -+ g_set_application_name (egg_desktop_file->name); -+ if (egg_desktop_file->icon) -+ { -+ if (g_path_is_absolute (egg_desktop_file->icon)) -+ gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL); -+ else -+ gtk_window_set_default_icon_name (egg_desktop_file->icon); -+ } -+ } -+ -+ G_UNLOCK (egg_desktop_file); -+} -+ -+/** -+ * egg_set_desktop_file: -+ * @desktop_file_path: path to the application's desktop file -+ * -+ * Creates an #EggDesktopFile for the application from the data at -+ * @desktop_file_path. This will also call g_set_application_name() -+ * with the localized application name from the desktop file, and -+ * gtk_window_set_default_icon_name() or -+ * gtk_window_set_default_icon_from_file() with the application's -+ * icon. Other code may use additional information from the desktop -+ * file. -+ * See egg_set_desktop_file_without_defaults() for a variant of this -+ * function that does not set the application name and default window -+ * icon. -+ * -+ * Note that for thread safety reasons, this function can only -+ * be called once, and is mutually exclusive with calling -+ * egg_set_desktop_file_without_defaults(). -+ **/ -+void -+egg_set_desktop_file (const char *desktop_file_path) -+{ -+ egg_set_desktop_file_internal (desktop_file_path, TRUE); -+} -+ -+/** -+ * egg_set_desktop_file_without_defaults: -+ * @desktop_file_path: path to the application's desktop file -+ * -+ * Creates an #EggDesktopFile for the application from the data at -+ * @desktop_file_path. -+ * See egg_set_desktop_file() for a variant of this function that -+ * sets the application name and default window icon from the information -+ * in the desktop file. -+ * -+ * Note that for thread safety reasons, this function can only -+ * be called once, and is mutually exclusive with calling -+ * egg_set_desktop_file(). -+ **/ -+void -+egg_set_desktop_file_without_defaults (const char *desktop_file_path) -+{ -+ egg_set_desktop_file_internal (desktop_file_path, FALSE); -+} -+ -+/** -+ * egg_get_desktop_file: -+ * -+ * Gets the application's #EggDesktopFile, as set by -+ * egg_set_desktop_file(). -+ * -+ * Return value: the #EggDesktopFile, or %NULL if it hasn't been set. -+ **/ -+EggDesktopFile * -+egg_get_desktop_file (void) -+{ -+ EggDesktopFile *retval; -+ -+ G_LOCK (egg_desktop_file); -+ retval = egg_desktop_file; -+ G_UNLOCK (egg_desktop_file); -+ -+ return retval; -+} -diff --git a/src/libeggsmclient/eggdesktopfile.h b/src/libeggsmclient/eggdesktopfile.h -new file mode 100644 -index 0000000..18fe463 ---- a/src/libeggsmclient/eggdesktopfile.h -+++ b/src/libeggsmclient/eggdesktopfile.h -@@ -0,0 +1,160 @@ -+/* eggdesktopfile.h - Freedesktop.Org Desktop Files -+ * Copyright (C) 2007 Novell, Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser 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, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; see the file COPYING.LIB. If not, -+ * write to the Free Software Foundation, Inc., 59 Temple Place - -+ * Suite 330, Boston, MA 02111-1307, USA. -+ */ -+ -+#ifndef __EGG_DESKTOP_FILE_H__ -+#define __EGG_DESKTOP_FILE_H__ -+ -+#include -+ -+G_BEGIN_DECLS -+ -+typedef struct EggDesktopFile EggDesktopFile; -+ -+typedef enum { -+ EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED, -+ -+ EGG_DESKTOP_FILE_TYPE_APPLICATION, -+ EGG_DESKTOP_FILE_TYPE_LINK, -+ EGG_DESKTOP_FILE_TYPE_DIRECTORY -+} EggDesktopFileType; -+ -+EggDesktopFile *egg_desktop_file_new (const char *desktop_file_path, -+ GError **error); -+ -+EggDesktopFile *egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, -+ GError **error); -+EggDesktopFile *egg_desktop_file_new_from_dirs (const char *desktop_file_path, -+ const char **search_dirs, -+ GError **error); -+EggDesktopFile *egg_desktop_file_new_from_key_file (GKeyFile *key_file, -+ const char *source, -+ GError **error); -+ -+void egg_desktop_file_free (EggDesktopFile *desktop_file); -+ -+const char *egg_desktop_file_get_source (EggDesktopFile *desktop_file); -+ -+EggDesktopFileType egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file); -+ -+const char *egg_desktop_file_get_name (EggDesktopFile *desktop_file); -+const char *egg_desktop_file_get_icon (EggDesktopFile *desktop_file); -+ -+gboolean egg_desktop_file_can_launch (EggDesktopFile *desktop_file, -+ const char *desktop_environment); -+ -+gboolean egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file); -+gboolean egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file); -+gboolean egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file); -+ -+char *egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, -+ GSList *documents, -+ GError **error); -+ -+gboolean egg_desktop_file_launch (EggDesktopFile *desktop_file, -+ GSList *documents, -+ GError **error, -+ ...) G_GNUC_NULL_TERMINATED; -+ -+typedef enum { -+ EGG_DESKTOP_FILE_LAUNCH_CLEARENV = 1, -+ EGG_DESKTOP_FILE_LAUNCH_PUTENV, -+ EGG_DESKTOP_FILE_LAUNCH_SCREEN, -+ EGG_DESKTOP_FILE_LAUNCH_WORKSPACE, -+ EGG_DESKTOP_FILE_LAUNCH_DIRECTORY, -+ EGG_DESKTOP_FILE_LAUNCH_TIME, -+ EGG_DESKTOP_FILE_LAUNCH_FLAGS, -+ EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC, -+ EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, -+ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE, -+ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE, -+ EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE, -+ EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID -+} EggDesktopFileLaunchOption; -+ -+/* Standard Keys */ -+#define EGG_DESKTOP_FILE_GROUP "Desktop Entry" -+ -+#define EGG_DESKTOP_FILE_KEY_TYPE "Type" -+#define EGG_DESKTOP_FILE_KEY_VERSION "Version" -+#define EGG_DESKTOP_FILE_KEY_NAME "Name" -+#define EGG_DESKTOP_FILE_KEY_GENERIC_NAME "GenericName" -+#define EGG_DESKTOP_FILE_KEY_NO_DISPLAY "NoDisplay" -+#define EGG_DESKTOP_FILE_KEY_COMMENT "Comment" -+#define EGG_DESKTOP_FILE_KEY_ICON "Icon" -+#define EGG_DESKTOP_FILE_KEY_HIDDEN "Hidden" -+#define EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN "OnlyShowIn" -+#define EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN "NotShowIn" -+#define EGG_DESKTOP_FILE_KEY_TRY_EXEC "TryExec" -+#define EGG_DESKTOP_FILE_KEY_EXEC "Exec" -+#define EGG_DESKTOP_FILE_KEY_PATH "Path" -+#define EGG_DESKTOP_FILE_KEY_TERMINAL "Terminal" -+#define EGG_DESKTOP_FILE_KEY_MIME_TYPE "MimeType" -+#define EGG_DESKTOP_FILE_KEY_CATEGORIES "Categories" -+#define EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY "StartupNotify" -+#define EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS "StartupWMClass" -+#define EGG_DESKTOP_FILE_KEY_URL "URL" -+ -+/* Accessors */ -+gboolean egg_desktop_file_has_key (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error); -+char *egg_desktop_file_get_string (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error) G_GNUC_MALLOC; -+char *egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, -+ const char *key, -+ const char *locale, -+ GError **error) G_GNUC_MALLOC; -+gboolean egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error); -+double egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, -+ const char *key, -+ GError **error); -+char **egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, -+ const char *key, -+ gsize *length, -+ GError **error) G_GNUC_MALLOC; -+char **egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, -+ const char *key, -+ const char *locale, -+ gsize *length, -+ GError **error) G_GNUC_MALLOC; -+ -+ -+/* Errors */ -+#define EGG_DESKTOP_FILE_ERROR egg_desktop_file_error_quark() -+ -+GQuark egg_desktop_file_error_quark (void); -+ -+typedef enum { -+ EGG_DESKTOP_FILE_ERROR_INVALID, -+ EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, -+ EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION -+} EggDesktopFileError; -+ -+/* Global application desktop file */ -+void egg_set_desktop_file (const char *desktop_file_path); -+void egg_set_desktop_file_without_defaults (const char *desktop_file_path); -+EggDesktopFile *egg_get_desktop_file (void); -+ -+ -+G_END_DECLS -+ -+#endif /* __EGG_DESKTOP_FILE_H__ */ -diff --git a/src/libeggsmclient/eggsmclient-private.h b/src/libeggsmclient/eggsmclient-private.h -new file mode 100644 -index 0000000..ccb10bf ---- a/src/libeggsmclient/eggsmclient-private.h -+++ b/src/libeggsmclient/eggsmclient-private.h -@@ -0,0 +1,53 @@ -+/* eggsmclient-private.h -+ * Copyright (C) 2007 Novell, Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser 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, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser 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. -+ */ -+ -+#ifndef __EGG_SM_CLIENT_PRIVATE_H__ -+#define __EGG_SM_CLIENT_PRIVATE_H__ -+ -+#include -+#include "eggsmclient.h" -+ -+G_BEGIN_DECLS -+ -+GKeyFile *egg_sm_client_save_state (EggSMClient *client); -+void egg_sm_client_quit_requested (EggSMClient *client); -+void egg_sm_client_quit_cancelled (EggSMClient *client); -+void egg_sm_client_quit (EggSMClient *client); -+ -+#if defined (GDK_WINDOWING_X11) -+# ifdef EGG_SM_CLIENT_BACKEND_XSMP -+GType egg_sm_client_xsmp_get_type (void); -+EggSMClient *egg_sm_client_xsmp_new (void); -+# endif -+# ifdef EGG_SM_CLIENT_BACKEND_DBUS -+GType egg_sm_client_dbus_get_type (void); -+EggSMClient *egg_sm_client_dbus_new (void); -+# endif -+#elif defined (GDK_WINDOWING_WIN32) -+GType egg_sm_client_win32_get_type (void); -+EggSMClient *egg_sm_client_win32_new (void); -+#elif defined (GDK_WINDOWING_QUARTZ) -+GType egg_sm_client_osx_get_type (void); -+EggSMClient *egg_sm_client_osx_new (void); -+#endif -+ -+G_END_DECLS -+ -+ -+#endif /* __EGG_SM_CLIENT_PRIVATE_H__ */ -diff --git a/src/libeggsmclient/eggsmclient-xsmp.c b/src/libeggsmclient/eggsmclient-xsmp.c -new file mode 100644 -index 0000000..8bebfba ---- a/src/libeggsmclient/eggsmclient-xsmp.c -+++ b/src/libeggsmclient/eggsmclient-xsmp.c -@@ -0,0 +1,1370 @@ -+/* -+ * Copyright (C) 2007 Novell, Inc. -+ * -+ * Inspired by various other pieces of code including GsmClient (C) -+ * 2001 Havoc Pennington, GnomeClient (C) 1998 Carsten Schaar, and twm -+ * session code (C) 1998 The Open Group. -+ * -+ * 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, -+ * 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. -+ * -+ * 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. -+ */ -+ -+#include "config.h" -+ -+#include "eggsmclient.h" -+#include "eggsmclient-private.h" -+ -+#include "eggdesktopfile.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#define EGG_TYPE_SM_CLIENT_XSMP (egg_sm_client_xsmp_get_type ()) -+#define EGG_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP)) -+#define EGG_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) -+#define EGG_IS_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_XSMP)) -+#define EGG_IS_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_XSMP)) -+#define EGG_SM_CLIENT_XSMP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) -+ -+typedef struct _EggSMClientXSMP EggSMClientXSMP; -+typedef struct _EggSMClientXSMPClass EggSMClientXSMPClass; -+ -+/* These mostly correspond to the similarly-named states in section -+ * 9.1 of the XSMP spec. Some of the states there aren't represented -+ * here, because we don't need them. SHUTDOWN_CANCELLED is slightly -+ * different from the spec; we use it when the client is IDLE after a -+ * ShutdownCancelled message, but the application is still interacting -+ * and doesn't know the shutdown has been cancelled yet. -+ */ -+typedef enum -+{ -+ XSMP_STATE_IDLE, -+ XSMP_STATE_SAVE_YOURSELF, -+ XSMP_STATE_INTERACT_REQUEST, -+ XSMP_STATE_INTERACT, -+ XSMP_STATE_SAVE_YOURSELF_DONE, -+ XSMP_STATE_SHUTDOWN_CANCELLED, -+ XSMP_STATE_CONNECTION_CLOSED -+} EggSMClientXSMPState; -+ -+static const char *state_names[] = { -+ "idle", -+ "save-yourself", -+ "interact-request", -+ "interact", -+ "save-yourself-done", -+ "shutdown-cancelled", -+ "connection-closed" -+}; -+ -+#define EGG_SM_CLIENT_XSMP_STATE(xsmp) (state_names[(xsmp)->state]) -+ -+struct _EggSMClientXSMP -+{ -+ EggSMClient parent; -+ -+ SmcConn connection; -+ char *client_id; -+ -+ EggSMClientXSMPState state; -+ char **restart_command; -+ gboolean set_restart_command; -+ int restart_style; -+ -+ guint idle; -+ -+ /* Current SaveYourself state */ -+ guint expecting_initial_save_yourself : 1; -+ guint need_save_state : 1; -+ guint need_quit_requested : 1; -+ guint interact_errors : 1; -+ guint shutting_down : 1; -+ -+ /* Todo list */ -+ guint waiting_to_set_initial_properties : 1; -+ guint waiting_to_emit_quit : 1; -+ guint waiting_to_emit_quit_cancelled : 1; -+ guint waiting_to_save_myself : 1; -+ -+}; -+ -+struct _EggSMClientXSMPClass -+{ -+ EggSMClientClass parent_class; -+ -+}; -+ -+static void sm_client_xsmp_startup (EggSMClient *client, -+ const char *client_id); -+static void sm_client_xsmp_set_restart_command (EggSMClient *client, -+ int argc, -+ const char **argv); -+static void sm_client_xsmp_will_quit (EggSMClient *client, -+ gboolean will_quit); -+static gboolean sm_client_xsmp_end_session (EggSMClient *client, -+ EggSMClientEndStyle style, -+ gboolean request_confirmation); -+ -+static void xsmp_save_yourself (SmcConn smc_conn, -+ SmPointer client_data, -+ int save_style, -+ Bool shutdown, -+ int interact_style, -+ Bool fast); -+static void xsmp_die (SmcConn smc_conn, -+ SmPointer client_data); -+static void xsmp_save_complete (SmcConn smc_conn, -+ SmPointer client_data); -+static void xsmp_shutdown_cancelled (SmcConn smc_conn, -+ SmPointer client_data); -+static void xsmp_interact (SmcConn smc_conn, -+ SmPointer client_data); -+ -+static SmProp *array_prop (const char *name, -+ ...); -+static SmProp *ptrarray_prop (const char *name, -+ GPtrArray *values); -+static SmProp *string_prop (const char *name, -+ const char *value); -+static SmProp *card8_prop (const char *name, -+ unsigned char value); -+ -+static void set_properties (EggSMClientXSMP *xsmp, ...); -+static void delete_properties (EggSMClientXSMP *xsmp, ...); -+ -+static GPtrArray *generate_command (char **restart_command, -+ const char *client_id, -+ const char *state_file); -+ -+static void save_state (EggSMClientXSMP *xsmp); -+static void do_save_yourself (EggSMClientXSMP *xsmp); -+static void update_pending_events (EggSMClientXSMP *xsmp); -+ -+static void ice_init (void); -+static gboolean process_ice_messages (IceConn ice_conn); -+static void smc_error_handler (SmcConn smc_conn, -+ Bool swap, -+ int offending_minor_opcode, -+ unsigned long offending_sequence, -+ int error_class, -+ int severity, -+ SmPointer values); -+ -+G_DEFINE_TYPE (EggSMClientXSMP, egg_sm_client_xsmp, EGG_TYPE_SM_CLIENT) -+ -+static void -+egg_sm_client_xsmp_init (EggSMClientXSMP *xsmp) -+{ -+ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; -+ xsmp->connection = NULL; -+ xsmp->restart_style = SmRestartIfRunning; -+} -+ -+static void -+egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass) -+{ -+ EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); -+ -+ sm_client_class->startup = sm_client_xsmp_startup; -+ sm_client_class->set_restart_command = sm_client_xsmp_set_restart_command; -+ sm_client_class->will_quit = sm_client_xsmp_will_quit; -+ sm_client_class->end_session = sm_client_xsmp_end_session; -+} -+ -+EggSMClient * -+egg_sm_client_xsmp_new (void) -+{ -+ if (!g_getenv ("SESSION_MANAGER")) -+ return NULL; -+ -+ return g_object_new (EGG_TYPE_SM_CLIENT_XSMP, NULL); -+} -+ -+static gboolean -+sm_client_xsmp_set_initial_properties (gpointer user_data) -+{ -+ EggSMClientXSMP *xsmp = user_data; -+ EggDesktopFile *desktop_file; -+ GPtrArray *clone, *restart; -+ char pid_str[64]; -+ -+ if (xsmp->idle) -+ { -+ g_source_remove (xsmp->idle); -+ xsmp->idle = 0; -+ } -+ xsmp->waiting_to_set_initial_properties = FALSE; -+ -+ if (egg_sm_client_get_mode () == EGG_SM_CLIENT_MODE_NO_RESTART) -+ xsmp->restart_style = SmRestartNever; -+ -+ /* Parse info out of desktop file */ -+ desktop_file = egg_get_desktop_file (); -+ if (desktop_file) -+ { -+ GError *err = NULL; -+ char *cmdline, **argv; -+ int argc; -+ -+ if (xsmp->restart_style == SmRestartIfRunning) -+ { -+ if (egg_desktop_file_get_boolean (desktop_file, -+ "X-GNOME-AutoRestart", NULL)) -+ xsmp->restart_style = SmRestartImmediately; -+ } -+ -+ if (!xsmp->set_restart_command) -+ { -+ cmdline = egg_desktop_file_parse_exec (desktop_file, NULL, &err); -+ if (cmdline && g_shell_parse_argv (cmdline, &argc, &argv, &err)) -+ { -+ egg_sm_client_set_restart_command (EGG_SM_CLIENT (xsmp), -+ argc, (const char **)argv); -+ g_strfreev (argv); -+ } -+ else -+ { -+ g_warning ("Could not parse Exec line in desktop file: %s", -+ err->message); -+ g_error_free (err); -+ } -+ g_free (cmdline); -+ } -+ } -+ -+ if (!xsmp->set_restart_command) -+ xsmp->restart_command = g_strsplit (g_get_prgname (), " ", -1); -+ -+ clone = generate_command (xsmp->restart_command, NULL, NULL); -+ restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); -+ -+ g_debug ("Setting initial properties"); -+ -+ /* Program, CloneCommand, RestartCommand, and UserID are required. -+ * ProcessID isn't required, but the SM may be able to do something -+ * useful with it. -+ */ -+ g_snprintf (pid_str, sizeof (pid_str), "%lu", (gulong) getpid ()); -+ set_properties (xsmp, -+ string_prop (SmProgram, g_get_prgname ()), -+ ptrarray_prop (SmCloneCommand, clone), -+ ptrarray_prop (SmRestartCommand, restart), -+ string_prop (SmUserID, g_get_user_name ()), -+ string_prop (SmProcessID, pid_str), -+ card8_prop (SmRestartStyleHint, xsmp->restart_style), -+ NULL); -+ g_ptr_array_free (clone, TRUE); -+ g_ptr_array_free (restart, TRUE); -+ -+ if (desktop_file) -+ { -+ set_properties (xsmp, -+ string_prop ("_GSM_DesktopFile", egg_desktop_file_get_source (desktop_file)), -+ NULL); -+ } -+ -+ update_pending_events (xsmp); -+ return FALSE; -+} -+ -+/* This gets called from two different places: xsmp_die() (when the -+ * server asks us to disconnect) and process_ice_messages() (when the -+ * server disconnects unexpectedly). -+ */ -+static void -+sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp) -+{ -+ SmcConn connection; -+ -+ if (!xsmp->connection) -+ return; -+ -+ g_debug ("Disconnecting"); -+ -+ connection = xsmp->connection; -+ xsmp->connection = NULL; -+ SmcCloseConnection (connection, 0, NULL); -+ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; -+ -+ xsmp->waiting_to_save_myself = FALSE; -+ update_pending_events (xsmp); -+} -+ -+static void -+sm_client_xsmp_startup (EggSMClient *client, -+ const char *client_id) -+{ -+ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; -+ SmcCallbacks callbacks; -+ char *ret_client_id; -+ char error_string_ret[256]; -+ -+ xsmp->client_id = g_strdup (client_id); -+ -+ ice_init (); -+ SmcSetErrorHandler (smc_error_handler); -+ -+ callbacks.save_yourself.callback = xsmp_save_yourself; -+ callbacks.die.callback = xsmp_die; -+ callbacks.save_complete.callback = xsmp_save_complete; -+ callbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled; -+ -+ callbacks.save_yourself.client_data = xsmp; -+ callbacks.die.client_data = xsmp; -+ callbacks.save_complete.client_data = xsmp; -+ callbacks.shutdown_cancelled.client_data = xsmp; -+ -+ client_id = NULL; -+ error_string_ret[0] = '\0'; -+ xsmp->connection = -+ SmcOpenConnection (NULL, xsmp, SmProtoMajor, SmProtoMinor, -+ SmcSaveYourselfProcMask | SmcDieProcMask | -+ SmcSaveCompleteProcMask | -+ SmcShutdownCancelledProcMask, -+ &callbacks, -+ xsmp->client_id, &ret_client_id, -+ sizeof (error_string_ret), error_string_ret); -+ -+ if (!xsmp->connection) -+ { -+ g_warning ("Failed to connect to the session manager: %s\n", -+ error_string_ret[0] ? -+ error_string_ret : "no error message given"); -+ xsmp->state = XSMP_STATE_CONNECTION_CLOSED; -+ return; -+ } -+ -+ /* We expect a pointless initial SaveYourself if either (a) we -+ * didn't have an initial client ID, or (b) we DID have an initial -+ * client ID, but the server rejected it and gave us a new one. -+ */ -+ if (!xsmp->client_id || -+ (ret_client_id && strcmp (xsmp->client_id, ret_client_id) != 0)) -+ xsmp->expecting_initial_save_yourself = TRUE; -+ -+ if (ret_client_id) -+ { -+ g_free (xsmp->client_id); -+ xsmp->client_id = g_strdup (ret_client_id); -+ free (ret_client_id); -+ -+ gdk_threads_enter (); -+ gdk_set_sm_client_id (xsmp->client_id); -+ gdk_threads_leave (); -+ -+ g_debug ("Got client ID \"%s\"", xsmp->client_id); -+ } -+ -+ xsmp->state = XSMP_STATE_IDLE; -+ -+ /* Do not set the initial properties until we reach the main loop, -+ * so that the application has a chance to call -+ * egg_set_desktop_file(). (This may also help the session manager -+ * have a better idea of when the application is fully up and -+ * running.) -+ */ -+ xsmp->waiting_to_set_initial_properties = TRUE; -+ xsmp->idle = g_idle_add (sm_client_xsmp_set_initial_properties, client); -+} -+ -+static void -+sm_client_xsmp_set_restart_command (EggSMClient *client, -+ int argc, -+ const char **argv) -+{ -+ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; -+ int i; -+ -+ g_strfreev (xsmp->restart_command); -+ -+ xsmp->restart_command = g_new (char *, argc + 1); -+ for (i = 0; i < argc; i++) -+ xsmp->restart_command[i] = g_strdup (argv[i]); -+ xsmp->restart_command[i] = NULL; -+ -+ xsmp->set_restart_command = TRUE; -+} -+ -+static void -+sm_client_xsmp_will_quit (EggSMClient *client, -+ gboolean will_quit) -+{ -+ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; -+ -+ if (xsmp->state == XSMP_STATE_CONNECTION_CLOSED) -+ { -+ /* The session manager has already exited! Schedule a quit -+ * signal. -+ */ -+ xsmp->waiting_to_emit_quit = TRUE; -+ update_pending_events (xsmp); -+ return; -+ } -+ else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) -+ { -+ /* We received a ShutdownCancelled message while the application -+ * was interacting; Schedule a quit_cancelled signal. -+ */ -+ xsmp->waiting_to_emit_quit_cancelled = TRUE; -+ update_pending_events (xsmp); -+ return; -+ } -+ -+ g_return_if_fail (xsmp->state == XSMP_STATE_INTERACT); -+ -+ g_debug ("Sending InteractDone(%s)", will_quit ? "False" : "True"); -+ SmcInteractDone (xsmp->connection, !will_quit); -+ -+ if (will_quit && xsmp->need_save_state) -+ save_state (xsmp); -+ -+ g_debug ("Sending SaveYourselfDone(%s)", will_quit ? "True" : "False"); -+ SmcSaveYourselfDone (xsmp->connection, will_quit); -+ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; -+} -+ -+static gboolean -+sm_client_xsmp_end_session (EggSMClient *client, -+ EggSMClientEndStyle style, -+ gboolean request_confirmation) -+{ -+ EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; -+ int save_type; -+ -+ /* To end the session via XSMP, we have to send a -+ * SaveYourselfRequest. We aren't allowed to do that if anything -+ * else is going on, but we don't want to expose this fact to the -+ * application. So we do our best to patch things up here... -+ * -+ * In the worst case, this method might block for some length of -+ * time in process_ice_messages, but the only time that code path is -+ * honestly likely to get hit is if the application tries to end the -+ * session as the very first thing it does, in which case it -+ * probably won't actually block anyway. It's not worth gunking up -+ * the API to try to deal nicely with the other 0.01% of cases where -+ * this happens. -+ */ -+ -+ while (xsmp->state != XSMP_STATE_IDLE || -+ xsmp->expecting_initial_save_yourself) -+ { -+ /* If we're already shutting down, we don't need to do anything. */ -+ if (xsmp->shutting_down) -+ return TRUE; -+ -+ switch (xsmp->state) -+ { -+ case XSMP_STATE_CONNECTION_CLOSED: -+ return FALSE; -+ -+ case XSMP_STATE_SAVE_YOURSELF: -+ /* Trying to log out from the save_state callback? Whatever. -+ * Abort the save_state. -+ */ -+ SmcSaveYourselfDone (xsmp->connection, FALSE); -+ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; -+ break; -+ -+ case XSMP_STATE_INTERACT_REQUEST: -+ case XSMP_STATE_INTERACT: -+ case XSMP_STATE_SHUTDOWN_CANCELLED: -+ /* Already in a shutdown-related state, just ignore -+ * the new shutdown request... -+ */ -+ return TRUE; -+ -+ case XSMP_STATE_IDLE: -+ if (xsmp->waiting_to_set_initial_properties) -+ sm_client_xsmp_set_initial_properties (xsmp); -+ -+ if (!xsmp->expecting_initial_save_yourself) -+ break; -+ /* else fall through */ -+ -+ case XSMP_STATE_SAVE_YOURSELF_DONE: -+ /* We need to wait for some response from the server.*/ -+ process_ice_messages (SmcGetIceConnection (xsmp->connection)); -+ break; -+ -+ default: -+ /* Hm... shouldn't happen */ -+ return FALSE; -+ } -+ } -+ -+ /* xfce4-session will do the wrong thing if we pass SmSaveGlobal and -+ * the user chooses to save the session. But gnome-session will do -+ * the wrong thing if we pass SmSaveBoth and the user chooses NOT to -+ * save the session... Sigh. -+ */ -+ if (!strcmp (SmcVendor (xsmp->connection), "xfce4-session")) -+ save_type = SmSaveBoth; -+ else -+ save_type = SmSaveGlobal; -+ -+ g_debug ("Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)", request_confirmation ? "!" : ""); -+ SmcRequestSaveYourself (xsmp->connection, -+ save_type, -+ True, /* shutdown */ -+ SmInteractStyleAny, -+ !request_confirmation, /* fast */ -+ True /* global */); -+ return TRUE; -+} -+ -+static gboolean -+idle_do_pending_events (gpointer data) -+{ -+ EggSMClientXSMP *xsmp = data; -+ EggSMClient *client = data; -+ -+ gdk_threads_enter (); -+ -+ xsmp->idle = 0; -+ -+ if (xsmp->waiting_to_emit_quit) -+ { -+ xsmp->waiting_to_emit_quit = FALSE; -+ egg_sm_client_quit (client); -+ goto out; -+ } -+ -+ if (xsmp->waiting_to_emit_quit_cancelled) -+ { -+ xsmp->waiting_to_emit_quit_cancelled = FALSE; -+ egg_sm_client_quit_cancelled (client); -+ xsmp->state = XSMP_STATE_IDLE; -+ } -+ -+ if (xsmp->waiting_to_save_myself) -+ { -+ xsmp->waiting_to_save_myself = FALSE; -+ do_save_yourself (xsmp); -+ } -+ -+ out: -+ gdk_threads_leave (); -+ return FALSE; -+} -+ -+static void -+update_pending_events (EggSMClientXSMP *xsmp) -+{ -+ gboolean want_idle = -+ xsmp->waiting_to_emit_quit || -+ xsmp->waiting_to_emit_quit_cancelled || -+ xsmp->waiting_to_save_myself; -+ -+ if (want_idle) -+ { -+ if (xsmp->idle == 0) -+ xsmp->idle = g_idle_add (idle_do_pending_events, xsmp); -+ } -+ else -+ { -+ if (xsmp->idle != 0) -+ g_source_remove (xsmp->idle); -+ xsmp->idle = 0; -+ } -+} -+ -+static void -+fix_broken_state (EggSMClientXSMP *xsmp, const char *message, -+ gboolean send_interact_done, -+ gboolean send_save_yourself_done) -+{ -+ g_warning ("Received XSMP %s message in state %s: client or server error", -+ message, EGG_SM_CLIENT_XSMP_STATE (xsmp)); -+ -+ /* Forget any pending SaveYourself plans we had */ -+ xsmp->waiting_to_save_myself = FALSE; -+ update_pending_events (xsmp); -+ -+ if (send_interact_done) -+ SmcInteractDone (xsmp->connection, False); -+ if (send_save_yourself_done) -+ SmcSaveYourselfDone (xsmp->connection, True); -+ -+ xsmp->state = send_save_yourself_done ? XSMP_STATE_SAVE_YOURSELF_DONE : XSMP_STATE_IDLE; -+} -+ -+/* SM callbacks */ -+ -+static void -+xsmp_save_yourself (SmcConn smc_conn, -+ SmPointer client_data, -+ int save_type, -+ Bool shutdown, -+ int interact_style, -+ Bool fast) -+{ -+ EggSMClientXSMP *xsmp = client_data; -+ gboolean wants_quit_requested; -+ -+ g_debug ("Received SaveYourself(%s, %s, %s, %s) in state %s", -+ save_type == SmSaveLocal ? "SmSaveLocal" : -+ save_type == SmSaveGlobal ? "SmSaveGlobal" : "SmSaveBoth", -+ shutdown ? "Shutdown" : "!Shutdown", -+ interact_style == SmInteractStyleAny ? "SmInteractStyleAny" : -+ interact_style == SmInteractStyleErrors ? "SmInteractStyleErrors" : -+ "SmInteractStyleNone", fast ? "Fast" : "!Fast", -+ EGG_SM_CLIENT_XSMP_STATE (xsmp)); -+ -+ if (xsmp->state != XSMP_STATE_IDLE && -+ xsmp->state != XSMP_STATE_SHUTDOWN_CANCELLED) -+ { -+ fix_broken_state (xsmp, "SaveYourself", FALSE, TRUE); -+ return; -+ } -+ -+ if (xsmp->waiting_to_set_initial_properties) -+ sm_client_xsmp_set_initial_properties (xsmp); -+ -+ /* If this is the initial SaveYourself, ignore it; we've already set -+ * properties and there's no reason to actually save state too. -+ */ -+ if (xsmp->expecting_initial_save_yourself) -+ { -+ xsmp->expecting_initial_save_yourself = FALSE; -+ -+ if (save_type == SmSaveLocal && -+ interact_style == SmInteractStyleNone && -+ !shutdown && !fast) -+ { -+ g_debug ("Sending SaveYourselfDone(True) for initial SaveYourself"); -+ SmcSaveYourselfDone (xsmp->connection, True); -+ /* As explained in the comment at the end of -+ * do_save_yourself(), SAVE_YOURSELF_DONE is the correct -+ * state here, not IDLE. -+ */ -+ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; -+ return; -+ } -+ else -+ g_warning ("First SaveYourself was not the expected one!"); -+ } -+ -+ /* Even ignoring the "fast" flag completely, there are still 18 -+ * different combinations of save_type, shutdown and interact_style. -+ * We interpret them as follows: -+ * -+ * Type Shutdown Interact Interpretation -+ * G F A/E/N do nothing (1) -+ * G T N do nothing (1)* -+ * G T A/E quit_requested (2) -+ * L/B F A/E/N save_state (3) -+ * L/B T N save_state (3)* -+ * L/B T A/E quit_requested, then save_state (4) -+ * -+ * 1. Do nothing, because the SM asked us to do something -+ * uninteresting (save open files, but then don't quit -+ * afterward) or rude (save open files without asking the user -+ * for confirmation). -+ * -+ * 2. Request interaction and then emit ::quit_requested. This -+ * perhaps isn't quite correct for the SmInteractStyleErrors -+ * case, but we don't care. -+ * -+ * 3. Emit ::save_state. The SmSaveBoth SaveYourselfs in these -+ * rows essentially get demoted to SmSaveLocal, because their -+ * Global halves correspond to "do nothing". -+ * -+ * 4. Request interaction, emit ::quit_requested, and then emit -+ * ::save_state after interacting. This is the SmSaveBoth -+ * equivalent of #2, but we also promote SmSaveLocal shutdown -+ * SaveYourselfs to SmSaveBoth here, because we want to give -+ * the user a chance to save open files before quitting. -+ * -+ * (* It would be nice if we could do something useful when the -+ * session manager sends a SaveYourself with shutdown True and -+ * SmInteractStyleNone. But we can't, so we just pretend it didn't -+ * even tell us it was shutting down. The docs for ::quit mention -+ * that it might not always be preceded by ::quit_requested.) -+ */ -+ -+ /* As an optimization, we don't actually request interaction and -+ * emit ::quit_requested if the application isn't listening to the -+ * signal. -+ */ -+ wants_quit_requested = g_signal_has_handler_pending (xsmp, g_signal_lookup ("quit_requested", EGG_TYPE_SM_CLIENT), 0, FALSE); -+ -+ xsmp->need_save_state = (save_type != SmSaveGlobal); -+ xsmp->need_quit_requested = (shutdown && wants_quit_requested && -+ interact_style != SmInteractStyleNone); -+ xsmp->interact_errors = (interact_style == SmInteractStyleErrors); -+ -+ xsmp->shutting_down = shutdown; -+ -+ do_save_yourself (xsmp); -+} -+ -+static void -+do_save_yourself (EggSMClientXSMP *xsmp) -+{ -+ if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) -+ { -+ /* The SM cancelled a previous SaveYourself, but we haven't yet -+ * had a chance to tell the application, so we can't start -+ * processing this SaveYourself yet. -+ */ -+ xsmp->waiting_to_save_myself = TRUE; -+ update_pending_events (xsmp); -+ return; -+ } -+ -+ if (xsmp->need_quit_requested) -+ { -+ xsmp->state = XSMP_STATE_INTERACT_REQUEST; -+ -+ g_debug ("Sending InteractRequest(%s)", -+ xsmp->interact_errors ? "Error" : "Normal"); -+ SmcInteractRequest (xsmp->connection, -+ xsmp->interact_errors ? SmDialogError : SmDialogNormal, -+ xsmp_interact, -+ xsmp); -+ return; -+ } -+ -+ if (xsmp->need_save_state) -+ { -+ save_state (xsmp); -+ -+ /* Though unlikely, the client could have been disconnected -+ * while the application was saving its state. -+ */ -+ if (!xsmp->connection) -+ return; -+ } -+ -+ g_debug ("Sending SaveYourselfDone(True)"); -+ SmcSaveYourselfDone (xsmp->connection, True); -+ -+ /* The client state diagram in the XSMP spec says that after a -+ * non-shutdown SaveYourself, we go directly back to "idle". But -+ * everything else in both the XSMP spec and the libSM docs -+ * disagrees. -+ */ -+ xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; -+} -+ -+static void -+save_state (EggSMClientXSMP *xsmp) -+{ -+ GKeyFile *state_file; -+ char *state_file_path, *data; -+ EggDesktopFile *desktop_file; -+ GPtrArray *restart; -+ int offset, fd; -+ -+ /* We set xsmp->state before emitting save_state, but our caller is -+ * responsible for setting it back afterward. -+ */ -+ xsmp->state = XSMP_STATE_SAVE_YOURSELF; -+ -+ state_file = egg_sm_client_save_state ((EggSMClient *)xsmp); -+ if (!state_file) -+ { -+ restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); -+ set_properties (xsmp, -+ ptrarray_prop (SmRestartCommand, restart), -+ NULL); -+ g_ptr_array_free (restart, TRUE); -+ delete_properties (xsmp, SmDiscardCommand, NULL); -+ return; -+ } -+ -+ desktop_file = egg_get_desktop_file (); -+ if (desktop_file) -+ { -+ GKeyFile *merged_file; -+ char *desktop_file_path; -+ -+ merged_file = g_key_file_new (); -+ desktop_file_path = -+ g_filename_from_uri (egg_desktop_file_get_source (desktop_file), -+ NULL, NULL); -+ if (desktop_file_path && -+ g_key_file_load_from_file (merged_file, desktop_file_path, -+ G_KEY_FILE_KEEP_COMMENTS | -+ G_KEY_FILE_KEEP_TRANSLATIONS, NULL)) -+ { -+ guint g, k, i; -+ char **groups, **keys, *value, *exec; -+ -+ groups = g_key_file_get_groups (state_file, NULL); -+ for (g = 0; groups[g]; g++) -+ { -+ keys = g_key_file_get_keys (state_file, groups[g], NULL, NULL); -+ for (k = 0; keys[k]; k++) -+ { -+ value = g_key_file_get_value (state_file, groups[g], -+ keys[k], NULL); -+ if (value) -+ { -+ g_key_file_set_value (merged_file, groups[g], -+ keys[k], value); -+ g_free (value); -+ } -+ } -+ g_strfreev (keys); -+ } -+ g_strfreev (groups); -+ -+ g_key_file_free (state_file); -+ state_file = merged_file; -+ -+ /* Update Exec key using "--sm-client-state-file %k" */ -+ restart = generate_command (xsmp->restart_command, -+ NULL, "%k"); -+ for (i = 0; i < restart->len; i++) -+ restart->pdata[i] = g_shell_quote (restart->pdata[i]); -+ g_ptr_array_add (restart, NULL); -+ exec = g_strjoinv (" ", (char **)restart->pdata); -+ g_strfreev ((char **)restart->pdata); -+ g_ptr_array_free (restart, FALSE); -+ -+ g_key_file_set_string (state_file, EGG_DESKTOP_FILE_GROUP, -+ EGG_DESKTOP_FILE_KEY_EXEC, -+ exec); -+ g_free (exec); -+ } -+ else -+ desktop_file = NULL; -+ -+ g_free (desktop_file_path); -+ } -+ -+ /* Now write state_file to disk. (We can't use mktemp(), because -+ * that requires the filename to end with "XXXXXX", and we want -+ * it to end with ".desktop".) -+ */ -+ -+ data = g_key_file_to_data (state_file, NULL, NULL); -+ g_key_file_free (state_file); -+ -+ offset = 0; -+ while (1) -+ { -+ state_file_path = g_strdup_printf ("%s%csession-state%c%s-%ld.%s", -+ g_get_user_config_dir (), -+ G_DIR_SEPARATOR, G_DIR_SEPARATOR, -+ g_get_prgname (), -+ (long)time (NULL) + offset, -+ desktop_file ? "desktop" : "state"); -+ -+ fd = open (state_file_path, O_WRONLY | O_CREAT | O_EXCL, 0644); -+ if (fd == -1) -+ { -+ if (errno == EEXIST) -+ { -+ offset++; -+ g_free (state_file_path); -+ continue; -+ } -+ else if (errno == ENOTDIR || errno == ENOENT) -+ { -+ char *sep = strrchr (state_file_path, G_DIR_SEPARATOR); -+ -+ *sep = '\0'; -+ if (g_mkdir_with_parents (state_file_path, 0755) != 0) -+ { -+ g_warning ("Could not create directory '%s'", -+ state_file_path); -+ g_free (state_file_path); -+ state_file_path = NULL; -+ break; -+ } -+ -+ continue; -+ } -+ -+ g_warning ("Could not create file '%s': %s", -+ state_file_path, g_strerror (errno)); -+ g_free (state_file_path); -+ state_file_path = NULL; -+ break; -+ } -+ -+ close (fd); -+ g_file_set_contents (state_file_path, data, -1, NULL); -+ break; -+ } -+ g_free (data); -+ -+ restart = generate_command (xsmp->restart_command, xsmp->client_id, -+ state_file_path); -+ set_properties (xsmp, -+ ptrarray_prop (SmRestartCommand, restart), -+ NULL); -+ g_ptr_array_free (restart, TRUE); -+ -+ if (state_file_path) -+ { -+ set_properties (xsmp, -+ array_prop (SmDiscardCommand, -+ "/bin/rm", "-rf", state_file_path, -+ NULL), -+ NULL); -+ g_free (state_file_path); -+ } -+} -+ -+static void -+xsmp_interact (SmcConn smc_conn, -+ SmPointer client_data) -+{ -+ EggSMClientXSMP *xsmp = client_data; -+ EggSMClient *client = client_data; -+ -+ g_debug ("Received Interact message in state %s", -+ EGG_SM_CLIENT_XSMP_STATE (xsmp)); -+ -+ if (xsmp->state != XSMP_STATE_INTERACT_REQUEST) -+ { -+ fix_broken_state (xsmp, "Interact", TRUE, TRUE); -+ return; -+ } -+ -+ xsmp->state = XSMP_STATE_INTERACT; -+ egg_sm_client_quit_requested (client); -+} -+ -+static void -+xsmp_die (SmcConn smc_conn, -+ SmPointer client_data) -+{ -+ EggSMClientXSMP *xsmp = client_data; -+ EggSMClient *client = client_data; -+ -+ g_debug ("Received Die message in state %s", -+ EGG_SM_CLIENT_XSMP_STATE (xsmp)); -+ -+ sm_client_xsmp_disconnect (xsmp); -+ egg_sm_client_quit (client); -+} -+ -+static void -+xsmp_save_complete (SmcConn smc_conn, -+ SmPointer client_data) -+{ -+ EggSMClientXSMP *xsmp = client_data; -+ -+ g_debug ("Received SaveComplete message in state %s", -+ EGG_SM_CLIENT_XSMP_STATE (xsmp)); -+ -+ if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) -+ xsmp->state = XSMP_STATE_IDLE; -+ else -+ fix_broken_state (xsmp, "SaveComplete", FALSE, FALSE); -+} -+ -+static void -+xsmp_shutdown_cancelled (SmcConn smc_conn, -+ SmPointer client_data) -+{ -+ EggSMClientXSMP *xsmp = client_data; -+ EggSMClient *client = client_data; -+ -+ g_debug ("Received ShutdownCancelled message in state %s", -+ EGG_SM_CLIENT_XSMP_STATE (xsmp)); -+ -+ xsmp->shutting_down = FALSE; -+ -+ if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) -+ { -+ /* We've finished interacting and now the SM has agreed to -+ * cancel the shutdown. -+ */ -+ xsmp->state = XSMP_STATE_IDLE; -+ egg_sm_client_quit_cancelled (client); -+ } -+ else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) -+ { -+ /* Hm... ok, so we got a shutdown SaveYourself, which got -+ * cancelled, but the application was still interacting, so we -+ * didn't tell it yet, and then *another* SaveYourself arrived, -+ * which we must still be waiting to tell the app about, except -+ * that now that SaveYourself has been cancelled too! Dizzy yet? -+ */ -+ xsmp->waiting_to_save_myself = FALSE; -+ update_pending_events (xsmp); -+ } -+ else -+ { -+ g_debug ("Sending SaveYourselfDone(False)"); -+ SmcSaveYourselfDone (xsmp->connection, False); -+ -+ if (xsmp->state == XSMP_STATE_INTERACT) -+ { -+ /* The application is currently interacting, so we can't -+ * tell it about the cancellation yet; we will wait until -+ * after it calls egg_sm_client_will_quit(). -+ */ -+ xsmp->state = XSMP_STATE_SHUTDOWN_CANCELLED; -+ } -+ else -+ { -+ /* The shutdown was cancelled before the application got a -+ * chance to interact. -+ */ -+ xsmp->state = XSMP_STATE_IDLE; -+ } -+ } -+} -+ -+/* Utilities */ -+ -+/* Create a restart/clone/Exec command based on @restart_command. -+ * If @client_id is non-%NULL, add "--sm-client-id @client_id". -+ * If @state_file is non-%NULL, add "--sm-client-state-file @state_file". -+ * -+ * None of the input strings are g_strdup()ed; the caller must keep -+ * them around until it is done with the returned GPtrArray, and must -+ * then free the array, but not its contents. -+ */ -+static GPtrArray * -+generate_command (char **restart_command, const char *client_id, -+ const char *state_file) -+{ -+ GPtrArray *cmd; -+ int i; -+ -+ cmd = g_ptr_array_new (); -+ g_ptr_array_add (cmd, restart_command[0]); -+ -+ if (client_id) -+ { -+ g_ptr_array_add (cmd, (char *)"--sm-client-id"); -+ g_ptr_array_add (cmd, (char *)client_id); -+ } -+ -+ if (state_file) -+ { -+ g_ptr_array_add (cmd, (char *)"--sm-client-state-file"); -+ g_ptr_array_add (cmd, (char *)state_file); -+ } -+ -+ for (i = 1; restart_command[i]; i++) -+ g_ptr_array_add (cmd, restart_command[i]); -+ -+ return cmd; -+} -+ -+/* Takes a NULL-terminated list of SmProp * values, created by -+ * array_prop, ptrarray_prop, string_prop, card8_prop, sets them, and -+ * frees them. -+ */ -+static void -+set_properties (EggSMClientXSMP *xsmp, ...) -+{ -+ GPtrArray *props; -+ SmProp *prop; -+ va_list ap; -+ guint i; -+ -+ props = g_ptr_array_new (); -+ -+ va_start (ap, xsmp); -+ while ((prop = va_arg (ap, SmProp *))) -+ g_ptr_array_add (props, prop); -+ va_end (ap); -+ -+ if (xsmp->connection) -+ { -+ SmcSetProperties (xsmp->connection, props->len, -+ (SmProp **)props->pdata); -+ } -+ -+ for (i = 0; i < props->len; i++) -+ { -+ prop = props->pdata[i]; -+ g_free (prop->vals); -+ g_free (prop); -+ } -+ g_ptr_array_free (props, TRUE); -+} -+ -+/* Takes a NULL-terminated list of property names and deletes them. */ -+static void -+delete_properties (EggSMClientXSMP *xsmp, ...) -+{ -+ GPtrArray *props; -+ char *prop; -+ va_list ap; -+ -+ if (!xsmp->connection) -+ return; -+ -+ props = g_ptr_array_new (); -+ -+ va_start (ap, xsmp); -+ while ((prop = va_arg (ap, char *))) -+ g_ptr_array_add (props, prop); -+ va_end (ap); -+ -+ SmcDeleteProperties (xsmp->connection, props->len, -+ (char **)props->pdata); -+ -+ g_ptr_array_free (props, TRUE); -+} -+ -+/* Takes an array of strings and creates a LISTofARRAY8 property. The -+ * strings are neither dupped nor freed; they need to remain valid -+ * until you're done with the SmProp. -+ */ -+static SmProp * -+array_prop (const char *name, ...) -+{ -+ SmProp *prop; -+ SmPropValue pv; -+ GArray *vals; -+ char *value; -+ va_list ap; -+ -+ prop = g_new (SmProp, 1); -+ prop->name = (char *)name; -+ prop->type = (char *)SmLISTofARRAY8; -+ -+ vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); -+ -+ va_start (ap, name); -+ while ((value = va_arg (ap, char *))) -+ { -+ pv.length = strlen (value); -+ pv.value = value; -+ g_array_append_val (vals, pv); -+ } -+ -+ prop->num_vals = vals->len; -+ prop->vals = (SmPropValue *)vals->data; -+ -+ g_array_free (vals, FALSE); -+ -+ return prop; -+} -+ -+/* Takes a GPtrArray of strings and creates a LISTofARRAY8 property. -+ * The array contents are neither dupped nor freed; they need to -+ * remain valid until you're done with the SmProp. -+ */ -+static SmProp * -+ptrarray_prop (const char *name, GPtrArray *values) -+{ -+ SmProp *prop; -+ SmPropValue pv; -+ GArray *vals; -+ guint i; -+ -+ prop = g_new (SmProp, 1); -+ prop->name = (char *)name; -+ prop->type = (char *)SmLISTofARRAY8; -+ -+ vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); -+ -+ for (i = 0; i < values->len; i++) -+ { -+ pv.length = strlen (values->pdata[i]); -+ pv.value = values->pdata[i]; -+ g_array_append_val (vals, pv); -+ } -+ -+ prop->num_vals = vals->len; -+ prop->vals = (SmPropValue *)vals->data; -+ -+ g_array_free (vals, FALSE); -+ -+ return prop; -+} -+ -+/* Takes a string and creates an ARRAY8 property. The string is -+ * neither dupped nor freed; it needs to remain valid until you're -+ * done with the SmProp. -+ */ -+static SmProp * -+string_prop (const char *name, const char *value) -+{ -+ SmProp *prop; -+ -+ prop = g_new (SmProp, 1); -+ prop->name = (char *)name; -+ prop->type = (char *)SmARRAY8; -+ -+ prop->num_vals = 1; -+ prop->vals = g_new (SmPropValue, 1); -+ -+ prop->vals[0].length = strlen (value); -+ prop->vals[0].value = (char *)value; -+ -+ return prop; -+} -+ -+/* Takes a char and creates a CARD8 property. */ -+static SmProp * -+card8_prop (const char *name, unsigned char value) -+{ -+ SmProp *prop; -+ char *card8val; -+ -+ /* To avoid having to allocate and free prop->vals[0], we cheat and -+ * make vals a 2-element-long array and then use the second element -+ * to store value. -+ */ -+ -+ prop = g_new (SmProp, 1); -+ prop->name = (char *)name; -+ prop->type = (char *)SmCARD8; -+ -+ prop->num_vals = 1; -+ prop->vals = g_new (SmPropValue, 2); -+ card8val = (char *)(&prop->vals[1]); -+ card8val[0] = value; -+ -+ prop->vals[0].length = 1; -+ prop->vals[0].value = card8val; -+ -+ return prop; -+} -+ -+/* ICE code. This makes no effort to play nice with anyone else trying -+ * to use libICE. Fortunately, no one uses libICE for anything other -+ * than SM. (DCOP uses ICE, but it has its own private copy of -+ * libICE.) -+ * -+ * When this moves to gtk, it will need to be cleverer, to avoid -+ * tripping over old apps that use GnomeClient or that use libSM -+ * directly. -+ */ -+ -+#include -+#include -+ -+static void ice_error_handler (IceConn ice_conn, -+ Bool swap, -+ int offending_minor_opcode, -+ unsigned long offending_sequence, -+ int error_class, -+ int severity, -+ IcePointer values); -+static void ice_io_error_handler (IceConn ice_conn); -+static void ice_connection_watch (IceConn ice_conn, -+ IcePointer client_data, -+ Bool opening, -+ IcePointer *watch_data); -+ -+static void -+ice_init (void) -+{ -+ IceSetIOErrorHandler (ice_io_error_handler); -+ IceSetErrorHandler (ice_error_handler); -+ IceAddConnectionWatch (ice_connection_watch, NULL); -+} -+ -+static gboolean -+process_ice_messages (IceConn ice_conn) -+{ -+ IceProcessMessagesStatus status; -+ -+ gdk_threads_enter (); -+ status = IceProcessMessages (ice_conn, NULL, NULL); -+ gdk_threads_leave (); -+ -+ switch (status) -+ { -+ case IceProcessMessagesSuccess: -+ return TRUE; -+ -+ case IceProcessMessagesIOError: -+ sm_client_xsmp_disconnect (IceGetConnectionContext (ice_conn)); -+ return FALSE; -+ -+ case IceProcessMessagesConnectionClosed: -+ return FALSE; -+ -+ default: -+ g_assert_not_reached (); -+ } -+} -+ -+static gboolean -+ice_iochannel_watch (GIOChannel *channel, -+ GIOCondition condition, -+ gpointer client_data) -+{ -+ return process_ice_messages (client_data); -+} -+ -+static void -+ice_connection_watch (IceConn ice_conn, -+ IcePointer client_data, -+ Bool opening, -+ IcePointer *watch_data) -+{ -+ guint watch_id; -+ -+ if (opening) -+ { -+ GIOChannel *channel; -+ int fd = IceConnectionNumber (ice_conn); -+ -+ fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC); -+ channel = g_io_channel_unix_new (fd); -+ watch_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR, -+ ice_iochannel_watch, ice_conn); -+ g_io_channel_unref (channel); -+ -+ *watch_data = GUINT_TO_POINTER (watch_id); -+ } -+ else -+ { -+ watch_id = GPOINTER_TO_UINT (*watch_data); -+ g_source_remove (watch_id); -+ } -+} -+ -+static void -+ice_error_handler (IceConn ice_conn, -+ Bool swap, -+ int offending_minor_opcode, -+ unsigned long offending_sequence, -+ int error_class, -+ int severity, -+ IcePointer values) -+{ -+ /* Do nothing */ -+} -+ -+static void -+ice_io_error_handler (IceConn ice_conn) -+{ -+ /* Do nothing */ -+} -+ -+static void -+smc_error_handler (SmcConn smc_conn, -+ Bool swap, -+ int offending_minor_opcode, -+ unsigned long offending_sequence, -+ int error_class, -+ int severity, -+ SmPointer values) -+{ -+ /* Do nothing */ -+} -diff --git a/src/libeggsmclient/eggsmclient.c b/src/libeggsmclient/eggsmclient.c -new file mode 100644 -index 0000000..efa901d ---- a/src/libeggsmclient/eggsmclient.c -+++ b/src/libeggsmclient/eggsmclient.c -@@ -0,0 +1,589 @@ -+/* -+ * Copyright (C) 2007 Novell, 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, -+ * 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. -+ * -+ * 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. -+ */ -+ -+#include "config.h" -+ -+#include -+#include -+ -+#include "eggsmclient.h" -+#include "eggsmclient-private.h" -+ -+static void egg_sm_client_debug_handler (const char *log_domain, -+ GLogLevelFlags log_level, -+ const char *message, -+ gpointer user_data); -+ -+enum { -+ SAVE_STATE, -+ QUIT_REQUESTED, -+ QUIT_CANCELLED, -+ QUIT, -+ LAST_SIGNAL -+}; -+ -+static guint signals[LAST_SIGNAL]; -+ -+struct _EggSMClientPrivate { -+ GKeyFile *state_file; -+}; -+ -+#define EGG_SM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) -+ -+G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT) -+ -+static EggSMClient *global_client; -+static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL; -+ -+static void -+egg_sm_client_init (EggSMClient *client) -+{ -+ ; -+} -+ -+static void -+egg_sm_client_class_init (EggSMClientClass *klass) -+{ -+ GObjectClass *object_class = G_OBJECT_CLASS (klass); -+ -+ g_type_class_add_private (klass, sizeof (EggSMClientPrivate)); -+ -+ /** -+ * EggSMClient::save_state: -+ * @client: the client -+ * @state_file: a #GKeyFile to save state information into -+ * -+ * Emitted when the session manager has requested that the -+ * application save information about its current state. The -+ * application should save its state into @state_file, and then the -+ * session manager may then restart the application in a future -+ * session and tell it to initialize itself from that state. -+ * -+ * You should not save any data into @state_file's "start group" -+ * (ie, the %NULL group). Instead, applications should save their -+ * data into groups with names that start with the application name, -+ * and libraries that connect to this signal should save their data -+ * into groups with names that start with the library name. -+ * -+ * Alternatively, rather than (or in addition to) using @state_file, -+ * the application can save its state by calling -+ * egg_sm_client_set_restart_command() during the processing of this -+ * signal (eg, to include a list of files to open). -+ **/ -+ signals[SAVE_STATE] = -+ g_signal_new ("save_state", -+ G_OBJECT_CLASS_TYPE (object_class), -+ G_SIGNAL_RUN_LAST, -+ G_STRUCT_OFFSET (EggSMClientClass, save_state), -+ NULL, NULL, -+ g_cclosure_marshal_VOID__POINTER, -+ G_TYPE_NONE, -+ 1, G_TYPE_POINTER); -+ -+ /** -+ * EggSMClient::quit_requested: -+ * @client: the client -+ * -+ * Emitted when the session manager requests that the application -+ * exit (generally because the user is logging out). The application -+ * should decide whether or not it is willing to quit (perhaps after -+ * asking the user what to do with documents that have unsaved -+ * changes) and then call egg_sm_client_will_quit(), passing %TRUE -+ * or %FALSE to give its answer to the session manager. (It does not -+ * need to give an answer before returning from the signal handler; -+ * it can interact with the user asynchronously and then give its -+ * answer later on.) If the application does not connect to this -+ * signal, then #EggSMClient will automatically return %TRUE on its -+ * behalf. -+ * -+ * The application should not save its session state as part of -+ * handling this signal; if the user has requested that the session -+ * be saved when logging out, then ::save_state will be emitted -+ * separately. -+ * -+ * If the application agrees to quit, it should then wait for either -+ * the ::quit_cancelled or ::quit signals to be emitted. -+ **/ -+ signals[QUIT_REQUESTED] = -+ g_signal_new ("quit_requested", -+ G_OBJECT_CLASS_TYPE (object_class), -+ G_SIGNAL_RUN_LAST, -+ G_STRUCT_OFFSET (EggSMClientClass, quit_requested), -+ NULL, NULL, -+ g_cclosure_marshal_VOID__VOID, -+ G_TYPE_NONE, -+ 0); -+ -+ /** -+ * EggSMClient::quit_cancelled: -+ * @client: the client -+ * -+ * Emitted when the session manager decides to cancel a logout after -+ * the application has already agreed to quit. After receiving this -+ * signal, the application can go back to what it was doing before -+ * receiving the ::quit_requested signal. -+ **/ -+ signals[QUIT_CANCELLED] = -+ g_signal_new ("quit_cancelled", -+ G_OBJECT_CLASS_TYPE (object_class), -+ G_SIGNAL_RUN_LAST, -+ G_STRUCT_OFFSET (EggSMClientClass, quit_cancelled), -+ NULL, NULL, -+ g_cclosure_marshal_VOID__VOID, -+ G_TYPE_NONE, -+ 0); -+ -+ /** -+ * EggSMClient::quit: -+ * @client: the client -+ * -+ * Emitted when the session manager wants the application to quit -+ * (generally because the user is logging out). The application -+ * should exit as soon as possible after receiving this signal; if -+ * it does not, the session manager may choose to forcibly kill it. -+ * -+ * Normally a GUI application would only be sent a ::quit if it -+ * agreed to quit in response to a ::quit_requested signal. However, -+ * this is not guaranteed; in some situations the session manager -+ * may decide to end the session without giving applications a -+ * chance to object. -+ **/ -+ signals[QUIT] = -+ g_signal_new ("quit", -+ G_OBJECT_CLASS_TYPE (object_class), -+ G_SIGNAL_RUN_LAST, -+ G_STRUCT_OFFSET (EggSMClientClass, quit), -+ NULL, NULL, -+ g_cclosure_marshal_VOID__VOID, -+ G_TYPE_NONE, -+ 0); -+} -+ -+static gboolean sm_client_disable = FALSE; -+static char *sm_client_state_file = NULL; -+static char *sm_client_id = NULL; -+static char *sm_config_prefix = NULL; -+ -+static gboolean -+sm_client_post_parse_func (GOptionContext *context, -+ GOptionGroup *group, -+ gpointer data, -+ GError **error) -+{ -+ EggSMClient *client = egg_sm_client_get (); -+ -+ if (sm_client_id == NULL) -+ { -+ const gchar *desktop_autostart_id; -+ -+ desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); -+ -+ if (desktop_autostart_id != NULL) -+ sm_client_id = g_strdup (desktop_autostart_id); -+ } -+ -+ /* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to -+ * use the same client id. */ -+ g_unsetenv ("DESKTOP_AUTOSTART_ID"); -+ -+ if (EGG_SM_CLIENT_GET_CLASS (client)->startup) -+ EGG_SM_CLIENT_GET_CLASS (client)->startup (client, sm_client_id); -+ return TRUE; -+} -+ -+/** -+ * egg_sm_client_get_option_group: -+ * -+ * Creates a %GOptionGroup containing the session-management-related -+ * options. You should add this group to the application's -+ * %GOptionContext if you want to use #EggSMClient. -+ * -+ * Return value: the %GOptionGroup -+ **/ -+GOptionGroup * -+egg_sm_client_get_option_group (void) -+{ -+ const GOptionEntry entries[] = { -+ { "sm-client-disable", 0, 0, -+ G_OPTION_ARG_NONE, &sm_client_disable, -+ N_("Disable connection to session manager"), NULL }, -+ { "sm-client-state-file", 0, 0, -+ G_OPTION_ARG_FILENAME, &sm_client_state_file, -+ N_("Specify file containing saved configuration"), N_("FILE") }, -+ { "sm-client-id", 0, 0, -+ G_OPTION_ARG_STRING, &sm_client_id, -+ N_("Specify session management ID"), N_("ID") }, -+ /* GnomeClient compatibility option */ -+ { "sm-disable", 0, G_OPTION_FLAG_HIDDEN, -+ G_OPTION_ARG_NONE, &sm_client_disable, -+ NULL, NULL }, -+ /* GnomeClient compatibility option. This is a dummy option that only -+ * exists so that sessions saved by apps with GnomeClient can be restored -+ * later when they've switched to EggSMClient. See bug #575308. -+ */ -+ { "sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN, -+ G_OPTION_ARG_STRING, &sm_config_prefix, -+ NULL, NULL }, -+ { NULL } -+ }; -+ GOptionGroup *group; -+ -+ /* Use our own debug handler for the "EggSMClient" domain. */ -+ g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, -+ egg_sm_client_debug_handler, NULL); -+ -+ group = g_option_group_new ("sm-client", -+ _("Session management options:"), -+ _("Show session management options"), -+ NULL, NULL); -+ g_option_group_add_entries (group, entries); -+ g_option_group_set_parse_hooks (group, NULL, sm_client_post_parse_func); -+ -+ return group; -+} -+ -+/** -+ * egg_sm_client_set_mode: -+ * @mode: an #EggSMClient mode -+ * -+ * Sets the "mode" of #EggSMClient as follows: -+ * -+ * %EGG_SM_CLIENT_MODE_DISABLED: Session management is completely -+ * disabled. The application will not even connect to the session -+ * manager. (egg_sm_client_get() will still return an #EggSMClient, -+ * but it will just be a dummy object.) -+ * -+ * %EGG_SM_CLIENT_MODE_NO_RESTART: The application will connect to -+ * the session manager (and thus will receive notification when the -+ * user is logging out, etc), but will request to not be -+ * automatically restarted with saved state in future sessions. -+ * -+ * %EGG_SM_CLIENT_MODE_NORMAL: The default. #EggSMCLient will -+ * function normally. -+ * -+ * This must be called before the application's main loop begins. -+ **/ -+void -+egg_sm_client_set_mode (EggSMClientMode mode) -+{ -+ global_client_mode = mode; -+} -+ -+/** -+ * egg_sm_client_get_mode: -+ * -+ * Gets the global #EggSMClientMode. See egg_sm_client_set_mode() -+ * for details. -+ * -+ * Return value: the global #EggSMClientMode -+ **/ -+EggSMClientMode -+egg_sm_client_get_mode (void) -+{ -+ return global_client_mode; -+} -+ -+/** -+ * egg_sm_client_get: -+ * -+ * Returns the master #EggSMClient for the application. -+ * -+ * On platforms that support saved sessions (ie, POSIX/X11), the -+ * application will only request to be restarted by the session -+ * manager if you call egg_set_desktop_file() to set an application -+ * desktop file. In particular, if the desktop file contains the key -+ * "X -+ * -+ * Return value: the master #EggSMClient. -+ **/ -+EggSMClient * -+egg_sm_client_get (void) -+{ -+ if (!global_client) -+ { -+ if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED && -+ !sm_client_disable) -+ { -+#if defined (GDK_WINDOWING_WIN32) -+ global_client = egg_sm_client_win32_new (); -+#elif defined (GDK_WINDOWING_QUARTZ) -+ global_client = egg_sm_client_osx_new (); -+#else -+ /* If both D-Bus and XSMP are compiled in, try XSMP first -+ * (since it supports state saving) and fall back to D-Bus -+ * if XSMP isn't available. -+ */ -+# ifdef EGG_SM_CLIENT_BACKEND_XSMP -+ global_client = egg_sm_client_xsmp_new (); -+# endif -+# ifdef EGG_SM_CLIENT_BACKEND_DBUS -+ if (!global_client) -+ global_client = egg_sm_client_dbus_new (); -+# endif -+#endif -+ } -+ -+ /* Fallback: create a dummy client, so that callers don't have -+ * to worry about a %NULL return value. -+ */ -+ if (!global_client) -+ global_client = g_object_new (EGG_TYPE_SM_CLIENT, NULL); -+ } -+ -+ return global_client; -+} -+ -+/** -+ * egg_sm_client_is_resumed: -+ * @client: the client -+ * -+ * Checks whether or not the current session has been resumed from -+ * a previous saved session. If so, the application should call -+ * egg_sm_client_get_state_file() and restore its state from the -+ * returned #GKeyFile. -+ * -+ * Return value: %TRUE if the session has been resumed -+ **/ -+gboolean -+egg_sm_client_is_resumed (EggSMClient *client) -+{ -+ g_return_val_if_fail (client == global_client, FALSE); -+ -+ return sm_client_state_file != NULL; -+} -+ -+/** -+ * egg_sm_client_get_state_file: -+ * @client: the client -+ * -+ * If the application was resumed by the session manager, this will -+ * return the #GKeyFile containing its state from the previous -+ * session. -+ * -+ * Note that other libraries and #EggSMClient itself may also store -+ * state in the key file, so if you call egg_sm_client_get_groups(), -+ * on it, the return value will likely include groups that you did not -+ * put there yourself. (It is also not guaranteed that the first -+ * group created by the application will still be the "start group" -+ * when it is resumed.) -+ * -+ * Return value: the #GKeyFile containing the application's earlier -+ * state, or %NULL on error. You should not free this key file; it -+ * is owned by @client. -+ **/ -+GKeyFile * -+egg_sm_client_get_state_file (EggSMClient *client) -+{ -+ EggSMClientPrivate *priv = EGG_SM_CLIENT_GET_PRIVATE (client); -+ char *state_file_path; -+ GError *err = NULL; -+ -+ g_return_val_if_fail (client == global_client, NULL); -+ -+ if (!sm_client_state_file) -+ return NULL; -+ if (priv->state_file) -+ return priv->state_file; -+ -+ if (!strncmp (sm_client_state_file, "file://", 7)) -+ state_file_path = g_filename_from_uri (sm_client_state_file, NULL, NULL); -+ else -+ state_file_path = g_strdup (sm_client_state_file); -+ -+ priv->state_file = g_key_file_new (); -+ if (!g_key_file_load_from_file (priv->state_file, state_file_path, 0, &err)) -+ { -+ g_warning ("Could not load SM state file '%s': %s", -+ sm_client_state_file, err->message); -+ g_clear_error (&err); -+ g_key_file_free (priv->state_file); -+ priv->state_file = NULL; -+ } -+ -+ g_free (state_file_path); -+ return priv->state_file; -+} -+ -+/** -+ * egg_sm_client_set_restart_command: -+ * @client: the client -+ * @argc: the length of @argv -+ * @argv: argument vector -+ * -+ * Sets the command used to restart @client if it does not have a -+ * .desktop file that can be used to find its restart command. -+ * -+ * This can also be used when handling the ::save_state signal, to -+ * save the current state via an updated command line. (Eg, providing -+ * a list of filenames to open when the application is resumed.) -+ **/ -+void -+egg_sm_client_set_restart_command (EggSMClient *client, -+ int argc, -+ const char **argv) -+{ -+ g_return_if_fail (EGG_IS_SM_CLIENT (client)); -+ -+ if (EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command) -+ EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command (client, argc, argv); -+} -+ -+/** -+ * egg_sm_client_will_quit: -+ * @client: the client -+ * @will_quit: whether or not the application is willing to quit -+ * -+ * This MUST be called in response to the ::quit_requested signal, to -+ * indicate whether or not the application is willing to quit. The -+ * application may call it either directly from the signal handler, or -+ * at some later point (eg, after asynchronously interacting with the -+ * user). -+ * -+ * If the application does not connect to ::quit_requested, -+ * #EggSMClient will call this method on its behalf (passing %TRUE -+ * for @will_quit). -+ * -+ * After calling this method, the application should wait to receive -+ * either ::quit_cancelled or ::quit. -+ **/ -+void -+egg_sm_client_will_quit (EggSMClient *client, -+ gboolean will_quit) -+{ -+ g_return_if_fail (EGG_IS_SM_CLIENT (client)); -+ -+ if (EGG_SM_CLIENT_GET_CLASS (client)->will_quit) -+ EGG_SM_CLIENT_GET_CLASS (client)->will_quit (client, will_quit); -+} -+ -+/** -+ * egg_sm_client_end_session: -+ * @style: a hint at how to end the session -+ * @request_confirmation: whether or not the user should get a chance -+ * to confirm the action -+ * -+ * Requests that the session manager end the current session. @style -+ * indicates how the session should be ended, and -+ * @request_confirmation indicates whether or not the user should be -+ * given a chance to confirm the logout/reboot/shutdown. Both of these -+ * flags are merely hints though; the session manager may choose to -+ * ignore them. -+ * -+ * Return value: %TRUE if the request was sent; %FALSE if it could not -+ * be (eg, because it could not connect to the session manager). -+ **/ -+gboolean -+egg_sm_client_end_session (EggSMClientEndStyle style, -+ gboolean request_confirmation) -+{ -+ EggSMClient *client = egg_sm_client_get (); -+ -+ g_return_val_if_fail (EGG_IS_SM_CLIENT (client), FALSE); -+ -+ if (EGG_SM_CLIENT_GET_CLASS (client)->end_session) -+ { -+ return EGG_SM_CLIENT_GET_CLASS (client)->end_session (client, style, -+ request_confirmation); -+ } -+ else -+ return FALSE; -+} -+ -+/* Signal-emitting callbacks from platform-specific code */ -+ -+GKeyFile * -+egg_sm_client_save_state (EggSMClient *client) -+{ -+ GKeyFile *state_file; -+ char *group; -+ -+ g_return_val_if_fail (client == global_client, NULL); -+ -+ state_file = g_key_file_new (); -+ -+ g_debug ("Emitting save_state"); -+ g_signal_emit (client, signals[SAVE_STATE], 0, state_file); -+ g_debug ("Done emitting save_state"); -+ -+ group = g_key_file_get_start_group (state_file); -+ if (group) -+ { -+ g_free (group); -+ return state_file; -+ } -+ else -+ { -+ g_key_file_free (state_file); -+ return NULL; -+ } -+} -+ -+void -+egg_sm_client_quit_requested (EggSMClient *client) -+{ -+ g_return_if_fail (client == global_client); -+ -+ if (!g_signal_has_handler_pending (client, signals[QUIT_REQUESTED], 0, FALSE)) -+ { -+ g_debug ("Not emitting quit_requested because no one is listening"); -+ egg_sm_client_will_quit (client, TRUE); -+ return; -+ } -+ -+ g_debug ("Emitting quit_requested"); -+ g_signal_emit (client, signals[QUIT_REQUESTED], 0); -+ g_debug ("Done emitting quit_requested"); -+} -+ -+void -+egg_sm_client_quit_cancelled (EggSMClient *client) -+{ -+ g_return_if_fail (client == global_client); -+ -+ g_debug ("Emitting quit_cancelled"); -+ g_signal_emit (client, signals[QUIT_CANCELLED], 0); -+ g_debug ("Done emitting quit_cancelled"); -+} -+ -+void -+egg_sm_client_quit (EggSMClient *client) -+{ -+ g_return_if_fail (client == global_client); -+ -+ g_debug ("Emitting quit"); -+ g_signal_emit (client, signals[QUIT], 0); -+ g_debug ("Done emitting quit"); -+ -+ /* FIXME: should we just call gtk_main_quit() here? */ -+} -+ -+static void -+egg_sm_client_debug_handler (const char *log_domain, -+ GLogLevelFlags log_level, -+ const char *message, -+ gpointer user_data) -+{ -+ static int debug = -1; -+ -+ if (debug < 0) -+ debug = (g_getenv ("EGG_SM_CLIENT_DEBUG") != NULL); -+ -+ if (debug) -+ g_log_default_handler (log_domain, log_level, message, NULL); -+} -diff --git a/src/libeggsmclient/eggsmclient.h b/src/libeggsmclient/eggsmclient.h -new file mode 100644 -index 0000000..e620b75 ---- a/src/libeggsmclient/eggsmclient.h -+++ b/src/libeggsmclient/eggsmclient.h -@@ -0,0 +1,117 @@ -+/* eggsmclient.h -+ * Copyright (C) 2007 Novell, Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser 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, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser 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. -+ */ -+ -+#ifndef __EGG_SM_CLIENT_H__ -+#define __EGG_SM_CLIENT_H__ -+ -+#include -+ -+G_BEGIN_DECLS -+ -+#define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ()) -+#define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient)) -+#define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass)) -+#define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT)) -+#define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT)) -+#define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass)) -+ -+typedef struct _EggSMClient EggSMClient; -+typedef struct _EggSMClientClass EggSMClientClass; -+typedef struct _EggSMClientPrivate EggSMClientPrivate; -+ -+typedef enum { -+ EGG_SM_CLIENT_END_SESSION_DEFAULT, -+ EGG_SM_CLIENT_LOGOUT, -+ EGG_SM_CLIENT_REBOOT, -+ EGG_SM_CLIENT_SHUTDOWN -+} EggSMClientEndStyle; -+ -+typedef enum { -+ EGG_SM_CLIENT_MODE_DISABLED, -+ EGG_SM_CLIENT_MODE_NO_RESTART, -+ EGG_SM_CLIENT_MODE_NORMAL -+} EggSMClientMode; -+ -+struct _EggSMClient -+{ -+ GObject parent; -+ -+}; -+ -+struct _EggSMClientClass -+{ -+ GObjectClass parent_class; -+ -+ /* signals */ -+ void (*save_state) (EggSMClient *client, -+ GKeyFile *state_file); -+ -+ void (*quit_requested) (EggSMClient *client); -+ void (*quit_cancelled) (EggSMClient *client); -+ void (*quit) (EggSMClient *client); -+ -+ /* virtual methods */ -+ void (*startup) (EggSMClient *client, -+ const char *client_id); -+ void (*set_restart_command) (EggSMClient *client, -+ int argc, -+ const char **argv); -+ void (*will_quit) (EggSMClient *client, -+ gboolean will_quit); -+ gboolean (*end_session) (EggSMClient *client, -+ EggSMClientEndStyle style, -+ gboolean request_confirmation); -+ -+ /* Padding for future expansion */ -+ void (*_egg_reserved1) (void); -+ void (*_egg_reserved2) (void); -+ void (*_egg_reserved3) (void); -+ void (*_egg_reserved4) (void); -+}; -+ -+GType egg_sm_client_get_type (void) G_GNUC_CONST; -+ -+GOptionGroup *egg_sm_client_get_option_group (void); -+ -+/* Initialization */ -+void egg_sm_client_set_mode (EggSMClientMode mode); -+EggSMClientMode egg_sm_client_get_mode (void); -+EggSMClient *egg_sm_client_get (void); -+ -+/* Resuming a saved session */ -+gboolean egg_sm_client_is_resumed (EggSMClient *client); -+GKeyFile *egg_sm_client_get_state_file (EggSMClient *client); -+ -+/* Alternate means of saving state */ -+void egg_sm_client_set_restart_command (EggSMClient *client, -+ int argc, -+ const char **argv); -+ -+/* Handling "quit_requested" signal */ -+void egg_sm_client_will_quit (EggSMClient *client, -+ gboolean will_quit); -+ -+/* Initiate a logout/reboot/shutdown */ -+gboolean egg_sm_client_end_session (EggSMClientEndStyle style, -+ gboolean request_confirmation); -+ -+G_END_DECLS -+ -+ -+#endif /* __EGG_SM_CLIENT_H__ */ --- -cgit v0.9 diff --git a/xchat-gnome-0.26.1-kill-libgnomeui.patch b/xchat-gnome-0.26.1-kill-libgnomeui.patch deleted file mode 100644 index c30778f..0000000 --- a/xchat-gnome-0.26.1-kill-libgnomeui.patch +++ /dev/null @@ -1,321 +0,0 @@ -From 3b6b529fb1529ad3d88cbee74df8ceba4dfd4a66 Mon Sep 17 00:00:00 2001 -From: Florian Müllner -Date: Wed, 13 Jan 2010 10:43:27 +0000 -Subject: Bug 584887 - Get rid of deprecated libgnome(ui) - -Replacing libgnome(ui) with EggSMClient and plain Glib/GTK+ -With few minor edits, committed ---- -diff --git a/configure.ac b/configure.ac -index d2a0f56..c3bf020 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -24,14 +24,13 @@ IT_PROG_INTLTOOL([0.35.0]) - GLIB_REQUIRED=2.18.0 - GTK_REQUIRED=2.14.0 - LIBGLADE_REQUIRED=2.3.2 --LIBGNOME_REQUIRED=2.16.0 --LIBGNOMEUI_REQUIRED=2.16.0 - GCONF_REQUIRED=2.8.0 - DBUS_REQUIRED=0.60 - DBUS_GLIB_REQUIRED=0.60 - LIBSEXY_REQUIRED=0.1.11 - LIBNOTIFY_REQUIRED=0.3.2 - LIBCANBERRAGTK_REQUIRED=0.3 -+SM_REQUIRED=1.0.0 - - AC_PROG_CC - AM_PROG_CC_C_O -@@ -65,12 +64,18 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ - gio-2.0 >= $GLIB_REQUIRED \ - gtk+-2.0 >= $GTK_REQUIRED \ - libglade-2.0 >= $LIBGLADE_REQUIRED \ -- libgnome-2.0 >= $LIBGNOME_REQUIRED \ -- libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ - gconf-2.0 >= $GCONF_REQUIRED \ - libsexy >= $LIBSEXY_REQUIRED \ - ]) - -+#EggSMClient replacing GnomeClient in libgnome -+PKG_CHECK_MODULES([EGG_SMCLIENT], [\ -+ gtk+-2.0 >= $GTK_REQUIRED \ -+ sm >= $SM_REQUIRED \ -+ ]) -+AC_SUBST(EGG_SMCLIENT_CFLAGS) -+AC_SUBST(EGG_SMCLIENT_LIBS) -+ - #D-Bus - AC_MSG_CHECKING([whether D-Bus support is requested]) - AC_ARG_ENABLE([dbus], -@@ -482,6 +487,7 @@ src/common/dbus/Makefile - src/common/Makefile - src/fe-gnome/Makefile - src/libcontrast/Makefile -+src/libeggsmclient/Makefile - src/Makefile - ]) - -diff --git a/src/Makefile.am b/src/Makefile.am -index 1e9465d..0e763f6 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -1 +1 @@ --SUBDIRS = common libcontrast fe-gnome -+SUBDIRS = common libcontrast libeggsmclient fe-gnome -diff --git a/src/fe-gnome/Makefile.am b/src/fe-gnome/Makefile.am -index 098e78d..8faab84 100644 ---- a/src/fe-gnome/Makefile.am -+++ b/src/fe-gnome/Makefile.am -@@ -98,7 +98,7 @@ xchat_gnome_CPPFLAGS = \ - -DTOPSRCDIR="\"$(top_srcdir)\"" \ - -DSYSCONFDIR="\"$(sysconfdir)\"" \ - -DICONDIR="\"$(pkgdatadir)/icons\"" \ -- -DDATADIR="\"$(pkgdatadir)\"" \ -+ -DDATADIR="\"$(datadir)\"" \ - -DXCHATSHAREDIR="\"$(pkgdatadir)\"" \ - -DLIBDIR="\"$(pkglibdir)\"" \ - -DPREFIX="\"$(prefix)\"" \ -@@ -119,6 +119,7 @@ xchat_gnome_LDFLAGS = \ - xchat_gnome_LDADD = \ - $(top_builddir)/src/common/libxchatcommon.la \ - $(top_builddir)/src/libcontrast/libcontrast.la \ -+ $(top_builddir)/src/libeggsmclient/libeggsmclient.la \ - $(DEPENDENCIES_LIBS) \ - $(OPENSSL_LIBS) \ - $(LIBSEXY_LIBS) -diff --git a/src/fe-gnome/fe-gnome.c b/src/fe-gnome/fe-gnome.c -index fd32bd9..29ea0c3 100644 ---- a/src/fe-gnome/fe-gnome.c -+++ b/src/fe-gnome/fe-gnome.c -@@ -22,9 +22,11 @@ - #include - #include - #include -+#include - #include --#include - #include -+#include "../libeggsmclient/eggsmclient.h" -+#include "../libeggsmclient/eggdesktopfile.h" - #include "gui.h" - #include "navigation-tree.h" - #include "main-window.h" -@@ -54,6 +56,8 @@ - #include "../common/cfgfiles.h" - #include "../common/plugin.h" - -+#define GNOME_DOT_GNOME ".gnome2" -+ - static gboolean opt_version = FALSE; - static gboolean opt_noplugins = FALSE; - static gchar *opt_cfgdir = NULL; -@@ -72,17 +76,47 @@ static GOptionEntry entries[] = { - - static void setup_sm (gint argc, - gchar *argv[]); --static gint save_session (GnomeClient *client, -- gint phase, -- GnomeSaveStyle save_style, -- gint is_shutdown, -- GnomeInteractStyle interact_style, -- gint is_fast, -- gpointer client_data); --static void kill_session (GnomeClient *client, -+static void quit_session (EggSMClient *client, - gpointer client_data); - static gboolean not_autoconnect (void); - -+static gchar * -+get_accels_filename (void) -+{ -+ const char *home; -+ -+ home = g_get_home_dir(); -+ if (!home) -+ return NULL; -+ return g_build_filename (home, GNOME_DOT_GNOME, "accels", PACKAGE, NULL); -+} -+ -+static void -+load_accels (void) -+{ -+ char *filename; -+ -+ filename = get_accels_filename (); -+ if (!filename) -+ return; -+ -+ gtk_accel_map_load (filename); -+ g_free (filename); -+} -+ -+static void -+save_accels (void) -+{ -+ char *filename; -+ -+ filename = get_accels_filename (); -+ if (!filename) -+ return; -+ -+ gtk_accel_map_save (filename); -+ g_free (filename); -+} -+ - int - fe_args (int argc, char *argv[]) - { -@@ -96,34 +130,33 @@ fe_args (int argc, char *argv[]) - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - #endif -- - context = g_option_context_new (NULL); - - g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); -- gui.program = gnome_program_init (PACKAGE, VERSION, -- LIBGNOMEUI_MODULE, argc, argv, -- GNOME_PARAM_GOPTION_CONTEXT, context, -- GNOME_PARAM_HUMAN_READABLE_NAME, "IRC Chat", -- GNOME_PROGRAM_STANDARD_PROPERTIES, -- NULL); -- -- if (error) { -- fprintf (stderr, _("xchat-gnome: %s\nTry `xchat-gnome --help' for more information\n"), error->message); -+ g_option_context_add_group (context, gtk_get_option_group (FALSE)); -+ g_option_context_add_group (context, egg_sm_client_get_option_group ()); -+ -+ gtk_init (&argc, &argv); -+ -+ if (! g_option_context_parse (context, &argc, &argv, &error)) { -+ g_printerr (_("Failed to parse arguments: %s\n"), error->message); - g_error_free (error); -+ g_option_context_free (context); - return 0; - } - -+ g_option_context_free (context); -+ - if (opt_version) { - g_print ("xchat-gnome %s\n", PACKAGE_VERSION); - return 0; - } - -- g_set_application_name (_("IRC Chat")); -- - if (opt_cfgdir) { - xdir_fs = opt_cfgdir; - } - -+ load_accels (); - setup_sm (argc, argv); - - return -1; -@@ -186,8 +219,6 @@ fe_main (void) - { - gtk_main (); - -- g_object_unref (gui.program); -- - /* sleep for 3 seconds so any QUIT messages are not lost. The */ - /* GUI is closed at this point, so the user doesn't even know! */ - -@@ -202,7 +233,7 @@ fe_main (void) - void - fe_cleanup (void) - { -- gnome_accelerators_sync (); -+ save_accels (); - } - - void -@@ -1035,45 +1066,21 @@ void fe_get_file (const char *title, - static void - setup_sm (gint argc, gchar *argv[]) - { -- GnomeClient *client; -- const gchar *prefix; -+ EggSMClient *client; -+ gchar *desktop_file; - -- client = gnome_master_client (); -+ client = egg_sm_client_get (); -+ desktop_file = g_build_filename (DATADIR, "applications", "xchat-gnome.desktop", NULL); -+ egg_set_desktop_file (desktop_file); -+ g_free (desktop_file); - -- g_signal_connect (G_OBJECT (client), "save_yourself", G_CALLBACK (save_session), argv[0]); -- g_signal_connect (G_OBJECT (client), "die", G_CALLBACK (kill_session), NULL); -+ g_signal_connect (G_OBJECT (client), "quit", G_CALLBACK (quit_session), NULL); - -- prefix = gnome_client_get_config_prefix (client); - /* FIXME: add discard command to remove saved state */ - } - --static gint --save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style, -- gint is_shutdown, GnomeInteractStyle interact_style, -- gint is_fast, gpointer client_data) --{ -- gchar **argv; -- gint argc; -- const gchar *prefix; -- -- argv = g_new0 (gchar *, 2); -- argv[0] = client_data; -- argc = 1; -- -- gnome_client_set_restart_style (client, GNOME_RESTART_IF_RUNNING); -- gnome_client_set_restart_command (client, argc, argv); -- gnome_client_set_clone_command (client, argc, argv); -- -- prefix = gnome_client_get_config_prefix (client); -- /* FIXME: save state */ -- -- g_free (argv); -- -- return TRUE; --} -- - static void --kill_session (GnomeClient* client, gpointer client_data) -+quit_session (EggSMClient* client, gpointer client_data) - { - gtk_widget_hide (GTK_WIDGET (gui.main_window)); - gtk_widget_hide (GTK_WIDGET (gui.dcc)); -diff --git a/src/fe-gnome/gui.h b/src/fe-gnome/gui.h -index 0af43f4..b27d8ff 100644 ---- a/src/fe-gnome/gui.h -+++ b/src/fe-gnome/gui.h -@@ -24,7 +24,6 @@ - - #include - #include --#include - #include "userlist.h" - #include "navigation-tree.h" - #include "dcc-window.h" -@@ -60,8 +59,6 @@ typedef struct - - NavModel *tree_model; - NavTree *server_tree; -- -- GnomeProgram *program; - } XChatGUI; - - extern XChatGUI gui; -diff --git a/src/fe-gnome/util.c b/src/fe-gnome/util.c -index 75d1e0c..a7540c5 100644 ---- a/src/fe-gnome/util.c -+++ b/src/fe-gnome/util.c -@@ -139,7 +139,7 @@ locate_data_file (const gchar *file_name) - path = uninstalled_path; - } else { - g_free (uninstalled_path); -- path = gnome_program_locate_file (gnome_program_get (), GNOME_FILE_DOMAIN_APP_DATADIR, file_name, FALSE, NULL); -+ path = g_build_filename (XCHATSHAREDIR, file_name, NULL); - } - - g_return_val_if_fail (path != NULL, NULL); --- -cgit v0.9 diff --git a/xchat-gnome.spec b/xchat-gnome.spec index e80f432..7b4e8e4 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -20,9 +20,6 @@ Patch0: xchat-gnome-0.23.92-config.patch Patch1: xchat-gnome-0.26.1-libnotify.patch # Patch to work with recent NetworkManager (0.7+) Patch10: xchat-gnome-0.26.1-recent-network-manager.patch -# Kill libgnomeui -Patch11: xchat-gnome-0.26.1-add-libeggsmclient.patch -Patch12: xchat-gnome-0.26.1-kill-libgnomeui.patch # Convert deprecated GDK functions to cairo Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch @@ -30,7 +27,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel Buildrequires: libsexy-devel >= 0.1.11 -BuildRequires: libgnomeui-devel BuildRequires: libnotify-devel BuildRequires: glib2-devel >= 2.18.0 BuildRequires: gtk2-devel >= 2.14.0 @@ -69,8 +65,6 @@ common settings will be included in the main user interface. . %patch0 -p1 -b .config %patch1 -p1 -b .notify %patch10 -p1 -b .recent-nm -%patch11 -p1 -b .add-libegg -%patch12 -p1 -b .kill-libgnomeui %patch13 -p1 -b .gdk-deprecations From bf74f0f1cd6ff12dafe95ac6092128f8a18fd666 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 16:54:22 -0400 Subject: [PATCH 072/105] Fix buildreqs. --- xchat-gnome.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 7b4e8e4..4dcb260 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -40,7 +40,7 @@ BuildRequires: perl-devel BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils -BuildRequires: GConf2 +BuildRequires: GConf2-devel BuildRequires: libtool autoconf automake gnome-common Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) From 88e2c4090dd4fd65290f84e8fbfaadd25794b70c Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Apr 2011 17:05:56 -0400 Subject: [PATCH 073/105] Fix buildreqs, again. --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 4dcb260..a356a59 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -41,6 +41,7 @@ BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils BuildRequires: GConf2-devel +BuildRequires: libglade2-devel BuildRequires: libtool autoconf automake gnome-common Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) From b998e29c5d95df1f7e4a6f65e055c0ec2c151b1d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 8 Apr 2011 22:29:24 -0400 Subject: [PATCH 074/105] Fix buildreqs some more. --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a356a59..ff25277 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -42,6 +42,7 @@ BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils BuildRequires: GConf2-devel BuildRequires: libglade2-devel +BuildRequires: libSM-devel BuildRequires: libtool autoconf automake gnome-common Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) From 5258a6f73a91e93f5db1d507d33427e9cd349228 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 17 Jun 2011 16:07:13 -0400 Subject: [PATCH 075/105] Fix crasher, clean up noise. --- ...tempt-to-render-a-nonexistent-string.patch | 26 ++++++++++++ 0002-Plugin_GetCurrent-can-return-NULL.patch | 41 +++++++++++++++++++ ...ap-depth-matches-screen-window-depth.patch | 26 ++++++++++++ xchat-gnome.spec | 16 +++++++- 4 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 0001-Dont-attempt-to-render-a-nonexistent-string.patch create mode 100644 0002-Plugin_GetCurrent-can-return-NULL.patch create mode 100644 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch diff --git a/0001-Dont-attempt-to-render-a-nonexistent-string.patch b/0001-Dont-attempt-to-render-a-nonexistent-string.patch new file mode 100644 index 0000000..fc22dd9 --- /dev/null +++ b/0001-Dont-attempt-to-render-a-nonexistent-string.patch @@ -0,0 +1,26 @@ +From 658b8d21e2ad4d158db6e189cc622e6a8e6b756b Mon Sep 17 00:00:00 2001 +From: Bill Nottingham +Date: Wed, 13 Apr 2011 22:40:17 -0400 +Subject: [PATCH 1/3] Dont' attempt to render a nonexistent string. + +https://bugzilla.gnome.org/show_bug.cgi?id=652867 +--- + src/fe-gnome/xtext.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c +index 06b00c5..6cba1d5 100644 +--- a/src/fe-gnome/xtext.c ++++ b/src/fe-gnome/xtext.c +@@ -2645,7 +2645,7 @@ gtk_xtext_render_flush (GtkXText * xtext, int x, int y, unsigned char *str, + + str_width = backend_get_text_width (xtext, str, len, is_mb); + +- if (xtext->dont_render2) ++ if (xtext->dont_render2 || str_width < 1) + return str_width; + + /* roll-your-own clipping (avoiding XftDrawString is always good!) */ +-- +1.7.5.2 + diff --git a/0002-Plugin_GetCurrent-can-return-NULL.patch b/0002-Plugin_GetCurrent-can-return-NULL.patch new file mode 100644 index 0000000..35a4fca --- /dev/null +++ b/0002-Plugin_GetCurrent-can-return-NULL.patch @@ -0,0 +1,41 @@ +From 7604517bd9c400ae60ab64b82aea1b9665e4122c Mon Sep 17 00:00:00 2001 +From: Bill Nottingham +Date: Tue, 19 Apr 2011 17:09:44 -0400 +Subject: [PATCH 2/3] Plugin_GetCurrent() can return NULL. + +Check its return before dereferencing it. + +https://bugzilla.gnome.org/show_bug.cgi?id=652866 +--- + plugins/python/python.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/plugins/python/python.c b/plugins/python/python.c +index 53267a3..bcceed1 100644 +--- a/plugins/python/python.c ++++ b/plugins/python/python.c +@@ -791,6 +791,8 @@ static PyObject * + Context_set(ContextObject *self, PyObject *args) + { + PyObject *plugin = Plugin_GetCurrent(); ++ if (plugin == NULL) ++ return NULL; + Plugin_SetContext(plugin, self->context); + Py_INCREF(Py_None); + return Py_None; +@@ -867,8 +869,11 @@ static PyObject * + Context_get_list(ContextObject *self, PyObject *args) + { + PyObject *plugin = Plugin_GetCurrent(); +- xchat_context *saved_context = Plugin_GetContext(plugin); ++ xchat_context *saved_context; + PyObject *ret; ++ if (plugin == NULL) ++ return NULL; ++ saved_context = Plugin_GetContext(plugin); + Plugin_SetContext(plugin, self->context); + ret = Module_xchat_get_list((PyObject*)self, args); + Plugin_SetContext(plugin, saved_context); +-- +1.7.5.2 + diff --git a/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch b/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch new file mode 100644 index 0000000..3be4915 --- /dev/null +++ b/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch @@ -0,0 +1,26 @@ +From 9464eeb4bd0b3f09901d18357dee06d084989162 Mon Sep 17 00:00:00 2001 +From: Bill Nottingham +Date: Fri, 17 Jun 2011 15:49:09 -0400 +Subject: [PATCH 3/3] Ensure pixmap depth matches screen/window depth. + +https://bugzilla.gnome.org/show_bug.cgi?id=652865 +--- + src/fe-gnome/conversation-panel.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/fe-gnome/conversation-panel.c b/src/fe-gnome/conversation-panel.c +index 59e1bcd..b230fd5 100644 +--- a/src/fe-gnome/conversation-panel.c ++++ b/src/fe-gnome/conversation-panel.c +@@ -592,7 +592,7 @@ conversation_panel_set_background (ConversationPanel *panel) + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + +- image = gdk_pixmap_new (NULL, width, height, 24); ++ image = gdk_pixmap_new (GDK_DRAWABLE (panel->priv->xtext->window), width, height, -1); + #if GTK_CHECK_VERSION (2, 23, 0) + context = gdk_cairo_create (GDK_DRAWABLE (image)); + gdk_cairo_set_source_pixbuf (context, pixbuf, 0, 0); +-- +1.7.5.2 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index ff25277..23af58c 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 0.git%{gitrev}%{?dist} +Release: 1.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -22,6 +22,12 @@ Patch1: xchat-gnome-0.26.1-libnotify.patch Patch10: xchat-gnome-0.26.1-recent-network-manager.patch # Convert deprecated GDK functions to cairo Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch +# Clean up warnings +Patch100: 0001-Dont-attempt-to-render-a-nonexistent-string.patch +# Fix potential plugin crashers +Patch101: 0002-Plugin_GetCurrent-can-return-NULL.patch +# Don't crash on 32bpp depth +Patch102: 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -68,7 +74,9 @@ common settings will be included in the main user interface. . %patch1 -p1 -b .notify %patch10 -p1 -b .recent-nm %patch13 -p1 -b .gdk-deprecations - +%patch100 -p1 -b .empty +%patch101 -p1 -b .nullplugin +%patch102 -p1 -b .depth %build ./autogen.sh @@ -135,6 +143,10 @@ fi %changelog +* Fri Jun 17 2011 Bill Nottingham - 0.26.2-1 +- fix crash on 32bpp depths with background images (#712626) +- clean up some Gdk-CRITICAL messages + * Thu Apr 07 2011 Bill Nottingham - 0.26.2-1 - update to 0.26.2 (fixes #660840) From 726af1c71293cf179dd3af62c88ef5bdc0aebf1d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 17 Jun 2011 16:40:34 -0400 Subject: [PATCH 076/105] Fix another crasher. --- ...emove-on-items-before-free-not-after.patch | 92 +++++++++++++++++++ xchat-gnome.spec | 8 +- 2 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 0004-Call-g_slist_remove-on-items-before-free-not-after.patch diff --git a/0004-Call-g_slist_remove-on-items-before-free-not-after.patch b/0004-Call-g_slist_remove-on-items-before-free-not-after.patch new file mode 100644 index 0000000..2d0489f --- /dev/null +++ b/0004-Call-g_slist_remove-on-items-before-free-not-after.patch @@ -0,0 +1,92 @@ +From 8dfd9e91bbf3de9084980ea19e4353ad88aa9399 Mon Sep 17 00:00:00 2001 +From: Bill Nottingham +Date: Fri, 17 Jun 2011 16:38:23 -0400 +Subject: [PATCH 4/4] Call g_slist_remove on items before free(), not after. + +--- + src/common/cfgfiles.c | 2 +- + src/common/plugin.c | 2 +- + src/common/servlist.c | 22 +++++++++++----------- + 3 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c +index 6c70727..330967a 100644 +--- a/src/common/cfgfiles.c ++++ b/src/common/cfgfiles.c +@@ -140,8 +140,8 @@ list_free (GSList ** list) + while (*list) + { + data = (void *) (*list)->data; +- free (data); + *list = g_slist_remove (*list, data); ++ free (data); + } + } + +diff --git a/src/common/plugin.c b/src/common/plugin.c +index 0889dca..c6a67ac 100644 +--- a/src/common/plugin.c ++++ b/src/common/plugin.c +@@ -160,9 +160,9 @@ xit: + } + if (pl->filename) + free ((char *)pl->filename); +- free (pl); + + plugin_list = g_slist_remove (plugin_list, pl); ++ free (pl); + + #ifdef USE_PLUGIN + fe_pluginlist_update (); +diff --git a/src/common/servlist.c b/src/common/servlist.c +index 3082966..b38ac4f 100644 +--- a/src/common/servlist.c ++++ b/src/common/servlist.c +@@ -792,9 +792,9 @@ servlist_server_add (ircnet *net, char *name) + void + servlist_server_remove (ircnet *net, ircserver *serv) + { ++ net->servlist = g_slist_remove (net->servlist, serv); + free (serv->hostname); + free (serv); +- net->servlist = g_slist_remove (net->servlist, serv); + } + + static void +@@ -818,6 +818,16 @@ servlist_net_remove (ircnet *net) + servlist_server_remove_all (net); + network_list = g_slist_remove (network_list, net); + ++ /* for safety */ ++ list = serv_list; ++ while (list) ++ { ++ serv = list->data; ++ if (serv->network == net) ++ serv->network = NULL; ++ list = list->next; ++ } ++ + if (net->nick) + free (net->nick); + if (net->nick2) +@@ -840,16 +850,6 @@ servlist_net_remove (ircnet *net) + free (net->encoding); + free (net->name); + free (net); +- +- /* for safety */ +- list = serv_list; +- while (list) +- { +- serv = list->data; +- if (serv->network == net) +- serv->network = NULL; +- list = list->next; +- } + } + + ircnet * +-- +1.7.5.2 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 23af58c..f4fe481 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 1.git%{gitrev}%{?dist} +Release: 2.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -28,6 +28,8 @@ Patch100: 0001-Dont-attempt-to-render-a-nonexistent-string.patch Patch101: 0002-Plugin_GetCurrent-can-return-NULL.patch # Don't crash on 32bpp depth Patch102: 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch +# free(foo); g_slist_remove(list, foo); is bad practice, mmmkay? +Patch103: 0004-Call-g_slist_remove-on-items-before-free-not-after.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -77,6 +79,7 @@ common settings will be included in the main user interface. . %patch100 -p1 -b .empty %patch101 -p1 -b .nullplugin %patch102 -p1 -b .depth +%patch103 -p1 -b .free %build ./autogen.sh @@ -143,9 +146,10 @@ fi %changelog -* Fri Jun 17 2011 Bill Nottingham - 0.26.2-1 +* Fri Jun 17 2011 Bill Nottingham - 0.26.2-2 - fix crash on 32bpp depths with background images (#712626) - clean up some Gdk-CRITICAL messages +- fix crash on exit in plugin code and elsewhere (#693122) * Thu Apr 07 2011 Bill Nottingham - 0.26.2-1 - update to 0.26.2 (fixes #660840) From ae9750cf947ad02d30dd2aba5b24762689242b85 Mon Sep 17 00:00:00 2001 From: Petr Sabata Date: Wed, 20 Jul 2011 03:28:19 +0200 Subject: [PATCH 077/105] Perl mass rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f4fe481..ff31f8d 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 2.git%{gitrev}%{?dist} +Release: 3.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -146,6 +146,9 @@ fi %changelog +* Wed Jul 20 2011 Petr Sabata - 0.26.2-3.git40c5bf988 +- Perl mass rebuild + * Fri Jun 17 2011 Bill Nottingham - 0.26.2-2 - fix crash on 32bpp depths with background images (#712626) - clean up some Gdk-CRITICAL messages From 9abf972683ccaeeff597167bde1ec4b84a3a4728 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 9 Aug 2011 15:30:02 -0400 Subject: [PATCH 078/105] Fix sm call to use our desktop file name. --- xchat-gnome-0.26.2-desktop-name.patch | 11 +++++++++++ xchat-gnome.spec | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 xchat-gnome-0.26.2-desktop-name.patch diff --git a/xchat-gnome-0.26.2-desktop-name.patch b/xchat-gnome-0.26.2-desktop-name.patch new file mode 100644 index 0000000..3f1c6ac --- /dev/null +++ b/xchat-gnome-0.26.2-desktop-name.patch @@ -0,0 +1,11 @@ +diff -up xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c.foo xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c +--- xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c.foo 2011-08-09 15:27:42.802160028 -0400 ++++ xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c 2011-08-09 15:28:03.596159828 -0400 +@@ -1074,7 +1074,7 @@ setup_sm (gint argc, gchar *argv[]) + gchar *desktop_file; + + client = egg_sm_client_get (); +- desktop_file = g_build_filename (DATADIR, "applications", "xchat-gnome.desktop", NULL); ++ desktop_file = g_build_filename (DATADIR, "applications", "fedora-xchat-gnome.desktop", NULL); + egg_set_desktop_file (desktop_file); + g_free (desktop_file); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index ff31f8d..3ba0dc3 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -18,6 +18,8 @@ Source0: http://ftp.gnome.org/pub/gnome/sources/%{name}/0.26/%{name}-%{ve Patch0: xchat-gnome-0.23.92-config.patch # Patch for libnotify 0.70 (just drop one parameter from one function) Patch1: xchat-gnome-0.26.1-libnotify.patch +# Fix for our desktop file name +Patch2: xchat-gnome-0.26.2-desktop-name.patch # Patch to work with recent NetworkManager (0.7+) Patch10: xchat-gnome-0.26.1-recent-network-manager.patch # Convert deprecated GDK functions to cairo @@ -74,6 +76,7 @@ common settings will be included in the main user interface. . %setup -q -n %{name}-%{version} %patch0 -p1 -b .config %patch1 -p1 -b .notify +%patch2 -p1 -b .desktop-name %patch10 -p1 -b .recent-nm %patch13 -p1 -b .gdk-deprecations %patch100 -p1 -b .empty From 7d205ca2149a685e5424372bfd40fa73ad3095cd Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 4 Oct 2011 14:49:16 -0400 Subject: [PATCH 079/105] don't iterate over an empty hash table (#742868, ) --- ...ix-crash-on-NULL-networks-hash-table.patch | 31 +++++++++++++++++++ xchat-gnome.spec | 6 ++++ 2 files changed, 37 insertions(+) create mode 100644 0001-Fix-crash-on-NULL-networks-hash-table.patch diff --git a/0001-Fix-crash-on-NULL-networks-hash-table.patch b/0001-Fix-crash-on-NULL-networks-hash-table.patch new file mode 100644 index 0000000..6ea4af6 --- /dev/null +++ b/0001-Fix-crash-on-NULL-networks-hash-table.patch @@ -0,0 +1,31 @@ +From 5b79d29146a72f1db0eff3bce4fd8e155d396c2d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Mon, 3 Oct 2011 13:47:27 +0200 +Subject: [PATCH] Fix crash on NULL 'networks' hash table +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + +Signed-off-by: Jiří Klimeš +--- + plugins/net-monitor/net-monitor.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/plugins/net-monitor/net-monitor.c b/plugins/net-monitor/net-monitor.c +index fada61c..6ac981c 100644 +--- a/plugins/net-monitor/net-monitor.c ++++ b/plugins/net-monitor/net-monitor.c +@@ -176,7 +176,8 @@ set_network_mode (NetworkStatus status) + */ + res_init(); + +- g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL); ++ if (networks) ++ g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL); + } + } + +-- +1.7.6.4 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 3ba0dc3..ca5e9c3 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -32,6 +32,8 @@ Patch101: 0002-Plugin_GetCurrent-can-return-NULL.patch Patch102: 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch # free(foo); g_slist_remove(list, foo); is bad practice, mmmkay? Patch103: 0004-Call-g_slist_remove-on-items-before-free-not-after.patch +# Don't iterate over an empty hash +Patch104: 0001-Fix-crash-on-NULL-networks-hash-table.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -83,6 +85,7 @@ common settings will be included in the main user interface. . %patch101 -p1 -b .nullplugin %patch102 -p1 -b .depth %patch103 -p1 -b .free +%patch104 -p1 -b .hash %build ./autogen.sh @@ -149,6 +152,9 @@ fi %changelog +* Tue Oct 04 2011 Bill Nottingham 0.26.2-4.git40c5bf988 +- don't iterate over an empty hash table (#742868, ) + * Wed Jul 20 2011 Petr Sabata - 0.26.2-3.git40c5bf988 - Perl mass rebuild From 00c3862fe7e720cc9a41c79159d27eace4921a4f Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 4 Oct 2011 14:54:36 -0400 Subject: [PATCH 080/105] bump release --- xchat-gnome.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index ca5e9c3..70032a1 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 3.git%{gitrev}%{?dist} +Release: 4.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet From 4da3e05ef4955fdd92afcfc8df87fbdc894e93e1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 6 Dec 2011 01:33:34 -0500 Subject: [PATCH 081/105] Rebuild for new libpng --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 70032a1..f75cb61 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 4.git%{gitrev}%{?dist} +Release: 5.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -152,6 +152,9 @@ fi %changelog +* Tue Dec 06 2011 Adam Jackson - 0.26.2-5.git40c5bf988 +- Rebuild for new libpng + * Tue Oct 04 2011 Bill Nottingham 0.26.2-4.git40c5bf988 - don't iterate over an empty hash table (#742868, ) From ca3489956a71f8e644fb9d0c4155b6b738025dac Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 14 Jan 2012 02:40:28 -0600 Subject: [PATCH 082/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f75cb61..13ea388 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 5.git%{gitrev}%{?dist} +Release: 6.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -152,6 +152,9 @@ fi %changelog +* Sat Jan 14 2012 Fedora Release Engineering - 0.26.2-6.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + * Tue Dec 06 2011 Adam Jackson - 0.26.2-5.git40c5bf988 - Rebuild for new libpng From a71da226d423ebd04e6351c46b0334e401ad85c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 15 Jun 2012 11:16:33 +0200 Subject: [PATCH 083/105] Perl 5.16 rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 13ea388..5b19e2a 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 6.git%{gitrev}%{?dist} +Release: 7.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -152,6 +152,9 @@ fi %changelog +* Fri Jun 15 2012 Petr Pisar - 0.26.2-7.git40c5bf988 +- Perl 5.16 rebuild + * Sat Jan 14 2012 Fedora Release Engineering - 0.26.2-6.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild From 60c1d98cb165c2e9afbc7f31a5d292130ac5d247 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 12 Jul 2012 12:08:54 -0400 Subject: [PATCH 084/105] make it build --- build.patch | 19 +++++++++++++++++++ xchat-gnome.spec | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 build.patch diff --git a/build.patch b/build.patch new file mode 100644 index 0000000..87368f2 --- /dev/null +++ b/build.patch @@ -0,0 +1,19 @@ +diff -up xchat-gnome-0.26.2/configure.ac.ice xchat-gnome-0.26.2/configure.ac +--- xchat-gnome-0.26.2/configure.ac.ice 2010-09-16 02:44:35.000000000 -0400 ++++ xchat-gnome-0.26.2/configure.ac 2012-07-12 12:05:32.287466474 -0400 +@@ -63,6 +63,7 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ + gio-2.0 >= $GLIB_REQUIRED \ + gtk+-2.0 >= $GTK_REQUIRED \ + libglade-2.0 >= $LIBGLADE_REQUIRED \ ++ gmodule-2.0 >= $GLIB_REQUIRED \ + gconf-2.0 >= $GCONF_REQUIRED \ + libsexy >= $LIBSEXY_REQUIRED \ + ]) +@@ -72,6 +72,7 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ + PKG_CHECK_MODULES([EGG_SMCLIENT], [\ + gtk+-2.0 >= $GTK_REQUIRED \ + sm >= $SM_REQUIRED \ ++ ice \ + ]) + AC_SUBST(EGG_SMCLIENT_CFLAGS) + AC_SUBST(EGG_SMCLIENT_LIBS) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 5b19e2a..c52e5ec 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -20,6 +20,8 @@ Patch0: xchat-gnome-0.23.92-config.patch Patch1: xchat-gnome-0.26.1-libnotify.patch # Fix for our desktop file name Patch2: xchat-gnome-0.26.2-desktop-name.patch +# Fix build (#839623) +Patch3: build.patch # Patch to work with recent NetworkManager (0.7+) Patch10: xchat-gnome-0.26.1-recent-network-manager.patch # Convert deprecated GDK functions to cairo @@ -79,6 +81,7 @@ common settings will be included in the main user interface. . %patch0 -p1 -b .config %patch1 -p1 -b .notify %patch2 -p1 -b .desktop-name +%patch3 -p1 -b .build %patch10 -p1 -b .recent-nm %patch13 -p1 -b .gdk-deprecations %patch100 -p1 -b .empty From d871b40423a8801a35b90547b0e82c490b8453f2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 21 Jul 2012 23:39:11 -0500 Subject: [PATCH 085/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index c52e5ec..989518d 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 7.git%{gitrev}%{?dist} +Release: 8.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -155,6 +155,9 @@ fi %changelog +* Sun Jul 22 2012 Fedora Release Engineering - 0.26.2-8.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Fri Jun 15 2012 Petr Pisar - 0.26.2-7.git40c5bf988 - Perl 5.16 rebuild From a0c0256fbc8ebf52a59b32b14f24d754ea56beeb Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 27 Sep 2012 15:17:09 -0400 Subject: [PATCH 086/105] Fix Czech translation that broke /me messages (#789365, ) --- ...Fix-ME-messages-in-czech-translation.patch | 25 +++++++++++++++++++ xchat-gnome.spec | 8 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-ME-messages-in-czech-translation.patch diff --git a/0001-Fix-ME-messages-in-czech-translation.patch b/0001-Fix-ME-messages-in-czech-translation.patch new file mode 100644 index 0000000..0b05c62 --- /dev/null +++ b/0001-Fix-ME-messages-in-czech-translation.patch @@ -0,0 +1,25 @@ +From ce1ef68680aca8cc4e3760fc200d9b71bffed3f6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Fri, 21 Sep 2012 14:27:12 +0200 +Subject: [PATCH] Fix /ME messages in czech translation. + +--- + po/cs.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/po/cs.po b/po/cs.po +index f91a5b0..15f1060 100644 +--- a/po/cs.po ++++ b/po/cs.po +@@ -1865,7 +1865,7 @@ msgstr "%C22*%O$t$1 byl přejmenován na $2" + + #: ../src/common/textevents.h:21 + msgid "%C13*%O$t$1 $2%O" +-msgstr "%C16*%O$t$1%O" ++msgstr "%C16*%O$t$1 $2%O" + + #: ../src/common/textevents.h:24 + msgid "%C13*%O$t%C8%B$1%B%O $2%O" +-- +1.7.11.4 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 989518d..0ac84df 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 8.git%{gitrev}%{?dist} +Release: 9.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -36,6 +36,8 @@ Patch102: 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch Patch103: 0004-Call-g_slist_remove-on-items-before-free-not-after.patch # Don't iterate over an empty hash Patch104: 0001-Fix-crash-on-NULL-networks-hash-table.patch +# Fix czech translation that breaks /me messages () +Patch105: 0001-Fix-ME-messages-in-czech-translation.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -89,6 +91,7 @@ common settings will be included in the main user interface. . %patch102 -p1 -b .depth %patch103 -p1 -b .free %patch104 -p1 -b .hash +%patch105 -p1 %build ./autogen.sh @@ -155,6 +158,9 @@ fi %changelog +* Thu Sep 27 2012 Bill Nottingham - 0.26.2-8.git40c5bf988 +- fix czech translation that broke /me messages (#789365, ) + * Sun Jul 22 2012 Fedora Release Engineering - 0.26.2-8.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From a5a66dc47c41bb6b424b721f6172adf808e7c1e3 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 27 Sep 2012 15:19:11 -0400 Subject: [PATCH 087/105] fix changelog ref --- xchat-gnome.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 0ac84df..9e3bd5b 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -158,7 +158,7 @@ fi %changelog -* Thu Sep 27 2012 Bill Nottingham - 0.26.2-8.git40c5bf988 +* Thu Sep 27 2012 Bill Nottingham - 0.26.2-9.git40c5bf988 - fix czech translation that broke /me messages (#789365, ) * Sun Jul 22 2012 Fedora Release Engineering - 0.26.2-8.git40c5bf988 From f0631536cfc0517e6d630d4752953c13df97b078 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Mon, 11 Feb 2013 08:53:50 +0530 Subject: [PATCH 088/105] Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077 - Cleanup spec as per recently changed packaging guidelines --- xchat-gnome.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 9e3bd5b..17b4ff2 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 9.git%{gitrev}%{?dist} +Release: 10.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -39,8 +39,6 @@ Patch104: 0001-Fix-crash-on-NULL-networks-hash-table.patch # Fix czech translation that breaks /me messages () Patch105: 0001-Fix-ME-messages-in-czech-translation.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - BuildRequires: openssl-devel Buildrequires: libsexy-devel >= 0.1.11 BuildRequires: libnotify-devel @@ -104,12 +102,11 @@ make %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" %find_lang %{name} find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' -desktop-file-install --vendor fedora --delete-original \ +desktop-file-install --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop @@ -140,7 +137,6 @@ fi %files -f %{name}.lang -%defattr(-,root,root,-) %doc COPYING AUTHORS %doc plugins/perl/xchat2-perldocs.html %{_bindir}/%{name} @@ -148,7 +144,7 @@ fi %{_datadir}/%{name}/ %{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png -%{_datadir}/applications/fedora-%{name}.desktop +%{_datadir}/applications/%{name}.desktop %{_datadir}/omf/%{name}/ %{_datadir}/gnome/help/%{name}/ %{_datadir}/dbus-1/services/org.gnome.Xchat.service @@ -158,6 +154,10 @@ fi %changelog +* Mon Feb 11 2013 Parag Nemade - 0.26.2-10.git40c5bf988 +- Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077 +- Cleanup spec as per recently changed packaging guidelines + * Thu Sep 27 2012 Bill Nottingham - 0.26.2-9.git40c5bf988 - fix czech translation that broke /me messages (#789365, ) From db39142a767253e33281669fdbc29707a73d6e04 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Mon, 11 Feb 2013 14:13:03 +0530 Subject: [PATCH 089/105] Fix missing function prototype compilation error for perl.c - Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077 - Cleanup spec as per recently changed packaging guidelines --- ...me-0.26.2-perl-plugin-function-prototype.patch | 15 +++++++++++++++ xchat-gnome.spec | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 xchat-gnome-0.26.2-perl-plugin-function-prototype.patch diff --git a/xchat-gnome-0.26.2-perl-plugin-function-prototype.patch b/xchat-gnome-0.26.2-perl-plugin-function-prototype.patch new file mode 100644 index 0000000..4cb9b72 --- /dev/null +++ b/xchat-gnome-0.26.2-perl-plugin-function-prototype.patch @@ -0,0 +1,15 @@ +diff -urN xchat-gnome-0.26.2.orig/plugins/perl/perl.c xchat-gnome-0.26.2/plugins/perl/perl.c +--- xchat-gnome-0.26.2.orig/plugins/perl/perl.c 2013-02-11 10:36:18.801119247 +0530 ++++ xchat-gnome-0.26.2/plugins/perl/perl.c 2013-02-11 12:45:49.369058799 +0530 +@@ -38,6 +38,11 @@ + + static int perl_load_file (char *script_name); + ++void xchat_plugin_get_info (char **name, char **desc, char **version, void **reserved); ++int xchat_plugin_init (xchat_plugin * plugin_handle, char **plugin_name, ++ char **plugin_desc, char **plugin_version, char *arg); ++int xchat_plugin_deinit (xchat_plugin * plugin_handle); ++ + #ifdef WIN32 + + static DWORD diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 17b4ff2..64f2a48 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -26,6 +26,8 @@ Patch3: build.patch Patch10: xchat-gnome-0.26.1-recent-network-manager.patch # Convert deprecated GDK functions to cairo Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch +# xchat-gnome-0.26.2-perl-plugin-function-prototype.patch +Patch14: xchat-gnome-0.26.2-perl-plugin-function-prototype.patch # Clean up warnings Patch100: 0001-Dont-attempt-to-render-a-nonexistent-string.patch # Fix potential plugin crashers @@ -84,6 +86,7 @@ common settings will be included in the main user interface. . %patch3 -p1 -b .build %patch10 -p1 -b .recent-nm %patch13 -p1 -b .gdk-deprecations +%patch14 -p1 -b .xchat-plugin %patch100 -p1 -b .empty %patch101 -p1 -b .nullplugin %patch102 -p1 -b .depth @@ -154,6 +157,9 @@ fi %changelog +* Mon Feb 11 2013 Parag Nemade - 0.26.2-11.git40c5bf988 +- Fix missing function prototype compilation error for perl.c + * Mon Feb 11 2013 Parag Nemade - 0.26.2-10.git40c5bf988 - Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077 - Cleanup spec as per recently changed packaging guidelines From 99b81aa7fed8fca54489970efd4f29d9a3e02ab4 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 3 Apr 2013 09:44:05 +0200 Subject: [PATCH 090/105] Drop the desktop file name patch now that the vendor prefix is gone --- xchat-gnome-0.26.2-desktop-name.patch | 11 ----------- xchat-gnome.spec | 8 ++++---- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 xchat-gnome-0.26.2-desktop-name.patch diff --git a/xchat-gnome-0.26.2-desktop-name.patch b/xchat-gnome-0.26.2-desktop-name.patch deleted file mode 100644 index 3f1c6ac..0000000 --- a/xchat-gnome-0.26.2-desktop-name.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c.foo xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c ---- xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c.foo 2011-08-09 15:27:42.802160028 -0400 -+++ xchat-gnome-0.26.2/src/fe-gnome/fe-gnome.c 2011-08-09 15:28:03.596159828 -0400 -@@ -1074,7 +1074,7 @@ setup_sm (gint argc, gchar *argv[]) - gchar *desktop_file; - - client = egg_sm_client_get (); -- desktop_file = g_build_filename (DATADIR, "applications", "xchat-gnome.desktop", NULL); -+ desktop_file = g_build_filename (DATADIR, "applications", "fedora-xchat-gnome.desktop", NULL); - egg_set_desktop_file (desktop_file); - g_free (desktop_file); diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 64f2a48..c19ad44 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 10.git%{gitrev}%{?dist} +Release: 12.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -18,8 +18,6 @@ Source0: http://ftp.gnome.org/pub/gnome/sources/%{name}/0.26/%{name}-%{ve Patch0: xchat-gnome-0.23.92-config.patch # Patch for libnotify 0.70 (just drop one parameter from one function) Patch1: xchat-gnome-0.26.1-libnotify.patch -# Fix for our desktop file name -Patch2: xchat-gnome-0.26.2-desktop-name.patch # Fix build (#839623) Patch3: build.patch # Patch to work with recent NetworkManager (0.7+) @@ -82,7 +80,6 @@ common settings will be included in the main user interface. . %setup -q -n %{name}-%{version} %patch0 -p1 -b .config %patch1 -p1 -b .notify -%patch2 -p1 -b .desktop-name %patch3 -p1 -b .build %patch10 -p1 -b .recent-nm %patch13 -p1 -b .gdk-deprecations @@ -157,6 +154,9 @@ fi %changelog +* Wed Apr 03 2013 Kalev Lember - 0.26.2-12.git40c5bf988 +- Drop the desktop file name patch now that the vendor prefix is gone + * Mon Feb 11 2013 Parag Nemade - 0.26.2-11.git40c5bf988 - Fix missing function prototype compilation error for perl.c From 51071f528190e020ea93d239b1d9178ebab1f823 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 3 Apr 2013 09:45:40 +0200 Subject: [PATCH 091/105] Remove the scrollkeeper runtime dep --- xchat-gnome.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index c19ad44..1d2b6f2 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -47,7 +47,6 @@ BuildRequires: gtk2-devel >= 2.14.0 BuildRequires: libcanberra-devel BuildRequires: python-devel BuildRequires: desktop-file-utils -BuildRequires: scrollkeeper BuildRequires: intltool BuildRequires: gettext BuildRequires: perl-devel @@ -63,9 +62,7 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires(pre): GConf2 Requires(post): GConf2 -Requires(post): scrollkeeper Requires(preun): GConf2 -Requires(postun): scrollkeeper %description @@ -117,7 +114,6 @@ desktop-file-install --delete-original \ %post %gconf_schema_upgrade apps_xchat notification urlscraper url_handler -scrollkeeper-update -q -o %{_datadir}/omf/%{name} || : touch --no-create %{_datadir}/icons/hicolor || : if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : @@ -129,7 +125,6 @@ fi %postun -scrollkeeper-update -q -o %{_datadir}/omf/%{name} || : touch --no-create %{_datadir}/icons/hicolor || : if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : @@ -156,6 +151,7 @@ fi %changelog * Wed Apr 03 2013 Kalev Lember - 0.26.2-12.git40c5bf988 - Drop the desktop file name patch now that the vendor prefix is gone +- Remove the scrollkeeper runtime dep * Mon Feb 11 2013 Parag Nemade - 0.26.2-11.git40c5bf988 - Fix missing function prototype compilation error for perl.c From df697a01d771f9327f39b81995168e77a120e093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 24 Jul 2013 11:08:29 +0200 Subject: [PATCH 092/105] Perl 5.18 rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 1d2b6f2..996589a 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 12.git%{gitrev}%{?dist} +Release: 13.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -149,6 +149,9 @@ fi %changelog +* Wed Jul 24 2013 Petr Pisar - 0.26.2-13.git40c5bf988 +- Perl 5.18 rebuild + * Wed Apr 03 2013 Kalev Lember - 0.26.2-12.git40c5bf988 - Drop the desktop file name patch now that the vendor prefix is gone - Remove the scrollkeeper runtime dep From c59499270c29bf8532f946ba142a7b8154862335 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 4 Aug 2013 02:42:42 -0500 Subject: [PATCH 093/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 996589a..21fa8db 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 13.git%{gitrev}%{?dist} +Release: 14.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -149,6 +149,9 @@ fi %changelog +* Sun Aug 04 2013 Fedora Release Engineering - 0.26.2-14.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Wed Jul 24 2013 Petr Pisar - 0.26.2-13.git40c5bf988 - Perl 5.18 rebuild From b024cbc4d1958b98dff6779df499aad00ec658c2 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 18 Nov 2013 12:39:58 -0500 Subject: [PATCH 094/105] Don't use a URL that doesn't work. --- xchat-gnome.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 21fa8db..3d9f637 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -13,7 +13,7 @@ URL: http://live.gnome.org/Xchat-Gnome # git clone git://git.gnome.org/xchat-gnome # git archive --format=tar --prefix=xchat-gnome-0.26.2/ XCHAT_GNOME_0_26_2 > xchat-gnome-0.26.2-%{gitrev}.ta # bzip2 xchat-gnome-0.26.2-%{gitrev}.tar -Source0: http://ftp.gnome.org/pub/gnome/sources/%{name}/0.26/%{name}-%{version}-%{gitrev}.tar.bz2 +Source0: %{name}-%{version}-%{gitrev}.tar.bz2 # Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 Patch0: xchat-gnome-0.23.92-config.patch # Patch for libnotify 0.70 (just drop one parameter from one function) From 86d6f384a85cb41951e2d0902afb37165342ea04 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 8 Jun 2014 00:21:22 -0500 Subject: [PATCH 095/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 3d9f637..a79f0b1 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 14.git%{gitrev}%{?dist} +Release: 15.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -149,6 +149,9 @@ fi %changelog +* Sun Jun 08 2014 Fedora Release Engineering - 0.26.2-15.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Sun Aug 04 2013 Fedora Release Engineering - 0.26.2-14.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 564f5dc37ed6e62a488cce25f46aa4f565df4d29 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 18 Aug 2014 09:24:58 +0000 Subject: [PATCH 096/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a79f0b1..49e6973 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 15.git%{gitrev}%{?dist} +Release: 16.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -149,6 +149,9 @@ fi %changelog +* Mon Aug 18 2014 Fedora Release Engineering - 0.26.2-16.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sun Jun 08 2014 Fedora Release Engineering - 0.26.2-15.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 04a49fc0ed4be06b1150583505455cc06d8aa476 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Thu, 28 Aug 2014 20:04:50 +0200 Subject: [PATCH 097/105] Perl 5.20 rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 49e6973..6a84973 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 16.git%{gitrev}%{?dist} +Release: 17.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -149,6 +149,9 @@ fi %changelog +* Thu Aug 28 2014 Jitka Plesnikova - 0.26.2-17.git40c5bf988 +- Perl 5.20 rebuild + * Mon Aug 18 2014 Fedora Release Engineering - 0.26.2-16.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From 69bf0edd04d2b94cf9d46a1df466941efc915022 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 29 Oct 2014 11:58:33 +0100 Subject: [PATCH 098/105] Do not force SSLv3, also allow TLSv1_X (#1091544) --- 0001-Don-t-force-the-use-of-SSLv3.patch | 37 +++++++++++++++++++++++++ xchat-gnome.spec | 8 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0001-Don-t-force-the-use-of-SSLv3.patch diff --git a/0001-Don-t-force-the-use-of-SSLv3.patch b/0001-Don-t-force-the-use-of-SSLv3.patch new file mode 100644 index 0000000..e0f0472 --- /dev/null +++ b/0001-Don-t-force-the-use-of-SSLv3.patch @@ -0,0 +1,37 @@ +From 527eb322a5bfa97d5716e7f8178e319c515065a2 Mon Sep 17 00:00:00 2001 +From: Marc Deslauriers +Date: Mon, 20 Oct 2014 10:08:26 -0400 +Subject: [PATCH] Don't force the use of SSLv3. + +SSLv3 should no longer be used for security reasons. Let the best +connection method be automatically determined by using SSLv23_client_method() +and SSLv23_server_method(). +--- + src/common/ssl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/common/ssl.c b/src/common/ssl.c +index a18ad47..35eb237 100644 +--- a/src/common/ssl.c ++++ b/src/common/ssl.c +@@ -70,7 +70,7 @@ _SSL_context_init (void (*info_cb_func), int server) + + SSLeay_add_ssl_algorithms (); + SSL_load_error_strings (); +- ctx = SSL_CTX_new (server ? SSLv3_server_method() : SSLv3_client_method ()); ++ ctx = SSL_CTX_new (server ? SSLv23_server_method() : SSLv23_client_method ()); + + SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH); + SSL_CTX_set_timeout (ctx, 300); +@@ -281,7 +281,7 @@ _SSL_socket (SSL_CTX *ctx, int sd) + __SSL_critical_error ("SSL_new"); + + SSL_set_fd (ssl, sd); +- if (ctx->method == SSLv3_client_method()) ++ if (ctx->method == SSLv23_client_method()) + SSL_set_connect_state (ssl); + else + SSL_set_accept_state(ssl); +-- +2.1.0 + diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 6a84973..504d463 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 17.git%{gitrev}%{?dist} +Release: 18.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -38,6 +38,8 @@ Patch103: 0004-Call-g_slist_remove-on-items-before-free-not-after.patch Patch104: 0001-Fix-crash-on-NULL-networks-hash-table.patch # Fix czech translation that breaks /me messages () Patch105: 0001-Fix-ME-messages-in-czech-translation.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1091544 +Patch106: 0001-Don-t-force-the-use-of-SSLv3.patch BuildRequires: openssl-devel Buildrequires: libsexy-devel >= 0.1.11 @@ -87,6 +89,7 @@ common settings will be included in the main user interface. . %patch103 -p1 -b .free %patch104 -p1 -b .hash %patch105 -p1 +%patch106 -p1 -b .allow-tls %build ./autogen.sh @@ -149,6 +152,9 @@ fi %changelog +* Wed Oct 29 2014 Debarshi Ray - 0.26.2-18.git40c5bf988 +- Do not force SSLv3, also allow TLSv1_X (#1091544) + * Thu Aug 28 2014 Jitka Plesnikova - 0.26.2-17.git40c5bf988 - Perl 5.20 rebuild From eff8adcbf678a8ce0502a70d5993ddbb53d9e622 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Sat, 6 Jun 2015 20:53:26 +0200 Subject: [PATCH 099/105] Perl 5.22 rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 504d463..a4f54c7 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 18.git%{gitrev}%{?dist} +Release: 19.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -152,6 +152,9 @@ fi %changelog +* Sat Jun 06 2015 Jitka Plesnikova - 0.26.2-19.git40c5bf988 +- Perl 5.22 rebuild + * Wed Oct 29 2014 Debarshi Ray - 0.26.2-18.git40c5bf988 - Do not force SSLv3, also allow TLSv1_X (#1091544) From f22fe4cd936fd95e4ba4deb69b387a8902d1af45 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 19 Jun 2015 03:47:56 +0000 Subject: [PATCH 100/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index a4f54c7..2880f0f 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 19.git%{gitrev}%{?dist} +Release: 20.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -152,6 +152,9 @@ fi %changelog +* Fri Jun 19 2015 Fedora Release Engineering - 0.26.2-20.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Sat Jun 06 2015 Jitka Plesnikova - 0.26.2-19.git40c5bf988 - Perl 5.22 rebuild From 8b74fc96c08b66084123ccda16b799c01b225fb9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 5 Feb 2016 03:19:35 +0000 Subject: [PATCH 101/105] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 2880f0f..f98337b 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 20.git%{gitrev}%{?dist} +Release: 21.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -152,6 +152,9 @@ fi %changelog +* Fri Feb 05 2016 Fedora Release Engineering - 0.26.2-21.git40c5bf988 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Fri Jun 19 2015 Fedora Release Engineering - 0.26.2-20.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From de2ed74159715fd6eb47746196c5d145bd1a3b0f Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 18 Feb 2016 20:35:30 -0600 Subject: [PATCH 102/105] Fix build with gnome-common 3.18 (#1267460) --- xchat-gnome.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f98337b..9df8f62 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 21.git%{gitrev}%{?dist} +Release: 22.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -92,6 +92,8 @@ common settings will be included in the main user interface. . %patch106 -p1 -b .allow-tls %build +# removed from gnome-common 3.18 (#1267460) +gnome-doc-prepare --force --copy ./autogen.sh %configure --disable-tcl \ --disable-scrollkeeper \ @@ -152,6 +154,9 @@ fi %changelog +* Fri Feb 19 2016 Yaakov Selkowitz - 0.26.2-22.git40c5bf988 +- Fix build with gnome-common 3.18 (#1267460) + * Fri Feb 05 2016 Fedora Release Engineering - 0.26.2-21.git40c5bf988 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 7b383b77bd5f7eab279640ea463ffc26f5d695d4 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mon, 16 May 2016 06:48:03 +0200 Subject: [PATCH 103/105] Perl 5.24 rebuild --- xchat-gnome.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index 9df8f62..f7fd481 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -2,7 +2,7 @@ Name: xchat-gnome Version: 0.26.2 -Release: 22.git%{gitrev}%{?dist} +Release: 23.git%{gitrev}%{?dist} Summary: GNOME front-end to xchat Group: Applications/Internet @@ -154,6 +154,9 @@ fi %changelog +* Mon May 16 2016 Jitka Plesnikova - 0.26.2-23.git40c5bf988 +- Perl 5.24 rebuild + * Fri Feb 19 2016 Yaakov Selkowitz - 0.26.2-22.git40c5bf988 - Fix build with gnome-common 3.18 (#1267460) From 4baab40b91e1f143d03a06a655c42f7eff81af0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 24 Jun 2016 09:29:51 +0200 Subject: [PATCH 104/105] Mandatory Perl build-requires added --- xchat-gnome.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xchat-gnome.spec b/xchat-gnome.spec index f7fd481..6ee19c2 100644 --- a/xchat-gnome.spec +++ b/xchat-gnome.spec @@ -52,6 +52,7 @@ BuildRequires: desktop-file-utils BuildRequires: intltool BuildRequires: gettext BuildRequires: perl-devel +BuildRequires: perl-generators BuildRequires: perl(XML::Parser) BuildRequires: perl(ExtUtils::Embed) BuildRequires: gnome-doc-utils From 0718961492e606ec1dbf5576354a5e3a1fbed2d2 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Sun, 20 Nov 2016 10:54:09 +0100 Subject: [PATCH 105/105] 2016-11-20: Retired orphaned package, because it was orphaned for more than six weeks. --- .gitignore | 1 - 0001-Don-t-force-the-use-of-SSLv3.patch | 37 -- ...tempt-to-render-a-nonexistent-string.patch | 26 - ...Fix-ME-messages-in-czech-translation.patch | 25 - ...ix-crash-on-NULL-networks-hash-table.patch | 31 -- 0002-Plugin_GetCurrent-can-return-NULL.patch | 41 -- ...ap-depth-matches-screen-window-depth.patch | 26 - ...emove-on-items-before-free-not-after.patch | 92 ---- build.patch | 19 - dead.package | 3 + sources | 1 - xchat-gnome-0.23.92-config.patch | 78 --- xchat-gnome-0.26.1-libnotify.patch | 11 - ...-gnome-0.26.1-recent-network-manager.patch | 149 ----- ...t-gnome-0.26.1-remove-deprecated-api.patch | 400 -------------- ....26.2-perl-plugin-function-prototype.patch | 15 - xchat-gnome.spec | 518 ------------------ 17 files changed, 3 insertions(+), 1470 deletions(-) delete mode 100644 .gitignore delete mode 100644 0001-Don-t-force-the-use-of-SSLv3.patch delete mode 100644 0001-Dont-attempt-to-render-a-nonexistent-string.patch delete mode 100644 0001-Fix-ME-messages-in-czech-translation.patch delete mode 100644 0001-Fix-crash-on-NULL-networks-hash-table.patch delete mode 100644 0002-Plugin_GetCurrent-can-return-NULL.patch delete mode 100644 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch delete mode 100644 0004-Call-g_slist_remove-on-items-before-free-not-after.patch delete mode 100644 build.patch create mode 100644 dead.package delete mode 100644 sources delete mode 100644 xchat-gnome-0.23.92-config.patch delete mode 100644 xchat-gnome-0.26.1-libnotify.patch delete mode 100644 xchat-gnome-0.26.1-recent-network-manager.patch delete mode 100644 xchat-gnome-0.26.1-remove-deprecated-api.patch delete mode 100644 xchat-gnome-0.26.2-perl-plugin-function-prototype.patch delete mode 100644 xchat-gnome.spec diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 98dbaf8..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/xchat-gnome-0.26.2-40c5bf988.tar.bz2 diff --git a/0001-Don-t-force-the-use-of-SSLv3.patch b/0001-Don-t-force-the-use-of-SSLv3.patch deleted file mode 100644 index e0f0472..0000000 --- a/0001-Don-t-force-the-use-of-SSLv3.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 527eb322a5bfa97d5716e7f8178e319c515065a2 Mon Sep 17 00:00:00 2001 -From: Marc Deslauriers -Date: Mon, 20 Oct 2014 10:08:26 -0400 -Subject: [PATCH] Don't force the use of SSLv3. - -SSLv3 should no longer be used for security reasons. Let the best -connection method be automatically determined by using SSLv23_client_method() -and SSLv23_server_method(). ---- - src/common/ssl.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/common/ssl.c b/src/common/ssl.c -index a18ad47..35eb237 100644 ---- a/src/common/ssl.c -+++ b/src/common/ssl.c -@@ -70,7 +70,7 @@ _SSL_context_init (void (*info_cb_func), int server) - - SSLeay_add_ssl_algorithms (); - SSL_load_error_strings (); -- ctx = SSL_CTX_new (server ? SSLv3_server_method() : SSLv3_client_method ()); -+ ctx = SSL_CTX_new (server ? SSLv23_server_method() : SSLv23_client_method ()); - - SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH); - SSL_CTX_set_timeout (ctx, 300); -@@ -281,7 +281,7 @@ _SSL_socket (SSL_CTX *ctx, int sd) - __SSL_critical_error ("SSL_new"); - - SSL_set_fd (ssl, sd); -- if (ctx->method == SSLv3_client_method()) -+ if (ctx->method == SSLv23_client_method()) - SSL_set_connect_state (ssl); - else - SSL_set_accept_state(ssl); --- -2.1.0 - diff --git a/0001-Dont-attempt-to-render-a-nonexistent-string.patch b/0001-Dont-attempt-to-render-a-nonexistent-string.patch deleted file mode 100644 index fc22dd9..0000000 --- a/0001-Dont-attempt-to-render-a-nonexistent-string.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 658b8d21e2ad4d158db6e189cc622e6a8e6b756b Mon Sep 17 00:00:00 2001 -From: Bill Nottingham -Date: Wed, 13 Apr 2011 22:40:17 -0400 -Subject: [PATCH 1/3] Dont' attempt to render a nonexistent string. - -https://bugzilla.gnome.org/show_bug.cgi?id=652867 ---- - src/fe-gnome/xtext.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c -index 06b00c5..6cba1d5 100644 ---- a/src/fe-gnome/xtext.c -+++ b/src/fe-gnome/xtext.c -@@ -2645,7 +2645,7 @@ gtk_xtext_render_flush (GtkXText * xtext, int x, int y, unsigned char *str, - - str_width = backend_get_text_width (xtext, str, len, is_mb); - -- if (xtext->dont_render2) -+ if (xtext->dont_render2 || str_width < 1) - return str_width; - - /* roll-your-own clipping (avoiding XftDrawString is always good!) */ --- -1.7.5.2 - diff --git a/0001-Fix-ME-messages-in-czech-translation.patch b/0001-Fix-ME-messages-in-czech-translation.patch deleted file mode 100644 index 0b05c62..0000000 --- a/0001-Fix-ME-messages-in-czech-translation.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ce1ef68680aca8cc4e3760fc200d9b71bffed3f6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Fri, 21 Sep 2012 14:27:12 +0200 -Subject: [PATCH] Fix /ME messages in czech translation. - ---- - po/cs.po | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/po/cs.po b/po/cs.po -index f91a5b0..15f1060 100644 ---- a/po/cs.po -+++ b/po/cs.po -@@ -1865,7 +1865,7 @@ msgstr "%C22*%O$t$1 byl přejmenován na $2" - - #: ../src/common/textevents.h:21 - msgid "%C13*%O$t$1 $2%O" --msgstr "%C16*%O$t$1%O" -+msgstr "%C16*%O$t$1 $2%O" - - #: ../src/common/textevents.h:24 - msgid "%C13*%O$t%C8%B$1%B%O $2%O" --- -1.7.11.4 - diff --git a/0001-Fix-crash-on-NULL-networks-hash-table.patch b/0001-Fix-crash-on-NULL-networks-hash-table.patch deleted file mode 100644 index 6ea4af6..0000000 --- a/0001-Fix-crash-on-NULL-networks-hash-table.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5b79d29146a72f1db0eff3bce4fd8e155d396c2d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 3 Oct 2011 13:47:27 +0200 -Subject: [PATCH] Fix crash on NULL 'networks' hash table -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - plugins/net-monitor/net-monitor.c | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/plugins/net-monitor/net-monitor.c b/plugins/net-monitor/net-monitor.c -index fada61c..6ac981c 100644 ---- a/plugins/net-monitor/net-monitor.c -+++ b/plugins/net-monitor/net-monitor.c -@@ -176,7 +176,8 @@ set_network_mode (NetworkStatus status) - */ - res_init(); - -- g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL); -+ if (networks) -+ g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL); - } - } - --- -1.7.6.4 - diff --git a/0002-Plugin_GetCurrent-can-return-NULL.patch b/0002-Plugin_GetCurrent-can-return-NULL.patch deleted file mode 100644 index 35a4fca..0000000 --- a/0002-Plugin_GetCurrent-can-return-NULL.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7604517bd9c400ae60ab64b82aea1b9665e4122c Mon Sep 17 00:00:00 2001 -From: Bill Nottingham -Date: Tue, 19 Apr 2011 17:09:44 -0400 -Subject: [PATCH 2/3] Plugin_GetCurrent() can return NULL. - -Check its return before dereferencing it. - -https://bugzilla.gnome.org/show_bug.cgi?id=652866 ---- - plugins/python/python.c | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/plugins/python/python.c b/plugins/python/python.c -index 53267a3..bcceed1 100644 ---- a/plugins/python/python.c -+++ b/plugins/python/python.c -@@ -791,6 +791,8 @@ static PyObject * - Context_set(ContextObject *self, PyObject *args) - { - PyObject *plugin = Plugin_GetCurrent(); -+ if (plugin == NULL) -+ return NULL; - Plugin_SetContext(plugin, self->context); - Py_INCREF(Py_None); - return Py_None; -@@ -867,8 +869,11 @@ static PyObject * - Context_get_list(ContextObject *self, PyObject *args) - { - PyObject *plugin = Plugin_GetCurrent(); -- xchat_context *saved_context = Plugin_GetContext(plugin); -+ xchat_context *saved_context; - PyObject *ret; -+ if (plugin == NULL) -+ return NULL; -+ saved_context = Plugin_GetContext(plugin); - Plugin_SetContext(plugin, self->context); - ret = Module_xchat_get_list((PyObject*)self, args); - Plugin_SetContext(plugin, saved_context); --- -1.7.5.2 - diff --git a/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch b/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch deleted file mode 100644 index 3be4915..0000000 --- a/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9464eeb4bd0b3f09901d18357dee06d084989162 Mon Sep 17 00:00:00 2001 -From: Bill Nottingham -Date: Fri, 17 Jun 2011 15:49:09 -0400 -Subject: [PATCH 3/3] Ensure pixmap depth matches screen/window depth. - -https://bugzilla.gnome.org/show_bug.cgi?id=652865 ---- - src/fe-gnome/conversation-panel.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/fe-gnome/conversation-panel.c b/src/fe-gnome/conversation-panel.c -index 59e1bcd..b230fd5 100644 ---- a/src/fe-gnome/conversation-panel.c -+++ b/src/fe-gnome/conversation-panel.c -@@ -592,7 +592,7 @@ conversation_panel_set_background (ConversationPanel *panel) - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); - -- image = gdk_pixmap_new (NULL, width, height, 24); -+ image = gdk_pixmap_new (GDK_DRAWABLE (panel->priv->xtext->window), width, height, -1); - #if GTK_CHECK_VERSION (2, 23, 0) - context = gdk_cairo_create (GDK_DRAWABLE (image)); - gdk_cairo_set_source_pixbuf (context, pixbuf, 0, 0); --- -1.7.5.2 - diff --git a/0004-Call-g_slist_remove-on-items-before-free-not-after.patch b/0004-Call-g_slist_remove-on-items-before-free-not-after.patch deleted file mode 100644 index 2d0489f..0000000 --- a/0004-Call-g_slist_remove-on-items-before-free-not-after.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 8dfd9e91bbf3de9084980ea19e4353ad88aa9399 Mon Sep 17 00:00:00 2001 -From: Bill Nottingham -Date: Fri, 17 Jun 2011 16:38:23 -0400 -Subject: [PATCH 4/4] Call g_slist_remove on items before free(), not after. - ---- - src/common/cfgfiles.c | 2 +- - src/common/plugin.c | 2 +- - src/common/servlist.c | 22 +++++++++++----------- - 3 files changed, 13 insertions(+), 13 deletions(-) - -diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c -index 6c70727..330967a 100644 ---- a/src/common/cfgfiles.c -+++ b/src/common/cfgfiles.c -@@ -140,8 +140,8 @@ list_free (GSList ** list) - while (*list) - { - data = (void *) (*list)->data; -- free (data); - *list = g_slist_remove (*list, data); -+ free (data); - } - } - -diff --git a/src/common/plugin.c b/src/common/plugin.c -index 0889dca..c6a67ac 100644 ---- a/src/common/plugin.c -+++ b/src/common/plugin.c -@@ -160,9 +160,9 @@ xit: - } - if (pl->filename) - free ((char *)pl->filename); -- free (pl); - - plugin_list = g_slist_remove (plugin_list, pl); -+ free (pl); - - #ifdef USE_PLUGIN - fe_pluginlist_update (); -diff --git a/src/common/servlist.c b/src/common/servlist.c -index 3082966..b38ac4f 100644 ---- a/src/common/servlist.c -+++ b/src/common/servlist.c -@@ -792,9 +792,9 @@ servlist_server_add (ircnet *net, char *name) - void - servlist_server_remove (ircnet *net, ircserver *serv) - { -+ net->servlist = g_slist_remove (net->servlist, serv); - free (serv->hostname); - free (serv); -- net->servlist = g_slist_remove (net->servlist, serv); - } - - static void -@@ -818,6 +818,16 @@ servlist_net_remove (ircnet *net) - servlist_server_remove_all (net); - network_list = g_slist_remove (network_list, net); - -+ /* for safety */ -+ list = serv_list; -+ while (list) -+ { -+ serv = list->data; -+ if (serv->network == net) -+ serv->network = NULL; -+ list = list->next; -+ } -+ - if (net->nick) - free (net->nick); - if (net->nick2) -@@ -840,16 +850,6 @@ servlist_net_remove (ircnet *net) - free (net->encoding); - free (net->name); - free (net); -- -- /* for safety */ -- list = serv_list; -- while (list) -- { -- serv = list->data; -- if (serv->network == net) -- serv->network = NULL; -- list = list->next; -- } - } - - ircnet * --- -1.7.5.2 - diff --git a/build.patch b/build.patch deleted file mode 100644 index 87368f2..0000000 --- a/build.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up xchat-gnome-0.26.2/configure.ac.ice xchat-gnome-0.26.2/configure.ac ---- xchat-gnome-0.26.2/configure.ac.ice 2010-09-16 02:44:35.000000000 -0400 -+++ xchat-gnome-0.26.2/configure.ac 2012-07-12 12:05:32.287466474 -0400 -@@ -63,6 +63,7 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ - gio-2.0 >= $GLIB_REQUIRED \ - gtk+-2.0 >= $GTK_REQUIRED \ - libglade-2.0 >= $LIBGLADE_REQUIRED \ -+ gmodule-2.0 >= $GLIB_REQUIRED \ - gconf-2.0 >= $GCONF_REQUIRED \ - libsexy >= $LIBSEXY_REQUIRED \ - ]) -@@ -72,6 +72,7 @@ PKG_CHECK_MODULES([DEPENDENCIES], [\ - PKG_CHECK_MODULES([EGG_SMCLIENT], [\ - gtk+-2.0 >= $GTK_REQUIRED \ - sm >= $SM_REQUIRED \ -+ ice \ - ]) - AC_SUBST(EGG_SMCLIENT_CFLAGS) - AC_SUBST(EGG_SMCLIENT_LIBS) diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..c8e92df --- /dev/null +++ b/dead.package @@ -0,0 +1,3 @@ +2016-11-20: Retired orphaned package, because it was orphaned for +more than six weeks. + diff --git a/sources b/sources deleted file mode 100644 index 2a15fb8..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -b65f089b921499b1c65172a618999248 xchat-gnome-0.26.2-40c5bf988.tar.bz2 diff --git a/xchat-gnome-0.23.92-config.patch b/xchat-gnome-0.23.92-config.patch deleted file mode 100644 index 1cb0439..0000000 --- a/xchat-gnome-0.23.92-config.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff -urp xchat-gnome-0.23.92.OLD/plugins/perl/perl.c xchat-gnome-0.23.92/plugins/perl/perl.c ---- xchat-gnome-0.23.92.OLD/plugins/perl/perl.c 2007-03-09 10:42:50.000000000 -0500 -+++ xchat-gnome-0.23.92/plugins/perl/perl.c 2008-09-09 19:07:08.000000000 -0400 -@@ -92,7 +92,7 @@ perl_auto_load (void) - if (!xdir) /* xchatdirfs is new for 2.0.9, will fail on older */ - xdir = xchat_get_info (ph, "xchatdir"); - -- /* autoload from ~/.xchat2/ or ${APPDATA}\X-Chat 2\ on win32 */ -+ /* autoload from ~/.xchat-gnome/ or ${APPDATA}\X-Chat 2\ on win32 */ - perl_auto_load_from_path (xdir); - - #ifdef WIN32 -diff -urp xchat-gnome-0.23.92.OLD/plugins/python/python.c xchat-gnome-0.23.92/plugins/python/python.c ---- xchat-gnome-0.23.92.OLD/plugins/python/python.c 2008-09-07 09:18:27.000000000 -0400 -+++ xchat-gnome-0.23.92/plugins/python/python.c 2008-09-09 19:06:47.000000000 -0400 -@@ -421,7 +421,7 @@ Util_Expand(char *filename) - return expanded; - g_free(expanded); - -- /* Check if ~/.xchat2/ exists. */ -+ /* Check if ~/.xchat-gnome/ exists. */ - expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), - filename, NULL); - if (g_file_test(expanded, G_FILE_TEST_EXISTS)) -diff -urp xchat-gnome-0.23.92.OLD/src/common/cfgfiles.c xchat-gnome-0.23.92/src/common/cfgfiles.c ---- xchat-gnome-0.23.92.OLD/src/common/cfgfiles.c 2007-09-12 10:12:26.000000000 -0400 -+++ xchat-gnome-0.23.92/src/common/cfgfiles.c 2008-09-09 19:05:01.000000000 -0400 -@@ -34,7 +34,7 @@ - #ifdef WIN32 - #define XCHAT_DIR "X-Chat 2" - #else --#define XCHAT_DIR ".xchat2" -+#define XCHAT_DIR ".xchat-gnome" - #endif - #define DEF_FONT "Monospace 9" - -@@ -351,7 +351,7 @@ check_prefs_dir (void) - #else - if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0) - #endif -- fe_message (_("Cannot create ~/.xchat2"), FE_MSG_ERROR); -+ fe_message (_("Cannot create ~/.xchat-gnome"), FE_MSG_ERROR); - } - } - -diff -urp xchat-gnome-0.23.92.OLD/src/common/fe.h xchat-gnome-0.23.92/src/common/fe.h ---- xchat-gnome-0.23.92.OLD/src/common/fe.h 2007-07-09 05:30:58.000000000 -0400 -+++ xchat-gnome-0.23.92/src/common/fe.h 2008-09-09 19:05:21.000000000 -0400 -@@ -106,7 +106,7 @@ void fe_get_str (char *prompt, char *def - void fe_get_int (char *prompt, int def, void *callback, void *ud); - #define FRF_WRITE 1 /* save file */ - #define FRF_MULTIPLE 2 /* multi-select */ --#define FRF_ADDFOLDER 4 /* add ~/.xchat2 to favourites */ -+#define FRF_ADDFOLDER 4 /* add ~/.xchat-gnome to favourites */ - #define FRF_CHOOSEFOLDER 8 /* choosing a folder only */ - #define FRF_FILTERISINITIAL 16 /* unused */ - #define FRF_NOASKOVERWRITE 32 /* don't ask to overwrite existing files */ -diff -urp xchat-gnome-0.23.92.OLD/src/fe-gnome/preferences-page-plugins.c xchat-gnome-0.23.92/src/fe-gnome/preferences-page-plugins.c ---- xchat-gnome-0.23.92.OLD/src/fe-gnome/preferences-page-plugins.c 2007-07-24 05:24:39.000000000 -0400 -+++ xchat-gnome-0.23.92/src/fe-gnome/preferences-page-plugins.c 2008-09-09 19:06:27.000000000 -0400 -@@ -242,7 +242,7 @@ open_plugin_clicked (GtkButton *button, - file_selector = gtk_file_chooser_dialog_new (_("Open Plugin"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); - - homedir = g_get_home_dir(); -- plugindir = g_strdup_printf ("%s/.xchat2/plugins", homedir); -+ plugindir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_selector), plugindir); - g_free (plugindir); - -@@ -417,7 +417,7 @@ preferences_page_plugins_check_plugins ( - xchat_plugin *plugin; - - homedir = g_get_home_dir (); -- xchatdir = g_strdup_printf ("%s/.xchat2/plugins", homedir); -+ xchatdir = g_strdup_printf ("%s/.xchat-gnome/plugins", homedir); - for_files (XCHATLIBDIR "/plugins", "*.so", fe_plugin_add); - for_files (XCHATLIBDIR "/plugins", "*.sl", fe_plugin_add); - for_files (XCHATLIBDIR "/plugins", "*.py", fe_plugin_add); diff --git a/xchat-gnome-0.26.1-libnotify.patch b/xchat-gnome-0.26.1-libnotify.patch deleted file mode 100644 index 40c29a4..0000000 --- a/xchat-gnome-0.26.1-libnotify.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xchat-gnome-0.26.1/plugins/notify-osd/notify-osd.c 2008-09-07 06:18:27.000000000 -0700 -+++ xchat-gnome-0.26.1/plugins/notify-osd/notify-osd.c.new 2010-11-08 13:42:40.856127590 -0800 -@@ -67,7 +67,7 @@ - gchar *escaped; - - escaped = g_markup_escape_text (message, strlen(message)); -- notify = notify_notification_new (summary, escaped, NULL, NULL); -+ notify = notify_notification_new (summary, escaped, NULL); - notify_notification_set_urgency (notify, NOTIFY_URGENCY_NORMAL); - notify_notification_set_icon_from_pixbuf (notify, notify_icon); - if (!notify_notification_show (notify, &error)) { diff --git a/xchat-gnome-0.26.1-recent-network-manager.patch b/xchat-gnome-0.26.1-recent-network-manager.patch deleted file mode 100644 index 2d0f225..0000000 --- a/xchat-gnome-0.26.1-recent-network-manager.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -up xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c ---- xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c.recent-nm 2009-03-15 09:08:06.000000000 -0500 -+++ xchat-gnome-0.26.1/plugins/net-monitor/net-monitor.c 2011-03-25 18:10:33.621834647 -0500 -@@ -23,7 +23,6 @@ - */ - - #include --#define DBUS_API_SUBJECT_TO_CHANGE - #include - #include - #include -@@ -54,13 +53,18 @@ typedef enum - - typedef enum - { -- NM_STATE_UNKNOWN = 0, -- NM_STATE_ASLEEP, -- NM_STATE_CONFIGURE_AP, -- NM_STATE_CONFIGURE_DEV, -- NM_STATE_CONFIGURE_IP, -- NM_STATE_CONNECTED, -- NM_STATE_DISCONNECTED, -+ NM_STATE_UNKNOWN = 0, -+ NM_OLD_STATE_ASLEEP = 1, -+ NM_OLD_STATE_CONNECTING = 4, -+ NM_OLD_STATE_CONNECTED = 5, -+ NM_OLD_STATE_DISCONNECTED = 6, -+ NM_STATE_ASLEEP = 10, -+ NM_STATE_DISCONNECTED = 20, -+ NM_STATE_DISCONNECTING = 30, -+ NM_STATE_CONNECTING = 40, -+ NM_STATE_CONNECTED_LOCAL = 50, -+ NM_STATE_CONNECTED_SITE = 60, -+ NM_STATE_CONNECTED_GLOBAL = 70 - } NetworkManagerState; - - enum { -@@ -180,50 +184,6 @@ set_network_mode (NetworkStatus status) - } - } - --static NetworkStatus --check_device_state (const char *path) --{ -- DBusMessage *message, *reply; -- DBusMessageIter iter; -- DBusError error; -- NetworkStatus network_mode; -- -- message = dbus_message_new_method_call (NM_SERVICE, path, NM_INTERFACE, "getLinkActive"); -- if (message == NULL) { -- g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); -- /* just guess that we're up */ -- return NETWORK_UP; -- } -- -- dbus_error_init (&error); -- reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error); -- -- if (dbus_error_is_set (&error)) { -- g_warning ("Net Monitor: Error retrieving device state: %s: %s\n", error.name, error.message); -- network_mode = NETWORK_UP; -- } else { -- dbus_message_iter_init (reply, &iter); -- -- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_BOOLEAN) { -- dbus_bool_t active; -- -- dbus_message_iter_get_basic (&iter, &active); -- network_mode = active ? NETWORK_UP : NETWORK_DOWN; -- } else { -- g_warning ("Net Monitor: got bad reply from NetworkManager\n"); -- network_mode = NETWORK_UP; -- } -- } -- -- if (reply) -- dbus_message_unref (reply); -- -- if (message) -- dbus_message_unref (message); -- -- return network_mode; --} -- - static void - determine_network_status () - { -@@ -232,7 +192,7 @@ determine_network_status () - DBusError error; - NetworkStatus network_mode = NETWORK_DOWN; - -- message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "getDevices"); -+ message = dbus_message_new_method_call (NM_SERVICE, NM_OBJECT_PATH, NM_INTERFACE, "state"); - if (message == NULL) { - g_warning ("Net Monitor: Couldn't allocate dbus message : %s: %s\n", error.name, error.message); - /* just guess that we're up */ -@@ -248,24 +208,15 @@ determine_network_status () - network_mode = NETWORK_UP; - } else { - dbus_message_iter_init (reply, &iter); -- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY) { -- DBusMessageIter child; -- -- dbus_message_iter_recurse (&iter, &child); -- -- while (dbus_message_iter_get_arg_type (&child) != DBUS_TYPE_INVALID) { -- const char *path; -- gboolean state; -- -- /* Check the state of this individual device. If any one -- * device is active, the network is up */ -- dbus_message_iter_get_basic (&child, &path); -- state = check_device_state (path); -- if (state == NETWORK_UP) -- network_mode = NETWORK_UP; -+ if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_UINT32) { -+ dbus_uint32_t state; - -- dbus_message_iter_next (&child); -- } -+ dbus_message_iter_get_basic (&iter, &state); -+ if (state == NM_OLD_STATE_CONNECTED || -+ state == NM_STATE_CONNECTED_LOCAL || -+ state == NM_STATE_CONNECTED_SITE || -+ state == NM_STATE_CONNECTED_GLOBAL) -+ network_mode = NETWORK_UP; - } else { - g_warning ("Net Monitor: got bad reply from NetworkManager\n"); - network_mode = NETWORK_UP; -@@ -284,16 +235,12 @@ determine_network_status () - static DBusHandlerResult - filter_func (DBusConnection *connection, DBusMessage *message, void *data) - { -- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNoLongerActive")) { -+ if (dbus_message_is_signal (message, NM_INTERFACE, "StateChanged") || -+ dbus_message_is_signal (message, NM_INTERFACE, "StateChange")) { - determine_network_status (); - return DBUS_HANDLER_RESULT_HANDLED; - } - -- if (dbus_message_is_signal (message, NM_INTERFACE, "DeviceNowActive")) { -- set_network_mode (NETWORK_UP); -- return DBUS_HANDLER_RESULT_HANDLED; -- } -- - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - diff --git a/xchat-gnome-0.26.1-remove-deprecated-api.patch b/xchat-gnome-0.26.1-remove-deprecated-api.patch deleted file mode 100644 index 1f4bc87..0000000 --- a/xchat-gnome-0.26.1-remove-deprecated-api.patch +++ /dev/null @@ -1,400 +0,0 @@ -From 23aa5dd1a3033c0badd750bedea8ba1b7a677a74 Mon Sep 17 00:00:00 2001 -From: Robert Ancell -Date: Mon, 17 Jan 2011 12:10:30 +0000 -Subject: Bug 637427 - [PATCH] Stop using deprecated GDK/GTK API - -removed a bit of deprecated apis, and minor indentation fixes ---- -diff --git a/src/fe-gnome/channel-list-window.c b/src/fe-gnome/channel-list-window.c -index e7e7c31..652f549 100644 ---- a/src/fe-gnome/channel-list-window.c -+++ b/src/fe-gnome/channel-list-window.c -@@ -497,7 +497,7 @@ channel_list_window_finalize (GObject *object) - g_source_remove (win->refresh_timeout); - } - chanlists = g_slist_remove (chanlists, (gpointer) win); -- gtk_widget_hide_all (win->window); -+ gtk_widget_hide (win->window); - - g_object_unref (win->xml); - G_OBJECT_CLASS (channel_list_window_parent_class)->finalize (object); -diff --git a/src/fe-gnome/connect-dialog.c b/src/fe-gnome/connect-dialog.c -index 35b90a6..22895e8 100644 ---- a/src/fe-gnome/connect-dialog.c -+++ b/src/fe-gnome/connect-dialog.c -@@ -159,7 +159,9 @@ connect_dialog_init (ConnectDialog *dialog) - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK); - gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->toplevel); -+#if !GTK_CHECK_VERSION (2, 23, 0) - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); -+#endif - - g_signal_connect (G_OBJECT (dialog->server_list), "row-activated", G_CALLBACK (row_activated), dialog); - -diff --git a/src/fe-gnome/conversation-panel.c b/src/fe-gnome/conversation-panel.c -index fb013c7..59e1bcd 100644 ---- a/src/fe-gnome/conversation-panel.c -+++ b/src/fe-gnome/conversation-panel.c -@@ -584,13 +584,23 @@ conversation_panel_set_background (ConversationPanel *panel) - pixbuf = gdk_pixbuf_new_from_file (filename, NULL); - if (pixbuf) { - gint width, height; -+#if GTK_CHECK_VERSION (2, 23, 0) -+ cairo_t *context; -+#endif - GdkPixmap *image; - - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); - - image = gdk_pixmap_new (NULL, width, height, 24); -+#if GTK_CHECK_VERSION (2, 23, 0) -+ context = gdk_cairo_create (GDK_DRAWABLE (image)); -+ gdk_cairo_set_source_pixbuf (context, pixbuf, 0, 0); -+ cairo_paint (context); -+ cairo_destroy (context); -+#else - gdk_draw_pixbuf (image, NULL, pixbuf, 0, 0, 0, 0, width, height, GDK_RGB_DITHER_NONE, 0, 0); -+#endif - - gtk_xtext_set_background (GTK_XTEXT (panel->priv->xtext), image, FALSE); - g_object_unref (pixbuf); -diff --git a/src/fe-gnome/irc-network-editor.c b/src/fe-gnome/irc-network-editor.c -index 0f424d0..4fa132b 100644 ---- a/src/fe-gnome/irc-network-editor.c -+++ b/src/fe-gnome/irc-network-editor.c -@@ -322,13 +322,22 @@ irc_network_editor_init (IrcNetworkEditor *dialog) - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (dialog->autojoin_channels), 1, _("Key"), dialog->autojoin_key_renderer, "text", 1, NULL); - g_object_set (G_OBJECT (dialog->autojoin_key_renderer), "editable", TRUE, NULL); - -+#if GTK_CHECK_VERSION (2, 23, 0) -+ dialog->encoding = gtk_combo_box_text_new (); -+#else - dialog->encoding = gtk_combo_box_new_text (); -+#endif -+ - gtk_widget_show (dialog->encoding); - gtk_table_attach_defaults (GTK_TABLE (dialog->network_settings_table), dialog->encoding, 1, 2, 5, 6); - - enc = (gchar **) encodings; - do { -+#if GTK_CHECK_VERSION (2, 23, 0) -+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dialog->encoding), _(*enc)); -+#else - gtk_combo_box_append_text (GTK_COMBO_BOX (dialog->encoding), _(*enc)); -+#endif - enc++; - } while (*enc); - -diff --git a/src/fe-gnome/preferences-page-colors.c b/src/fe-gnome/preferences-page-colors.c -index 51afb4f..33186c9 100644 ---- a/src/fe-gnome/preferences-page-colors.c -+++ b/src/fe-gnome/preferences-page-colors.c -@@ -255,10 +255,18 @@ preferences_page_colors_new (gpointer prefs_dialog, GtkBuilder *xml) - gtk_list_store_set (p->page_store, &iter, 0, PREFERENCES_PAGE (page)->icon, 1, _("Colors"), 2, 1, -1); - - page->combo = gtk_combo_box_new_text (); -+#if GTK_CHECK_VERSION (2, 23, 0) -+ page->combo = gtk_combo_box_text_new (); -+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("Black on White")); -+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("White on Black")); -+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("Custom")); -+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (page->combo), _("System Theme Colors")); -+#else - gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("Black on White")); - gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("White on Black")); - gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("Custom")); - gtk_combo_box_append_text (GTK_COMBO_BOX (page->combo), _("System Theme Colors")); -+#endif - gtk_widget_show (page->combo); - gtk_label_set_mnemonic_widget (GTK_LABEL (page->color_label_1), page->combo); - gtk_box_pack_start (GTK_BOX (page->foreground_background_hbox), page->combo, FALSE, TRUE, 0); -diff --git a/src/fe-gnome/text-entry.c b/src/fe-gnome/text-entry.c -index 24c192b..ad24c6c 100644 ---- a/src/fe-gnome/text-entry.c -+++ b/src/fe-gnome/text-entry.c -@@ -624,19 +624,35 @@ get_color_icon (int c, GtkStyle *style) - { - GtkWidget *image; - GdkPixmap *pixmap; -+#if GTK_CHECK_VERSION (2, 23, 0) -+ cairo_t *context; -+#else - GdkGC *color; -+#endif - - pixmap = gdk_pixmap_new (NULL, 16, 16, 24); - -+#if GTK_CHECK_VERSION (2, 23, 0) -+ context = gdk_cairo_create (GDK_DRAWABLE (pixmap)); -+ gdk_cairo_set_source_color (context, &style->dark[GTK_STATE_NORMAL]); -+ cairo_rectangle (context, 0, 0, 16, 16); -+ cairo_fill (context); -+ gdk_cairo_set_source_color (context, &colors[c]); -+ cairo_rectangle (context, 1, 1, 14, 14); -+ cairo_fill (context); -+ cairo_destroy (context); -+#else - color = gdk_gc_new (GDK_DRAWABLE (pixmap)); - gdk_gc_set_foreground (color, &style->dark[GTK_STATE_NORMAL]); - gdk_draw_rectangle (GDK_DRAWABLE (pixmap), color, TRUE, 0, 0, 16, 16); - gdk_gc_set_foreground (color, &colors[c]); - gdk_draw_rectangle (GDK_DRAWABLE (pixmap), color, TRUE, 1, 1, 14, 14); - g_object_unref (color); -+#endif - - image = gtk_image_new_from_pixmap (pixmap, NULL); - g_object_unref (pixmap); -+ - return image; - } - -diff --git a/src/fe-gnome/userlist-gui.c b/src/fe-gnome/userlist-gui.c -index c6671df..3e1dd66 100644 ---- a/src/fe-gnome/userlist-gui.c -+++ b/src/fe-gnome/userlist-gui.c -@@ -402,7 +402,12 @@ userlist_button_release (GtkWidget *widget, GdkEventButton *button, gpointer dat - gint x, y, width, height; - - gdk_window_get_root_origin (gui.userlist_window->window, &x, &y); -+#if GTK_CHECK_VERSION (2, 23, 0) -+ width = gdk_window_get_width (gui.userlist_window->window); -+ height = gdk_window_get_height (gui.userlist_window->window); -+#else - gdk_drawable_get_size (gui.userlist_window->window, &width, &height); -+#endif - - /* If the event happened on top of the userlist window, we don't want to - * close it */ -diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c -index a7e2caf..06b00c5 100644 ---- a/src/fe-gnome/xtext.c -+++ b/src/fe-gnome/xtext.c -@@ -978,28 +978,28 @@ gtk_xtext_realize (GtkWidget * widget) - attributes.visual = gtk_widget_get_visual (widget); - - widget->window = gdk_window_new (widget->parent->window, &attributes, -- GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | -- GDK_WA_COLORMAP); -+ GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | -+ GDK_WA_COLORMAP); - - gdk_window_set_user_data (widget->window, widget); - -- xtext->depth = gdk_drawable_get_visual (widget->window)->depth; -+ xtext->depth = gdk_drawable_get_depth (widget->window); - - val.subwindow_mode = GDK_INCLUDE_INFERIORS; - val.graphics_exposures = 0; - - xtext->bgc = gdk_gc_new_with_values (widget->window, &val, -- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); -+ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); - xtext->fgc = gdk_gc_new_with_values (widget->window, &val, -- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); -+ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); - xtext->light_gc = gdk_gc_new_with_values (widget->window, &val, -- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); -+ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); - xtext->dark_gc = gdk_gc_new_with_values (widget->window, &val, -- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); -+ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); - xtext->thin_gc = gdk_gc_new_with_values (widget->window, &val, -- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); -+ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); - xtext->marker_gc = gdk_gc_new_with_values (widget->window, &val, -- GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); -+ GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW); - - /* for the separator bar (light) */ - col.red = 0xffff; col.green = 0xffff; col.blue = 0xffff; -@@ -1041,9 +1041,9 @@ gtk_xtext_realize (GtkWidget * widget) - gdk_gc_set_fill (xtext->bgc, GDK_TILED); - } - --#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) -- xtext->hand_cursor = gdk_cursor_new (GDK_HAND1); -- xtext->resize_cursor = gdk_cursor_new (GDK_LEFT_SIDE); -+#if GTK_CHECK_VERSION (2, 23, 0) -+ xtext->hand_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_HAND1); -+ xtext->resize_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_LEFT_SIDE); - #else - xtext->hand_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_HAND1); - xtext->resize_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_LEFT_SIDE); -@@ -1718,7 +1718,11 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext) - int p_y, win_height; - - gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0); -+#if GTK_CHECK_VERSION (2, 23, 0) -+ win_height = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height); -+#endif - - if (p_y > win_height && - xtext->adj->value < (xtext->adj->upper - xtext->adj->page_size)) -@@ -1758,7 +1762,11 @@ gtk_xtext_selection_update (GtkXText * xtext, GdkEventMotion * event, int p_y, g - int win_height; - int moved; - -+#if GTK_CHECK_VERSION (2, 16, 0) -+ win_height = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height); -+#endif - - /* selecting past top of window, scroll up! */ - if (p_y < 0 && xtext->adj->value >= 0) -@@ -2372,8 +2380,8 @@ gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret) - - static void - gtk_xtext_selection_get (GtkWidget * widget, -- GtkSelectionData * selection_data_ptr, -- guint info, guint time) -+ GtkSelectionData * selection_data_ptr, -+ guint info, guint time) - { - GtkXText *xtext = GTK_XTEXT (widget); - char *stripped; -@@ -2398,16 +2406,16 @@ gtk_xtext_selection_get (GtkWidget * widget, - gint format; - gint new_length; - --#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) -- gdk_string_to_compound_text ( -+ gdk_string_to_compound_text_for_display ( -+#if GTK_CHECK_VERSION (2, 23, 0) -+ gdk_window_get_display (widget->window), - #else -- gdk_string_to_compound_text_for_display ( -- gdk_drawable_get_display (widget->window), -+ gdk_drawable_get_display (widget->window), - #endif -- stripped, &encoding, &format, &new_text, -- &new_length); -+ stripped, &encoding, &format, &new_text, -+ &new_length); - gtk_selection_data_set (selection_data_ptr, encoding, format, -- new_text, new_length); -+ new_text, new_length); - gdk_free_compound_text (new_text); - } - break; -@@ -3750,7 +3758,13 @@ gtk_xtext_load_trans (GtkXText * xtext) - if (xtext->shaded) - { - int width, height; -+#if GTK_CHECK_VERSION (2, 23, 0) -+ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); -+ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); -+#endif -+ - xtext->pixmap = shade_pixmap (xtext, rootpix, x, y, width+105, height); - if (xtext->pixmap == NULL) - { -@@ -3763,8 +3777,8 @@ gtk_xtext_load_trans (GtkXText * xtext) - } else - { - noshade: --#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) -- xtext->pixmap = gdk_pixmap_foreign_new (rootpix); -+#if GTK_CHECK_VERSION (2, 23, 0) -+ xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_window_get_display (GTK_WIDGET (xtext)->window), rootpix); - #else - xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_drawable_get_display (GTK_WIDGET (xtext)->window), rootpix); - #endif -@@ -3910,7 +3924,11 @@ gtk_xtext_find_subline (GtkXText *xtext, textentry *ent, int line) - if (line <= RECORD_WRAPS) - return ent->wrap_offset[line - 1]; - -+#if GTK_CHECK_VERSION (2, 16, 0) -+ win_width = gdk_window_get_width (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &win_width, 0); -+#endif - win_width -= MARGIN; - - /* indent = ent->indent; -@@ -4329,7 +4347,12 @@ gtk_xtext_calc_lines (xtext_buffer *buf, int fire_signal) - int height; - int lines; - -+#if GTK_CHECK_VERSION (2, 23, 0) -+ width = gdk_window_get_width (GTK_WIDGET (buf->xtext)->window); -+ height = gdk_window_get_height (GTK_WIDGET (buf->xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (buf->xtext)->window, &width, &height); -+#endif - width -= MARGIN; - - if (width < 30 || height < buf->xtext->fontsize || width < buf->indent + 30) -@@ -4424,7 +4447,12 @@ gtk_xtext_render_ents (GtkXText * xtext, textentry * enta, textentry * entb) - if (xtext->buffer->indent < MARGIN) - xtext->buffer->indent = MARGIN; /* 2 pixels is our left margin */ - -+#if GTK_CHECK_VERSION (2, 23, 0) -+ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); -+ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); -+#endif - width -= MARGIN; - - if (width < 32 || height < xtext->fontsize || width < xtext->buffer->indent + 30) -@@ -4511,7 +4539,12 @@ gtk_xtext_render_page (GtkXText * xtext) - if (xtext->buffer->indent < MARGIN) - xtext->buffer->indent = MARGIN; /* 2 pixels is our left margin */ - -+#if GTK_CHECK_VERSION (2, 23, 0) -+ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); -+ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); -+#endif - - if (width < 34 || height < xtext->fontsize || width < xtext->buffer->indent + 32) - return; -@@ -4563,8 +4596,11 @@ gtk_xtext_render_page (GtkXText * xtext) - #endif - #endif - { -+ -+#if !GTK_CHECK_VERSION (2, 13, 0) - /* so the obscured regions are exposed */ - gdk_gc_set_exposures (xtext->fgc, TRUE); -+#endif - if (overlap < 1) /* DOWN */ - { - int remainder; -@@ -4719,7 +4755,12 @@ gtk_xtext_check_ent_visibility (GtkXText * xtext, textentry *find_ent, int add) - int width; - int height; - -+#if GTK_CHECK_VERSION (2, 16, 0) -+ width = gdk_window_get_width (GTK_WIDGET (xtext)->window); -+ height = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height); -+#endif - - lines_max = ((height + xtext->pixel_offset) / xtext->fontsize) + add; - ent = xtext->buffer->pagetop_ent; -@@ -5191,8 +5232,12 @@ gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render) - - if (!gtk_widget_get_realized (GTK_WIDGET (xtext))) - gtk_widget_realize (GTK_WIDGET (xtext)); -- -+#if GTK_CHECK_VERSION (2, 23, 0) -+ w = gdk_window_get_width (GTK_WIDGET (xtext)->window); -+ h = gdk_window_get_height (GTK_WIDGET (xtext)->window); -+#else - gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &w, &h); -+#endif - - /* after a font change */ - if (buf->needs_recalc) --- -cgit v0.9 diff --git a/xchat-gnome-0.26.2-perl-plugin-function-prototype.patch b/xchat-gnome-0.26.2-perl-plugin-function-prototype.patch deleted file mode 100644 index 4cb9b72..0000000 --- a/xchat-gnome-0.26.2-perl-plugin-function-prototype.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -urN xchat-gnome-0.26.2.orig/plugins/perl/perl.c xchat-gnome-0.26.2/plugins/perl/perl.c ---- xchat-gnome-0.26.2.orig/plugins/perl/perl.c 2013-02-11 10:36:18.801119247 +0530 -+++ xchat-gnome-0.26.2/plugins/perl/perl.c 2013-02-11 12:45:49.369058799 +0530 -@@ -38,6 +38,11 @@ - - static int perl_load_file (char *script_name); - -+void xchat_plugin_get_info (char **name, char **desc, char **version, void **reserved); -+int xchat_plugin_init (xchat_plugin * plugin_handle, char **plugin_name, -+ char **plugin_desc, char **plugin_version, char *arg); -+int xchat_plugin_deinit (xchat_plugin * plugin_handle); -+ - #ifdef WIN32 - - static DWORD diff --git a/xchat-gnome.spec b/xchat-gnome.spec deleted file mode 100644 index 6ee19c2..0000000 --- a/xchat-gnome.spec +++ /dev/null @@ -1,518 +0,0 @@ -%global gitrev 40c5bf988 - -Name: xchat-gnome -Version: 0.26.2 -Release: 23.git%{gitrev}%{?dist} -Summary: GNOME front-end to xchat - -Group: Applications/Internet -License: GPLv2+ -URL: http://live.gnome.org/Xchat-Gnome -# Generated from git, tarball wasn't released. -# To generate: -# git clone git://git.gnome.org/xchat-gnome -# git archive --format=tar --prefix=xchat-gnome-0.26.2/ XCHAT_GNOME_0_26_2 > xchat-gnome-0.26.2-%{gitrev}.ta -# bzip2 xchat-gnome-0.26.2-%{gitrev}.tar -Source0: %{name}-%{version}-%{gitrev}.tar.bz2 -# Patch specific to Fedora to use .xchat-gnome, instead of .xchat2 -Patch0: xchat-gnome-0.23.92-config.patch -# Patch for libnotify 0.70 (just drop one parameter from one function) -Patch1: xchat-gnome-0.26.1-libnotify.patch -# Fix build (#839623) -Patch3: build.patch -# Patch to work with recent NetworkManager (0.7+) -Patch10: xchat-gnome-0.26.1-recent-network-manager.patch -# Convert deprecated GDK functions to cairo -Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch -# xchat-gnome-0.26.2-perl-plugin-function-prototype.patch -Patch14: xchat-gnome-0.26.2-perl-plugin-function-prototype.patch -# Clean up warnings -Patch100: 0001-Dont-attempt-to-render-a-nonexistent-string.patch -# Fix potential plugin crashers -Patch101: 0002-Plugin_GetCurrent-can-return-NULL.patch -# Don't crash on 32bpp depth -Patch102: 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch -# free(foo); g_slist_remove(list, foo); is bad practice, mmmkay? -Patch103: 0004-Call-g_slist_remove-on-items-before-free-not-after.patch -# Don't iterate over an empty hash -Patch104: 0001-Fix-crash-on-NULL-networks-hash-table.patch -# Fix czech translation that breaks /me messages () -Patch105: 0001-Fix-ME-messages-in-czech-translation.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1091544 -Patch106: 0001-Don-t-force-the-use-of-SSLv3.patch - -BuildRequires: openssl-devel -Buildrequires: libsexy-devel >= 0.1.11 -BuildRequires: libnotify-devel -BuildRequires: glib2-devel >= 2.18.0 -BuildRequires: gtk2-devel >= 2.14.0 -BuildRequires: libcanberra-devel -BuildRequires: python-devel -BuildRequires: desktop-file-utils -BuildRequires: intltool -BuildRequires: gettext -BuildRequires: perl-devel -BuildRequires: perl-generators -BuildRequires: perl(XML::Parser) -BuildRequires: perl(ExtUtils::Embed) -BuildRequires: gnome-doc-utils -BuildRequires: GConf2-devel -BuildRequires: libglade2-devel -BuildRequires: libSM-devel -BuildRequires: libtool autoconf automake gnome-common - -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) - -Requires(pre): GConf2 -Requires(post): GConf2 -Requires(preun): GConf2 - - -%description -xchat-gnome is a new frontend for the popular X-Chat IRC client. GNOME's -philosophy in terms of user interfaces has been progressing towards -presenting the user with few options, yet sane defaults. While many of the -normal X-Chat options will be preserved inside GConf, only the most -common settings will be included in the main user interface. . - - -%prep -%setup -q -n %{name}-%{version} -%patch0 -p1 -b .config -%patch1 -p1 -b .notify -%patch3 -p1 -b .build -%patch10 -p1 -b .recent-nm -%patch13 -p1 -b .gdk-deprecations -%patch14 -p1 -b .xchat-plugin -%patch100 -p1 -b .empty -%patch101 -p1 -b .nullplugin -%patch102 -p1 -b .depth -%patch103 -p1 -b .free -%patch104 -p1 -b .hash -%patch105 -p1 -%patch106 -p1 -b .allow-tls - -%build -# removed from gnome-common 3.18 (#1267460) -gnome-doc-prepare --force --copy -./autogen.sh -%configure --disable-tcl \ - --disable-scrollkeeper \ - --disable-schemas-install \ - --disable-maintainer-mode \ - --disable-static -make %{?_smp_mflags} - - -%install -make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" -%find_lang %{name} -find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' - -desktop-file-install --delete-original \ - --dir $RPM_BUILD_ROOT%{_datadir}/applications \ - $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop - - -%pre -%gconf_schema_prepare apps_xchat notification urlscraper url_handler - - -%post -%gconf_schema_upgrade apps_xchat notification urlscraper url_handler -touch --no-create %{_datadir}/icons/hicolor || : -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -fi - - -%preun -%gconf_schema_remove apps_xchat notification urlscraper url_handler - - -%postun -touch --no-create %{_datadir}/icons/hicolor || : -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -fi - - -%files -f %{name}.lang -%doc COPYING AUTHORS -%doc plugins/perl/xchat2-perldocs.html -%{_bindir}/%{name} -%{_sysconfdir}/gconf/schemas/*.schemas -%{_datadir}/%{name}/ -%{_datadir}/icons/hicolor/128x128/apps/%{name}.png -%{_datadir}/icons/hicolor/48x48/apps/%{name}.png -%{_datadir}/applications/%{name}.desktop -%{_datadir}/omf/%{name}/ -%{_datadir}/gnome/help/%{name}/ -%{_datadir}/dbus-1/services/org.gnome.Xchat.service -%{_mandir}/man1/%{name}.1.gz -%dir %{_libdir}/%{name} -%{_libdir}/%{name}/plugins/ - - -%changelog -* Mon May 16 2016 Jitka Plesnikova - 0.26.2-23.git40c5bf988 -- Perl 5.24 rebuild - -* Fri Feb 19 2016 Yaakov Selkowitz - 0.26.2-22.git40c5bf988 -- Fix build with gnome-common 3.18 (#1267460) - -* Fri Feb 05 2016 Fedora Release Engineering - 0.26.2-21.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Fri Jun 19 2015 Fedora Release Engineering - 0.26.2-20.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sat Jun 06 2015 Jitka Plesnikova - 0.26.2-19.git40c5bf988 -- Perl 5.22 rebuild - -* Wed Oct 29 2014 Debarshi Ray - 0.26.2-18.git40c5bf988 -- Do not force SSLv3, also allow TLSv1_X (#1091544) - -* Thu Aug 28 2014 Jitka Plesnikova - 0.26.2-17.git40c5bf988 -- Perl 5.20 rebuild - -* Mon Aug 18 2014 Fedora Release Engineering - 0.26.2-16.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sun Jun 08 2014 Fedora Release Engineering - 0.26.2-15.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Aug 04 2013 Fedora Release Engineering - 0.26.2-14.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Wed Jul 24 2013 Petr Pisar - 0.26.2-13.git40c5bf988 -- Perl 5.18 rebuild - -* Wed Apr 03 2013 Kalev Lember - 0.26.2-12.git40c5bf988 -- Drop the desktop file name patch now that the vendor prefix is gone -- Remove the scrollkeeper runtime dep - -* Mon Feb 11 2013 Parag Nemade - 0.26.2-11.git40c5bf988 -- Fix missing function prototype compilation error for perl.c - -* Mon Feb 11 2013 Parag Nemade - 0.26.2-10.git40c5bf988 -- Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077 -- Cleanup spec as per recently changed packaging guidelines - -* Thu Sep 27 2012 Bill Nottingham - 0.26.2-9.git40c5bf988 -- fix czech translation that broke /me messages (#789365, ) - -* Sun Jul 22 2012 Fedora Release Engineering - 0.26.2-8.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Fri Jun 15 2012 Petr Pisar - 0.26.2-7.git40c5bf988 -- Perl 5.16 rebuild - -* Sat Jan 14 2012 Fedora Release Engineering - 0.26.2-6.git40c5bf988 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Tue Dec 06 2011 Adam Jackson - 0.26.2-5.git40c5bf988 -- Rebuild for new libpng - -* Tue Oct 04 2011 Bill Nottingham 0.26.2-4.git40c5bf988 -- don't iterate over an empty hash table (#742868, ) - -* Wed Jul 20 2011 Petr Sabata - 0.26.2-3.git40c5bf988 -- Perl mass rebuild - -* Fri Jun 17 2011 Bill Nottingham - 0.26.2-2 -- fix crash on 32bpp depths with background images (#712626) -- clean up some Gdk-CRITICAL messages -- fix crash on exit in plugin code and elsewhere (#693122) - -* Thu Apr 07 2011 Bill Nottingham - 0.26.2-1 -- update to 0.26.2 (fixes #660840) - -* Fri Mar 25 2011 Dan Williams - 0.26.1-17 -- Update for NetworkManager 0.9 (#437645) -- Update for recent GTK/GNOME API changes - -* Mon Feb 07 2011 Fedora Release Engineering - 0.26.1-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Nov 08 2010 Adam Williamson - 0.26.1-15 -- add libnotify.patch for new libnotify - -* Sat Jul 31 2010 Adam Williamson - 0.26.1-14 -- Add deprecated-symbol.patch - upstream commit - 8d35b36baa8204b68c9520ec92327e34c1d7c580 - to fix FTBFS - -* Tue Jul 27 2010 David Malcolm - 0.26.1-13 -- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild - -* Wed Jun 02 2010 Marcela Maslanova - 0.26.1-12 -- Mass rebuild with perl-5.12.0 - -* Sun Apr 25 2010 Brian Pepple - 0.26.1-11 -- Remove clean section. No longer needed. -- Update scriptlets for gconf macros. - -* Sun Mar 28 2010 Brian Pepple - 0.26.1-10 -- Add patch for depreciated gtk macros. -- Add patch to fix auto-accept dcc transfers. -- Add patch for FreeNode port numbers. - -* Sun Mar 7 2010 Brian Pepple - 0.26.1-9 -- Add patch to fix DSOLinking. (#564820) - -* Mon Jan 18 2010 Brian Pepple - 0.26.1-8 -- Add patch to fix regression with bing unable to set status 'back'. - -* Wed Jan 13 2010 Brian Pepple - 0.26.1-7 -- Add patch to fix crash. (#550662) - -* Mon Dec 7 2009 Stepan Kasal - 0.26.1-6 -- rebuild against perl 5.10.1 - -* Fri Aug 21 2009 Tomas Mraz - 0.26.1-5 -- rebuilt with new openssl - -* Mon Jul 27 2009 Fedora Release Engineering - 0.26.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Fri Jun 19 2009 Brian Pepple - 0.26.1-3 -- Fix topic patch. - -* Sun May 10 2009 Brian Pepple - 0.26.1-2 -- Add patch to fix topic entry bug. (#483839) - -* Sat Apr 18 2009 Brian Pepple - 0.26.1-1 -- Update to 0.26.1. - -* Tue Mar 31 2009 Brian Pepple - 0.26.0-1 -- Update to 0.26.0. - -* Thu Feb 26 2009 Fedora Release Engineering - 0.24.3.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Jan 29 2009 Brian Pepple - 0.24.3.1-1 -- Update to 0.24.3.1. - -* Sun Jan 18 2009 Tomas Mraz - 0.24.1-3 -- rebuild with new openssl - -* Sun Nov 30 2008 Ignacio Vazquez-Abrams - 0.24.1-2 -- Rebuild for Python 2.6 - -* Fri Nov 14 2008 Brian Pepple - 0.24.1-1 -- Update to 0.24.1. -- Update Source URL. - -* Tue Sep 23 2008 Brian Pepple - 0.24.0-1 -- Update to 0.24.0. -- Drop deps patch. Fixed upstream. - -* Tue Sep 9 2008 Brian Pepple - 0.23.92-1 -- Update to 0.23.92. -- Add deps patch to correctly set libnotify & libcanberra options. -- Update BR. -- Drop reconnect patch. Fixed upstream. -- Drop away-command patch. Fixed upstream. -- Drop spell-checking patch. Fixed upstream. -- Drop it-translation patch. Fixed upstream. - -* Thu Mar 27 2008 Brian Pepple - 0.18-12 -- Add patch to fix italian translation bug. (#431133) - -* Tue Mar 25 2008 Brian Pepple - 0.18-11 -- Add patch to fix spell-checking language selection. (#427067) -- Add BR on perl-devel & perl(ExtUtils::Embed)to actually build the perl plugin. - -* Thu Mar 06 2008 Tom "spot" Callaway - 0.18-10 -- Rebuild for new perl - -* Tue Feb 12 2008 Brian Pepple - 0.18-9 -- Updated away/back patch. (#430883) - -* Wed Jan 30 2008 Brian Pepple - 0.18-8 -- Rebuild. - -* Wed Dec 5 2007 Brian Pepple - 0.18-7 -- rebuild for new libssl.so.6/libcrypto.so.6 - -* Sat Nov 17 2007 Brian Pepple - 0.18-6 -- Add patch to fix away/back command. - -* Thu Sep 13 2007 Brian Pepple - 0.18-5 -- Add patch to fix reconnect bug. (#225408) - -* Tue Aug 21 2007 Brian Pepple - 0.18-4 -- Rebuild. - -* Thu Aug 2 2007 Brian Pepple - 0.18-3 -- Update license tag. - -* Mon Jul 9 2007 Brian Pepple - 0.18-2 -- Drop requires on python, since dep on python-libs will be pulled in. - -* Mon Jul 9 2007 Brian Pepple - 0.18-1 -- Update to 0.18. -- Drop static patch, fixed upstream. -- Drop setup-dialog patch, fixed upstream. -- Drop gettext patch. -- Update config patch. - -* Sun Jun 10 2007 Brian Pepple - 0.17-7 -- Drop requires on yelp. - -* Sat Jun 9 2007 Brian Pepple - 0.17-6 -- Add requires on yelp. (#243417) - -* Mon May 28 2007 Brian Pepple - 0.17-5 -- Add gettext patch so we don't print translation information when open a query window. - -* Mon Apr 16 2007 Brian Pepple - 0.17-4 -- Add patch to fix setup-dialog. (#236636) - -* Tue Apr 3 2007 Brian Pepple - 0.17-3 -- Add patch to fix crasher. (#235144). - -* Mon Apr 2 2007 Brian Pepple - 0.17-2 -- D'Oh! Forgot to add the new config patch. - -* Mon Apr 2 2007 Brian Pepple - 0.17-1 -- Update to 0.17 (bugfix release). -- Update the config patch. -- libsexy-devel to be at least 0.1.11. - -* Tue Jan 16 2007 Brian Pepple - 0.16-2 -- Drop conditional statement for libnotify. -- Remove BR on dbus-devel, since libnotify-devel will pull this in. - -* Wed Jan 10 2007 Brian Pepple - 0.16-1 -- Update to 0.16. -- Move themeable app icon to correct directory. - -* Fri Dec 8 2006 Brian Pepple - 0.15-2 -- Rebuild for new python. - -* Sun Oct 29 2006 Brian Pepple - 0.15-1 -- Update to 0.15. -- Add new icons. - -* Thu Oct 26 2006 Brian Pepple - 0.14-1 -- Update to 0.14. -- Remove xchat-gnome-remote. -- Drop X-Fedora desktop category. -- Use disable-schemas-install & disable-static with configure. - -* Thu Aug 31 2006 Brian Pepple - 0.13-4 -- Add BR for perl(XML::Parser). - -* Thu Aug 31 2006 Brian Pepple - 0.13-3 -- Update for FC6. - -* Wed Jul 26 2006 Brian Pepple - 0.13-2 -- Update to 0.13. - -* Tue Jun 20 2006 Brian Pepple - 0.12-2 -- Update to 0.12. - -* Sat May 20 2006 Brian Pepple - 0.11-3 -- Drop patch for libnotify. - -* Tue Apr 4 2006 Brian Pepple - 0.11-2 -- Update to 0.11 -- Drop screensaver patch. -- Add scriptlet for gtk+ icon cache. - -* Sun Mar 19 2006 Brian Pepple - 0.10-5 -- Rebuild for libsexy-0.1.8. - -* Thu Mar 16 2006 Brian Pepple - 0.10-4 -- Rebuild for new libsexy. - -* Sat Feb 25 2006 Brian Pepple - 0.10-3 -- Add libnotify patch to work with 0.3.0 api. - -* Fri Feb 24 2006 Brian Pepple - 0.10-2 -- Add patch to use correct gnome-screensaver dbus object. -- Drop killall gconfd-2 calls in scriptlets. - -* Fri Feb 24 2006 Brian Pepple - 0.10-1 -- Update to 0.10. -- Add -disable-scrollkeeprer to config. -- Add BR for gnome-doc-utils. -- Disable libnotify plugin, until libnotify is updated in Rawhide. - -* Wed Feb 15 2006 Brian Pepple - 0.9-6 -- Drop unnecessary BR (libSM-devel & libglade2-devel). - -* Mon Feb 13 2006 Brian Pepple - 0.9-5 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Tue Feb 7 2006 Brian Pepple - 0.9-4 -- Rebuild due to new libsexy. - -* Mon Jan 23 2006 Brian Pepple - 0.9-3 -- Bump. - -* Sat Jan 21 2006 Brian Pepple - 0.9-2 -- Add xchat_gnome_url_handler.schemas to scriptlet. - -* Fri Jan 20 2006 Brian Pepple - 0.9-1 -- Update to 0.9. -- Add BR for libnotify-devel. -- Drop certificates patch. - -* Fri Dec 30 2005 Brian Pepple - 0.8-2 -- add patch for self-signed certificate acceptance. (#174591) - -* Tue Dec 20 2005 Brian Pepple - 0.8-1 -- Udate to 0.8. - -* Sun Dec 18 2005 Brian Pepple - 0.8-01.rc2 -- Update to 0.8rc2. - -* Thu Dec 15 2005 Brian Pepple - 0.8-01.rc1 -- Update to 0.8rc1. -- Drop documentation removed from upstream tarball. -- Drop depreciated config options. -- Enable dbus support. -- Drop 323944 patch, since it's been applied upstream. -- Drop datadir patch, since it's been applied upstream. - -* Wed Dec 14 2005 Brian Pepple - 0.7-4 -- Add patch to fix #175751. - -* Wed Nov 30 2005 Brian Pepple - 0.7-3 -- Disable dbus support, until FE Bug #174592 is fixed. - -* Mon Nov 21 2005 Brian Pepple - 0.7-2 -- Update to 0.7. -- Add BR for libSM-devel. -- Disable libnotify support, until it's available in Rawhide. -- Add help files & scrollkeeper scriptlets. -- Add BR & requires for scrollkeeper. - -* Sat Nov 12 2005 Brian Pepple - 0.6-7 -- Bump - -* Sat Nov 12 2005 Brian Pepple - 0.6-6 -- Bump release for upgrade path from FC-4. - -* Sat Nov 12 2005 Brian Pepple - 0.6-5 -- Add test for release version to determine if dbus is enabled. -- Add dist tag. - -* Sat Nov 12 2005 Brian Pepple - 0.6-4 -- Remove obsoletes xchat. -- Add patch to change datadir location. -- Add patch to change config dir. - -* Thu Nov 10 2005 Brian Pepple - 0.6-3 -- Add xchat-remote to files, and re-add dbus config flag. - -* Thu Nov 10 2005 Brian Pepple - 0.6-2 -- Merge some items from Bastien Nocera's spec file (#172873). -- Add configure option to enable ipv6 & shm tinting support. -- Simplify schemas installation. - -* Tue Oct 25 2005 Brian Pepple - 0.6-1 -- Initial Fedora Extras spec file. -