]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
save the titlebarLayout in the default config
[chaz/openbox] / src / Window.cc
index 8df9ddfe733af2da1c99ded8fa80de0da9ef7e1a..cc078fba01b35a408a9d4ad8fa0bc81cc2fc2386 100644 (file)
@@ -216,7 +216,7 @@ OpenboxWindow::OpenboxWindow(Openbox &o, Window w, BScreen *s) : openbox(o) {
   }
   upsize();
 
-  Bool place_window = True;
+  place_window = true;
   if (openbox.isStartup() || flags.transient ||
       client.normal_hint_flags & (PPosition|USPosition)) {
     setGravityOffsets();
@@ -226,7 +226,7 @@ OpenboxWindow::OpenboxWindow(Openbox &o, Window w, BScreen *s) : openbox(o) {
         (signed) (frame.y + frame.y_border) >= 0 &&
         frame.x <= (signed) screen->size().w() &&
         frame.y <= (signed) screen->size().h()))
-      place_window = False;
+      place_window = false;
   }
 
   frame.window = createToplevelWindow(frame.x, frame.y, frame.width,
@@ -1422,6 +1422,9 @@ Bool OpenboxWindow::setInputFocus(void) {
 void OpenboxWindow::iconify(void) {
   if (flags.iconic) return;
 
+  if (flags.moving)
+    endMove();
+
   if (windowmenu) windowmenu->hide();
 
   setState(IconicState);
@@ -1467,8 +1470,8 @@ void OpenboxWindow::deiconify(Bool reassoc, Bool raise) {
 
   // if we're using the click to place placement type, then immediately
   // after the window is mapped, we need to start interactively moving it
-  if (!(flags.iconic || reassoc) &&
-      screen->placementPolicy() == BScreen::ClickMousePlacement) {
+  if (screen->placementPolicy() == BScreen::ClickMousePlacement &&
+      place_window && !(flags.iconic || reassoc)) {
     // if the last window wasn't placed yet, or we're just moving a window
     // already, finish off that move cleanly
     OpenboxWindow *w = openbox.getFocusedWindow();
@@ -2593,7 +2596,7 @@ void OpenboxWindow::buttonPressEvent(XButtonEvent *be) {
           mx = be->x_root - windowmenu->getWidth() / 2;
           if (be->window == frame.title || be->window == frame.label) {
             my = frame.y + frame.title_h;
-          } else if (be->window = frame.handle) {
+          } else if (be->window == frame.handle) {
             my = frame.y + frame.y_handle - windowmenu->getHeight();
           } else { // (be->window == frame.window)
             if (be->y <= (signed) frame.bevel_w) {
@@ -3088,21 +3091,25 @@ void OpenboxWindow::changeOpenboxHints(OpenboxHints *net) {
 
     default:
     case DecorNormal:
-      decorations.titlebar = decorations.border = decorations.handle =
-       decorations.iconify = decorations.maximize = decorations.menu = True;
+      decorations.titlebar = decorations.iconify = decorations.menu =
+        decorations.border = True;
+      decorations.handle = (functions.resize && !flags.transient);
+      decorations.maximize = functions.maximize;
 
       break;
 
     case DecorTiny:
       decorations.titlebar = decorations.iconify = decorations.menu = True;
-      decorations.border = decorations.handle = decorations.maximize = False;
+      decorations.border = decorations.border = decorations.handle = False;
+      decorations.maximize = functions.maximize;
+
       break;
 
     case DecorTool:
-      decorations.titlebar = decorations.menu = functions.move = True;
-      decorations.iconify = decorations.border = decorations.handle =
-       decorations.maximize = False;
+      decorations.titlebar = decorations.menu = True;
+      decorations.iconify = decorations.border = False;
+      decorations.handle = (functions.resize && !flags.transient);
+      decorations.maximize = functions.maximize;
 
       break;
     }
This page took 0.021641 seconds and 4 git commands to generate.