summaryrefslogtreecommitdiffstats
path: root/x11/gnome-panel
diff options
context:
space:
mode:
authoravl <avl@df743ca5-7f9a-e211-a948-0013205c9059>2009-10-12 21:12:23 +0800
committeravl <avl@df743ca5-7f9a-e211-a948-0013205c9059>2009-10-12 21:12:23 +0800
commit4d420f1acb4a3b0ea55af2e589dad2c6789bf348 (patch)
tree09e9ec2ae936be3f10239fdfc42b7138837d0b45 /x11/gnome-panel
parent8ee9591337f71a2171977eaf39641ec295069346 (diff)
downloadmarcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.tar
marcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.tar.gz
marcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.tar.bz2
marcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.tar.lz
marcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.tar.xz
marcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.tar.zst
marcuscom-ports-4d420f1acb4a3b0ea55af2e589dad2c6789bf348.zip
Fix crashes in various conditions with the new randr code.
This fixes displaying panel on my second monitor and suppresses errors like: ** (gnome-panel:1091): CRITICAL **: panel_multiscreen_width: assertion `monitor >= 0 && monitor < monitors [n_screen]' failed GNOME Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=597101 Obtained from: GNOME GIT git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@13117 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'x11/gnome-panel')
-rw-r--r--x11/gnome-panel/Makefile4
-rw-r--r--x11/gnome-panel/files/patch-gnome-panel_panel-multiscreen.c59
2 files changed, 61 insertions, 2 deletions
diff --git a/x11/gnome-panel/Makefile b/x11/gnome-panel/Makefile
index 020ff59b8..e1c093123 100644
--- a/x11/gnome-panel/Makefile
+++ b/x11/gnome-panel/Makefile
@@ -3,12 +3,12 @@
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/x11/gnome-panel/Makefile,v 1.205 2009/09/09 06:15:27 marcus Exp $
+# $MCom: ports/x11/gnome-panel/Makefile,v 1.206 2009/09/22 03:16:41 avl Exp $
#
PORTNAME= gnome-panel
PORTVERSION= 2.28.0
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
diff --git a/x11/gnome-panel/files/patch-gnome-panel_panel-multiscreen.c b/x11/gnome-panel/files/patch-gnome-panel_panel-multiscreen.c
new file mode 100644
index 000000000..50ef12367
--- /dev/null
+++ b/x11/gnome-panel/files/patch-gnome-panel_panel-multiscreen.c
@@ -0,0 +1,59 @@
+--- gnome-panel/panel-multiscreen.c.orig 2009-10-12 22:57:08.000000000 +1000
++++ gnome-panel/panel-multiscreen.c 2009-10-12 22:57:08.000000000 +1000
+@@ -136,9 +136,17 @@
+ xroot = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
+
+ #if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3))
+- if (have_randr_1_3)
++ if (have_randr_1_3) {
+ resources = XRRGetScreenResourcesCurrent (xdisplay, xroot);
+- else
++ if (resources->noutput == 0) {
++ /* This might happen if nothing tried to get randr
++ * resources from the server before, so we need an
++ * active probe. See comment #27 in
++ * https://bugzilla.gnome.org/show_bug.cgi?id=597101 */
++ XRRFreeScreenResources (resources);
++ resources = XRRGetScreenResources (xdisplay, xroot);
++ }
++ } else
+ resources = XRRGetScreenResources (xdisplay, xroot);
+ #else
+ resources = XRRGetScreenResources (xdisplay, xroot);
+@@ -205,6 +213,17 @@
+ return FALSE;
+ }
+
++ if (geometries->len == 0) {
++ /* This can happen in at least one case:
++ * https://bugzilla.novell.com/show_bug.cgi?id=543876 where all
++ * monitors appear disconnected (possibly because the screen
++ * is behing a KVM switch) -- see comment #8.
++ * There might be other cases too, so we stay on the safe side.
++ */
++ g_array_free (geometries, TRUE);
++ return FALSE;
++ }
++
+ *monitors_ret = geometries->len;
+ *geometries_ret = (GdkRectangle *) g_array_free (geometries, FALSE);
+
+@@ -238,9 +257,15 @@
+ int *monitors_ret,
+ GdkRectangle **geometries_ret)
+ {
+- if (panel_multiscreen_get_randr_monitors_for_screen (screen,
+- monitors_ret,
+- geometries_ret))
++ gboolean res;
++
++ *monitors_ret = 0;
++ *geometries_ret = NULL;
++
++ res = panel_multiscreen_get_randr_monitors_for_screen (screen,
++ monitors_ret,
++ geometries_ret);
++ if (res && *monitors_ret > 0)
+ return;
+
+ panel_multiscreen_get_gdk_monitors_for_screen (screen,