aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-12 04:23:31 (GMT)
committerfluxgen <fluxgen>2003-05-12 04:23:31 (GMT)
commit244c63f4b46469b4ce5879259dafef3d5062c6cd (patch)
treed1a5abf06ed92783c13c8d19f6d415aaa9004e9f
parenta084e737f84b8c0840efdbac13e1af6010f279d9 (diff)
downloadfluxbox_paul-244c63f4b46469b4ce5879259dafef3d5062c6cd.zip
fluxbox_paul-244c63f4b46469b4ce5879259dafef3d5062c6cd.tar.bz2
added RANDR support
-rw-r--r--configure.in22
-rw-r--r--src/fluxbox.cc26
-rw-r--r--src/fluxbox.hh3
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
2dnl Initialize autoconf and automake 2dnl Initialize autoconf and automake
3AC_INIT(src/main.cc) 3AC_INIT(src/main.cc)
4AC_PREREQ(2.52) 4AC_PREREQ(2.52)
5AM_INIT_AUTOMAKE(fluxbox,0.9.2,no-define) 5AM_INIT_AUTOMAKE(fluxbox,0.9.3,no-define)
6 6
7dnl Determine default prefix 7dnl Determine default prefix
8test x$prefix = "xNONE" && prefix="$ac_default_prefix" 8test x$prefix = "xNONE" && prefix="$ac_default_prefix"
@@ -104,7 +104,7 @@ AC_ARG_ENABLE(
104dnl Check for Remember options 104dnl Check for Remember options
105AC_MSG_CHECKING([whether to include remember functionality]) 105AC_MSG_CHECKING([whether to include remember functionality])
106AC_ARG_ENABLE( 106AC_ARG_ENABLE(
107 remember, [ --enable-remember include code for Remembering attributes [default=yes]], 107 remember, [ --enable-remember include code for Remembering attributes [default=yes]],
108 if test x$enableval = "xyes"; then 108 if test x$enableval = "xyes"; then
109 AC_MSG_RESULT([yes]) 109 AC_MSG_RESULT([yes])
110 AC_DEFINE(REMEMBER, 1, " compile with remember") 110 AC_DEFINE(REMEMBER, 1, " compile with remember")
@@ -325,6 +325,24 @@ AC_ARG_ENABLE(
325) 325)
326AM_CONDITIONAL(MULTIBYTE, test x$MULTIBYTE = xtrue) 326AM_CONDITIONAL(MULTIBYTE, test x$MULTIBYTE = xtrue)
327 327
328AC_MSG_CHECKING([whether to have RANDR (The X Resize and Rotate Extension) support])
329AC_ARG_ENABLE(
330 randr,
331[ --enable-randr RANDR (The X Resize and Rotate Extension) support [default=yes]],
332 if test x$enableval = "xyes"; then
333 AC_MSG_RESULT([yes])
334 AC_CHECK_LIB(Xrandr, XRRQueryExtension,
335 AC_DEFINE(HAVE_RANDR, 1, "randr support")
336 LIBS="$LIBS -lXrandr")
337 else
338 AC_MSG_RESULT([no])
339 fi,
340 AC_MSG_RESULT([yes])
341 AC_CHECK_LIB(Xrandr, XRRQueryExtension,
342 AC_DEFINE(HAVE_RANDR, 1, "randr support")
343 LIBS="$LIBS -lXrandr")
344)
345
328dnl Check for Xinerama support 346dnl Check for Xinerama support
329 347
330AC_MSG_CHECKING([whether to build support for the Xinerama extension]) 348AC_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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.139 2003/05/11 23:44:09 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.140 2003/05/12 04:23:31 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -42,6 +42,7 @@
42#include "Keys.hh" 42#include "Keys.hh"
43#include "FbAtoms.hh" 43#include "FbAtoms.hh"
44 44
45
45//Use GNU extensions 46//Use GNU extensions
46#ifndef _GNU_SOURCE 47#ifndef _GNU_SOURCE
47#define _GNU_SOURCE 48#define _GNU_SOURCE
@@ -71,9 +72,15 @@
71#include <X11/Xatom.h> 72#include <X11/Xatom.h>
72#include <X11/keysym.h> 73#include <X11/keysym.h>
73#include <X11/cursorfont.h> 74#include <X11/cursorfont.h>
75// X extensions
74#ifdef SHAPE 76#ifdef SHAPE
75#include <X11/extensions/shape.h> 77#include <X11/extensions/shape.h>
76#endif // SHAPE 78#endif // SHAPE
79#ifdef HAVE_RANDR
80#include <X11/extensions/Xrandr.h>
81#endif // HAVE_RANDR
82
83// system headers
77 84
78#include <cstdio> 85#include <cstdio>
79#include <cstdlib> 86#include <cstdlib>
@@ -410,6 +417,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
410 m_starting(true), 417 m_starting(true),
411 m_shutdown(false), 418 m_shutdown(false),
412 m_server_grabs(0), 419 m_server_grabs(0),
420 m_randr_event_type(0),
413 m_RC_PATH("fluxbox"), 421 m_RC_PATH("fluxbox"),
414 m_RC_INIT_FILE("init") { 422 m_RC_INIT_FILE("init") {
415 423
@@ -442,6 +450,12 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
442 450
443 s_singleton = this; 451 s_singleton = this;
444 452
453#ifdef HAVE_RANDR
454 // get randr event type
455 int error_base;
456 XRRQueryExtension(disp, &m_randr_event_type, &error_base);
457#endif // HAVE_RANDR
458
445 // setup atom handlers before we create any windows 459 // setup atom handlers before we create any windows
446#ifdef USE_GNOME 460#ifdef USE_GNOME
447 addAtomHandler(new Gnome()); // for gnome 1 atom support 461 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
450#ifdef USE_NEWWMSPEC 464#ifdef USE_NEWWMSPEC
451 addAtomHandler(new Ewmh()); // for Extended window manager atom support 465 addAtomHandler(new Ewmh()); // for Extended window manager atom support
452#endif // USE_NEWWMSPEC 466#endif // USE_NEWWMSPEC
467
453#ifdef REMEMBER 468#ifdef REMEMBER
454 addAtomHandler(new Remember()); // for remembering window attribs 469 addAtomHandler(new Remember()); // for remembering window attribs
455#endif // REMEMBER 470#endif // REMEMBER
@@ -853,6 +868,15 @@ void Fluxbox::handleEvent(XEvent * const e) {
853 handleClientMessage(e->xclient); 868 handleClientMessage(e->xclient);
854 break; 869 break;
855 default: { 870 default: {
871#ifdef HAVE_RANDR
872 if (e->type == m_randr_event_type) {
873 // update root window size in screen
874 BScreen *scr = searchScreen(e->xany.window);
875 if (scr != 0)
876 scr->updateSize();
877 }
878#endif // HAVE_RANDR
879
856 } 880 }
857 881
858 } 882 }
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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.hh,v 1.56 2003/05/11 22:18:33 fluxgen Exp $ 25// $Id: fluxbox.hh,v 1.57 2003/05/12 04:23:31 fluxgen Exp $
26 26
27#ifndef FLUXBOX_HH 27#ifndef FLUXBOX_HH
28#define FLUXBOX_HH 28#define FLUXBOX_HH
@@ -268,6 +268,7 @@ private:
268 bool m_starting; 268 bool m_starting;
269 bool m_shutdown; 269 bool m_shutdown;
270 int m_server_grabs; 270 int m_server_grabs;
271 int m_randr_event_type; ///< the type number of randr event
271 const char *m_RC_PATH; 272 const char *m_RC_PATH;
272 const char *m_RC_INIT_FILE; 273 const char *m_RC_INIT_FILE;
273}; 274};