diff --git a/configure.ac b/configure.ac index 832cf36..53e699b 100644 --- a/configure.ac +++ b/configure.ac @@ -53,9 +53,16 @@ PKG_CHECK_MODULES([EFL], elementary >= 0.7.0 edje >= 1.1.0 ecore >= 1.0.0 - ecore-x >= 1.0.0 ]) +PKG_CHECK_MODULES([ECORE_X], [ecore-x >= 1.0.0], + [ + AC_DEFINE(HAVE_ECORE_X, 1, [X11 support]) + ], + [] +) + + AC_OUTPUT([ Makefile src/Makefile diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 8a3b239..5726cbe 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -5,7 +5,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -DLOCALE_DIR=\"$(datadir)/locale\" \ -@EFL_CFLAGS@ +@EFL_CFLAGS@ \ +@ECORE_X_CFLAGS@ bin_PROGRAMS = ecrire @@ -18,7 +19,7 @@ ecrire_SOURCES = \ ui/font_dialog.c \ ui/alerts.c -ecrire_LDADD = @EFL_LIBS@ @LTLIBINTL@ +ecrire_LDADD = @EFL_LIBS@ @ECORE_X_LIBS@ @LTLIBINTL@ EXTRA_DIST = \ mess_header.h \ diff --git a/src/bin/main.c b/src/bin/main.c index cc29016..88cd9aa 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -1,7 +1,13 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include -#include +#ifdef HAVE_ECORE_X +# include +#endif #include "mess_header.h" #include "cfg.h" @@ -530,6 +536,7 @@ editor_font_choose(Evas_Object *ent, const char *font, int size) ecrire_cfg_save(); } +#ifdef HAVE_ECORE_X static Eina_Bool _selection_notify(void *data __UNUSED__, int type __UNUSED__, void *_event) { @@ -547,6 +554,7 @@ _selection_notify(void *data __UNUSED__, int type __UNUSED__, void *_event) return ECORE_CALLBACK_PASS_ON; } +#endif int main(int argc, char *argv[]) @@ -672,6 +680,7 @@ main(int argc, char *argv[]) elm_toolbar_item_append(tbar, "preferences-system", _("Settings"), _font_settings, entry); +#ifdef HAVE_ECORE_X if (!ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_CLIPBOARD)) { elm_object_item_disabled_set(paste_item, EINA_TRUE); @@ -680,6 +689,7 @@ main(int argc, char *argv[]) ecore_x_fixes_selection_notification_request(ECORE_X_ATOM_SELECTION_CLIPBOARD); ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, _selection_notify, NULL); +#endif /* We don't have a selection when we start, make the items disabled */ elm_object_item_disabled_set(copy_item, EINA_TRUE);