aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc14
-rw-r--r--src/FbWinFrame.hh3
-rw-r--r--src/Window.cc15
3 files changed, 10 insertions, 22 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 68adc0f..adef30c 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -90,7 +90,6 @@ FbWinFrame::FbWinFrame(BScreen &screen, FbWinFrameTheme &theme, FbTk::ImageContr
90 m_active_orig_client_bw(0), 90 m_active_orig_client_bw(0),
91 m_need_render(true), 91 m_need_render(true),
92 m_button_size(1), 92 m_button_size(1),
93 m_width_before_shade(1),
94 m_height_before_shade(1), 93 m_height_before_shade(1),
95 m_shaded(false), 94 m_shaded(false),
96 m_focused_alpha(0), 95 m_focused_alpha(0),
@@ -232,7 +231,6 @@ void FbWinFrame::shade() {
232 // toggle shade 231 // toggle shade
233 m_shaded = !m_shaded; 232 m_shaded = !m_shaded;
234 if (m_shaded) { // i.e. should be shaded now 233 if (m_shaded) { // i.e. should be shaded now
235 m_width_before_shade = m_window.width();
236 m_height_before_shade = m_window.height(); 234 m_height_before_shade = m_window.height();
237 m_window.resize(m_window.width(), m_titlebar.height()); 235 m_window.resize(m_window.width(), m_titlebar.height());
238 alignTabs(); 236 alignTabs();
@@ -240,7 +238,7 @@ void FbWinFrame::shade() {
240 if ( m_shape.get() ) 238 if ( m_shape.get() )
241 m_shape->update(); 239 m_shape->update();
242 } else { // should be unshaded 240 } else { // should be unshaded
243 m_window.resize(m_width_before_shade, m_height_before_shade); 241 m_window.resize(m_window.width(), m_height_before_shade);
244 reconfigure(); 242 reconfigure();
245 } 243 }
246} 244}
@@ -279,19 +277,13 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh
279 if (move && x == window().x() && y == window().y()) 277 if (move && x == window().x() && y == window().y())
280 move = false; 278 move = false;
281 279
282 if (resize && width == FbWinFrame::width() && height == FbWinFrame::height()) 280 if (resize && (m_shaded || width == FbWinFrame::width() &&
281 height == FbWinFrame::height()))
283 resize = false; 282 resize = false;
284 283
285 if (!move && !resize) 284 if (!move && !resize)
286 return; 285 return;
287 286
288 if (resize && m_shaded) {
289 // update unshaded size if we're in shaded state and just resize width
290 m_width_before_shade = width;
291 m_height_before_shade = height;
292 height = m_window.height();
293 }
294
295 if (move && resize) { 287 if (move && resize) {
296 m_window.moveResize(x, y, width, height); 288 m_window.moveResize(x, y, width, height);
297 notifyMoved(false); // will reconfigure 289 notifyMoved(false); // will reconfigure
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 2ea3542..8d0c3ba 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -380,8 +380,7 @@ private:
380 380
381 bool m_need_render; 381 bool m_need_render;
382 int m_button_size; ///< size for all titlebar buttons 382 int m_button_size; ///< size for all titlebar buttons
383 unsigned int m_width_before_shade, ///< width before shade, so we can restore it when we unshade 383 unsigned int m_height_before_shade; ///< height before shade, so we can restore it when we unshade
384 m_height_before_shade; ///< height before shade, so we can restore it when we unshade
385 bool m_shaded; ///< wheter we're shaded or not 384 bool m_shaded; ///< wheter we're shaded or not
386 unsigned char m_focused_alpha; ///< focused alpha value 385 unsigned char m_focused_alpha; ///< focused alpha value
387 unsigned char m_unfocused_alpha; ///< unfocused alpha value 386 unsigned char m_unfocused_alpha; ///< unfocused alpha value
diff --git a/src/Window.cc b/src/Window.cc
index a6fff7c..066d962 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1252,29 +1252,26 @@ void FluxboxWindow::resize(unsigned int width, unsigned int height) {
1252 1252
1253// send_event is just an override 1253// send_event is just an override
1254void FluxboxWindow::moveResize(int new_x, int new_y, 1254void FluxboxWindow::moveResize(int new_x, int new_y,
1255 unsigned int new_width, unsigned int new_height, bool send_event) { 1255 unsigned int new_width, unsigned int new_height,
1256 bool send_event) {
1256 1257
1257 // magic to detect if moved during initialisation 1258 // magic to detect if moved during initialisation
1258 if (!m_initialized) 1259 if (!m_initialized)
1259 m_old_pos_x = 1; 1260 m_old_pos_x = 1;
1260 1261
1261 send_event = send_event || (frame().x() != new_x || frame().y() != new_y); 1262 send_event = send_event || frame().x() != new_x || frame().y() != new_y;
1263
1264 if ((new_width != frame().width() || new_height != frame().height()) &&
1265 isResizable() && !isShaded()) {
1262 1266
1263 if (new_width != frame().width() || new_height != frame().height()) {
1264 if ((((signed) frame().width()) + new_x) < 0) 1267 if ((((signed) frame().width()) + new_x) < 0)
1265 new_x = 0; 1268 new_x = 0;
1266 if ((((signed) frame().height()) + new_y) < 0) 1269 if ((((signed) frame().height()) + new_y) < 0)
1267 new_y = 0; 1270 new_y = 0;
1268 1271
1269 if (!isResizable()) {
1270 new_width = width();
1271 new_height = height();
1272 }
1273
1274 frame().moveResize(new_x, new_y, new_width, new_height); 1272 frame().moveResize(new_x, new_y, new_width, new_height);
1275 setFocusFlag(focused); 1273 setFocusFlag(focused);
1276 1274
1277 shaded = false;
1278 send_event = true; 1275 send_event = true;
1279 } else if (send_event) 1276 } else if (send_event)
1280 frame().move(new_x, new_y); 1277 frame().move(new_x, new_y);