]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
properly watch for windows on other workspaces when mapping.
[chaz/openbox] / src / Window.cc
index 0b161f6ca642fb7342586ff4d64d683c7fac7d8e..f18d4dead2aaafdb4adef0f1a84392f2eba14ebb 100644 (file)
@@ -2611,6 +2611,14 @@ void BlackboxWindow::mapRequestEvent(const XMapRequestEvent *re) {
           client.window);
 #endif // DEBUG
 
+  /*
+     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() &&
+      blackbox_attrib.workspace < screen->getWorkspaceCount())
+    if (current_state == NormalState) current_state = WithdrawnState;
+
   switch (current_state) {
   case IconicState:
     iconify();
@@ -2694,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
@@ -2706,6 +2714,8 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
     break;
 
   case XA_WM_TRANSIENT_FOR: {
+    bool s = flags.stuck;
+    
     // determine if this is a transient window
     getTransientInfo();
 
@@ -2714,6 +2724,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
       functions &= ~Func_Maximize;
       setAllowedActions();
       setupDecor();
+      if (flags.stuck != s) stick();
     }
 
     reconfigure();
@@ -2792,7 +2803,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
 
@@ -3601,7 +3612,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
@@ -3720,6 +3731,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);
This page took 0.022355 seconds and 4 git commands to generate.