From 52ed0566210f7b49f06ac4cf8d49ff423d3268d7 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 7 Feb 2002 14:41:52 +0000 Subject: added gnome win state --- src/Window.cc | 63 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index 67d772c..f3c3bc3 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.24 2002/02/04 06:53:14 fluxgen Exp $ +// $Id: Window.cc,v 1.25 2002/02/07 14:41:52 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -196,7 +196,8 @@ tab(0) getWMHints(); getWMNormalHints(); - #ifdef SLIT + #ifdef SLIT + if (client.initial_state == WithdrawnState) { screen->getSlit()->addClient(client.window); throw NOERROR; @@ -391,17 +392,15 @@ tab(0) } setFocusFlag(false); - /* + + #ifdef GNOME + updateGnomeAtoms(); + #endif + #ifdef DEBUG fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); #endif - */ - //TODO move this - #ifdef GNOME - int val = workspace_number; - XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom(), - XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); - #endif + } @@ -573,9 +572,10 @@ void FluxboxWindow::showError(FluxboxWindow::Error error) { #endif // DEBUG } -Window FluxboxWindow::createToplevelWindow(int x, int y, unsigned int width, - unsigned int height, - unsigned int borderwidth) +Window FluxboxWindow::createToplevelWindow( + int x, int y, unsigned int width, + unsigned int height, + unsigned int borderwidth) { XSetWindowAttributes attrib_create; unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWColormap | @@ -861,6 +861,39 @@ void FluxboxWindow::createButton(int type, ButtonEventProc pressed, ButtonEventP b.released = released; buttonlist.push_back(b); } +#ifdef GNOME +void FluxboxWindow::updateGnomeAtoms() { + int val = workspace_number; + XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom(), + XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); + long state = getGnomeWindowState(); + XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeStateAtom(), + XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); + #ifdef DEBUG + cerr<<__FILE__<<"("<<__LINE__<<"): 0x"<getBaseDisplay()->getGnomeStateAtom()<