fixed click raise option, patch from Dale P. Smith

This commit is contained in:
fluxgen 2003-04-16 00:38:06 +00:00
parent 80c38380d1
commit 21bc356be2
3 changed files with 26 additions and 23 deletions

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Screen.cc,v 1.123 2003/04/15 23:09:12 rathnor Exp $ // $Id: Screen.cc,v 1.124 2003/04/16 00:37:19 fluxgen Exp $
#include "Screen.hh" #include "Screen.hh"
@ -386,6 +386,7 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"),
antialias(rm, false, scrname+".antialias", altscrname+".Antialias"), antialias(rm, false, scrname+".antialias", altscrname+".Antialias"),
auto_raise(rm, false, scrname+".autoRaise", altscrname+".AutoRaise"), auto_raise(rm, false, scrname+".autoRaise", altscrname+".AutoRaise"),
click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
@ -1864,23 +1865,23 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
FbTk::Menu *focus_menu = createMenuFromScreen(*this); FbTk::Menu *focus_menu = createMenuFromScreen(*this);
focus_menu->insert(new FocusModelMenuItem(i18n->getMessage( focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
ConfigmenuSet, ConfigmenuSet,
ConfigmenuClickToFocus, ConfigmenuClickToFocus,
"Click To Focus"), "Click To Focus"),
*this, *this,
Fluxbox::CLICKTOFOCUS, Fluxbox::CLICKTOFOCUS,
save_and_reconfigure)); save_and_reconfigure));
focus_menu->insert(new FocusModelMenuItem(i18n->getMessage( focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
ConfigmenuSet, ConfigmenuSet,
ConfigmenuSloppyFocus, ConfigmenuSloppyFocus,
"Sloppy Focus"), "Sloppy Focus"),
*this, *this,
Fluxbox::SLOPPYFOCUS, Fluxbox::SLOPPYFOCUS,
save_and_reconfigure)); save_and_reconfigure));
focus_menu->insert(new FocusModelMenuItem(i18n->getMessage( focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
ConfigmenuSet, ConfigmenuSet,
ConfigmenuSemiSloppyFocus, ConfigmenuSemiSloppyFocus,
"Semi Sloppy Focus"), "Semi Sloppy Focus"),
*this, *this,
Fluxbox::SEMISLOPPYFOCUS, Fluxbox::SEMISLOPPYFOCUS,
save_and_reconfigure)); save_and_reconfigure));
@ -1894,6 +1895,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
focus_menu->update(); focus_menu->update();
rootmenuList.push_back(focus_menu); rootmenuList.push_back(focus_menu);
menu.insert(i18n->getMessage( menu.insert(i18n->getMessage(
ConfigmenuSet, ConfigmenuFocusModel, ConfigmenuSet, ConfigmenuFocusModel,
"Focus Model"), "Focus Model"),
@ -1903,8 +1905,8 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
menu.insert("Slit", &getSlit()->menu()); menu.insert("Slit", &getSlit()->menu());
#endif // SLIT #endif // SLIT
menu.insert(i18n->getMessage( menu.insert(i18n->getMessage(
ToolbarSet, ToolbarToolbarTitle, ToolbarSet, ToolbarToolbarTitle,
"Toolbar"), &m_toolbarhandler->getToolbarMenu()); "Toolbar"), &m_toolbarhandler->getToolbarMenu());
menu.insert(new menu.insert(new
BoolMenuItem(i18n->getMessage( BoolMenuItem(i18n->getMessage(
ConfigmenuSet, ConfigmenuImageDithering, ConfigmenuSet, ConfigmenuImageDithering,
@ -1947,6 +1949,9 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
"Desktop MouseWheel Switching"), "Desktop MouseWheel Switching"),
*resource.desktop_wheeling, save_and_reconfigure)); *resource.desktop_wheeling, save_and_reconfigure));
menu.insert(new BoolMenuItem("Click Raises",
*resource.click_raises,
save_and_reconfigure));
// setup antialias cmd to reload style and save resource on toggle // setup antialias cmd to reload style and save resource on toggle
menu.insert(new BoolMenuItem("antialias", *resource.antialias, menu.insert(new BoolMenuItem("antialias", *resource.antialias,
save_and_reconfigure)); save_and_reconfigure));

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Screen.hh,v 1.76 2003/04/15 12:14:13 fluxgen Exp $ // $Id: Screen.hh,v 1.77 2003/04/16 00:36:09 fluxgen Exp $
#ifndef SCREEN_HH #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
@ -89,6 +89,7 @@ public:
inline bool isWorkspaceWarping() const { return *resource.workspace_warping; } inline bool isWorkspaceWarping() const { return *resource.workspace_warping; }
inline bool isDesktopWheeling() const { return *resource.desktop_wheeling; } inline bool isDesktopWheeling() const { return *resource.desktop_wheeling; }
inline bool doAutoRaise() const { return *resource.auto_raise; } inline bool doAutoRaise() const { return *resource.auto_raise; }
inline bool clickRaises() const { return *resource.click_raises; }
inline bool doImageDither() const { return *resource.image_dither; } inline bool doImageDither() const { return *resource.image_dither; }
inline bool doMaxOverSlit() const { return *resource.max_over_slit; } inline bool doMaxOverSlit() const { return *resource.max_over_slit; }
inline bool doOpaqueMove() const { return *resource.opaque_move; } inline bool doOpaqueMove() const { return *resource.opaque_move; }
@ -397,7 +398,7 @@ private:
sloppy_window_grouping, workspace_warping, sloppy_window_grouping, workspace_warping,
desktop_wheeling, show_window_pos, desktop_wheeling, show_window_pos,
focus_last, focus_new, focus_last, focus_new,
antialias, auto_raise; antialias, auto_raise, click_raises;
Resource<std::string> rootcommand; Resource<std::string> rootcommand;
Resource<Fluxbox::FocusModel> focus_model; Resource<Fluxbox::FocusModel> focus_model;
bool ordered_dither; bool ordered_dither;

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.138 2003/04/15 23:09:13 rathnor Exp $ // $Id: Window.cc,v 1.139 2003/04/16 00:38:06 fluxgen Exp $
#include "Window.hh" #include "Window.hh"
@ -320,13 +320,9 @@ void FluxboxWindow::init() {
m_frame.reconfigure(); m_frame.reconfigure();
// redirect events from frame to us // redirect events from frame to us
#ifdef DEBUG
cerr<<"Setting up catch for events in frame"<<endl;
#endif // DEBUG
m_frame.setEventHandler(*this); m_frame.setEventHandler(*this);
#ifdef DEBUG
cerr<<"setup for catching events....done"<<endl;
#endif // DEBUG
lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0; lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0;
// display connection // display connection
@ -2192,8 +2188,9 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
setInputFocus(); setInputFocus();
} }
if (m_frame.clientArea() == be.window) { if (m_frame.clientArea() == be.window) {
raise(); if (getScreen().clickRaises())
raise();
XAllowEvents(display, ReplayPointer, be.time); XAllowEvents(display, ReplayPointer, be.time);
} else { } else {
button_grab_x = be.x_root - m_frame.x() - screen.getBorderWidth(); button_grab_x = be.x_root - m_frame.x() - screen.getBorderWidth();