X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=4824a34acadc4b2ded219ea7c32264eef5faac4a;hb=41a38bbdaf245f12e58f2609092bfbcf8fba6f78;hp=60182ce952e38dbccb224df533d8b570792db4f7;hpb=ef66d63b422bd7dc6de9d4dd28b7f7e7c0624e05;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index 60182ce9..4824a34a 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -153,7 +153,7 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) { windowmenu = 0; /* - get the initial size and location of client window (relative to the + set the initial size and location of client window (relative to the _root window_). This position is the reference point used with the window's gravity to find the window's initial position. */ @@ -2612,11 +2612,12 @@ void BlackboxWindow::mapRequestEvent(const XMapRequestEvent *re) { #endif // DEBUG /* - Even thought the window wants to be shown, if it is not on the current + Even though the window wants to be shown, if it is not on the current workspace, then it isn't going to be shown right now. */ - if (blackbox_attrib.workspace != screen->getCurrentWorkspaceID()) - current_state = WithdrawnState; + if (blackbox_attrib.workspace != screen->getCurrentWorkspaceID() && + blackbox_attrib.workspace < screen->getWorkspaceCount()) + if (current_state == NormalState) current_state = WithdrawnState; switch (current_state) { case IconicState: @@ -2701,7 +2702,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) { if (pe->state == PropertyDelete) return; -#ifdef DEBUG +#if 0 fprintf(stderr, "BlackboxWindow::propertyNotifyEvent(): for 0x%lx\n", client.window); #endif @@ -2718,12 +2719,13 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) { // determine if this is a transient window getTransientInfo(); + if (flags.stuck != s) stick(); + // adjust the window decorations based on transience if (isTransient()) { functions &= ~Func_Maximize; setAllowedActions(); setupDecor(); - if (flags.stuck != s) stick(); } reconfigure(); @@ -2802,7 +2804,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) { void BlackboxWindow::exposeEvent(const XExposeEvent *ee) { -#ifdef DEBUG +#if 0 fprintf(stderr, "BlackboxWindow::exposeEvent() for 0x%lx\n", client.window); #endif @@ -3611,7 +3613,7 @@ void BlackboxWindow::endResize(void) { void BlackboxWindow::motionNotifyEvent(const XMotionEvent *me) { -#ifdef DEBUG +#if 0 fprintf(stderr, "BlackboxWindow::motionNotifyEvent() for 0x%lx\n", client.window); #endif @@ -3730,6 +3732,12 @@ void BlackboxWindow::restore(bool remap) { if (flags.shaded && ! flags.iconic) setState(NormalState); + // erase the netwm stuff that we read when a window maps, so that it + // doesn't persist between mappings. + // (these are the ones read in getNetWMFlags().) + xatom->eraseValue(client.window, XAtom::net_wm_desktop); + xatom->eraseValue(client.window, XAtom::net_wm_state); + restoreGravity(client.rect); XUnmapWindow(blackbox->getXDisplay(), frame.window);