Skip to content

Commit

Permalink
handle oversized windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
luebking authored and mgumz committed Aug 27, 2016
1 parent 4304e66 commit 299e098
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Window.cc
Expand Up @@ -506,6 +506,25 @@ void FluxboxWindow::init() {

fluxbox.attachSignals(*this);

if (!m_state.fullscreen) {
unsigned int new_width = 0, new_height = 0;
if (m_client->width() >= screen().width()) {
m_state.maximized |= WindowState::MAX_HORZ;
new_width = 2 * screen().width() / 3;
}
if (m_client->height() >= screen().height()) {
m_state.maximized |= WindowState::MAX_VERT;
new_height = 2 * screen().height() / 3;
}
if (new_width || new_height) {
const int maximized = m_state.maximized;
m_state.maximized = WindowState::MAX_NONE;
resize(new_width ? new_width : width(), new_height ? new_height : height());
m_placed = false;
m_state.maximized = maximized;
}
}

// this window is managed, we are now allowed to modify actual state
m_initialized = true;

Expand Down

0 comments on commit 299e098

Please sign in to comment.