diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 93 |
1 files changed, 12 insertions, 81 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index bbf5a73..a2fd191 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.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: fluxbox.cc,v 1.85 2002/12/02 23:49:56 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.86 2002/12/03 23:58:06 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "fluxbox.hh" | 28 | #include "fluxbox.hh" |
@@ -566,12 +566,13 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
566 | 566 | ||
567 | return; | 567 | return; |
568 | } | 568 | } |
569 | 569 | // try FbTk::EventHandler first | |
570 | FbTk::EventManager::instance()->handleEvent(*e); | ||
571 | |||
570 | switch (e->type) { | 572 | switch (e->type) { |
571 | case ButtonRelease: | 573 | case ButtonRelease: |
572 | case ButtonPress: | 574 | case ButtonPress: |
573 | handleButtonEvent(e->xbutton); | 575 | handleButtonEvent(e->xbutton); |
574 | FbTk::EventManager::instance()->handleEvent(*e); | ||
575 | break; | 576 | break; |
576 | case ConfigureRequest: | 577 | case ConfigureRequest: |
577 | { | 578 | { |
@@ -726,17 +727,13 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
726 | last_time = e->xmotion.time; | 727 | last_time = e->xmotion.time; |
727 | 728 | ||
728 | FluxboxWindow *win = 0; | 729 | FluxboxWindow *win = 0; |
729 | Basemenu *menu = 0; | ||
730 | Tab *tab = 0; | 730 | Tab *tab = 0; |
731 | 731 | ||
732 | if ((win = searchWindow(e->xmotion.window)) !=0) | 732 | if ((win = searchWindow(e->xmotion.window)) !=0) |
733 | win->motionNotifyEvent(&e->xmotion); | 733 | win->motionNotifyEvent(&e->xmotion); |
734 | else if ((menu = searchMenu(e->xmotion.window)) !=0) | ||
735 | menu->motionNotifyEvent(&e->xmotion); | ||
736 | else if ((tab = searchTab(e->xmotion.window)) !=0) | 734 | else if ((tab = searchTab(e->xmotion.window)) !=0) |
737 | tab->motionNotifyEvent(&e->xmotion); | 735 | tab->motionNotifyEvent(&e->xmotion); |
738 | 736 | ||
739 | |||
740 | } | 737 | } |
741 | break; | 738 | break; |
742 | case PropertyNotify: { | 739 | case PropertyNotify: { |
@@ -755,13 +752,11 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
755 | case EnterNotify: { | 752 | case EnterNotify: { |
756 | last_time = e->xcrossing.time; | 753 | last_time = e->xcrossing.time; |
757 | 754 | ||
758 | BScreen *screen = (BScreen *) 0; | 755 | BScreen *screen = 0; |
759 | FluxboxWindow *win = (FluxboxWindow *) 0; | 756 | FluxboxWindow *win = 0; |
760 | Basemenu *menu = (Basemenu *) 0; | 757 | Tab *tab = 0; |
761 | |||
762 | Tab *tab = (Tab *) 0; | ||
763 | #ifdef SLIT | 758 | #ifdef SLIT |
764 | Slit *slit = (Slit *) 0; | 759 | Slit *slit = 0; |
765 | #endif // SLIT | 760 | #endif // SLIT |
766 | 761 | ||
767 | if (e->xcrossing.mode == NotifyGrab) | 762 | if (e->xcrossing.mode == NotifyGrab) |
@@ -789,11 +784,7 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
789 | 784 | ||
790 | ungrab(); | 785 | ungrab(); |
791 | } | 786 | } |
792 | } else if ((menu = searchMenu(e->xcrossing.window))) | 787 | } else if ((tab = searchTab(e->xcrossing.window))) { |
793 | menu->enterNotifyEvent(&e->xcrossing); | ||
794 | /* else if ((tbar = searchToolbar(e->xcrossing.window))) | ||
795 | tbar->enterNotifyEvent(&e->xcrossing); | ||
796 | */else if ((tab = searchTab(e->xcrossing.window))) { | ||
797 | win = tab->getWindow(); | 788 | win = tab->getWindow(); |
798 | if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && | 789 | if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && |
799 | (! no_focus)) { | 790 | (! no_focus)) { |
@@ -812,10 +803,6 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
812 | else if ((slit = searchSlit(e->xcrossing.window))) | 803 | else if ((slit = searchSlit(e->xcrossing.window))) |
813 | slit->enterNotifyEvent(&e->xcrossing); | 804 | slit->enterNotifyEvent(&e->xcrossing); |
814 | #endif // SLIT | 805 | #endif // SLIT |
815 | else { | ||
816 | FbTk::EventManager::instance()->handleEvent(*e); | ||
817 | } | ||
818 | |||
819 | 806 | ||
820 | } | 807 | } |
821 | break; | 808 | break; |
@@ -824,48 +811,32 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
824 | last_time = e->xcrossing.time; | 811 | last_time = e->xcrossing.time; |
825 | 812 | ||
826 | FluxboxWindow *win = (FluxboxWindow *) 0; | 813 | FluxboxWindow *win = (FluxboxWindow *) 0; |
827 | Basemenu *menu = (Basemenu *) 0; | ||
828 | 814 | ||
829 | #ifdef SLIT | 815 | #ifdef SLIT |
830 | Slit *slit = (Slit *) 0; | 816 | Slit *slit = (Slit *) 0; |
831 | #endif // SLIT | 817 | #endif // SLIT |
832 | 818 | if ((win = searchWindow(e->xcrossing.window))) | |
833 | if ((menu = searchMenu(e->xcrossing.window))) | 819 | win->installColormap(false); |
834 | menu->leaveNotifyEvent(&e->xcrossing); | ||
835 | else if ((win = searchWindow(e->xcrossing.window))) | ||
836 | win->installColormap(False); | ||
837 | /* else if ((tbar = searchToolbar(e->xcrossing.window))) | ||
838 | tbar->leaveNotifyEvent(&e->xcrossing); | ||
839 | */ | ||
840 | #ifdef SLIT | 820 | #ifdef SLIT |
841 | else if ((slit = searchSlit(e->xcrossing.window))) | 821 | else if ((slit = searchSlit(e->xcrossing.window))) |
842 | slit->leaveNotifyEvent(&e->xcrossing); | 822 | slit->leaveNotifyEvent(&e->xcrossing); |
843 | #endif // SLIT | 823 | #endif // SLIT |
844 | else { | ||
845 | FbTk::EventManager::instance()->handleEvent(*e); | ||
846 | } | ||
847 | 824 | ||
848 | } | 825 | } |
849 | break; | 826 | break; |
850 | case Expose: | 827 | case Expose: |
851 | { | 828 | { |
852 | FluxboxWindow *win = (FluxboxWindow *) 0; | 829 | FluxboxWindow *win = (FluxboxWindow *) 0; |
853 | Basemenu *menu = (Basemenu *) 0; | ||
854 | Tab *tab = 0; | 830 | Tab *tab = 0; |
855 | 831 | ||
856 | if ((win = searchWindow(e->xexpose.window))) | 832 | if ((win = searchWindow(e->xexpose.window))) |
857 | win->exposeEvent(&e->xexpose); | 833 | win->exposeEvent(&e->xexpose); |
858 | else if ((menu = searchMenu(e->xexpose.window))) | ||
859 | menu->exposeEvent(&e->xexpose); | ||
860 | else if ((tab = searchTab(e->xexpose.window))) | 834 | else if ((tab = searchTab(e->xexpose.window))) |
861 | tab->exposeEvent(&e->xexpose); | 835 | tab->exposeEvent(&e->xexpose); |
862 | else | ||
863 | FbTk::EventManager::instance()->handleEvent(*e); | ||
864 | } | 836 | } |
865 | break; | 837 | break; |
866 | case KeyPress: | 838 | case KeyPress: |
867 | handleKeyEvent(e->xkey); | 839 | handleKeyEvent(e->xkey); |
868 | FbTk::EventManager::instance()->handleEvent(*e); | ||
869 | break; | 840 | break; |
870 | case ColormapNotify: { | 841 | case ColormapNotify: { |
871 | BScreen *screen = searchScreen(e->xcolormap.window); | 842 | BScreen *screen = searchScreen(e->xcolormap.window); |
@@ -903,7 +874,6 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
903 | win->shapeEvent(shape_event); | 874 | win->shapeEvent(shape_event); |
904 | } | 875 | } |
905 | #endif // SHAPE | 876 | #endif // SHAPE |
906 | FbTk::EventManager::instance()->handleEvent(*e); | ||
907 | } | 877 | } |
908 | } | 878 | } |
909 | } | 879 | } |
@@ -915,7 +885,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
915 | last_time = be.time; | 885 | last_time = be.time; |
916 | 886 | ||
917 | FluxboxWindow *win = 0; | 887 | FluxboxWindow *win = 0; |
918 | Basemenu *menu = 0; | ||
919 | Tab *tab = 0; | 888 | Tab *tab = 0; |
920 | #ifdef SLIT | 889 | #ifdef SLIT |
921 | Slit *slit = (Slit *) 0; | 890 | Slit *slit = (Slit *) 0; |
@@ -927,9 +896,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
927 | 896 | ||
928 | if (be.button == 1) | 897 | if (be.button == 1) |
929 | win->installColormap(True); | 898 | win->installColormap(True); |
930 | |||
931 | } else if ((menu = searchMenu(be.window))) { | ||
932 | menu->buttonPressEvent(&be); | ||
933 | } | 899 | } |
934 | #ifdef SLIT | 900 | #ifdef SLIT |
935 | else if ((slit = searchSlit(be.window))) { | 901 | else if ((slit = searchSlit(be.window))) { |
@@ -1029,13 +995,10 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
1029 | { | 995 | { |
1030 | last_time = be.time; | 996 | last_time = be.time; |
1031 | FluxboxWindow *win = (FluxboxWindow *) 0; | 997 | FluxboxWindow *win = (FluxboxWindow *) 0; |
1032 | Basemenu *menu = (Basemenu *) 0; | ||
1033 | Tab *tab = 0; | 998 | Tab *tab = 0; |
1034 | 999 | ||
1035 | if ((win = searchWindow(be.window))) | 1000 | if ((win = searchWindow(be.window))) |
1036 | win->buttonReleaseEvent(&be); | 1001 | win->buttonReleaseEvent(&be); |
1037 | else if ((menu = searchMenu(be.window))) | ||
1038 | menu->buttonReleaseEvent(&be); | ||
1039 | else if ((tab = searchTab(be.window))) | 1002 | else if ((tab = searchTab(be.window))) |
1040 | tab->buttonReleaseEvent(&be); | 1003 | tab->buttonReleaseEvent(&be); |
1041 | } | 1004 | } |
@@ -1716,18 +1679,6 @@ FluxboxWindow *Fluxbox::searchGroup(Window window, FluxboxWindow *win) { | |||
1716 | return it == groupSearch.end() ? 0 : it->second; | 1679 | return it == groupSearch.end() ? 0 : it->second; |
1717 | } | 1680 | } |
1718 | 1681 | ||
1719 | |||
1720 | Basemenu *Fluxbox::searchMenu(Window window) { | ||
1721 | std::map<Window, Basemenu *>::iterator it = menuSearch.find(window); | ||
1722 | return it == menuSearch.end() ? 0 : it->second; | ||
1723 | } | ||
1724 | |||
1725 | |||
1726 | Toolbar *Fluxbox::searchToolbar(Window window) { | ||
1727 | std::map<Window, Toolbar *>::iterator it = toolbarSearch.find(window); | ||
1728 | return it == toolbarSearch.end() ? 0 : it->second; | ||
1729 | } | ||
1730 | |||
1731 | Tab *Fluxbox::searchTab(Window window) { | 1682 | Tab *Fluxbox::searchTab(Window window) { |
1732 | std::map<Window, Tab *>::iterator it = tabSearch.find(window); | 1683 | std::map<Window, Tab *>::iterator it = tabSearch.find(window); |
1733 | return it == tabSearch.end() ? 0 : it->second; | 1684 | return it == tabSearch.end() ? 0 : it->second; |
@@ -1751,17 +1702,6 @@ void Fluxbox::saveGroupSearch(Window window, FluxboxWindow *data) { | |||
1751 | groupSearch[window] = data; | 1702 | groupSearch[window] = data; |
1752 | } | 1703 | } |
1753 | 1704 | ||
1754 | |||
1755 | void Fluxbox::saveMenuSearch(Window window, Basemenu *data) { | ||
1756 | menuSearch[window] = data; | ||
1757 | } | ||
1758 | |||
1759 | |||
1760 | void Fluxbox::saveToolbarSearch(Window window, Toolbar *data) { | ||
1761 | toolbarSearch[window] = data; | ||
1762 | } | ||
1763 | |||
1764 | |||
1765 | void Fluxbox::saveTabSearch(Window window, Tab *data) { | 1705 | void Fluxbox::saveTabSearch(Window window, Tab *data) { |
1766 | tabSearch[window] = data; | 1706 | tabSearch[window] = data; |
1767 | } | 1707 | } |
@@ -1782,15 +1722,6 @@ void Fluxbox::removeGroupSearch(Window window) { | |||
1782 | groupSearch.erase(window); | 1722 | groupSearch.erase(window); |
1783 | } | 1723 | } |
1784 | 1724 | ||
1785 | void Fluxbox::removeMenuSearch(Window window) { | ||
1786 | menuSearch.erase(window); | ||
1787 | } | ||
1788 | |||
1789 | void Fluxbox::removeToolbarSearch(Window window) { | ||
1790 | toolbarSearch.erase(window); | ||
1791 | } | ||
1792 | |||
1793 | |||
1794 | void Fluxbox::removeTabSearch(Window window) { | 1725 | void Fluxbox::removeTabSearch(Window window) { |
1795 | tabSearch.erase(window); | 1726 | tabSearch.erase(window); |
1796 | } | 1727 | } |