aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-02 13:26:44 (GMT)
committerfluxgen <fluxgen>2004-01-02 13:26:44 (GMT)
commitb4fc4b5793b81d1ff67caa5086caa873bfe7e441 (patch)
tree4ff8a809c7ce7ac2534372891e8333547f17424b
parent698c46130aae83bf3abfe98bd2fed510971ccc69 (diff)
downloadfluxbox_pavel-b4fc4b5793b81d1ff67caa5086caa873bfe7e441.zip
fluxbox_pavel-b4fc4b5793b81d1ff67caa5086caa873bfe7e441.tar.bz2
some cleaning, using FbWindow setClientWindow instead
-rw-r--r--src/FbWinFrame.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index ea0ae29..fed91f9 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.67 2003/12/18 18:03:21 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.68 2004/01/02 13:26:44 fluxgen Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -81,7 +81,7 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
81 m_button_pm(0), 81 m_button_pm(0),
82 m_themelistener(*this), 82 m_themelistener(*this),
83 m_shape(new Shape(m_window, theme.shapePlace())) { 83 m_shape(new Shape(m_window, theme.shapePlace())) {
84 theme.addListener(m_themelistener); 84 m_theme.reconfigSig().attach(&m_themelistener);
85 init(); 85 init();
86} 86}
87 87
@@ -365,25 +365,24 @@ void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) {
365} 365}
366 366
367void FbWinFrame::setClientWindow(FbTk::FbWindow &win) { 367void FbWinFrame::setClientWindow(FbTk::FbWindow &win) {
368 setClientWindow(win.window());
369}
370 368
371void FbWinFrame::setClientWindow(Window win) {
372 Display *display = FbTk::App::instance()->display(); 369 Display *display = FbTk::App::instance()->display();
373 XSetWindowBorderWidth(display, win, 0);
374 370
375 XChangeSaveSet(display, win, SetModeInsert); 371 win.setBorderWidth(0);
372
373 XChangeSaveSet(display, win.window(), SetModeInsert);
376 374
377 XSelectInput(display, m_window.window(), NoEventMask); 375 m_window.setEventMask(NoEventMask);
378 376
379 // we need to mask this so we don't get unmap event 377 // we need to mask this so we don't get unmap event
380 XSelectInput(display, win, NoEventMask); 378 win.setEventMask(NoEventMask);
381 XReparentWindow(display, win, m_window.window(), 0, m_clientarea.y()); 379 win.reparent(m_window, 0, clientArea().y());
382 // remask window so we get events 380 // remask window so we get events
383 XSelectInput(display, win, PropertyChangeMask | StructureNotifyMask | 381 win.setEventMask(PropertyChangeMask | StructureNotifyMask |
384 FocusChangeMask); 382 FocusChangeMask);
385 XSelectInput(display, m_window.window(), ButtonPressMask | ButtonReleaseMask | 383
386 ButtonMotionMask | EnterWindowMask | SubstructureRedirectMask); 384 m_window.setEventMask(ButtonPressMask | ButtonReleaseMask |
385 ButtonMotionMask | EnterWindowMask | SubstructureRedirectMask);
387 386
388 XFlush(display); 387 XFlush(display);
389 388
@@ -392,10 +391,10 @@ void FbWinFrame::setClientWindow(Window win) {
392 attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | 391 attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask |
393 ButtonMotionMask; 392 ButtonMotionMask;
394 393
395 XChangeWindowAttributes(display, win, CWEventMask|CWDontPropagate, &attrib_set); 394 XChangeWindowAttributes(display, win.window(), CWEventMask|CWDontPropagate, &attrib_set);
396 395
397 m_clientarea.raise(); 396 m_clientarea.raise();
398 XRaiseWindow(display, win); 397 win.raise();
399 m_window.showSubwindows(); 398 m_window.showSubwindows();
400} 399}
401 400
@@ -649,14 +648,6 @@ void FbWinFrame::reconfigure() {
649 } 648 }
650 649
651 if (m_use_handle) { 650 if (m_use_handle) {
652 client_height -= m_handle.height() + m_handle.borderWidth();
653 }
654
655 m_clientarea.moveResize(0, client_top,
656 m_window.width(), client_height);
657
658 if (m_use_handle) {
659
660 // align handle and grips 651 // align handle and grips
661 const int grip_height = m_handle.height(); 652 const int grip_height = m_handle.height();
662 const int grip_width = 20; //TODO 653 const int grip_width = 20; //TODO
@@ -672,9 +663,16 @@ void FbWinFrame::reconfigure() {
672 m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, 663 m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw,
673 grip_width, grip_height); 664 grip_width, grip_height);
674 m_handle.raise(); 665 m_handle.raise();
666
667 client_height -= m_handle.height() + m_handle.borderWidth();
668
675 } else { 669 } else {
676 m_handle.lower(); 670 m_handle.lower();
677 } 671 }
672
673 m_clientarea.moveResize(0, client_top,
674 m_window.width(), client_height);
675
678 } 676 }
679 677
680 678
@@ -824,7 +822,6 @@ void FbWinFrame::renderTitlebar() {
824 return; 822 return;
825 823
826 // render pixmaps 824 // render pixmaps
827
828 render(m_theme.titleFocusTexture(), m_title_focused_color, 825 render(m_theme.titleFocusTexture(), m_title_focused_color,
829 m_title_focused_pm, 826 m_title_focused_pm,
830 m_titlebar.width(), m_titlebar.height()); 827 m_titlebar.width(), m_titlebar.height());
@@ -838,6 +835,7 @@ void FbWinFrame::renderTitlebar() {
838 m_label_focused_pm, 835 m_label_focused_pm,
839 m_label.width(), m_label.height()); 836 m_label.width(), m_label.height());
840 837
838
841 render(m_theme.labelUnfocusTexture(), m_label_unfocused_color, 839 render(m_theme.labelUnfocusTexture(), m_label_unfocused_color,
842 m_label_unfocused_pm, 840 m_label_unfocused_pm,
843 m_label.width(), m_label.height()); 841 m_label.width(), m_label.height());
@@ -969,6 +967,7 @@ void FbWinFrame::renderButtons() {
969} 967}
970 968
971void FbWinFrame::init() { 969void FbWinFrame::init() {
970
972 // setup update timer 971 // setup update timer
973 FbTk::RefCount<FbTk::Command> update_transp(new FbTk::SimpleCommand<FbWinFrame>(*this, 972 FbTk::RefCount<FbTk::Command> update_transp(new FbTk::SimpleCommand<FbWinFrame>(*this,
974 &FbWinFrame::updateTransparent)); 973 &FbWinFrame::updateTransparent));
@@ -1041,8 +1040,9 @@ void FbWinFrame::render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm,
1041 if (!tex.usePixmap()) { 1040 if (!tex.usePixmap()) {
1042 pm = None; 1041 pm = None;
1043 col = tex.color(); 1042 col = tex.color();
1044 } else 1043 } else {
1045 pm = m_imagectrl.renderImage(w, h, tex); 1044 pm = m_imagectrl.renderImage(w, h, tex);
1045 }
1046 1046
1047 if (tmp) 1047 if (tmp)
1048 m_imagectrl.removeImage(tmp); 1048 m_imagectrl.removeImage(tmp);
@@ -1106,7 +1106,7 @@ void FbWinFrame::renderLabelButtons() {
1106 renderButtonUnfocus(**btn_it); 1106 renderButtonUnfocus(**btn_it);
1107 1107
1108 } 1108 }
1109 1109
1110 if (m_current_label != 0) { 1110 if (m_current_label != 0) {
1111 1111
1112 if (label_pm) { 1112 if (label_pm) {
@@ -1115,7 +1115,7 @@ void FbWinFrame::renderLabelButtons() {
1115 m_current_label->setBackgroundColor(label_color); 1115 m_current_label->setBackgroundColor(label_color);
1116 1116
1117 } 1117 }
1118 1118
1119} 1119}
1120 1120
1121void FbWinFrame::setBorderWidth(unsigned int border_width) { 1121void FbWinFrame::setBorderWidth(unsigned int border_width) {