]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
catch button presses on the window's frame window, else they end up passing up the...
[chaz/openbox] / src / Window.cc
index 72643c2de73d4bddf8faa6cc9a28d36e67d913bb..dcbb5f08afc55654e5c2f1806fd7d6cbaf33670a 100644 (file)
@@ -475,7 +475,13 @@ Window BlackboxWindow::createToplevelWindow(void) {
   attrib_create.background_pixmap = None;
   attrib_create.colormap = screen->getColormap();
   attrib_create.override_redirect = True;
-  attrib_create.event_mask = EnterWindowMask | LeaveWindowMask;
+  attrib_create.event_mask = EnterWindowMask | LeaveWindowMask |
+                             ButtonPress;
+  /*
+    We catch button presses because other wise they get passed down to the
+    root window, which will then cause root menus to show when you click the
+    window's frame.
+  */
 
   return XCreateWindow(blackbox->getXDisplay(), screen->getRootWindow(),
                        0, 0, 1, 1, frame.border_w, screen->getDepth(),
@@ -2681,7 +2687,7 @@ void BlackboxWindow::redrawCloseButton(bool pressed) const {
   XClearWindow(blackbox->getXDisplay(), frame.close_button);
 
   BPen pen((flags.focused) ? screen->getWindowStyle()->b_pic_focus :
-           screen->getWindowStyle()->b_pic_unfocus, 0, 2);
+           screen->getWindowStyle()->b_pic_unfocus);
   XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
             2, 2, (frame.button_w - 3), (frame.button_w - 3));
   XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
@@ -2736,7 +2742,8 @@ void BlackboxWindow::mapRequestEvent(const XMapRequestEvent *re) {
      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() &&
+  if (! flags.stuck &&
+      blackbox_attrib.workspace != screen->getCurrentWorkspaceID() &&
       blackbox_attrib.workspace < screen->getWorkspaceCount())
     if (current_state == NormalState) current_state = WithdrawnState;
 
@@ -3859,10 +3866,15 @@ void BlackboxWindow::enterNotifyEvent(const XCrossingEvent* ce) {
       bool success = setInputFocus();
       if (success)    // if focus succeeded install the colormap
         installColormap(True); // XXX: shouldnt we honour no install?
-    }
 
-    if (screen->doAutoRaise())
-      timer->start();
+      /*
+        We only auto-raise when the window wasn't focused because otherwise
+        we run into problems with gtk+ drop-down lists. The window ends up
+        raising over the list.
+      */
+      if (screen->doAutoRaise())
+        timer->start();
+    }
   }
 }
 
This page took 0.023808 seconds and 4 git commands to generate.