aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-02-22 15:10:43 (GMT)
committerrathnor <rathnor>2003-02-22 15:10:43 (GMT)
commitcc2f023a22db212b4097d7756379bb6b9e866b11 (patch)
tree33cd8f790e760965960d54406250dd73ab0aec93 /src/Screen.cc
parent7cf8c0863e6dd07e1023207964605de12f7d0a3c (diff)
downloadfluxbox-cc2f023a22db212b4097d7756379bb6b9e866b11.zip
fluxbox-cc2f023a22db212b4097d7756379bb6b9e866b11.tar.bz2
fix focus models for new event handler and Resource setup
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index ee32f56..9ca7859 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.112 2003/02/20 23:31:13 fluxgen Exp $ 25// $Id: Screen.cc,v 1.113 2003/02/22 15:10:43 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -139,22 +139,21 @@ FbTk::Menu *createMenuFromScreen(BScreen &screen) {
139 return menu; 139 return menu;
140} 140}
141 141
142/* 142class FocusModelMenuItem : public FbTk::MenuItem {
143class WindowLayerMenuItem : public FbTk::MenuItem {
144public: 143public:
145 WindowLayerMenuItem(const char *label, FluxboxWindow &win, int layernum): 144 FocusModelMenuItem(const char *label, BScreen &screen, Fluxbox::FocusModel model, FbTk::RefCount<FbTk::Command> &cmd):
146 FbTk::MenuItem(label), m_window(win), m_layernum(layernum) { 145 FbTk::MenuItem(label, cmd), m_screen(screen), m_focusmodel(model) {
147 } 146 }
148 bool isEnabled() const { return m_window.getLayerNum() != m_layernum; } 147 bool isEnabled() const { return m_screen.getFocusModel() != m_focusmodel; }
149 void click(int button, int time) { 148 void click(int button, int time) {
150 m_window.moveToLayer(m_layernum); 149 m_screen.saveFocusModel(m_focusmodel);
150 FbTk::MenuItem::click(button, time);
151 } 151 }
152 152
153private: 153private:
154 FluxboxWindow &m_window; 154 BScreen &m_screen;
155 int m_layernum; 155 Fluxbox::FocusModel m_focusmodel;
156}; 156};
157*/
158 157
159 158
160}; // End anonymous namespace 159}; // End anonymous namespace
@@ -363,6 +362,7 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
363 focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), 362 focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"),
364 antialias(rm, false, scrname+".antialias", altscrname+".Antialias"), 363 antialias(rm, false, scrname+".antialias", altscrname+".Antialias"),
365 rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), 364 rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
365 focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
366 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), 366 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
367 toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"), 367 toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"),
368 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), 368 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
@@ -616,7 +616,7 @@ BScreen::BScreen(ResourceManager &rm,
616 } 616 }
617 } 617 }
618 618
619 if (! resource.sloppy_focus) { 619 if (! isSloppyFocus()) {
620 XSetInputFocus(disp, m_toolbar->getWindowID(), 620 XSetInputFocus(disp, m_toolbar->getWindowID(),
621 RevertToParent, CurrentTime); 621 RevertToParent, CurrentTime);
622 } 622 }
@@ -1733,21 +1733,27 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1733 // create focus menu 1733 // create focus menu
1734 FbTk::Menu *focus_menu = createMenuFromScreen(*this); 1734 FbTk::Menu *focus_menu = createMenuFromScreen(*this);
1735 1735
1736 /* focus_menu->insert(new BoolMenuItem(i18n->getMessage( 1736 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
1737 ConfigmenuSet, ConfigmenuClickToFocus,
1738 "Click To Focus"),*/
1739 focus_menu->insert(new BoolMenuItem(i18n->getMessage(
1740 ConfigmenuSet, 1737 ConfigmenuSet,
1738 ConfigmenuClickToFocus,
1739 "Click To Focus"),
1740 *this,
1741 Fluxbox::CLICKTOFOCUS,
1742 save_and_reconfigure));
1743 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
1744 ConfigmenuSet,
1741 ConfigmenuSloppyFocus, 1745 ConfigmenuSloppyFocus,
1742 "Sloppy Focus"), 1746 "Sloppy Focus"),
1743 resource.sloppy_focus, 1747 *this,
1744 save_and_reconfigure)); 1748 Fluxbox::SLOPPYFOCUS,
1745 focus_menu->insert(new BoolMenuItem(i18n->getMessage( 1749 save_and_reconfigure));
1750 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
1746 ConfigmenuSet, 1751 ConfigmenuSet,
1747 ConfigmenuSemiSloppyFocus, 1752 ConfigmenuSemiSloppyFocus,
1748 "Semi Sloppy Focus"), 1753 "Semi Sloppy Focus"),
1749 resource.semi_sloppy_focus, 1754 *this,
1750 save_and_reconfigure)); 1755 Fluxbox::SEMISLOPPYFOCUS,
1756 save_and_reconfigure));
1751 focus_menu->insert(new BoolMenuItem(i18n->getMessage( 1757 focus_menu->insert(new BoolMenuItem(i18n->getMessage(
1752 ConfigmenuSet, 1758 ConfigmenuSet,
1753 ConfigmenuAutoRaise, 1759 ConfigmenuAutoRaise,