From 244c63f4b46469b4ce5879259dafef3d5062c6cd Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 12 May 2003 04:23:31 +0000 Subject: added RANDR support --- configure.in | 22 ++++++++++++++++++++-- src/fluxbox.cc | 26 +++++++++++++++++++++++++- src/fluxbox.hh | 3 ++- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 4ab70e3..0f74cfc 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl configure.in for Fluxbox - created from configure.in Blackbox 0.61.1 dnl Initialize autoconf and automake AC_INIT(src/main.cc) AC_PREREQ(2.52) -AM_INIT_AUTOMAKE(fluxbox,0.9.2,no-define) +AM_INIT_AUTOMAKE(fluxbox,0.9.3,no-define) dnl Determine default prefix test x$prefix = "xNONE" && prefix="$ac_default_prefix" @@ -104,7 +104,7 @@ AC_ARG_ENABLE( dnl Check for Remember options AC_MSG_CHECKING([whether to include remember functionality]) AC_ARG_ENABLE( - remember, [ --enable-remember include code for Remembering attributes [default=yes]], + remember, [ --enable-remember include code for Remembering attributes [default=yes]], if test x$enableval = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE(REMEMBER, 1, " compile with remember") @@ -325,6 +325,24 @@ AC_ARG_ENABLE( ) AM_CONDITIONAL(MULTIBYTE, test x$MULTIBYTE = xtrue) +AC_MSG_CHECKING([whether to have RANDR (The X Resize and Rotate Extension) support]) +AC_ARG_ENABLE( + randr, +[ --enable-randr RANDR (The X Resize and Rotate Extension) support [default=yes]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + AC_CHECK_LIB(Xrandr, XRRQueryExtension, + AC_DEFINE(HAVE_RANDR, 1, "randr support") + LIBS="$LIBS -lXrandr") + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([yes]) + AC_CHECK_LIB(Xrandr, XRRQueryExtension, + AC_DEFINE(HAVE_RANDR, 1, "randr support") + LIBS="$LIBS -lXrandr") +) + dnl Check for Xinerama support AC_MSG_CHECKING([whether to build support for the Xinerama extension]) diff --git a/src/fluxbox.cc b/src/fluxbox.cc index b77bd73..48573a5 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.139 2003/05/11 23:44:09 rathnor Exp $ +// $Id: fluxbox.cc,v 1.140 2003/05/12 04:23:31 fluxgen Exp $ #include "fluxbox.hh" @@ -42,6 +42,7 @@ #include "Keys.hh" #include "FbAtoms.hh" + //Use GNU extensions #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -71,9 +72,15 @@ #include #include #include +// X extensions #ifdef SHAPE #include #endif // SHAPE +#ifdef HAVE_RANDR +#include +#endif // HAVE_RANDR + +// system headers #include #include @@ -410,6 +417,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile m_starting(true), m_shutdown(false), m_server_grabs(0), + m_randr_event_type(0), m_RC_PATH("fluxbox"), m_RC_INIT_FILE("init") { @@ -442,6 +450,12 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile s_singleton = this; +#ifdef HAVE_RANDR + // get randr event type + int error_base; + XRRQueryExtension(disp, &m_randr_event_type, &error_base); +#endif // HAVE_RANDR + // setup atom handlers before we create any windows #ifdef USE_GNOME addAtomHandler(new Gnome()); // for gnome 1 atom support @@ -450,6 +464,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile #ifdef USE_NEWWMSPEC addAtomHandler(new Ewmh()); // for Extended window manager atom support #endif // USE_NEWWMSPEC + #ifdef REMEMBER addAtomHandler(new Remember()); // for remembering window attribs #endif // REMEMBER @@ -853,6 +868,15 @@ void Fluxbox::handleEvent(XEvent * const e) { handleClientMessage(e->xclient); break; default: { +#ifdef HAVE_RANDR + if (e->type == m_randr_event_type) { + // update root window size in screen + BScreen *scr = searchScreen(e->xany.window); + if (scr != 0) + scr->updateSize(); + } +#endif // HAVE_RANDR + } } diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 25ffeea..503e55c 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.56 2003/05/11 22:18:33 fluxgen Exp $ +// $Id: fluxbox.hh,v 1.57 2003/05/12 04:23:31 fluxgen Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH @@ -268,6 +268,7 @@ private: bool m_starting; bool m_shutdown; int m_server_grabs; + int m_randr_event_type; ///< the type number of randr event const char *m_RC_PATH; const char *m_RC_INIT_FILE; }; -- cgit v0.11.2