diff options
-rw-r--r-- | src/fluxbox.cc | 346 |
1 files changed, 112 insertions, 234 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 27ee143..d0a1b69 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.90 2003/01/10 00:44:17 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.91 2003/01/12 18:11:12 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "fluxbox.hh" | 28 | #include "fluxbox.hh" |
@@ -366,14 +366,6 @@ Fluxbox::Fluxbox(int m_argc, char **m_argv, const char *dpy_name, const char *rc | |||
366 | 366 | ||
367 | masked = None; | 367 | masked = None; |
368 | 368 | ||
369 | #ifdef SLIT | ||
370 | #ifdef KDE | ||
371 | //For KDE dock applets | ||
372 | kwm1_dockwindow = XInternAtom(getXDisplay(), "KWM_DOCKWINDOW", False); //KDE v1.x | ||
373 | kwm2_dockwindow = XInternAtom(getXDisplay(), "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False); //KDE v2.x | ||
374 | #endif //KDE | ||
375 | |||
376 | #endif // SLIT | ||
377 | 369 | ||
378 | #ifdef HAVE_GETPID | 370 | #ifdef HAVE_GETPID |
379 | fluxbox_pid = XInternAtom(getXDisplay(), "_BLACKBOX_PID", False); | 371 | fluxbox_pid = XInternAtom(getXDisplay(), "_BLACKBOX_PID", False); |
@@ -576,19 +568,10 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
576 | { | 568 | { |
577 | FluxboxWindow *win = (FluxboxWindow *) 0; | 569 | FluxboxWindow *win = (FluxboxWindow *) 0; |
578 | 570 | ||
579 | #ifdef SLIT | ||
580 | Slit *slit = (Slit *) 0; | ||
581 | #endif // SLIT | ||
582 | |||
583 | if ((win = searchWindow(e->xconfigurerequest.window))) { | 571 | if ((win = searchWindow(e->xconfigurerequest.window))) { |
584 | win->configureRequestEvent(e->xconfigurerequest); | 572 | win->configureRequestEvent(e->xconfigurerequest); |
585 | 573 | ||
586 | #ifdef SLIT | 574 | } else { |
587 | } else if ((slit = searchSlit(e->xconfigurerequest.window))) { | ||
588 | slit->configureRequestEvent(&e->xconfigurerequest); | ||
589 | #endif // SLIT | ||
590 | |||
591 | } else { | ||
592 | grab(); | 575 | grab(); |
593 | 576 | ||
594 | if (validateWindow(e->xconfigurerequest.window)) { | 577 | if (validateWindow(e->xconfigurerequest.window)) { |
@@ -615,50 +598,7 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
615 | #ifdef DEBUG | 598 | #ifdef DEBUG |
616 | cerr<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl; | 599 | cerr<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl; |
617 | #endif // DEBUG | 600 | #endif // DEBUG |
618 | |||
619 | #ifdef SLIT | ||
620 | #ifdef KDE | ||
621 | //Check and see if client is KDE dock applet. | ||
622 | //If so add to Slit | ||
623 | bool iskdedockapp = false; | ||
624 | Atom ajunk; | ||
625 | int ijunk; | ||
626 | unsigned long *data = (unsigned long *) 0, uljunk; | ||
627 | |||
628 | // Check if KDE v2.x dock applet | ||
629 | if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window, | ||
630 | getKWM2DockwindowAtom(), 0l, 1l, False, | ||
631 | XA_WINDOW, &ajunk, &ijunk, &uljunk, | ||
632 | &uljunk, (unsigned char **) &data) == Success) { | ||
633 | |||
634 | if (data) | ||
635 | iskdedockapp = True; | ||
636 | XFree((char *) data); | ||
637 | |||
638 | } | ||
639 | |||
640 | // Check if KDE v1.x dock applet | ||
641 | if (!iskdedockapp) { | ||
642 | if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window, | ||
643 | getKWM1DockwindowAtom(), 0l, 1l, False, | ||
644 | getKWM1DockwindowAtom(), &ajunk, &ijunk, &uljunk, | ||
645 | &uljunk, (unsigned char **) &data) == Success) { | ||
646 | iskdedockapp = (data && data[0] != 0); | ||
647 | XFree((char *) data); | ||
648 | } | ||
649 | } | ||
650 | 601 | ||
651 | if (iskdedockapp) { | ||
652 | XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask); | ||
653 | ScreenList::iterator it = screenList.begin(); | ||
654 | for (; (*it) == screenList.back(); ++it) { | ||
655 | (*it)->getSlit()->addClient(e->xmaprequest.window); | ||
656 | } | ||
657 | return; | ||
658 | } | ||
659 | #endif //KDE | ||
660 | #endif // SLIT | ||
661 | |||
662 | FluxboxWindow *win = searchWindow(e->xmaprequest.window); | 602 | FluxboxWindow *win = searchWindow(e->xmaprequest.window); |
663 | 603 | ||
664 | if (! win) { | 604 | if (! win) { |
@@ -692,23 +632,13 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
692 | case CreateNotify: | 632 | case CreateNotify: |
693 | break; | 633 | break; |
694 | case DestroyNotify: { | 634 | case DestroyNotify: { |
695 | FluxboxWindow *win = (FluxboxWindow *) 0; | 635 | FluxboxWindow *win = 0; |
696 | |||
697 | #ifdef SLIT | ||
698 | Slit *slit = 0; | ||
699 | #endif // SLIT | ||
700 | 636 | ||
701 | if ((win = searchWindow(e->xdestroywindow.window)) && win->getClientWindow() == e->xdestroywindow.window) { | 637 | if ((win = searchWindow(e->xdestroywindow.window)) && win->getClientWindow() == e->xdestroywindow.window) { |
702 | win->destroyNotifyEvent(e->xdestroywindow); | 638 | win->destroyNotifyEvent(e->xdestroywindow); |
703 | removeWindowSearch(win->getClientWindow()); | 639 | removeWindowSearch(win->getClientWindow()); |
704 | delete win; | 640 | delete win; |
705 | } | 641 | } |
706 | #ifdef SLIT | ||
707 | else if ((slit = searchSlit(e->xdestroywindow.window))) { | ||
708 | slit->removeClient(e->xdestroywindow.window, false); | ||
709 | |||
710 | } | ||
711 | #endif // SLIT | ||
712 | 642 | ||
713 | } | 643 | } |
714 | break; | 644 | break; |
@@ -744,9 +674,6 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
744 | BScreen *screen = 0; | 674 | BScreen *screen = 0; |
745 | FluxboxWindow *win = 0; | 675 | FluxboxWindow *win = 0; |
746 | Tab *tab = 0; | 676 | Tab *tab = 0; |
747 | #ifdef SLIT | ||
748 | Slit *slit = 0; | ||
749 | #endif // SLIT | ||
750 | 677 | ||
751 | if (e->xcrossing.mode == NotifyGrab) | 678 | if (e->xcrossing.mode == NotifyGrab) |
752 | break; | 679 | break; |
@@ -788,10 +715,6 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
788 | ungrab(); | 715 | ungrab(); |
789 | } | 716 | } |
790 | } | 717 | } |
791 | #ifdef SLIT | ||
792 | else if ((slit = searchSlit(e->xcrossing.window))) | ||
793 | slit->enterNotifyEvent(&e->xcrossing); | ||
794 | #endif // SLIT | ||
795 | 718 | ||
796 | } | 719 | } |
797 | break; | 720 | break; |
@@ -801,15 +724,8 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
801 | 724 | ||
802 | FluxboxWindow *win = (FluxboxWindow *) 0; | 725 | FluxboxWindow *win = (FluxboxWindow *) 0; |
803 | 726 | ||
804 | #ifdef SLIT | ||
805 | Slit *slit = (Slit *) 0; | ||
806 | #endif // SLIT | ||
807 | if ((win = searchWindow(e->xcrossing.window))) | 727 | if ((win = searchWindow(e->xcrossing.window))) |
808 | win->installColormap(false); | 728 | win->installColormap(false); |
809 | #ifdef SLIT | ||
810 | else if ((slit = searchSlit(e->xcrossing.window))) | ||
811 | slit->leaveNotifyEvent(&e->xcrossing); | ||
812 | #endif // SLIT | ||
813 | 729 | ||
814 | } | 730 | } |
815 | break; | 731 | break; |
@@ -875,9 +791,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
875 | 791 | ||
876 | FluxboxWindow *win = 0; | 792 | FluxboxWindow *win = 0; |
877 | Tab *tab = 0; | 793 | Tab *tab = 0; |
878 | #ifdef SLIT | ||
879 | Slit *slit = (Slit *) 0; | ||
880 | #endif // SLIT | ||
881 | 794 | ||
882 | if ((win = searchWindow(be.window))) { | 795 | if ((win = searchWindow(be.window))) { |
883 | 796 | ||
@@ -886,11 +799,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
886 | if (be.button == 1) | 799 | if (be.button == 1) |
887 | win->installColormap(True); | 800 | win->installColormap(True); |
888 | } | 801 | } |
889 | #ifdef SLIT | ||
890 | else if ((slit = searchSlit(be.window))) { | ||
891 | slit->buttonPressEvent(&be); | ||
892 | } | ||
893 | #endif // SLIT | ||
894 | else if ((tab = searchTab(be.window))) { | 802 | else if ((tab = searchTab(be.window))) { |
895 | tab->buttonPressEvent(&be); | 803 | tab->buttonPressEvent(&be); |
896 | } else { | 804 | } else { |
@@ -1002,9 +910,6 @@ void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) { | |||
1002 | 910 | ||
1003 | FluxboxWindow *win = 0; | 911 | FluxboxWindow *win = 0; |
1004 | 912 | ||
1005 | #ifdef SLIT | ||
1006 | Slit *slit = (Slit *) 0; | ||
1007 | #endif // SLIT | ||
1008 | BScreen *screen = searchScreen(ue.event); | 913 | BScreen *screen = searchScreen(ue.event); |
1009 | 914 | ||
1010 | if ( (ue.event != ue.window) && (screen != 0 || !ue.send_event)) | 915 | if ( (ue.event != ue.window) && (screen != 0 || !ue.send_event)) |
@@ -1022,11 +927,6 @@ void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) { | |||
1022 | } | 927 | } |
1023 | 928 | ||
1024 | } | 929 | } |
1025 | #ifdef SLIT | ||
1026 | else if ((slit = searchSlit(ue.window))!=0) { | ||
1027 | slit->removeClient(ue.window); | ||
1028 | } | ||
1029 | #endif // SLIT | ||
1030 | 930 | ||
1031 | } | 931 | } |
1032 | 932 | ||
@@ -1658,15 +1558,6 @@ Tab *Fluxbox::searchTab(Window window) { | |||
1658 | return it == tabSearch.end() ? 0 : it->second; | 1558 | return it == tabSearch.end() ? 0 : it->second; |
1659 | } | 1559 | } |
1660 | 1560 | ||
1661 | |||
1662 | #ifdef SLIT | ||
1663 | Slit *Fluxbox::searchSlit(Window window) { | ||
1664 | std::map<Window, Slit *>::iterator it = slitSearch.find(window); | ||
1665 | return it == slitSearch.end() ? 0 : it->second; | ||
1666 | } | ||
1667 | #endif // SLIT | ||
1668 | |||
1669 | |||
1670 | void Fluxbox::saveWindowSearch(Window window, FluxboxWindow *data) { | 1561 | void Fluxbox::saveWindowSearch(Window window, FluxboxWindow *data) { |
1671 | windowSearch[window] = data; | 1562 | windowSearch[window] = data; |
1672 | } | 1563 | } |
@@ -1680,13 +1571,6 @@ void Fluxbox::saveTabSearch(Window window, Tab *data) { | |||
1680 | tabSearch[window] = data; | 1571 | tabSearch[window] = data; |
1681 | } | 1572 | } |
1682 | 1573 | ||
1683 | #ifdef SLIT | ||
1684 | void Fluxbox::saveSlitSearch(Window window, Slit *data) { | ||
1685 | slitSearch[window] = data; | ||
1686 | } | ||
1687 | #endif // SLIT | ||
1688 | |||
1689 | |||
1690 | void Fluxbox::removeWindowSearch(Window window) { | 1574 | void Fluxbox::removeWindowSearch(Window window) { |
1691 | windowSearch.erase(window); | 1575 | windowSearch.erase(window); |
1692 | } | 1576 | } |
@@ -1700,13 +1584,6 @@ void Fluxbox::removeTabSearch(Window window) { | |||
1700 | tabSearch.erase(window); | 1584 | tabSearch.erase(window); |
1701 | } | 1585 | } |
1702 | 1586 | ||
1703 | #ifdef SLIT | ||
1704 | void Fluxbox::removeSlitSearch(Window window) { | ||
1705 | slitSearch.erase(window); | ||
1706 | } | ||
1707 | #endif // SLIT | ||
1708 | |||
1709 | |||
1710 | void Fluxbox::restart(const char *prog) { | 1587 | void Fluxbox::restart(const char *prog) { |
1711 | shutdown(); | 1588 | shutdown(); |
1712 | 1589 | ||
@@ -1773,46 +1650,46 @@ void Fluxbox::save_rc() { | |||
1773 | for (; it != it_end; ++it) { | 1650 | for (; it != it_end; ++it) { |
1774 | BScreen *screen = *it; | 1651 | BScreen *screen = *it; |
1775 | int screen_number = screen->getScreenNumber(); | 1652 | int screen_number = screen->getScreenNumber(); |
1653 | /* | ||
1654 | #ifdef SLIT | ||
1655 | string slit_placement; | ||
1656 | |||
1657 | switch (screen->getSlitPlacement()) { | ||
1658 | case Slit::TOPLEFT: slit_placement = "TopLeft"; break; | ||
1659 | case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break; | ||
1660 | case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break; | ||
1661 | case Slit::TOPCENTER: slit_placement = "TopCenter"; break; | ||
1662 | case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break; | ||
1663 | case Slit::TOPRIGHT: slit_placement = "TopRight"; break; | ||
1664 | case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break; | ||
1665 | case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break; | ||
1666 | } | ||
1776 | 1667 | ||
1777 | #ifdef SLIT | 1668 | sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number, |
1778 | string slit_placement; | 1669 | slit_placement.c_str()); |
1779 | 1670 | XrmPutLineResource(&new_blackboxrc, rc_string); | |
1780 | switch (screen->getSlitPlacement()) { | ||
1781 | case Slit::TOPLEFT: slit_placement = "TopLeft"; break; | ||
1782 | case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break; | ||
1783 | case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break; | ||
1784 | case Slit::TOPCENTER: slit_placement = "TopCenter"; break; | ||
1785 | case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break; | ||
1786 | case Slit::TOPRIGHT: slit_placement = "TopRight"; break; | ||
1787 | case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break; | ||
1788 | case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break; | ||
1789 | } | ||
1790 | |||
1791 | sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number, | ||
1792 | slit_placement.c_str()); | ||
1793 | XrmPutLineResource(&new_blackboxrc, rc_string); | ||
1794 | |||
1795 | sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number, | ||
1796 | ((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" : | ||
1797 | "Vertical")); | ||
1798 | XrmPutLineResource(&new_blackboxrc, rc_string); | ||
1799 | 1671 | ||
1800 | sprintf(rc_string, "session.screen%d.slit.onTop: %s", screen_number, | 1672 | sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number, |
1801 | ((screen->getSlit()->isOnTop()) ? "True" : "False")); | 1673 | ((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" : |
1802 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1674 | "Vertical")); |
1675 | XrmPutLineResource(&new_blackboxrc, rc_string); | ||
1803 | 1676 | ||
1804 | sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number, | 1677 | sprintf(rc_string, "session.screen%d.slit.onTop: %s", screen_number, |
1805 | ((screen->getSlit()->doAutoHide()) ? "True" : "False")); | 1678 | ((screen->getSlit()->isOnTop()) ? "True" : "False")); |
1806 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1679 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1807 | 1680 | ||
1808 | #ifdef XINERAMA | 1681 | sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number, |
1809 | sprintf(rc_string, "session.screen%d.slit.onHead: %d", screen_number, | 1682 | ((screen->getSlit()->doAutoHide()) ? "True" : "False")); |
1810 | screen->getSlitOnHead()); | 1683 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1811 | XrmPutLineResource(&new_blackboxrc, rc_string); | ||
1812 | #endif // XINERAMA | ||
1813 | 1684 | ||
1814 | #endif // SLIT | 1685 | #ifdef XINERAMA |
1686 | sprintf(rc_string, "session.screen%d.slit.onHead: %d", screen_number, | ||
1687 | screen->getSlitOnHead()); | ||
1688 | XrmPutLineResource(&new_blackboxrc, rc_string); | ||
1689 | #endif // XINERAMA | ||
1815 | 1690 | ||
1691 | #endif // SLIT | ||
1692 | */ | ||
1816 | sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, | 1693 | sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, |
1817 | ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ? | 1694 | ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ? |
1818 | "LeftToRight" : "RightToLeft")); | 1695 | "LeftToRight" : "RightToLeft")); |
@@ -1860,7 +1737,7 @@ void Fluxbox::save_rc() { | |||
1860 | focus_mode.c_str()); | 1737 | focus_mode.c_str()); |
1861 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1738 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1862 | 1739 | ||
1863 | // load_rc(screen); | 1740 | // load_rc(screen); |
1864 | // these are static, but may not be saved in the users resource file, | 1741 | // these are static, but may not be saved in the users resource file, |
1865 | // writing these resources will allow the user to edit them at a later | 1742 | // writing these resources will allow the user to edit them at a later |
1866 | // time... but loading the defaults before saving allows us to rewrite the | 1743 | // time... but loading the defaults before saving allows us to rewrite the |
@@ -1933,6 +1810,7 @@ void Fluxbox::load_rc() { | |||
1933 | //get resource filename | 1810 | //get resource filename |
1934 | string dbfile(getRcFilename()); | 1811 | string dbfile(getRcFilename()); |
1935 | 1812 | ||
1813 | |||
1936 | if (dbfile.size() != 0) { | 1814 | if (dbfile.size() != 0) { |
1937 | if (!m_resourcemanager.load(dbfile.c_str())) { | 1815 | if (!m_resourcemanager.load(dbfile.c_str())) { |
1938 | cerr<<"Faild to load database:"<<dbfile<<endl; | 1816 | cerr<<"Faild to load database:"<<dbfile<<endl; |
@@ -2132,79 +2010,79 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
2132 | screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT); | 2010 | screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT); |
2133 | } else | 2011 | } else |
2134 | screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); | 2012 | screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); |
2135 | 2013 | /* | |
2136 | #ifdef SLIT | 2014 | #ifdef SLIT |
2137 | sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); | 2015 | sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); |
2138 | sprintf(class_lookup, "Session.Screen%d.Slit.Placement", screen_number); | 2016 | sprintf(class_lookup, "Session.Screen%d.Slit.Placement", screen_number); |
2139 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, | 2017 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, |
2140 | &value)) { | 2018 | &value)) { |
2141 | if (! strncasecmp(value.addr, "TopLeft", value.size)) | 2019 | if (! strncasecmp(value.addr, "TopLeft", value.size)) |
2142 | screen->saveSlitPlacement(Slit::TOPLEFT); | 2020 | screen->saveSlitPlacement(Slit::TOPLEFT); |
2143 | else if (! strncasecmp(value.addr, "CenterLeft", value.size)) | 2021 | else if (! strncasecmp(value.addr, "CenterLeft", value.size)) |
2144 | screen->saveSlitPlacement(Slit::CENTERLEFT); | 2022 | screen->saveSlitPlacement(Slit::CENTERLEFT); |
2145 | else if (! strncasecmp(value.addr, "BottomLeft", value.size)) | 2023 | else if (! strncasecmp(value.addr, "BottomLeft", value.size)) |
2146 | screen->saveSlitPlacement(Slit::BOTTOMLEFT); | 2024 | screen->saveSlitPlacement(Slit::BOTTOMLEFT); |
2147 | else if (! strncasecmp(value.addr, "TopCenter", value.size)) | 2025 | else if (! strncasecmp(value.addr, "TopCenter", value.size)) |
2148 | screen->saveSlitPlacement(Slit::TOPCENTER); | 2026 | screen->saveSlitPlacement(Slit::TOPCENTER); |
2149 | else if (! strncasecmp(value.addr, "BottomCenter", value.size)) | 2027 | else if (! strncasecmp(value.addr, "BottomCenter", value.size)) |
2150 | screen->saveSlitPlacement(Slit::BOTTOMCENTER); | 2028 | screen->saveSlitPlacement(Slit::BOTTOMCENTER); |
2151 | else if (! strncasecmp(value.addr, "TopRight", value.size)) | 2029 | else if (! strncasecmp(value.addr, "TopRight", value.size)) |
2152 | screen->saveSlitPlacement(Slit::TOPRIGHT); | 2030 | screen->saveSlitPlacement(Slit::TOPRIGHT); |
2153 | else if (! strncasecmp(value.addr, "BottomRight", value.size)) | 2031 | else if (! strncasecmp(value.addr, "BottomRight", value.size)) |
2154 | screen->saveSlitPlacement(Slit::BOTTOMRIGHT); | 2032 | screen->saveSlitPlacement(Slit::BOTTOMRIGHT); |
2155 | else | 2033 | else |
2156 | screen->saveSlitPlacement(Slit::CENTERRIGHT); | 2034 | screen->saveSlitPlacement(Slit::CENTERRIGHT); |
2157 | } else | 2035 | } else |
2158 | screen->saveSlitPlacement(Slit::CENTERRIGHT); | 2036 | screen->saveSlitPlacement(Slit::CENTERRIGHT); |
2159 | 2037 | ||
2160 | sprintf(name_lookup, "session.screen%d.slit.direction", screen_number); | 2038 | sprintf(name_lookup, "session.screen%d.slit.direction", screen_number); |
2161 | sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number); | 2039 | sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number); |
2162 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, | 2040 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, |
2163 | &value)) { | 2041 | &value)) { |
2164 | if (! strncasecmp(value.addr, "Horizontal", value.size)) | 2042 | if (! strncasecmp(value.addr, "Horizontal", value.size)) |
2165 | screen->saveSlitDirection(Slit::HORIZONTAL); | 2043 | screen->saveSlitDirection(Slit::HORIZONTAL); |
2166 | else | 2044 | else |
2167 | screen->saveSlitDirection(Slit::VERTICAL); | 2045 | screen->saveSlitDirection(Slit::VERTICAL); |
2168 | } else | 2046 | } else |
2169 | screen->saveSlitDirection(Slit::VERTICAL); | 2047 | screen->saveSlitDirection(Slit::VERTICAL); |
2170 | 2048 | ||
2171 | sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number); | 2049 | sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number); |
2172 | sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number); | 2050 | sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number); |
2173 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, | 2051 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, |
2174 | &value)) { | 2052 | &value)) { |
2175 | if (! strncasecmp(value.addr, "True", value.size)) | 2053 | if (! strncasecmp(value.addr, "True", value.size)) |
2176 | screen->saveSlitOnTop(True); | 2054 | screen->saveSlitOnTop(True); |
2177 | else | 2055 | else |
2178 | screen->saveSlitOnTop(False); | 2056 | screen->saveSlitOnTop(False); |
2179 | } else | 2057 | } else |
2180 | screen->saveSlitOnTop(False); | 2058 | screen->saveSlitOnTop(False); |
2181 | 2059 | ||
2182 | sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number); | 2060 | sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number); |
2183 | sprintf(class_lookup, "Session.Screen%d.Slit.AutoHide", screen_number); | 2061 | sprintf(class_lookup, "Session.Screen%d.Slit.AutoHide", screen_number); |
2184 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, | 2062 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, |
2185 | &value)) { | 2063 | &value)) { |
2186 | if (! strncasecmp(value.addr, "True", value.size)) | 2064 | if (! strncasecmp(value.addr, "True", value.size)) |
2187 | screen->saveSlitAutoHide(True); | 2065 | screen->saveSlitAutoHide(True); |
2188 | else | 2066 | else |
2189 | screen->saveSlitAutoHide(False); | 2067 | screen->saveSlitAutoHide(False); |
2190 | } else | 2068 | } else |
2191 | screen->saveSlitAutoHide(False); | 2069 | screen->saveSlitAutoHide(False); |
2192 | 2070 | ||
2193 | #ifdef XINERAMA | 2071 | #ifdef XINERAMA |
2194 | int tmp_head; | 2072 | int tmp_head; |
2195 | sprintf(name_lookup, "session.screen%d.slit.onHead", screen_number); | 2073 | sprintf(name_lookup, "session.screen%d.slit.onHead", screen_number); |
2196 | sprintf(class_lookup, "Session.Screen%d.Slit.OnHead", screen_number); | 2074 | sprintf(class_lookup, "Session.Screen%d.Slit.OnHead", screen_number); |
2197 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, | 2075 | if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, |
2198 | &value)) { | 2076 | &value)) { |
2199 | if (sscanf(value.addr, "%d", &tmp_head) != 1) | 2077 | if (sscanf(value.addr, "%d", &tmp_head) != 1) |
2200 | tmp_head = 0; | 2078 | tmp_head = 0; |
2201 | } else | 2079 | } else |
2202 | tmp_head = 0; | 2080 | tmp_head = 0; |
2203 | screen->saveSlitOnHead(tmp_head); | 2081 | screen->saveSlitOnHead(tmp_head); |
2204 | #endif // XINERAMA | 2082 | #endif // XINERAMA |
2205 | 2083 | ||
2206 | #endif // SLIT | 2084 | #endif // SLIT |
2207 | 2085 | */ | |
2208 | #ifdef HAVE_STRFTIME | 2086 | #ifdef HAVE_STRFTIME |
2209 | sprintf(name_lookup, "session.screen%d.strftimeFormat", screen_number); | 2087 | sprintf(name_lookup, "session.screen%d.strftimeFormat", screen_number); |
2210 | sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number); | 2088 | sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number); |