diff options
author | fluxgen <fluxgen> | 2003-05-12 04:23:31 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-05-12 04:23:31 (GMT) |
commit | 244c63f4b46469b4ce5879259dafef3d5062c6cd (patch) | |
tree | d1a5abf06ed92783c13c8d19f6d415aaa9004e9f /src/fluxbox.cc | |
parent | a084e737f84b8c0840efdbac13e1af6010f279d9 (diff) | |
download | fluxbox-244c63f4b46469b4ce5879259dafef3d5062c6cd.zip fluxbox-244c63f4b46469b4ce5879259dafef3d5062c6cd.tar.bz2 |
added RANDR support
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 26 |
1 files changed, 25 insertions, 1 deletions
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 | } |