From 42ace977752c4e2dc9e77794d0f9ac73c53437ef Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 23 Oct 2007 22:53:46 +0000 Subject: allow changing maximization state while window is fullscreen --- src/Window.cc | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index 767aff5..51a7ee9 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -537,18 +537,17 @@ void FluxboxWindow::init() { m_focused = false; } - // maximization won't work if we think the window is fullscreen - bool tmp_fullscreen = fullscreen; - fullscreen = false; + if (fullscreen) { + fullscreen = false; + setFullscreen(true); + } + if (maximized) { int tmp = maximized; maximized = MAX_NONE; setMaximizedState(tmp); } - if (tmp_fullscreen) - setFullscreen(true); - struct timeval now; gettimeofday(&now, NULL); @@ -1596,8 +1595,8 @@ void FluxboxWindow::setFullscreen(bool flag) { */ void FluxboxWindow::maximize(int type) { - // doesn't make sense to maximize - if (isFullscreen() || type == MAX_NONE) + // nothing to do + if (type == MAX_NONE) return; int new_max = maximized; @@ -1618,15 +1617,12 @@ void FluxboxWindow::maximize(int type) { void FluxboxWindow::setMaximizedState(int type) { - if (!m_initialized) { - // this will interfere with the window getting placed, so we delay it + if (!m_initialized || isFullscreen() || type == maximized) { + // this will interfere with window placement, so we delay it maximized = type; return; } - if (isFullscreen() || type == maximized) - return; - if (isShaded()) shade(); -- cgit v0.11.2