diff options
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 2c7bde2..61402f1 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -35,10 +35,6 @@ | |||
35 | #include "Screen.hh" | 35 | #include "Screen.hh" |
36 | #include "WindowCmd.hh" | 36 | #include "WindowCmd.hh" |
37 | 37 | ||
38 | #ifdef XINERAMA | ||
39 | #include "Xinerama.hh" | ||
40 | #endif // XINERAMA | ||
41 | |||
42 | #include "Strut.hh" | 38 | #include "Strut.hh" |
43 | #include "FbTk/CommandParser.hh" | 39 | #include "FbTk/CommandParser.hh" |
44 | #include "Layer.hh" | 40 | #include "Layer.hh" |
@@ -216,6 +212,9 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): | |||
216 | m_toolbarmenu(scrn.menuTheme(), | 212 | m_toolbarmenu(scrn.menuTheme(), |
217 | scrn.imageControl(), | 213 | scrn.imageControl(), |
218 | *scrn.layerManager().getLayer(Layer::MENU)), | 214 | *scrn.layerManager().getLayer(Layer::MENU)), |
215 | #ifdef XINERAMA | ||
216 | m_xineramaheadmenu(0), | ||
217 | #endif // XINERAMA | ||
219 | m_theme(scrn.screenNumber()), | 218 | m_theme(scrn.screenNumber()), |
220 | m_tool_factory(scrn), | 219 | m_tool_factory(scrn), |
221 | m_strut(0), | 220 | m_strut(0), |
@@ -521,14 +520,9 @@ void Toolbar::reconfigure() { | |||
521 | 520 | ||
522 | 521 | ||
523 | void Toolbar::buttonPressEvent(XButtonEvent &be) { | 522 | void Toolbar::buttonPressEvent(XButtonEvent &be) { |
524 | WinClient *old = WindowCmd<void>::client(); | ||
525 | WindowCmd<void>::setWindow(0); | ||
526 | if (Fluxbox::instance()->keys()->doAction(be.type, be.state, be.button, | 523 | if (Fluxbox::instance()->keys()->doAction(be.type, be.state, be.button, |
527 | Keys::ON_TOOLBAR, be.time)) { | 524 | Keys::ON_TOOLBAR, 0, be.time)) |
528 | WindowCmd<void>::setClient(old); | ||
529 | return; | 525 | return; |
530 | } | ||
531 | WindowCmd<void>::setClient(old); | ||
532 | 526 | ||
533 | if (be.button == 1) | 527 | if (be.button == 1) |
534 | raise(); | 528 | raise(); |
@@ -554,11 +548,8 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) { | |||
554 | } | 548 | } |
555 | 549 | ||
556 | void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { | 550 | void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { |
557 | WinClient *old = WindowCmd<void>::client(); | ||
558 | WindowCmd<void>::setWindow(0); | ||
559 | Fluxbox::instance()->keys()->doAction(ce.type, ce.state, 0, | 551 | Fluxbox::instance()->keys()->doAction(ce.type, ce.state, 0, |
560 | Keys::ON_TOOLBAR); | 552 | Keys::ON_TOOLBAR); |
561 | WindowCmd<void>::setClient(old); | ||
562 | 553 | ||
563 | if (! doAutoHide()) { | 554 | if (! doAutoHide()) { |
564 | if (isHidden()) | 555 | if (isHidden()) |
@@ -581,11 +572,8 @@ void Toolbar::leaveNotifyEvent(XCrossingEvent &event) { | |||
581 | event.y_root > y() && event.y_root <= (int)(y() + height())) | 572 | event.y_root > y() && event.y_root <= (int)(y() + height())) |
582 | return; | 573 | return; |
583 | 574 | ||
584 | WinClient *old = WindowCmd<void>::client(); | ||
585 | WindowCmd<void>::setWindow(0); | ||
586 | Fluxbox::instance()->keys()->doAction(event.type, event.state, 0, | 575 | Fluxbox::instance()->keys()->doAction(event.type, event.state, 0, |
587 | Keys::ON_TOOLBAR); | 576 | Keys::ON_TOOLBAR); |
588 | WindowCmd<void>::setClient(old); | ||
589 | 577 | ||
590 | if (! doAutoHide()) | 578 | if (! doAutoHide()) |
591 | return; | 579 | return; |
@@ -629,6 +617,10 @@ void Toolbar::update(FbTk::Subject *subj) { | |||
629 | else | 617 | else |
630 | reconfigure(); | 618 | reconfigure(); |
631 | 619 | ||
620 | #ifdef XINERAMA | ||
621 | if (subj == &m_screen.resizeSig() && m_xineramaheadmenu) | ||
622 | m_xineramaheadmenu->reloadHeads(); | ||
623 | #endif // XINERAMA | ||
632 | } | 624 | } |
633 | 625 | ||
634 | void Toolbar::setPlacement(Toolbar::Placement where) { | 626 | void Toolbar::setPlacement(Toolbar::Placement where) { |
@@ -872,6 +864,7 @@ void Toolbar::setupMenus(bool skip_new_placement) { | |||
872 | #ifdef XINERAMA | 864 | #ifdef XINERAMA |
873 | if (screen().hasXinerama()) { | 865 | if (screen().hasXinerama()) { |
874 | menu().insert(_FB_XTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), | 866 | menu().insert(_FB_XTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), |
867 | m_xineramaheadmenu = | ||
875 | new XineramaHeadMenu<Toolbar>(screen().menuTheme(), | 868 | new XineramaHeadMenu<Toolbar>(screen().menuTheme(), |
876 | screen(), | 869 | screen(), |
877 | screen().imageControl(), | 870 | screen().imageControl(), |