[gnome-panel] require xrandr 1.3.0 at build time
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] require xrandr 1.3.0 at build time
- Date: Wed, 20 Jul 2016 12:06:32 +0000 (UTC)
commit f4e7e81152287d21a879993b631660f9ce9a3e45
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Jul 20 15:04:06 2016 +0300
require xrandr 1.3.0 at build time
applets/notification_area/Makefile.am | 2 -
configure.ac | 83 ++++++++++++---------------------
gnome-panel/Makefile.am | 3 -
gnome-panel/panel-multiscreen.c | 16 ------
libpanel-applet/Makefile.am | 2 +-
5 files changed, 31 insertions(+), 75 deletions(-)
---
diff --git a/applets/notification_area/Makefile.am b/applets/notification_area/Makefile.am
index 508ecc7..0de706d 100644
--- a/applets/notification_area/Makefile.am
+++ b/applets/notification_area/Makefile.am
@@ -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 = \
diff --git a/configure.ac b/configure.ac
index 45ed9c3..e834850 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 ""
diff --git a/gnome-panel/Makefile.am b/gnome-panel/Makefile.am
index db4013e..68528f9 100644
--- a/gnome-panel/Makefile.am
+++ b/gnome-panel/Makefile.am
@@ -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 = \
diff --git a/gnome-panel/panel-multiscreen.c b/gnome-panel/panel-multiscreen.c
index bea12ad..ca6fd68 100644
--- a/gnome-panel/panel-multiscreen.c
+++ b/gnome-panel/panel-multiscreen.c
@@ -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
diff --git a/libpanel-applet/Makefile.am b/libpanel-applet/Makefile.am
index 33fbe4a..3f69ebf 100644
--- a/libpanel-applet/Makefile.am
+++ b/libpanel-applet/Makefile.am
@@ -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) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]