From 69d80c590579f0aa7a711a0c42e440a05c6ff260 Mon Sep 17 00:00:00 2001
From: Michal Zime <michal dot zimen at gmail dot com>
Date: Mon, 23 Nov 2009 21:11:04 +0100
Subject: Keep 'maximum/fullscreen' when moving a window between different
 heads

---
 ChangeLog     |  5 +++++
 src/Window.cc | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index d3745d3..fe03f58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
  (Format: Year/Month/Day)
 Changes for 1.1.2
 
+*09/11/23:
+   * Keep 'maximized/fullscreen' state when changing the current head of a
+   window (thanks Michal Zimen)
+     Window.cc
+
 *09/10/03:
    * Build system cleanup: Check for extension headers (Mathias)
      autogen.sh configure.in, removed 'missing' file
diff --git a/src/Window.cc b/src/Window.cc
index 34b92e1..c03447c 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2884,6 +2884,13 @@ void FluxboxWindow::stopMoving(bool interrupted) {
     ungrabPointer(CurrentTime);
 
     FbTk::App::instance()->sync(false); //make sure the redraw is made before we continue
+
+    // if Head has been changed we want it to redraw by current state
+    if (m_state.maximized || m_state.fullscreen) {
+        frame().applyState();
+        attachWorkAreaSig();
+        stateSig().notify();
+    }
 }
 
 /**
@@ -3767,6 +3774,13 @@ void FluxboxWindow::setOnHead(int head) {
              screen().getHeadY(head) + frame().y() - screen().getHeadY(cur));
         m_placed = placed;
     }
+
+    // if Head has been changed we want it to redraw by current state
+    if (m_state.maximized || m_state.fullscreen) {
+        frame().applyState();
+        attachWorkAreaSig();
+        stateSig().notify();
+    }
 }
 
 void FluxboxWindow::placeWindow(int head) {
-- 
cgit v0.11.2