aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-28 08:53:16 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-28 08:53:16 (GMT)
commitf2c8868724ebcaa6afaac4a71093f77b7eeaa23f (patch)
treee64111d54d58f819e261f4fa552fae8e111b30e8 /src/Screen.cc
parentbcf37890b617730cfded161b9a3d18f7c377e724 (diff)
parent04a1d2a83b96eb6d1b1958e4f3e25ffdf295aa4d (diff)
downloadfluxbox-f2c8868724ebcaa6afaac4a71093f77b7eeaa23f.zip
fluxbox-f2c8868724ebcaa6afaac4a71093f77b7eeaa23f.tar.bz2
Merge branch 'master' of fluxbox@git.fluxbox.org:fluxbox
Conflicts: ChangeLog
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 2c038d2..fe5ee31 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -292,7 +292,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
292 max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"), 292 max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"),
293 max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"), 293 max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"),
294 workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"), 294 workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
295 show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), 295 show_window_pos(rm, false, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
296 auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"), 296 auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
297 click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"), 297 click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
298 default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"), 298 default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
@@ -855,19 +855,26 @@ void BScreen::propertyNotify(Atom atom) {
855} 855}
856 856
857void BScreen::keyPressEvent(XKeyEvent &ke) { 857void BScreen::keyPressEvent(XKeyEvent &ke) {
858 Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode, 858 if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
859 Keys::GLOBAL|Keys::ON_DESKTOP); 859 Keys::GLOBAL|Keys::ON_DESKTOP))
860 // re-grab keyboard, so we don't pass KeyRelease to clients
861 FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
862
860} 863}
861 864
862void BScreen::keyReleaseEvent(XKeyEvent &ke) { 865void BScreen::keyReleaseEvent(XKeyEvent &ke) {
863 if (!m_cycling) 866 if (m_cycling) {
864 return; 867 unsigned int state = FbTk::KeyUtil::instance().cleanMods(ke.state);
868 state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode);
869
870 if (state) // still cycling
871 return;
865 872
866 unsigned int state = FbTk::KeyUtil::instance().cleanMods(ke.state); 873 m_cycling = false;
867 state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode); 874 focusControl().stopCyclingFocus();
875 }
868 876
869 if (!state) // all modifiers were released 877 FbTk::EventManager::instance()->ungrabKeyboard();
870 FbTk::EventManager::instance()->ungrabKeyboard();
871} 878}
872 879
873void BScreen::buttonPressEvent(XButtonEvent &be) { 880void BScreen::buttonPressEvent(XButtonEvent &be) {
@@ -879,11 +886,6 @@ void BScreen::buttonPressEvent(XButtonEvent &be) {
879 0, be.time); 886 0, be.time);
880} 887}
881 888
882void BScreen::notifyUngrabKeyboard() {
883 m_cycling = false;
884 focusControl().stopCyclingFocus();
885}
886
887void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) { 889void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) {
888 // get modifiers from event that causes this for focus order cycling 890 // get modifiers from event that causes this for focus order cycling
889 XEvent ev = Fluxbox::instance()->lastEvent(); 891 XEvent ev = Fluxbox::instance()->lastEvent();
@@ -895,7 +897,7 @@ void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) {
895 897
896 if (!m_cycling && mods) { 898 if (!m_cycling && mods) {
897 m_cycling = true; 899 m_cycling = true;
898 FbTk::EventManager::instance()->grabKeyboard(*this, rootWindow().window()); 900 FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
899 } 901 }
900 902
901 if (mods == 0) // can't stacked cycle unless there is a mod to grab 903 if (mods == 0) // can't stacked cycle unless there is a mod to grab
@@ -1029,10 +1031,10 @@ void BScreen::addIcon(FluxboxWindow *w) {
1029 if (find(iconList().begin(), iconList().end(), w) != iconList().end()) 1031 if (find(iconList().begin(), iconList().end(), w) != iconList().end())
1030 return; 1032 return;
1031 1033
1032 m_icon_list.push_back(w); 1034 iconList().push_back(w);
1033 1035
1034 // notify listeners 1036 // notify listeners
1035 m_iconlist_sig.emit(*this); 1037 iconListSig().emit(*this);
1036} 1038}
1037 1039
1038 1040
@@ -1047,7 +1049,7 @@ void BScreen::removeIcon(FluxboxWindow *w) {
1047 // change the iconlist 1049 // change the iconlist
1048 if (erase_it != m_icon_list.end()) { 1050 if (erase_it != m_icon_list.end()) {
1049 iconList().erase(erase_it); 1051 iconList().erase(erase_it);
1050 m_iconlist_sig.emit(*this); 1052 iconListSig().emit(*this);
1051 } 1053 }
1052} 1054}
1053 1055
@@ -1556,7 +1558,8 @@ void BScreen::removeConfigMenu(FbTk::Menu &menu) {
1556 if (erase_it != m_configmenu_list.end()) 1558 if (erase_it != m_configmenu_list.end())
1557 m_configmenu_list.erase(erase_it); 1559 m_configmenu_list.erase(erase_it);
1558 1560
1559 setupConfigmenu(*m_configmenu.get()); 1561 if (!isShuttingdown())
1562 setupConfigmenu(*m_configmenu.get());
1560 1563
1561} 1564}
1562 1565
@@ -1627,12 +1630,12 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1627 cerr<<e.what()<<endl; 1630 cerr<<e.what()<<endl;
1628 } 1631 }
1629 1632
1630 focus_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Configmenu, 1633 _BOOLITEM(*focus_menu, Configmenu, AutoRaise,
1631 AutoRaise, 1634 "Auto Raise", "Auto Raise windows on sloppy",
1632 "Auto Raise", 1635 resource.auto_raise, saverc_cmd);
1633 "Auto Raise windows on sloppy"), 1636 _BOOLITEM(*focus_menu, Configmenu, ClickRaises,
1634 resource.auto_raise, 1637 "Click Raises", "Click Raises",
1635 save_and_reconfigure)); 1638 resource.click_raises, saverc_cmd);
1636 1639
1637 focus_menu->updateMenu(); 1640 focus_menu->updateMenu();
1638 1641
@@ -1799,9 +1802,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1799 "Workspace Warping", 1802 "Workspace Warping",
1800 "Workspace Warping - dragging windows to the edge and onto the next workspace", 1803 "Workspace Warping - dragging windows to the edge and onto the next workspace",
1801 resource.workspace_warping, saverc_cmd); 1804 resource.workspace_warping, saverc_cmd);
1802 _BOOLITEM(menu, Configmenu, ClickRaises,
1803 "Click Raises", "Click Raises",
1804 resource.click_raises, saverc_cmd);
1805 1805
1806#undef _BOOLITEM 1806#undef _BOOLITEM
1807 1807