]> Dogcows Code - chaz/openbox/blobdiff - src/Slit.cc
move the checkmarks to the opposite side of the bullets. This means they still can...
[chaz/openbox] / src / Slit.cc
index 83923dfcb43d8278dbd4cc3387ee389b72d5461d..307430320921a27849648b852805d53dbe4a0477 100644 (file)
@@ -40,8 +40,7 @@ extern "C" {
 Slit::Slit(BScreen *scr) {
   screen = scr;
   blackbox = screen->getBlackbox();
-  slitstr = (std::string)"session.screen" + itostring(screen->getScreenNumber())
-    + ".slit.";
+  slitstr = "session.screen" + itostring(screen->getScreenNumber()) + ".slit.";
   config = blackbox->getConfig();
 
   load_rc();
@@ -86,6 +85,9 @@ Slit::~Slit(void) {
 
   delete slitmenu;
 
+  screen->removeStrut(&strut);
+  screen->updateAvailableArea();
+
   screen->getImageControl()->removeImage(frame.pixmap);
 
   blackbox->removeSlitSearch(frame.window);
@@ -433,25 +435,29 @@ void Slit::updateStrut(void) {
   strut.top = strut.bottom = strut.left = strut.right = 0;
 
   if (! clientList.empty()) {
+    // when not hidden both borders are in use, when hidden only one is
+    unsigned int border_width = screen->getBorderWidth();
+    if (! do_auto_hide)
+      border_width *= 2;
+
     switch (direction) {
     case Vertical:
       switch (placement) {
       case TopCenter:
-        strut.top = getY() + getExposedHeight() +
-                    (screen->getBorderWidth() * 2);
+        strut.top = getExposedHeight() + border_width;
         break;
       case BottomCenter:
-        strut.bottom = screen->getHeight() - getY();
+        strut.bottom = getExposedHeight() + border_width;
         break;
       case TopLeft:
       case CenterLeft:
       case BottomLeft:
-        strut.left = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.left = getExposedWidth() + border_width;
         break;
       case TopRight:
       case CenterRight:
       case BottomRight:
-        strut.right = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.right = getExposedWidth() + border_width;
         break;
       }
       break;
@@ -460,19 +466,18 @@ void Slit::updateStrut(void) {
       case TopCenter:
       case TopLeft:
       case TopRight:
-        strut.top = getY() + getExposedHeight() +
-                    (screen->getBorderWidth() * 2);
+        strut.top = getExposedHeight() + border_width;
         break;
       case BottomCenter:
       case BottomLeft:
       case BottomRight:
-        strut.bottom = screen->getHeight() - getY();
+        strut.bottom = getExposedHeight() + border_width;
         break;
       case CenterLeft:
-        strut.left = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.left = getExposedWidth() + border_width;
         break;
       case CenterRight:
-        strut.right = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.right = getExposedWidth() + border_width;
         break;
       }
       break;
@@ -622,7 +627,7 @@ void Slit::shutdown(void) {
 }
 
 
-void Slit::buttonPressEvent(XButtonEvent *e) {
+void Slit::buttonPressEvent(const XButtonEvent *e) {
   if (e->window != frame.window) return;
 
   if (e->button == Button1 && (! on_top)) {
@@ -656,7 +661,7 @@ void Slit::buttonPressEvent(XButtonEvent *e) {
 }
 
 
-void Slit::enterNotifyEvent(XCrossingEvent *) {
+void Slit::enterNotifyEvent(const XCrossingEvent *) {
   if (! do_auto_hide)
     return;
 
@@ -668,7 +673,7 @@ void Slit::enterNotifyEvent(XCrossingEvent *) {
 }
 
 
-void Slit::leaveNotifyEvent(XCrossingEvent *) {
+void Slit::leaveNotifyEvent(const XCrossingEvent *) {
   if (! do_auto_hide)
     return;
 
@@ -680,7 +685,7 @@ void Slit::leaveNotifyEvent(XCrossingEvent *) {
 }
 
 
-void Slit::configureRequestEvent(XConfigureRequestEvent *e) {
+void Slit::configureRequestEvent(const XConfigureRequestEvent *e) {
   if (! blackbox->validateWindow(e->window))
     return;
 
@@ -734,7 +739,7 @@ void Slit::toggleAutoHide(void) {
 }
 
 
-void Slit::unmapNotifyEvent(XUnmapEvent *e) {
+void Slit::unmapNotifyEvent(const XUnmapEvent *e) {
   removeClient(e->window);
 }
 
This page took 0.028957 seconds and 4 git commands to generate.