X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fwindow.cc;h=cbd60f3733831f34274c788dc0ce83a9c98e4f35;hb=843f9726ab6fd99fe3a2f285e6c85bd2880a275f;hp=4027b47fb337def6cd6b3d767ee25cd273f26ee1;hpb=a0e50e15b507f1f8752bd7858c9e758265a34fc4;p=chaz%2Fopenbox diff --git a/util/epist/window.cc b/util/epist/window.cc index 4027b47f..cbd60f37 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -31,12 +31,13 @@ using std::endl; using std::hex; using std::dec; -#include "window.hh" #include "epist.hh" +#include "screen.hh" +#include "window.hh" #include "../../src/XAtom.hh" -XWindow::XWindow(epist *epist, Window window) - : _epist(epist), _xatom(epist->xatom()), _window(window) { +XWindow::XWindow(epist *epist, screen *screen, Window window) + : _epist(epist), _screen(screen), _xatom(epist->xatom()), _window(window) { _unmapped = false; @@ -140,3 +141,45 @@ void XWindow::processEvent(const XEvent &e) { break; } } + + +void XWindow::shade(const bool sh) const { + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_wm_state, + _window, (sh ? 1 : 0), + _xatom->getAtom(XAtom::net_wm_state_shaded)); +} + + +void XWindow::close() const { + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_close_window, + _window); +} + + +void XWindow::raise() const { + XRaiseWindow(_epist->getXDisplay(), _window); +} + + +void XWindow::lower() const { + XLowerWindow(_epist->getXDisplay(), _window); +} + + +void XWindow::iconify() const { + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::wm_change_state, + _window, IconicState); +} + + +void XWindow::focus() const { + // this will also unshade the window.. + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window, + _window); +} + + +void XWindow::sendTo(unsigned int dest) const { + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_wm_desktop, + _window, dest); +}