]> Dogcows Code - chaz/openbox/commitdiff
add options for ignoring shaded windows and full-maxed windows while placing new...
authorDana Jansens <danakj@orodu.net>
Tue, 16 Jul 2002 02:18:16 +0000 (02:18 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 16 Jul 2002 02:18:16 +0000 (02:18 +0000)
nls/C/Configmenu.m
src/Configmenu.cc
src/Screen.cc
src/Screen.hh
src/Workspace.cc

index 3143c0d80a68666de9390d706ed936db02c71d6d..fdbc83f6ac9b0912233ba2a9571e6ae9b94e072f 100644 (file)
@@ -46,3 +46,7 @@ $ #TopBottom
 # Top to Bottom
 $ #BottomTop
 # Bottom to Top
+$ #IgnoreShaded
+# Ignore shaded windows
+$ #IgnoreMax
+# Ignore full-maximized windows
index d78d3da943ee521e7615cc5fc7b25232fd6fb94e..c4f2326ecea72c4284790a9eda7d878edd8c472c 100644 (file)
@@ -229,6 +229,11 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm):
          BScreen::TopBottom);
   insert(i18n(ConfigmenuSet, ConfigmenuBottomTop, "Bottom to Top"),
          BScreen::BottomTop);
+  insert(i18n(ConfigmenuSet, ConfigmenuIgnoreShaded, "Ignore shaded windows"),
+         BScreen::IgnoreShaded);
+  insert(i18n(ConfigmenuSet, ConfigmenuIgnoreMax,
+              "Ignore full-maximized windows"),
+         BScreen::IgnoreMaximized);
   update();
   setValues();
 }
@@ -255,6 +260,9 @@ void Configmenu::Placementmenu::setValues(void) {
   setItemSelected(7, ! tb);
   setItemEnabled(6, e);
   setItemEnabled(7, e);
+  
+  setItemSelected(8, getScreen()->getPlaceIgnoreShaded());
+  setItemSelected(9, getScreen()->getPlaceIgnoreMaximized());
 }
 
 
@@ -360,6 +368,21 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) {
     setItemSelected(6, false);
     setItemSelected(7, true);
 
+    break;
+  
+  case BScreen::IgnoreShaded:
+    getScreen()->savePlaceIgnoreShaded(! getScreen()->getPlaceIgnoreShaded());
+
+    setItemSelected(8, getScreen()->getPlaceIgnoreShaded());
+
+    break;
+
+  case BScreen::IgnoreMaximized:
+    getScreen()->
+      savePlaceIgnoreMaximized(! getScreen()->getPlaceIgnoreMaximized());
+
+    setItemSelected(9, getScreen()->getPlaceIgnoreMaximized());
+
     break;
   }
 }
index c2f52cb933b68f878d75184106c79ff6294f68f7..a01b08874e1c1a75ad6d0a2c990ff630a3e6b89e 100644 (file)
@@ -490,7 +490,7 @@ void BScreen::saveDateFormat(int f) {
 }
 
 
-void BScreen::saveClock24Hour(Bool c) {
+void BScreen::saveClock24Hour(bool c) {
   resource.clock24hour = c;
   config->setValue(screenstr + "clockFormat", resource.clock24hour ? 24 : 12);
 }
@@ -510,6 +510,20 @@ void BScreen::saveWorkspaceNames() {
 }
 
 
+void BScreen::savePlaceIgnoreShaded(bool i) {
+  resource.ignore_shaded = i;
+  config->setValue(screenstr + "placementIgnoreShaded",
+                   resource.ignore_shaded);
+}
+
+
+void BScreen::savePlaceIgnoreMaximized(bool i) {
+  resource.ignore_maximized = i;
+  config->setValue(screenstr + "placementIgnoreMaximized",
+                   resource.ignore_maximized);
+}
+
+
 void BScreen::save_rc(void) {
   saveSloppyFocus(resource.sloppy_focus);
   saveAutoRaise(resource.auto_raise);
@@ -534,6 +548,8 @@ void BScreen::save_rc(void) {
   saveDateFormat(resource.date_format);
   savwClock24Hour(resource.clock24hour);
 #endif // HAVE_STRFTIME
+  savePlaceIgnoreShaded(resource.ignore_shaded);
+  savePlaceIgnoreMaximized(resource.ignore_maximized);
 
   toolbar->save_rc();
   slit->save_rc();
@@ -639,9 +655,8 @@ void BScreen::load_rc(void) {
     resource.placement_policy = RowSmartPlacement;
 
 #ifdef    HAVE_STRFTIME
-  if (config->getValue(screenstr + "strftimeFormat", s))
-    resource.strftime_format = s;
-  else
+  if (! config->getValue(screenstr + "strftimeFormat",
+                         resource.strftime_format))
     resource.strftime_format = "%I:%M %p";
 #else // !HAVE_STRFTIME
   long l;
@@ -655,6 +670,14 @@ void BScreen::load_rc(void) {
     l = 12;
   resource.clock24hour = l == 24;
 #endif // HAVE_STRFTIME
+  
+  if (! config->getValue(screenstr + "placementIgnoreShaded",
+                         resource.ignore_shaded))
+    resource.ignore_shaded = true;
+
+  if (! config->getValue(screenstr + "placementIgnoreMaximized",
+                         resource.ignore_maximized))
+    resource.ignore_maximized = true;
 }
 
 
index 37946b99aea49f5db7a8c01572b471d488ba58b5..7701a1d29c5fcdd6315ea65200e261f171f1684a 100644 (file)
@@ -149,7 +149,8 @@ private:
 
     bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
       opaque_move, full_max, focus_new, focus_last, click_raise,
-      hide_toolbar, window_to_window_snap, window_corner_snap, aa_fonts;
+      hide_toolbar, window_to_window_snap, window_corner_snap, aa_fonts,
+      ignore_shaded, ignore_maximized;
     BColor border_color;
 
     unsigned int workspaces;
@@ -189,7 +190,8 @@ private:
   void updateWorkArea(void);
 public:
   enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement,
-         UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop };
+         UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop,
+         IgnoreShaded, IgnoreMaximized };
   enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet };
   enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure,
          WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise,
@@ -244,6 +246,10 @@ public:
   { return resource.border_width; }
   inline unsigned int getResizeZones(void) const
   { return resource.resize_zones; }
+  inline bool getPlaceIgnoreShaded(void) const
+  { return resource.ignore_shaded; }
+  inline bool getPlaceIgnoreMaximized(void) const
+  { return resource.ignore_maximized; }
 
   inline unsigned int getCurrentWorkspaceID(void) const
   { return current_workspace->getID(); }
@@ -280,6 +286,8 @@ public:
   void saveWindowToWindowSnap(bool s);
   void saveWindowCornerSnap(bool s);
   void saveResizeZones(unsigned int z);
+  void savePlaceIgnoreShaded(bool i);
+  void savePlaceIgnoreMaximized(bool i);
   inline void iconUpdate(void) { iconmenu->update(); }
 
 #ifdef    HAVE_STRFTIME
index 88280a1d32eaeb9260069d4e816d742c879c4129..586adbadcf3f3fa99a2dd790757aa00e58a5cc86 100644 (file)
@@ -572,7 +572,8 @@ bool Workspace::smartPlacement(Rect& win, const Rect& availableArea) {
   for (; wit != end; ++wit) {
     const BlackboxWindow* const curr = *wit;
 
-    if (curr->isShaded()) continue;
+    if (curr->isShaded() && screen->getPlaceIgnoreShaded()) continue;
+    if (curr->isMaximizedFull() && screen->getPlaceIgnoreMaximized()) continue;
 
     tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
                 curr->frameRect().width() + screen->getBorderWidth(),
This page took 0.03433 seconds and 4 git commands to generate.