aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-19 00:35:08 (GMT)
committerfluxgen <fluxgen>2003-12-19 00:35:08 (GMT)
commit8002a73374e16f2878e4b2d366768f4cadd89ebd (patch)
tree039ba2b502357c2c34660931123ac26f313ce2a1 /src/fluxbox.cc
parent448d9fa7220291df30366b7e1f10e65cbc8a273e (diff)
downloadfluxbox-8002a73374e16f2878e4b2d366768f4cadd89ebd.zip
fluxbox-8002a73374e16f2878e4b2d366768f4cadd89ebd.tar.bz2
cleaning
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc206
1 files changed, 50 insertions, 156 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 26bf782..d3fd613 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.207 2003/12/16 23:36:06 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.208 2003/12/19 00:35:08 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -30,12 +30,7 @@
30#include "Screen.hh" 30#include "Screen.hh"
31#include "Window.hh" 31#include "Window.hh"
32#include "Workspace.hh" 32#include "Workspace.hh"
33#include "StringUtil.hh"
34#include "Resource.hh"
35#include "XrmDatabaseHelper.hh"
36#include "AtomHandler.hh" 33#include "AtomHandler.hh"
37#include "ImageControl.hh"
38#include "EventManager.hh"
39#include "FbCommands.hh" 34#include "FbCommands.hh"
40#include "WinClient.hh" 35#include "WinClient.hh"
41#include "Keys.hh" 36#include "Keys.hh"
@@ -44,6 +39,11 @@
44 39
45#include "FbTk/Image.hh" 40#include "FbTk/Image.hh"
46#include "FbTk/KeyUtil.hh" 41#include "FbTk/KeyUtil.hh"
42#include "FbTk/ImageControl.hh"
43#include "FbTk/EventManager.hh"
44#include "FbTk/StringUtil.hh"
45#include "FbTk/Resource.hh"
46#include "FbTk/XrmDatabaseHelper.hh"
47 47
48//Use GNU extensions 48//Use GNU extensions
49#ifndef _GNU_SOURCE 49#ifndef _GNU_SOURCE
@@ -160,23 +160,7 @@ setFromString(char const *strval) {
160 *this = false; 160 *this = false;
161} 161}
162 162
163template<> 163
164void FbTk::Resource<Fluxbox::FocusModel>::
165setFromString(char const *strval) {
166 // auto raise options here for backwards read compatibility
167 // they are not supported for saving purposes. Nor does the "AutoRaise"
168 // part actually do anything
169 if (strcasecmp(strval, "SloppyFocus") == 0
170 || strcasecmp(strval, "AutoRaiseSloppyFocus") == 0)
171 m_value = Fluxbox::SLOPPYFOCUS;
172 else if (strcasecmp(strval, "SemiSloppyFocus") == 0
173 || strcasecmp(strval, "AutoRaiseSemiSloppyFocus") == 0)
174 m_value = Fluxbox::SEMISLOPPYFOCUS;
175 else if (strcasecmp(strval, "ClickToFocus") == 0)
176 m_value = Fluxbox::CLICKTOFOCUS;
177 else
178 setDefaultValue();
179}
180 164
181template<> 165template<>
182void FbTk::Resource<Fluxbox::TitlebarList>:: 166void FbTk::Resource<Fluxbox::TitlebarList>::
@@ -238,20 +222,6 @@ template<>
238std::string FbTk::Resource<std::string>:: 222std::string FbTk::Resource<std::string>::
239getString() { return **this; } 223getString() { return **this; }
240 224
241template<>
242std::string FbTk::Resource<Fluxbox::FocusModel>::
243getString() {
244 switch (m_value) {
245 case Fluxbox::SLOPPYFOCUS:
246 return string("SloppyFocus");
247 case Fluxbox::SEMISLOPPYFOCUS:
248 return string("SemiSloppyFocus");
249 case Fluxbox::CLICKTOFOCUS:
250 return string("ClickToFocus");
251 }
252 // default string
253 return string("ClickToFocus");
254}
255 225
256template<> 226template<>
257std::string FbTk::Resource<Fluxbox::TitlebarList>:: 227std::string FbTk::Resource<Fluxbox::TitlebarList>::
@@ -407,6 +377,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
407 m_rc_colors_per_channel(m_resourcemanager, 4, 377 m_rc_colors_per_channel(m_resourcemanager, 4,
408 "session.colorsPerChannel", "Session.ColorsPerChannel"), 378 "session.colorsPerChannel", "Session.ColorsPerChannel"),
409 m_rc_numlayers(m_resourcemanager, 13, "session.numLayers", "Session.NumLayers"), 379 m_rc_numlayers(m_resourcemanager, 13, "session.numLayers", "Session.NumLayers"),
380 m_rc_double_click_interval(m_resourcemanager, 250, "session.doubleClickInterval", "Session.DoubleClickInterval"),
381 m_rc_update_delay_time(m_resourcemanager, 0, "session.updateDelayTime", "Session.UpdateDelayTime"),
410 m_rc_stylefile(m_resourcemanager, "", "session.styleFile", "Session.StyleFile"), 382 m_rc_stylefile(m_resourcemanager, "", "session.styleFile", "Session.StyleFile"),
411 m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"), 383 m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"),
412 m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"), 384 m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"),
@@ -511,8 +483,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
511 cerr<<"Warning: cannot set locale modifiers"<<endl; 483 cerr<<"Warning: cannot set locale modifiers"<<endl;
512 484
513 485
514 resource.update_delay_time = 5;
515
516#ifdef HAVE_GETPID 486#ifdef HAVE_GETPID
517 m_fluxbox_pid = XInternAtom(disp, "_BLACKBOX_PID", False); 487 m_fluxbox_pid = XInternAtom(disp, "_BLACKBOX_PID", False);
518#endif // HAVE_GETPID 488#endif // HAVE_GETPID
@@ -523,6 +493,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
523 sprintf(scrname, "session.screen%d", i); 493 sprintf(scrname, "session.screen%d", i);
524 sprintf(altscrname, "session.Screen%d", i); 494 sprintf(altscrname, "session.Screen%d", i);
525 BScreen *screen = new BScreen(m_screen_rm.lock(), 495 BScreen *screen = new BScreen(m_screen_rm.lock(),
496
526 scrname, altscrname, 497 scrname, altscrname,
527 i, getNumberOfLayers()); 498 i, getNumberOfLayers());
528 if (! screen->isScreenManaged()) { 499 if (! screen->isScreenManaged()) {
@@ -589,11 +560,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
589 560
590 m_reconfigure_wait = m_reread_menu_wait = false; 561 m_reconfigure_wait = m_reread_menu_wait = false;
591 562
592 m_timer.setTimeout(0);
593 FbTk::RefCount<FbTk::Command> reconf_cmd(new FbTk::SimpleCommand<Fluxbox>(*this, &Fluxbox::timed_reconfigure));
594 m_timer.setCommand(reconf_cmd);
595 m_timer.fireOnce(true);
596
597 // Create keybindings handler and load keys file 563 // Create keybindings handler and load keys file
598 m_key.reset(new Keys(StringUtil::expandFilename(*m_rc_keyfile).c_str())); 564 m_key.reset(new Keys(StringUtil::expandFilename(*m_rc_keyfile).c_str()));
599 565
@@ -605,7 +571,11 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
605 cerr<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl; 571 cerr<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl;
606#endif //DEBUG 572#endif //DEBUG
607 m_starting = false; 573 m_starting = false;
608 // FbTk::ThemeManager::instance().listItems(); 574 //
575 // For dumping theme items
576 // FbTk::ThemeManager::instance().listItems();
577 //
578 m_resourcemanager.dump();
609} 579}
610 580
611 581
@@ -999,68 +969,68 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
999 if (! screen->isRootColormapInstalled()) 969 if (! screen->isRootColormapInstalled())
1000 screen->imageControl().installRootColormap(); 970 screen->imageControl().installRootColormap();
1001 971
1002 if (screen->getWorkspacemenu()->isVisible()) 972 if (screen->getWorkspacemenu().isVisible())
1003 screen->getWorkspacemenu()->hide(); 973 screen->getWorkspacemenu().hide();
1004 if (screen->getRootmenu()->isVisible()) 974 if (screen->getRootmenu().isVisible())
1005 screen->getRootmenu()->hide(); 975 screen->getRootmenu().hide();
1006 976
1007 } else if (be.button == 2) { 977 } else if (be.button == 2) {
1008 int mx = be.x_root - 978 int mx = be.x_root -
1009 (screen->getWorkspacemenu()->width() / 2); 979 (screen->getWorkspacemenu().width() / 2);
1010 int my = be.y_root - 980 int my = be.y_root -
1011 (screen->getWorkspacemenu()->titleHeight() / 2); 981 (screen->getWorkspacemenu().titleHeight() / 2);
1012 982
1013 if (mx < 0) mx = 0; 983 if (mx < 0) mx = 0;
1014 if (my < 0) my = 0; 984 if (my < 0) my = 0;
1015 985
1016 if (mx + screen->getWorkspacemenu()->width() > 986 if (mx + screen->getWorkspacemenu().width() >
1017 screen->width()) { 987 screen->width()) {
1018 mx = screen->width()-1 - 988 mx = screen->width()-1 -
1019 screen->getWorkspacemenu()->width() - 989 screen->getWorkspacemenu().width() -
1020 2*screen->getWorkspacemenu()->fbwindow().borderWidth(); 990 2*screen->getWorkspacemenu().fbwindow().borderWidth();
1021 } 991 }
1022 992
1023 if (my + screen->getWorkspacemenu()->height() > 993 if (my + screen->getWorkspacemenu().height() >
1024 screen->height()) { 994 screen->height()) {
1025 my = screen->height()-1 - 995 my = screen->height()-1 -
1026 screen->getWorkspacemenu()->height() - 996 screen->getWorkspacemenu().height() -
1027 2*screen->getWorkspacemenu()->fbwindow().borderWidth(); 997 2*screen->getWorkspacemenu().fbwindow().borderWidth();
1028 } 998 }
1029 screen->getWorkspacemenu()->move(mx, my); 999 screen->getWorkspacemenu().move(mx, my);
1030 1000
1031 if (! screen->getWorkspacemenu()->isVisible()) { 1001 if (! screen->getWorkspacemenu().isVisible()) {
1032 screen->getWorkspacemenu()->removeParent(); 1002 screen->getWorkspacemenu().removeParent();
1033 screen->getWorkspacemenu()->show(); 1003 screen->getWorkspacemenu().show();
1034 } 1004 }
1035 } else if (be.button == 3) { 1005 } else if (be.button == 3) {
1036 //calculate placement of root menu 1006 //calculate placement of root menu
1037 //and show/hide it 1007 //and show/hide it
1038 int mx = be.x_root - 1008 int mx = be.x_root -
1039 (screen->getRootmenu()->width() / 2); 1009 (screen->getRootmenu().width() / 2);
1040 int my = be.y_root - 1010 int my = be.y_root -
1041 (screen->getRootmenu()->titleHeight() / 2); 1011 (screen->getRootmenu().titleHeight() / 2);
1042 int borderw = screen->getRootmenu()->fbwindow().borderWidth(); 1012 int borderw = screen->getRootmenu().fbwindow().borderWidth();
1043 1013
1044 if (mx < 0) mx = 0; 1014 if (mx < 0) mx = 0;
1045 if (my < 0) my = 0; 1015 if (my < 0) my = 0;
1046 1016
1047 if (mx + screen->getRootmenu()->width() + 2*borderw > screen->width()) { 1017 if (mx + screen->getRootmenu().width() + 2*borderw > screen->width()) {
1048 mx = screen->width() - 1018 mx = screen->width() -
1049 screen->getRootmenu()->width() - 1019 screen->getRootmenu().width() -
1050 2*borderw; 1020 2*borderw;
1051 } 1021 }
1052 1022
1053 if (my + screen->getRootmenu()->height() + 2*borderw > 1023 if (my + screen->getRootmenu().height() + 2*borderw >
1054 screen->height()) { 1024 screen->height()) {
1055 my = screen->height() - 1025 my = screen->height() -
1056 screen->getRootmenu()->height() - 1026 screen->getRootmenu().height() -
1057 2*borderw; 1027 2*borderw;
1058 } 1028 }
1059 screen->getRootmenu()->move(mx, my); 1029 screen->getRootmenu().move(mx, my);
1060 1030
1061 if (! screen->getRootmenu()->isVisible()) { 1031 if (! screen->getRootmenu().isVisible()) {
1062 checkMenu(); 1032 checkMenu();
1063 screen->getRootmenu()->show(); 1033 screen->getRootmenu().show();
1064 } 1034 }
1065 } else if (screen->isDesktopWheeling() && be.button == 4) { 1035 } else if (screen->isDesktopWheeling() && be.button == 4) {
1066 screen->nextWorkspace(1); 1036 screen->nextWorkspace(1);
@@ -1539,15 +1509,6 @@ void Fluxbox::save_rc() {
1539 } else 1509 } else
1540 cerr<<"database filename is invalid!"<<endl; 1510 cerr<<"database filename is invalid!"<<endl;
1541 1511
1542
1543 sprintf(rc_string, "session.doubleClickInterval: %lu",
1544 resource.double_click_interval);
1545 XrmPutLineResource(&new_blackboxrc, rc_string);
1546
1547
1548 sprintf(rc_string, "session.updateDelayTime: %lu", resource.update_delay_time);
1549 XrmPutLineResource(&new_blackboxrc, rc_string);
1550
1551 ScreenList::iterator it = m_screen_list.begin(); 1512 ScreenList::iterator it = m_screen_list.begin();
1552 ScreenList::iterator it_end = m_screen_list.end(); 1513 ScreenList::iterator it_end = m_screen_list.end();
1553 1514
@@ -1642,12 +1603,10 @@ void Fluxbox::getDefaultDataFilename(char *name, string &filename) {
1642 1603
1643/// loads resources 1604/// loads resources
1644void Fluxbox::load_rc() { 1605void Fluxbox::load_rc() {
1645 XrmDatabaseHelper database;
1646 1606
1647 //get resource filename 1607 //get resource filename
1648 string dbfile(getRcFilename()); 1608 string dbfile(getRcFilename());
1649 1609
1650
1651 if (dbfile.size() != 0) { 1610 if (dbfile.size() != 0) {
1652 if (!m_resourcemanager.load(dbfile.c_str())) { 1611 if (!m_resourcemanager.load(dbfile.c_str())) {
1653 cerr<<"Failed to load database:"<<dbfile<<endl; 1612 cerr<<"Failed to load database:"<<dbfile<<endl;
@@ -1660,10 +1619,8 @@ void Fluxbox::load_rc() {
1660 cerr<<"Failed to load database: "<<DEFAULT_INITFILE<<endl; 1619 cerr<<"Failed to load database: "<<DEFAULT_INITFILE<<endl;
1661 } 1620 }
1662 1621
1663 XrmValue value;
1664 char *value_type;
1665 if (m_rc_menufile->size() == 0) 1622 if (m_rc_menufile->size() == 0)
1666 m_rc_menufile.setDefaultValue(); 1623 m_rc_menufile.setDefaultValue();
1667 1624
1668 if (m_rc_slitlistfile->size() != 0) { 1625 if (m_rc_slitlistfile->size() != 0) {
1669 *m_rc_slitlistfile = StringUtil::expandFilename(*m_rc_slitlistfile); 1626 *m_rc_slitlistfile = StringUtil::expandFilename(*m_rc_slitlistfile);
@@ -1683,29 +1640,6 @@ void Fluxbox::load_rc() {
1683 else // expand tilde 1640 else // expand tilde
1684 *m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile); 1641 *m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile);
1685 1642
1686 //load file
1687 database = XrmGetFileDatabase(dbfile.c_str());
1688 if (database==0) {
1689 cerr<<"Fluxbox: Cant open "<<dbfile<<" !"<<endl;
1690 cerr<<"Using: "<<DEFAULT_INITFILE<<endl;
1691 database = XrmGetFileDatabase(DEFAULT_INITFILE);
1692 }
1693
1694 if (XrmGetResource(*database, "session.doubleClickInterval",
1695 "Session.DoubleClickInterval", &value_type, &value)) {
1696 if (sscanf(value.addr, "%lu", &resource.double_click_interval) != 1)
1697 resource.double_click_interval = 250;
1698 } else
1699 resource.double_click_interval = 250;
1700
1701
1702 if (XrmGetResource(*database, "session.updateDelayTime", "Session.updateDelayTime",
1703 &value_type, &value)) {
1704 if (sscanf(value.addr, "%lu", &resource.update_delay_time) != 1)
1705 resource.update_delay_time = 5;
1706 } else
1707 resource.update_delay_time = 5;
1708
1709 // expand tilde 1643 // expand tilde
1710 *m_rc_groupfile = StringUtil::expandFilename(*m_rc_groupfile); 1644 *m_rc_groupfile = StringUtil::expandFilename(*m_rc_groupfile);
1711 1645
@@ -1731,30 +1665,9 @@ void Fluxbox::load_rc(BScreen &screen) {
1731 char *value_type, name_lookup[1024], class_lookup[1024]; 1665 char *value_type, name_lookup[1024], class_lookup[1024];
1732 int screen_number = screen.screenNumber(); 1666 int screen_number = screen.screenNumber();
1733 1667
1734 sprintf(name_lookup, "session.screen%d.rowPlacementDirection", screen_number);
1735 sprintf(class_lookup, "Session.Screen%d.RowPlacementDirection", screen_number);
1736 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
1737 &value)) {
1738 if (! strncasecmp(value.addr, "righttoleft", value.size))
1739 screen.saveRowPlacementDirection(BScreen::RIGHTLEFT);
1740 else
1741 screen.saveRowPlacementDirection(BScreen::LEFTRIGHT);
1742 } else
1743 screen.saveRowPlacementDirection(BScreen::LEFTRIGHT);
1744
1745 sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number);
1746 sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number);
1747 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
1748 &value)) {
1749 if (! strncasecmp(value.addr, "bottomtotop", value.size))
1750 screen.saveColPlacementDirection(BScreen::BOTTOMTOP);
1751 else
1752 screen.saveColPlacementDirection(BScreen::TOPBOTTOM);
1753 } else
1754 screen.saveColPlacementDirection(BScreen::TOPBOTTOM);
1755 1668
1756 screen.removeWorkspaceNames(); 1669 screen.removeWorkspaceNames();
1757 1670
1758 sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number); 1671 sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number);
1759 sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number); 1672 sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number);
1760 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, 1673 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
@@ -1791,21 +1704,6 @@ void Fluxbox::load_rc(BScreen &screen) {
1791 for (unsigned int i=0; i<paths.size(); ++i) 1704 for (unsigned int i=0; i<paths.size(); ++i)
1792 FbTk::Image::addSearchPath(paths[i]); 1705 FbTk::Image::addSearchPath(paths[i]);
1793 } 1706 }
1794
1795 sprintf(name_lookup, "session.screen%d.windowPlacement", screen_number);
1796 sprintf(class_lookup, "Session.Screen%d.WindowPlacement", screen_number);
1797 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
1798 &value)) {
1799 if (! strncasecmp(value.addr, "RowSmartPlacement", value.size))
1800 screen.savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
1801 else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size))
1802 screen.savePlacementPolicy(BScreen::COLSMARTPLACEMENT);
1803 else if (! strncasecmp(value.addr, "UnderMousePlacement", value.size))
1804 screen.savePlacementPolicy(BScreen::UNDERMOUSEPLACEMENT);
1805 else
1806 screen.savePlacementPolicy(BScreen::CASCADEPLACEMENT);
1807 } else
1808 screen.savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
1809 1707
1810 if (dbfile.size() != 0) { 1708 if (dbfile.size() != 0) {
1811 if (!m_screen_rm.load(dbfile.c_str())) { 1709 if (!m_screen_rm.load(dbfile.c_str())) {
@@ -1850,8 +1748,7 @@ void Fluxbox::reload_rc() {
1850void Fluxbox::reconfigure() { 1748void Fluxbox::reconfigure() {
1851 m_reconfigure_wait = true; 1749 m_reconfigure_wait = true;
1852 1750
1853 if (! m_timer.isTiming()) 1751 timed_reconfigure();
1854 m_timer.start();
1855} 1752}
1856 1753
1857 1754
@@ -1904,8 +1801,7 @@ void Fluxbox::checkMenu() {
1904void Fluxbox::rereadMenu() { 1801void Fluxbox::rereadMenu() {
1905 m_reread_menu_wait = true; 1802 m_reread_menu_wait = true;
1906 1803
1907 if (! m_timer.isTiming()) 1804 timed_reconfigure();
1908 m_timer.start();
1909} 1805}
1910 1806
1911 1807
@@ -2055,7 +1951,7 @@ void Fluxbox::setFocusedWindow(WinClient *client) {
2055void Fluxbox::revertFocus(BScreen &screen, bool wait_for_end) { 1951void Fluxbox::revertFocus(BScreen &screen, bool wait_for_end) {
2056 // Relevant resources: 1952 // Relevant resources:
2057 // resource.focus_last = whether we focus last focused when changing workspace 1953 // resource.focus_last = whether we focus last focused when changing workspace
2058 // Fluxbox::FocusModel = sloppy, click, whatever 1954 // BScreen::FocusModel = sloppy, click, whatever
2059 if (wait_for_end) { 1955 if (wait_for_end) {
2060 if (m_focus_revert_screen == 0) { 1956 if (m_focus_revert_screen == 0) {
2061 m_focus_revert_screen = &screen; 1957 m_focus_revert_screen = &screen;
@@ -2082,15 +1978,13 @@ void Fluxbox::revertFocus(BScreen &screen, bool wait_for_end) {
2082 next_focus->fbwindow()->setCurrentClient(*next_focus, true, ignore_event))) { 1978 next_focus->fbwindow()->setCurrentClient(*next_focus, true, ignore_event))) {
2083 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer 1979 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
2084 switch (screen.getFocusModel()) { 1980 switch (screen.getFocusModel()) {
2085 case SLOPPYFOCUS: 1981 case BScreen::SLOPPYFOCUS:
2086 case SEMISLOPPYFOCUS: 1982 case BScreen::SEMISLOPPYFOCUS:
2087 XSetInputFocus(FbTk::App::instance()->display(), 1983 XSetInputFocus(FbTk::App::instance()->display(),
2088 PointerRoot, None, CurrentTime); 1984 PointerRoot, None, CurrentTime);
2089 break; 1985 break;
2090 case CLICKTOFOCUS: 1986 case BScreen::CLICKTOFOCUS:
2091 XSetInputFocus(FbTk::App::instance()->display(), 1987 screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime);
2092 screen.rootWindow().window(),
2093 RevertToPointerRoot, CurrentTime);
2094 break; 1988 break;
2095 } 1989 }
2096 } 1990 }