aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-01 08:26:48 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-08-27 06:54:26 (GMT)
commit299e098f5f6fc6d33684b3d4e80185c8a7899664 (patch)
tree4442d82cc21e23d6c38f1b952b65a1348e1011cc
parent4304e667870709f29f0fda9e5fbc56cdd81744cc (diff)
downloadfluxbox-299e098f5f6fc6d33684b3d4e80185c8a7899664.zip
fluxbox-299e098f5f6fc6d33684b3d4e80185c8a7899664.tar.bz2
handle oversized windows
Clients can still be stupid (feh constrains itself to the root window ...) or lazy (llpp uses the last size - if that was in pivot mode ...) and create windows which exceed the workspace dimensions, resulting in both opposing edges being off-screen (for all tested placements) This applies partial maximization instead and resizes the (restored) window to soem sane size (size constraints applied) CCBUG: 688 CCBUG: 984
-rw-r--r--src/Window.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 3ad5088..f1bf1e9 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -506,6 +506,25 @@ void FluxboxWindow::init() {
506 506
507 fluxbox.attachSignals(*this); 507 fluxbox.attachSignals(*this);
508 508
509 if (!m_state.fullscreen) {
510 unsigned int new_width = 0, new_height = 0;
511 if (m_client->width() >= screen().width()) {
512 m_state.maximized |= WindowState::MAX_HORZ;
513 new_width = 2 * screen().width() / 3;
514 }
515 if (m_client->height() >= screen().height()) {
516 m_state.maximized |= WindowState::MAX_VERT;
517 new_height = 2 * screen().height() / 3;
518 }
519 if (new_width || new_height) {
520 const int maximized = m_state.maximized;
521 m_state.maximized = WindowState::MAX_NONE;
522 resize(new_width ? new_width : width(), new_height ? new_height : height());
523 m_placed = false;
524 m_state.maximized = maximized;
525 }
526 }
527
509 // this window is managed, we are now allowed to modify actual state 528 // this window is managed, we are now allowed to modify actual state
510 m_initialized = true; 529 m_initialized = true;
511 530