Wed May 16 18:06:04 2018 UTC ()
Runtime fix for xfce4-session: don't segfault when trying to add a new
startup service in xfce4-session-settings.
(youri)
diff -r1.65 -r1.66 pkgsrc/x11/xfce4-session/Makefile
diff -r1.21 -r1.22 pkgsrc/x11/xfce4-session/distinfo
diff -r0 -r1.1 pkgsrc/x11/xfce4-session/patches/patch-settings_xfae-dialog.c
diff -r1.2 -r1.3 pkgsrc/x11/xfce4-session/patches/patch-xfsm-shutdown-helper_main.c
--- pkgsrc/x11/xfce4-session/Makefile 2018/04/16 14:35:27 1.65
+++ pkgsrc/x11/xfce4-session/Makefile 2018/05/16 18:06:04 1.66
| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | # $NetBSD: Makefile,v 1.65 2018/04/16 14:35:27 wiz Exp $ | | 1 | # $NetBSD: Makefile,v 1.66 2018/05/16 18:06:04 youri Exp $ |
2 | | | 2 | |
3 | PKGREVISION= 3 | | 3 | PKGREVISION= 4 |
4 | .include "../../meta-pkgs/xfce4/Makefile.common" | | 4 | .include "../../meta-pkgs/xfce4/Makefile.common" |
5 | | | 5 | |
6 | DISTNAME= xfce4-session-4.13.0 | | 6 | DISTNAME= xfce4-session-4.13.0 |
7 | CATEGORIES= x11 | | 7 | CATEGORIES= x11 |
8 | MASTER_SITES+= http://archive.xfce.org/src/xfce/xfce4-session/4.13/ | | 8 | MASTER_SITES+= http://archive.xfce.org/src/xfce/xfce4-session/4.13/ |
9 | | | 9 | |
10 | HOMEPAGE= http://docs.xfce.org/xfce/xfce4-session/start | | 10 | HOMEPAGE= http://docs.xfce.org/xfce/xfce4-session/start |
11 | COMMENT= Xfce session manager | | 11 | COMMENT= Xfce session manager |
12 | | | 12 | |
13 | PKGCONFIG_OVERRIDE+= libxfsm/xfce4-session-2.0.pc.in | | 13 | PKGCONFIG_OVERRIDE+= libxfsm/xfce4-session-2.0.pc.in |
14 | | | 14 | |
15 | BUILD_DEFS+= PKG_SYSCONFBASE | | 15 | BUILD_DEFS+= PKG_SYSCONFBASE |
16 | | | 16 | |
--- pkgsrc/x11/xfce4-session/distinfo 2017/06/22 09:40:24 1.21
+++ pkgsrc/x11/xfce4-session/distinfo 2018/05/16 18:06:04 1.22
| @@ -1,12 +1,13 @@ | | | @@ -1,12 +1,13 @@ |
1 | $NetBSD: distinfo,v 1.21 2017/06/22 09:40:24 youri Exp $ | | 1 | $NetBSD: distinfo,v 1.22 2018/05/16 18:06:04 youri Exp $ |
2 | | | 2 | |
3 | SHA1 (xfce4-session-4.13.0.tar.bz2) = 23d93a524870c0402c83ab23650a63bcaeaeb234 | | 3 | SHA1 (xfce4-session-4.13.0.tar.bz2) = 23d93a524870c0402c83ab23650a63bcaeaeb234 |
4 | RMD160 (xfce4-session-4.13.0.tar.bz2) = ab9fda8e31891ce9e244e9d7d15fc865d5a6f6c1 | | 4 | RMD160 (xfce4-session-4.13.0.tar.bz2) = ab9fda8e31891ce9e244e9d7d15fc865d5a6f6c1 |
5 | SHA512 (xfce4-session-4.13.0.tar.bz2) = 61f9a547b03eb109a1a0fc83feaac743ea2119360f2f7208e589feb3e8f1db016ffe85cf1c8e20633ec399f263dcbccd35c431bde6f6f1482658688096da5cb0 | | 5 | SHA512 (xfce4-session-4.13.0.tar.bz2) = 61f9a547b03eb109a1a0fc83feaac743ea2119360f2f7208e589feb3e8f1db016ffe85cf1c8e20633ec399f263dcbccd35c431bde6f6f1482658688096da5cb0 |
6 | Size (xfce4-session-4.13.0.tar.bz2) = 1314715 bytes | | 6 | Size (xfce4-session-4.13.0.tar.bz2) = 1314715 bytes |
7 | SHA1 (patch-ac) = 6d6ecae678ef34b0435ea40fa75ce51aeea1509d | | 7 | SHA1 (patch-ac) = 6d6ecae678ef34b0435ea40fa75ce51aeea1509d |
8 | SHA1 (patch-config.h.in) = 30e2ae1ea70a99a83f11523e940081b661add69b | | 8 | SHA1 (patch-config.h.in) = 30e2ae1ea70a99a83f11523e940081b661add69b |
9 | SHA1 (patch-configure) = 55a15e79821b89cc37f6ebedac6ad1804cdee38a | | 9 | SHA1 (patch-configure) = 55a15e79821b89cc37f6ebedac6ad1804cdee38a |
10 | SHA1 (patch-scripts_Makefile.in) = 042c3d9c632a57f9acfc8dab43aa6bca8ec69097 | | 10 | SHA1 (patch-scripts_Makefile.in) = 042c3d9c632a57f9acfc8dab43aa6bca8ec69097 |
| | | 11 | SHA1 (patch-settings_xfae-dialog.c) = 11e981e02dc573525ce1801c20a4cd437fdf8e3c |
11 | SHA1 (patch-settings_xfce4-session.xml) = 86a50db54aede973d7495869e3e713a39a73446d | | 12 | SHA1 (patch-settings_xfce4-session.xml) = 86a50db54aede973d7495869e3e713a39a73446d |
12 | SHA1 (patch-xfsm-shutdown-helper_main.c) = 6f885efe31597360bb9534007daffa46df41c831 | | 13 | SHA1 (patch-xfsm-shutdown-helper_main.c) = afe8ba4afeb55227dacbb12e225c8542ce66b9f5 |
With xfce4-session built from git (after the gtk3
migration work), trying to add or edit an application
autostart entry results in a segmentation fault after a
"(xfce4-session-settings:9094): Gtk-CRITICAL **:
gtk_entry_get_text: assertion 'GTK_IS_ENTRY (entry)'
failed" message.
It appears that when the "notify::text" signal callbacks
for the "command_entry" and "name_entry" GtkEntry objects
are created, they are called immediately, before the second
GtkEntry object is created resulting in a failure in the
xfae_dialog_update() function to properly process the objects.
Thanks to ToZ for reporting and providing the fix.
diff --git a/settings/xfae-dialog.c b/settings/xfae-dialog.c
index af860b9..7442634 100644
--- settings/xfae-dialog.c
+++ settings/xfae-dialog.c
@@ -98,8 +98,7 @@ xfae_dialog_init (XfaeDialog *dialog)
dialog->name_entry = g_object_new (GTK_TYPE_ENTRY,
"activates-default", TRUE,
NULL);
- g_signal_connect_swapped (G_OBJECT (dialog->name_entry), "notify::text",
- G_CALLBACK (xfae_dialog_update), dialog);
+
gtk_grid_attach (GTK_GRID (grid), dialog->name_entry, 1, 0, 1, 1);
gtk_widget_show (dialog->name_entry);
@@ -132,11 +131,15 @@ xfae_dialog_init (XfaeDialog *dialog)
dialog->command_entry = g_object_new (GTK_TYPE_ENTRY,
"activates-default", TRUE,
NULL);
- g_signal_connect_swapped (G_OBJECT (dialog->command_entry), "notify::text",
- G_CALLBACK (xfae_dialog_update), dialog);
+
gtk_box_pack_start (GTK_BOX (hbox), dialog->command_entry, TRUE, TRUE, 0);
gtk_widget_show (dialog->command_entry);
+ g_signal_connect_swapped (G_OBJECT (dialog->name_entry), "notify::text",
+ G_CALLBACK (xfae_dialog_update), dialog);
+ g_signal_connect_swapped (G_OBJECT (dialog->command_entry), "notify::text",
+ G_CALLBACK (xfae_dialog_update), dialog);
+
button = g_object_new (GTK_TYPE_BUTTON,
"can-default", FALSE,
NULL);
--- pkgsrc/x11/xfce4-session/patches/patch-xfsm-shutdown-helper_main.c 2015/07/06 10:39:35 1.2
+++ pkgsrc/x11/xfce4-session/patches/patch-xfsm-shutdown-helper_main.c 2018/05/16 18:06:04 1.3
| @@ -1,28 +1,28 @@ | | | @@ -1,28 +1,28 @@ |
1 | $NetBSD: patch-xfsm-shutdown-helper_main.c,v 1.2 2015/07/06 10:39:35 richard Exp $ | | 1 | $NetBSD: patch-xfsm-shutdown-helper_main.c,v 1.3 2018/05/16 18:06:04 youri Exp $ |
2 | | | 2 | |
3 | Add NetBSD commands. | | 3 | Add NetBSD commands. |
4 | ... and be careful to only SUSPEND or HIBERNATE when defined. | | 4 | ... and be careful to only SUSPEND or HIBERNATE when defined. |
5 | | | 5 | |
6 | --- xfsm-shutdown-helper/main.c.orig 2014-08-28 15:52:27.000000000 +0000 | | 6 | --- xfsm-shutdown-helper/main.c.orig 2014-08-28 15:52:27.000000000 +0000 |
7 | +++ xfsm-shutdown-helper/main.c | | 7 | +++ xfsm-shutdown-helper/main.c |
8 | @@ -91,7 +91,10 @@ | | 8 | @@ -91,7 +91,10 @@ |
9 | #define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/zzz" | | 9 | #define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/zzz" |
10 | #define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/ZZZ" | | 10 | #define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/ZZZ" |
11 | #endif | | 11 | #endif |
12 | - | | 12 | - |
13 | +#ifdef BACKEND_TYPE_NETBSD | | 13 | +#ifdef BACKEND_TYPE_NETBSD |
14 | +#define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/zzz" | | 14 | +#define UP_BACKEND_SUSPEND_COMMAND "/sbin/sysctl -w hw.acpi.sleep.state=1" |
15 | +#define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/zzz" | | 15 | +#define UP_BACKEND_HIBERNATE_COMMAND "/sbin/sysctl -w hw.acpi.sleep.state=4" |
16 | +#endif | | 16 | +#endif |
17 | | | 17 | |
18 | static gboolean | | 18 | static gboolean |
19 | run (const gchar *command) | | 19 | run (const gchar *command) |
20 | @@ -217,22 +220,26 @@ main (int argc, char **argv) | | 20 | @@ -217,22 +220,26 @@ main (int argc, char **argv) |
21 | } | | 21 | } |
22 | else if(suspend) | | 22 | else if(suspend) |
23 | { | | 23 | { |
24 | +#if defined(UP_BACKEND_SUSPEND_COMMAND) | | 24 | +#if defined(UP_BACKEND_SUSPEND_COMMAND) |
25 | if (run (UP_BACKEND_SUSPEND_COMMAND)) | | 25 | if (run (UP_BACKEND_SUSPEND_COMMAND)) |
26 | { | | 26 | { |
27 | return EXIT_CODE_SUCCESS; | | 27 | return EXIT_CODE_SUCCESS; |
28 | } | | 28 | } |