Commit f4e7e811 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

require xrandr 1.3.0 at build time

parent f89661d8
......@@ -33,7 +33,6 @@ libnotification_area_applet_la_SOURCES = main.c main.h
libnotification_area_applet_la_LIBADD = \
libtray.la \
../../libpanel-applet/libpanel-applet.la \
$(X_LIBS) \
$(NOTIFICATION_AREA_LIBS) \
$(LIBPANEL_APPLET_LIBS)
......@@ -46,7 +45,6 @@ libnotification_area_applet_la_LDFLAGS = \
testtray_SOURCES = testtray.c
testtray_LDADD = \
libtray.la \
$(X_LIBS) \
$(NOTIFICATION_AREA_LIBS)
testtray_CFLAGS = \
......
......@@ -109,34 +109,44 @@ CAIRO_REQUIRED=1.0.0
GWEATHER_REQUIRED=3.17.1
DCONF_REQUIRED=0.13.4
LIBRSVG_REQUIRED=2.36.2
XRANDR_REQUIRED=1.3.0
dnl pkg-config dependency checks
PKG_CHECK_MODULES(PANEL, gmodule-2.0 >= $GLIB_REQUIRED
gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED
pango >= $PANGO_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
cairo-xlib glib-2.0 >= $GLIB_REQUIRED
gmodule-2.0 >= $GLIB_REQUIRED
gio-2.0 >= $GLIB_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED
gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED
libgnome-menu-3.0 >= $LIBGNOME_MENU_REQUIRED
dconf >= $DCONF_REQUIRED)
AC_SUBST(PANEL_CFLAGS)
AC_SUBST(PANEL_LIBS)
PKG_CHECK_MODULES(LIBPANEL_APPLET, gtk+-3.0 >= $GTK_REQUIRED cairo-xlib cairo-gobject gio-2.0 >= $GLIB_REQUIRED gio-unix-2.0 >= $GLIB_REQUIRED)
AC_SUBST(LIBPANEL_APPLET_CFLAGS)
AC_SUBST(LIBPANEL_APPLET_LIBS)
PKG_CHECK_MODULES([PANEL], [
gmodule-2.0 >= $GLIB_REQUIRED
gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED
pango >= $PANGO_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
cairo-xlib
glib-2.0 >= $GLIB_REQUIRED
gmodule-2.0 >= $GLIB_REQUIRED
gio-2.0 >= $GLIB_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED
gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED
libgnome-menu-3.0 >= $LIBGNOME_MENU_REQUIRED
dconf >= $DCONF_REQUIRED
x11
xrandr >= $XRANDR_REQUIRED
])
PKG_CHECK_MODULES([LIBPANEL_APPLET], [
gtk+-3.0 >= $GTK_REQUIRED
cairo-xlib
cairo-gobject
gio-2.0 >= $GLIB_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED
x11
])
PKG_CHECK_MODULES(FISH, gtk+-3.0 >= $GTK_REQUIRED cairo >= $CAIRO_REQUIRED)
AC_SUBST(FISH_CFLAGS)
AC_SUBST(FISH_LIBS)
PKG_CHECK_MODULES(NOTIFICATION_AREA, gtk+-3.0 >= $GTK_REQUIRED)
AC_SUBST(NOTIFICATION_AREA_CFLAGS)
AC_SUBST(NOTIFICATION_AREA_LIBS)
PKG_CHECK_MODULES([NOTIFICATION_AREA], [
gtk+-3.0 >= $GTK_REQUIRED
x11
])
PKG_CHECK_MODULES(WNCKLET, gtk+-3.0 >= $GTK_REQUIRED libwnck-3.0 >= $LIBWNCK_REQUIRED)
AC_SUBST(WNCKLET_CFLAGS)
......@@ -203,38 +213,6 @@ dnl **************************************************************************
AC_STRUCT_DIRENT_D_TYPE
dnl X development libraries check
PKG_CHECK_MODULES(X, x11 xau, :, [
# pkg-config modules not found (only present since X11R7 aka Xorg); use
# old-style detection
AC_PATH_XTRA()
# X not found
if test x$no_x = xyes ; then
AC_MSG_ERROR([X development libraries not found])
fi
gp_save_cflags="$CFLAGS"
gp_save_libs="$LIBS"
CFLAGS="$X_CFLAGS"
LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
AC_CHECK_LIB(X11, XFree,, AC_MSG_ERROR([libX11 not found]))
AC_CHECK_LIB(Xau, XauFileName,, AC_MSG_ERROR([libXau not found]))
CFLAGS="$gp_save_cflags"
LIBS="$gp_save_libs"
X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXau $X_EXTRA_LIBS"
])
AC_SUBST(X_LIBS)
dnl X RANDR extension
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 Modules dir
AC_SUBST([modulesdir],"\$(libdir)/gnome-panel/modules")
......@@ -342,7 +320,6 @@ echo ""
echo " Maintainer mode .................: ${USE_MAINTAINER_MODE}"
echo ""
echo " Evolution-Data-Server support ...: ${enable_eds}"
echo " XRandr support ..................: ${have_randr}"
echo " Build introspection support .....: ${found_introspection}"
echo " Build gtk-doc documentation .....: ${enable_gtk_doc}"
echo ""
......
......@@ -136,8 +136,6 @@ gnome_panel_LDADD = \
$(top_builddir)/gnome-panel/libpanel-applet-private/libpanel-applet-private.la \
$(top_builddir)/gnome-panel/libpanel-util/libpanel-util.la \
$(PANEL_LIBS) \
$(XRANDR_LIBS) \
$(X_LIBS) \
$(NULL)
gnome_panel_LDFLAGS = \
......@@ -167,7 +165,6 @@ gnome_desktop_item_edit_CFLAGS = \
gnome_desktop_item_edit_LDADD = \
$(top_builddir)/gnome-panel/libpanel-util/libpanel-util.la \
$(PANEL_LIBS) \
$(X_LIBS) \
$(NULL)
gnome_desktop_item_edit_LDFLAGS = \
......
......@@ -42,7 +42,6 @@ static gboolean have_randr = FALSE;
static gboolean have_randr_1_3 = FALSE;
static guint reinit_id = 0;
#ifdef HAVE_RANDR
static gboolean
_panel_multiscreen_output_should_be_first (Display *xdisplay,
RROutput output,
......@@ -83,14 +82,12 @@ _panel_multiscreen_output_should_be_first (Display *xdisplay,
*/
return (g_ascii_strncasecmp (info->name, "LVDS", strlen ("LVDS")) == 0);
}
#endif
static gboolean
panel_multiscreen_get_randr_monitors_for_screen (GdkScreen *screen,
int *monitors_ret,
GdkRectangle **geometries_ret)
{
#ifdef HAVE_RANDR
Display *xdisplay;
Window xroot;
XRRScreenResources *resources;
......@@ -128,7 +125,6 @@ panel_multiscreen_get_randr_monitors_for_screen (GdkScreen *screen,
xdisplay = GDK_SCREEN_XDISPLAY (screen);
xroot = GDK_WINDOW_XID (gdk_screen_get_root_window (screen));
#if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3))
if (have_randr_1_3) {
resources = XRRGetScreenResourcesCurrent (xdisplay, xroot);
if (resources->noutput == 0) {
......@@ -141,18 +137,13 @@ panel_multiscreen_get_randr_monitors_for_screen (GdkScreen *screen,
}
} else
resources = XRRGetScreenResources (xdisplay, xroot);
#else
resources = XRRGetScreenResources (xdisplay, xroot);
#endif
if (!resources)
return FALSE;
primary = None;
#if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3))
if (have_randr_1_3)
primary = XRRGetOutputPrimary (xdisplay, xroot);
#endif
geometries = g_array_sized_new (FALSE, FALSE,
sizeof (GdkRectangle),
......@@ -221,9 +212,6 @@ panel_multiscreen_get_randr_monitors_for_screen (GdkScreen *screen,
*geometries_ret = (GdkRectangle *) g_array_free (geometries, FALSE);
return TRUE;
#else
return FALSE;
#endif
}
static void
......@@ -405,15 +393,12 @@ panel_multiscreen_queue_reinit (void)
static void
panel_multiscreen_init_randr (GdkDisplay *display)
{
#ifdef HAVE_RANDR
Display *xdisplay;
int event_base, error_base;
#endif
have_randr = FALSE;
have_randr_1_3 = FALSE;
#ifdef HAVE_RANDR
xdisplay = GDK_DISPLAY_XDISPLAY (display);
/* We don't remember the event/error bases, as we expect to get "screen
......@@ -430,7 +415,6 @@ panel_multiscreen_init_randr (GdkDisplay *display)
if ((major == 1 && minor >= 3) || major > 1)
have_randr_1_3 = TRUE;
}
#endif
}
void
......
......@@ -30,7 +30,7 @@ libpanel_applet_la_SOURCES = \
libpanel_applet_la_LIBADD = \
$(LIBPANEL_APPLET_LIBS) \
$(X_LIBS)
$(NULL)
libpanel_applet_la_LDFLAGS = \
-version-info $(LIB_PANEL_APPLET_LT_VERSION) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment