aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-01-23 10:38:25 (GMT)
committerrathnor <rathnor>2004-01-23 10:38:25 (GMT)
commite56c3c5b448a16a90dc1e518b29afd5c0ee544e8 (patch)
treefb30b241de738787281827cf9d63baa666839900 /src
parent9d035e19c8d574e148ac92cc537de6c49f000f61 (diff)
downloadfluxbox-e56c3c5b448a16a90dc1e518b29afd5c0ee544e8.zip
fluxbox-e56c3c5b448a16a90dc1e518b29afd5c0ee544e8.tar.bz2
fix some issues with window frame that happened when changing style
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc52
-rw-r--r--src/Window.cc35
-rw-r--r--src/Window.hh15
3 files changed, 81 insertions, 21 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index d310f24..5dcd64a 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.72 2004/01/21 19:47:30 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.73 2004/01/23 10:37:01 rathnor Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -455,10 +455,12 @@ bool FbWinFrame::showHandle() {
455 if (m_use_handle || theme().handleWidth() == 0) 455 if (m_use_handle || theme().handleWidth() == 0)
456 return false; 456 return false;
457 457
458 m_use_handle = true;
459
460 renderHandles();
458 m_handle.show(); 461 m_handle.show();
459 m_handle.showSubwindows(); // shows grips 462 m_handle.showSubwindows(); // shows grips
460 463
461 m_use_handle = true;
462 m_window.resize(m_window.width(), m_window.height() + m_handle.height() + 464 m_window.resize(m_window.width(), m_window.height() + m_handle.height() +
463 m_handle.borderWidth()); 465 m_handle.borderWidth());
464 return true; 466 return true;
@@ -636,6 +638,13 @@ void FbWinFrame::reconfigure() {
636 return; 638 return;
637 639
638 m_bevel = theme().bevelWidth(); 640 m_bevel = theme().bevelWidth();
641 // reconfigure can't set borderwidth, as it doesn't know
642 // if it's meant to be borderless or not
643
644 unsigned int orig_handle_h = handle().height();
645 if (m_use_handle && orig_handle_h != theme().handleWidth())
646 m_window.resize(m_window.width(), m_window.height() -
647 orig_handle_h + theme().handleWidth());
639 648
640 handle().resize(handle().width(), 649 handle().resize(handle().width(),
641 theme().handleWidth()); 650 theme().handleWidth());
@@ -663,32 +672,37 @@ void FbWinFrame::reconfigure() {
663 client_height -= titlebar_height; 672 client_height -= titlebar_height;
664 } 673 }
665 674
666 if (m_use_handle) { 675 // align handle and grips
667 // align handle and grips 676 const int grip_height = m_handle.height();
668 const int grip_height = m_handle.height(); 677 const int grip_width = 20; //TODO
669 const int grip_width = 20; //TODO 678 const int handle_bw = static_cast<signed>(m_handle.borderWidth());
670 const int handle_bw = static_cast<signed>(m_handle.borderWidth());
671
672 const int ypos = m_window.height() - grip_height - m_handle.borderWidth();
673 m_handle.moveResize(-handle_bw, ypos,
674 m_window.width(), grip_height);
675
676 m_grip_left.moveResize(-handle_bw, -handle_bw,
677 grip_width, grip_height);
678 679
679 m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, 680 int ypos = m_window.height();
680 grip_width, grip_height);
681 m_handle.raise();
682 681
683 client_height -= m_handle.height() + m_handle.borderWidth(); 682 // if the handle isn't on, it's actually below the window
683 if (m_use_handle)
684 ypos -= grip_height + handle_bw;
685
686 // we do handle settings whether on or not so that if they get toggled
687 // then things are ok...
688 m_handle.moveResize(-handle_bw, ypos,
689 m_window.width(), grip_height);
690
691 m_grip_left.moveResize(-handle_bw, -handle_bw,
692 grip_width, grip_height);
693
694 m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw,
695 grip_width, grip_height);
684 696
697 if (m_use_handle) {
698 m_handle.raise();
699 client_height -= m_handle.height() + m_handle.borderWidth();
685 } else { 700 } else {
686 m_handle.lower(); 701 m_handle.lower();
687 } 702 }
688 703
689 m_clientarea.moveResize(0, client_top, 704 m_clientarea.moveResize(0, client_top,
690 m_window.width(), client_height); 705 m_window.width(), client_height);
691
692 } 706 }
693 707
694 708
diff --git a/src/Window.cc b/src/Window.cc
index ff67a8d..a7e3afa 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.265 2004/01/21 15:42:59 fluxgen Exp $ 25// $Id: Window.cc,v 1.266 2004/01/23 10:37:08 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -264,6 +264,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
264 m_diesig(*this), 264 m_diesig(*this),
265 m_focussig(*this), 265 m_focussig(*this),
266 m_titlesig(*this), 266 m_titlesig(*this),
267 m_themelistener(*this),
267 moving(false), resizing(false), shaded(false), 268 moving(false), resizing(false), shaded(false),
268 iconic(false), focused(false), 269 iconic(false), focused(false),
269 stuck(false), m_managed(false), 270 stuck(false), m_managed(false),
@@ -280,6 +281,8 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
280 m_parent(client.screen().rootWindow()), 281 m_parent(client.screen().rootWindow()),
281 m_resize_corner(RIGHTBOTTOM) { 282 m_resize_corner(RIGHTBOTTOM) {
282 283
284 tm.reconfigSig().attach(&m_themelistener);
285
283 init(); 286 init();
284} 287}
285 288
@@ -3457,3 +3460,33 @@ void FluxboxWindow::setupWindow() {
3457 3460
3458 menu().reconfigure(); // update graphics 3461 menu().reconfigure(); // update graphics
3459} 3462}
3463
3464
3465/**
3466 * reconfigTheme: must be called after frame is reconfigured
3467 * Client windows need to be made the same size and location as
3468 * the frame's client area.
3469 */
3470void FluxboxWindow::reconfigTheme() {
3471
3472 m_frame.setBorderWidth(decorations.border?frame().theme().border().width():0);
3473 if (decorations.handle && frame().theme().handleWidth() != 0)
3474 frame().showHandle();
3475 else
3476 frame().hideHandle();
3477
3478 ClientList::iterator it = clientList().begin();
3479 ClientList::iterator it_end = clientList().end();
3480
3481 int x = m_frame.clientArea().x(),
3482 y = m_frame.clientArea().y();
3483
3484 unsigned int width = m_frame.clientArea().width(),
3485 height = m_frame.clientArea().height();
3486
3487 for (; it != it_end; ++it) {
3488 (*it)->moveResize(x, y, width, height);
3489 }
3490
3491 sendConfigureNotify();
3492}
diff --git a/src/Window.hh b/src/Window.hh
index 71c0b71..0ee053f 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.hh,v 1.106 2004/01/18 19:14:08 fluxgen Exp $ 25// $Id: Window.hh,v 1.107 2004/01/23 10:38:25 rathnor Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -352,6 +352,8 @@ public:
352 FbTk::Subject &titleSig() { return m_titlesig; } 352 FbTk::Subject &titleSig() { return m_titlesig; }
353 /** @} */ // end group signals 353 /** @} */ // end group signals
354 354
355 void reconfigTheme();
356
355 const timeval &lastFocusTime() const { return m_last_focus_time;} 357 const timeval &lastFocusTime() const { return m_last_focus_time;}
356 358
357 //@} 359 //@}
@@ -410,6 +412,17 @@ private:
410 // state and hint signals 412 // state and hint signals
411 WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig, m_focussig, m_titlesig; 413 WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig, m_focussig, m_titlesig;
412 414
415 class ThemeListener: public FbTk::Observer {
416 public:
417 ThemeListener(FluxboxWindow &win):m_win(win) { }
418 void update(FbTk::Subject *) {
419 m_win.reconfigTheme();
420 }
421 private:
422 FluxboxWindow &m_win;
423 };
424 ThemeListener m_themelistener;
425
413 // Window states 426 // Window states
414 bool moving, resizing, shaded, iconic, 427 bool moving, resizing, shaded, iconic,
415 focused, stuck, m_managed; 428 focused, stuck, m_managed;