Changeset 5f822cacbfc32f33be99a0effecd375a37b2a2cb

Show
Ignore:
Timestamp:
10/11/2006 05:31:30 AM (2 years ago)
Author:
daf <daf>
git-committer:
daf <daf> 1160569890 +0000
git-parent:

[e0ef99d70db4b0a6aeac48795c5ca986a428b1f8]

git-author:
daf <daf> 1160569890 +0000
Message:

Autotools foo for Xinerama

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r0378f20 r5f822ca  
     1Tue Oct 10 21:14:46 EDT 2006    Dave Foster <daf@minuslab.net> 
     2        * Tried to introduce some autotools foo to deal with Xinerama 
     3          better. 
     4 
    15Thu Sep 28 14:25:56 EDT 2006    Dave Foster <daf@minuslab.net> 
    26        * Fixed a major bug that I introduced into single display code, 
  • bootstrap

    rde2583a r5f822ca  
    99sh libtoolize --copy --force --automake 
    1010sh autoconf 
     11sh autoheader 
    1112sh automake --include-deps --add-missing --copy 
    1213 
  • configure.ac

    rde2583a r5f822ca  
    3535NITROGEN_CFLAGS="$GLIB2_CFLAGS $GTK2_CFLAGS $GTKMM2_CFLAGS $GTHREAD2_CFLAGS" 
    3636 
    37 AC_SUBST(NITROGEN_LIBS) 
    38 AC_SUBST(NITROGEN_CFLAGS) 
    39  
    4037dnl do some autotools picen to get inotify 
    41 AC_ARG_ENABLE(inotify, [  --disable-inotify       disable support for inotify watching of dirs (default: enable)], [enable_inotify=$enableval],[enable_inotify=yes]) 
     38AC_ARG_ENABLE(inotify, [  --disable-inotify       disable support for inotify watching of dirs (default: enabled)], [enable_inotify=$enableval],[enable_inotify=yes]) 
    4239 
    4340if test x$enable_inotify = xyes; then 
    4441        AC_DEFINE(USE_INOTIFY, 1, [Define to enable inotify dir watching]) 
    4542fi 
     43 
     44dnl now do some proper checking for Xinerama 
     45AC_ARG_ENABLE(xinerama, [  --disable-xinerama      disable support for Xinerama (default: enabled)], [enable_xinerama=$xineramaval],[enable_xinerama=yes]) 
     46 
     47if test x$enable_xinerama = xyes; then 
     48        AC_CHECK_LIB(Xinerama, XineramaQueryScreens,  
     49                                        [AC_DEFINE(USE_XINERAMA, 1, [Define to enable Xinerama]) 
     50                                         NITROGEN_LIBS="$NITROGEN_LIBS -lXinerama"], 
     51                                        [enable_xinerama=no]) 
     52fi 
     53 
     54AC_SUBST(NITROGEN_LIBS) 
     55AC_SUBST(NITROGEN_CFLAGS) 
    4656 
    4757AC_CONFIG_FILES(Makefile src/Makefile) 
     
    6171fi 
    6272 
     73if test x$enable_xinerama = xyes; then 
     74        echo "xinerama support ............ enabled" 
     75else 
     76        echo "xinerama support ............ disabled" 
     77fi 
     78 
    6379echo "" 
    6480echo "##########################################" 
  • src/NWindow.cc

    re0ef99d r5f822ca  
    2424#include <sys/types.h> 
    2525#include <sys/wait.h> 
     26 
     27#ifdef USE_XINERAMA 
    2628#include <X11/extensions/Xinerama.h> 
     29#endif 
    2730 
    2831// leethax constructor 
    2932 
    30 NWindow::NWindow (void) : apply (Gtk::Stock::APPLY), cb_save("Sa_ve"), is_multihead(false)  { 
     33NWindow::NWindow (void) : apply (Gtk::Stock::APPLY), cb_save("Sa_ve"), is_multihead(false), is_xinerama(false)  { 
    3134         
    3235        set_border_width (5); 
     
    169172        } 
    170173 
     174#ifdef USE_XINERAMA 
    171175        // xinerama 
    172176        int event_base, error_base; 
     
    194198                return; 
    195199        } 
     200#endif 
    196201 
    197202        // if we made it here, we do not have any kidn of multihead 
  • src/main.cc

    r3071726 r5f822ca  
    7070        Glib::RefPtr<Gdk::Display> disp = manager->get_default_display(); 
    7171         
     72#ifdef USE_XINERAMA 
    7273        XineramaScreenInfo* xinerama_info; 
    7374        gint xinerama_num_screens; 
     
    109110                        } 
    110111                } 
    111         } else { 
    112  
    113                 for (int n=0; n<disp->get_n_screens(); n++) { 
     112 
     113                // must return here becuase not all systems have xinerama 
     114                program_log("leaving set_saved_bgs()");  
     115                return; 
     116        }  
     117#endif 
     118 
     119        for (int n=0; n<disp->get_n_screens(); n++) { 
    114120                                 
    115                        display = disp->get_screen(n)->make_display_name(); 
    116  
    117                        program_log("display: %s", display.c_str()); 
     121                display = disp->get_screen(n)->make_display_name(); 
     122 
     123                program_log("display: %s", display.c_str()); 
    118124                         
    119                        if (cfg->get_bg(display, file, mode, bgcolor)) { 
     125                if (cfg->get_bg(display, file, mode, bgcolor)) { 
    120126                                         
    121                                program_log("setting bg on %s to %s (mode: %d)", display.c_str(), file.c_str(), mode); 
    122                                SetBG::set_bg(display, file, mode, bgcolor); 
    123                                program_log("set bg on %s to %s (mode: %d)", display.c_str(), file.c_str(), mode); 
     127                        program_log("setting bg on %s to %s (mode: %d)", display.c_str(), file.c_str(), mode); 
     128                        SetBG::set_bg(display, file, mode, bgcolor); 
     129                        program_log("set bg on %s to %s (mode: %d)", display.c_str(), file.c_str(), mode); 
    124130                                 
    125                         } else { 
    126                                 std::cerr << "Could not get bg info" << std::endl; 
    127                         } 
     131                } else { 
     132                        std::cerr << "Could not get bg info" << std::endl; 
    128133                } 
    129134        }