From 29d81960467f75ce906062aa64e2a7df2bf32afb Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 8 Sep 2002 10:58:30 +0000 Subject: setupWindow and referenses --- src/Gnome.cc | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/src/Gnome.cc b/src/Gnome.cc index 9a5d9cb..c7784c3 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.1 2002/09/07 20:32:44 fluxgen Exp $ +// $Id: Gnome.cc,v 1.2 2002/09/08 10:58:30 fluxgen Exp $ #include "Gnome.hh" #include "Window.hh" @@ -77,6 +77,33 @@ void Gnome::initForScreen(const BScreen &screen) { } +void Gnome::setupWindow(FluxboxWindow &win) { + // load gnome state atom + Display *disp = BaseDisplay::getXDisplay(); + Atom ret_type; + int fmt; + unsigned long nitems, bytes_after; + long flags, *data = 0; + + if (XGetWindowProperty(disp, win.getClientWindow(), + m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL, + &ret_type, &fmt, &nitems, &bytes_after, + (unsigned char **) &data) == Success && data) { + flags = *data; + setState(&win, flags); + XFree (data); + } + + if (XGetWindowProperty(disp, win.getClientWindow(), + m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL, + &ret_type, &fmt, &nitems, &bytes_after, + (unsigned char **)&data) == Success && data) { +#ifdef DEBUG + cerr<<__FILE__<<"("<<__LINE__<<"): Workspace: "<<*data<isStuck()) + if (win.isStuck()) state |= WIN_STATE_STICKY; - if (win->isIconic()) + if (win.isIconic()) state |= WIN_STATE_MINIMIZED; - if (win->isShaded()) + if (win.isShaded()) state |= WIN_STATE_SHADED; - XChangeProperty(BaseDisplay::getXDisplay(), win->getClientWindow(), + XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(), m_gnome_wm_win_state, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); } -void Gnome::updateHints(FluxboxWindow *win) { +void Gnome::updateHints(FluxboxWindow &win) { //TODO } -- cgit v0.11.2