aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2013-08-02 09:19:26 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-08-02 09:19:26 (GMT)
commitff3635ad0aa55f781314ff8b43ed3183cfb12ab6 (patch)
tree8ae5cbc88d0d61d1b7665086d997f038c9f68289
parent57ec44e9940992554c8d55b09e885f9c020a209d (diff)
downloadfluxbox-ff3635ad0aa55f781314ff8b43ed3183cfb12ab6.zip
fluxbox-ff3635ad0aa55f781314ff8b43ed3183cfb12ab6.tar.bz2
Fix ArrangeWindowsStack* for multi-head displays
* Fix integer wrap around for some situations (resulting in a very wide window): w = max_width - x_offs - (*closest)->widthOffset() If the given window is on the right most display and thus 'x_offs' is bigger than 'max_width' (half of the display width), the resulting 'w' wraps around and becomes very large. * Place a single window via ArrangeWindowsStack* as well * Some minor code styling / reordering along the way
-rw-r--r--src/WorkspaceCmd.cc129
1 files changed, 67 insertions, 62 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 2d4de03..ea4d617 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -407,20 +407,17 @@ void ArrangeWindowsCmd::execute() {
407 // - only on current head 407 // - only on current head
408 const int head = screen->getCurrHead(); 408 const int head = screen->getCurrHead();
409 Workspace::Windows::iterator win; 409 Workspace::Windows::iterator win;
410
411 Workspace::Windows normal_windows; 410 Workspace::Windows normal_windows;
412 Workspace::Windows shaded_windows; 411 Workspace::Windows shaded_windows;
413 FluxboxWindow* main_window = NULL; // Main (big) window for stacked modes 412 FluxboxWindow* main_window = NULL; // Main (big) window for stacked modes
414 for(win = space->windowList().begin(); win != space->windowList().end(); ++win) { 413
414 for (win = space->windowList().begin(); win != space->windowList().end(); ++win) {
415 int winhead = screen->getHead((*win)->fbWindow()); 415 int winhead = screen->getHead((*win)->fbWindow());
416 if ((winhead == head || winhead == 0) && m_pat.match(**win)) { 416 if ((winhead == head || winhead == 0) && m_pat.match(**win)) {
417 // If using stacked tiling, and this window is focused, set it as main window 417
418 if (((m_tile_method == STACKLEFT) || (m_tile_method == STACKRIGHT) 418 if ((m_tile_method >= STACKLEFT) && (*win)->isFocused()) {
419 || (m_tile_method == STACKBOTTOM) || (m_tile_method == STACKTOP))
420 && (*win)->isFocused()){
421 main_window = (*win); 419 main_window = (*win);
422 } 420 } else {
423 else{
424 if ((*win)->isShaded()) 421 if ((*win)->isShaded())
425 shaded_windows.push_back(*win); 422 shaded_windows.push_back(*win);
426 else 423 else
@@ -428,31 +425,35 @@ void ArrangeWindowsCmd::execute() {
428 } 425 }
429 } 426 }
430 } 427 }
428
431 // if using stacked-left/right/top/bottom and we