aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrame.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-09-24 14:02:25 (GMT)
committerrathnor <rathnor>2003-09-24 14:02:25 (GMT)
commitfeb7462e381b4015bc736e90da87dc7cc5711b1a (patch)
treee028335ecbc02b1e79128247293003b2ce5afc29 /src/FbWinFrame.cc
parentbec4f7c894677a92d9210a1b1e511afd4cee5e5e (diff)
downloadfluxbox_pavel-feb7462e381b4015bc736e90da87dc7cc5711b1a.zip
fluxbox_pavel-feb7462e381b4015bc736e90da87dc7cc5711b1a.tar.bz2
Fix updates to mwm_hints, and make configure request move and resize atomic
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r--src/FbWinFrame.cc85
1 files changed, 49 insertions, 36 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 1781fcd..fb309b4 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.cc,v 1.53 2003/09/16 13:11:41 rathnor Exp $ 22// $Id: FbWinFrame.cc,v 1.54 2003/09/24 14:02:25 rathnor Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -163,53 +163,66 @@ void FbWinFrame::shade() {
163 163
164 164
165void FbWinFrame::move(int x, int y) { 165void FbWinFrame::move(int x, int y) {
166 // don't update unless we really changes position 166 moveResize(x, y, 0, 0, true, false);
167 if (x == window().x() && y == window().y()) 167}
168 return;
169 168
170 window().move(x, y); 169void FbWinFrame::resize(unsigned int width, unsigned int height) {
171 // update transparent only if we need to 170 moveResize(0, 0, width, height, false, true);
172 if (theme().alpha() == 255) 171}
173 return;
174 172
175 // restart update timer 173// need an atomic moveresize where possible
176 m_update_timer.start(); 174void FbWinFrame::moveResizeForClient(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) {
175 // total height for frame
177 176
178 /* 177 unsigned int total_height = height;
179 178
180 */ 179 if (resize) {
180 // having a titlebar = 1 extra border + titlebar height
181 if (m_use_titlebar)
182 total_height += m_titlebar.height() + m_titlebar.borderWidth();
183 // having a handle = 1 extra border + handle height
184 if (m_use_handle)
185 total_height += m_handle.height() + m_handle.borderWidth();
186 }
187 moveResize(x, y, width, total_height, move, resize);
181} 188}
182 189
183void FbWinFrame::resize(unsigned int width, unsigned int height) { 190void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) {
184 // update unshaded size if we're in shaded state and just resize width 191 moveResizeForClient(0, 0, width, height, false, true);
185 if (m_shaded) { 192}
193
194void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) {
195 if (move && x == window().x() && y == window().y())
196 move = false;
197
198 if (resize && width == FbWinFrame::width() && height == FbWinFrame::height())
199 resize = false;
200
201 if (!move && !resize)
202 return;
203
204 if (resize && m_shaded) {
205 // update unshaded size if we're in shaded state and just resize width
186 m_width_before_shade = width; 206 m_width_before_shade = width;
187 m_height_before_shade = height; 207 m_height_before_shade = height;
188 m_window.resize(width, m_window.height()); 208 height = m_window.height();
209 }
210
211 if (move && resize) {
212 m_window.moveResize(x, y, width, height);
213 } else if (move) {
214 m_window.move(x, y);
215 // this stuff will be caught by reconfigure if resized
216 if (theme().alpha() != 255) {
217 // restart update timer
218 m_update_timer.start();
219 }
189 } else { 220 } else {
190 m_window.resize(width, height); 221 m_window.resize(width, height);
191 } 222 }
192 223
193 reconfigure(); 224 if (resize)
194} 225 reconfigure();
195
196void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) {
197 // total height for frame
198 unsigned int total_height = height;
199
200 // having a titlebar = 1 extra border + titlebar height
201 if (m_use_titlebar)
202 total_height += m_titlebar.height() + m_titlebar.borderWidth();
203 // having a handle = 1 extra border + handle height
204 if (m_use_handle)
205 total_height += m_handle.height() + m_handle.borderWidth();
206 resize(width, total_height);
207}
208
209void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height) {
210 move(x, y);
211 if (width != FbWinFrame::width() || height != FbWinFrame::height())
212 resize(width, height);
213} 226}
214 227
215void FbWinFrame::setFocus(bool newvalue) { 228void FbWinFrame::setFocus(bool newvalue) {