diff -Nurd -x'*~' gnome-panel-2.28.0.orig/configure.in gnome-panel-2.28.0/configure.in --- gnome-panel-2.28.0.orig/configure.in 2009-09-21 12:35:48.000000000 -0400 +++ gnome-panel-2.28.0/configure.in 2016-06-08 02:57:17.000000000 -0400 @@ -255,8 +255,9 @@ dnl X RANDR extension -if $PKG_CONFIG --exists "xrandr >= 1.2.0" ; then - AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library]) +PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2.0, have_randr=yes, have_randr=no) +if test "x$have_randr" = "xyes"; then + AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library]) fi dnl IDL directories diff -Nurd -x'*~' gnome-panel-2.28.0.orig/doc/reference/panel-applet/Makefile.am gnome-panel-2.28.0/doc/reference/panel-applet/Makefile.am --- gnome-panel-2.28.0.orig/doc/reference/panel-applet/Makefile.am 2009-05-01 21:01:58.000000000 -0400 +++ gnome-panel-2.28.0/doc/reference/panel-applet/Makefile.am 2016-06-08 02:54:22.000000000 -0400 @@ -46,11 +46,11 @@ # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib # contains GtkObjects/GObjects and you want to document signals and properties. GTKDOC_CFLAGS = \ + -I$(srcdir)/../../../libpanel-applet \ + -I$(top_builddir)/libpanel-applet \ $(CFLAGS) \ $(CPPFLAGS) \ - $(PANEL_CFLAGS) \ - -I$(srcdir)/../../../libpanel-applet \ - -I$(top_builddir)/libpanel-applet + $(PANEL_CFLAGS) GTKDOC_LIBS = \ $(LDFLAGS) \ diff -Nurd -x'*~' gnome-panel-2.28.0.orig/gnome-panel/Makefile.am gnome-panel-2.28.0/gnome-panel/Makefile.am --- gnome-panel-2.28.0.orig/gnome-panel/Makefile.am 2009-08-28 18:08:47.000000000 -0400 +++ gnome-panel-2.28.0/gnome-panel/Makefile.am 2016-06-08 02:58:31.000000000 -0400 @@ -18,6 +18,7 @@ $(STANDARD_PROPERTIES_CFLAGS) \ $(PANEL_CFLAGS) \ $(PANELCONFIG_CFLAGS) \ + $(XRANDR_CFLAGS) \ $(WARN_CFLAGS) \ $(NULL) @@ -156,7 +157,8 @@ gnome_panel_LDADD = \ $(top_builddir)/gnome-panel/libpanel-util/libpanel-util.la \ $(PANEL_LIBS) \ - $(X_LIBS) + $(XRANDR_LIBS) \ + $(X_LIBS) $(INTLLIBS) gnome_panel_LDFLAGS = -export-dynamic @@ -172,7 +174,7 @@ gnome_desktop_item_edit_LDADD = \ $(top_builddir)/gnome-panel/libpanel-util/libpanel-util.la \ $(PANEL_LIBS) \ - $(X_LIBS) + $(X_LIBS) $(INTLLIBS) uidir = $(datadir)/gnome-panel/ui ui_DATA = \ diff -Nurd -x'*~' gnome-panel-2.28.0.orig/gnome-panel/panel-multiscreen.c gnome-panel-2.28.0/gnome-panel/panel-multiscreen.c --- gnome-panel-2.28.0.orig/gnome-panel/panel-multiscreen.c 2009-08-25 09:08:54.000000000 -0400 +++ gnome-panel-2.28.0/gnome-panel/panel-multiscreen.c 2016-06-08 02:59:15.000000000 -0400 @@ -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, diff -Nurd -x'*~' gnome-panel-2.28.0.orig/libpanel-applet/Makefile.am gnome-panel-2.28.0/libpanel-applet/Makefile.am --- gnome-panel-2.28.0.orig/libpanel-applet/Makefile.am 2009-08-11 09:59:09.000000000 -0400 +++ gnome-panel-2.28.0/libpanel-applet/Makefile.am 2016-06-08 02:53:19.000000000 -0400 @@ -28,7 +28,7 @@ -no-undefined libpanel_applet_2_la_LIBADD = \ $(LIBPANEL_APPLET_LIBS) \ - $(X_LIBS) + $(X_LIBS) $(INTLLIBS) libpanel_appletincludedir = $(includedir)/panel-2.0 diff -Nurd -x'*~' gnome-panel-2.28.0.orig/libpanel-applet/libpanelapplet-2.0.pc.in gnome-panel-2.28.0/libpanel-applet/libpanelapplet-2.0.pc.in --- gnome-panel-2.28.0.orig/libpanel-applet/libpanelapplet-2.0.pc.in 2009-04-19 13:45:10.000000000 -0400 +++ gnome-panel-2.28.0/libpanel-applet/libpanelapplet-2.0.pc.in 2016-06-08 02:53:19.000000000 -0400 @@ -7,5 +7,5 @@ Description: libpanel-applet-2 Requires: gconf-2.0 gtk+-2.0 libbonoboui-2.0 Version: @VERSION@ -Libs: -L${libdir} -lpanel-applet-2 +Libs: -L${libdir} -lpanel-applet-2 @INTLLIBS@ Cflags: -I${includedir}/panel-2.0