From 72fd5e03a48396e6feec86534d266c68a9edd915 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 16 Aug 2008 06:30:09 -0700 Subject: revert focus when closing dialogs --- src/CommandDialog.cc | 1 - src/FbTk/TextButton.cc | 8 ++++---- src/Keys.cc | 6 +++--- src/fluxbox.hh | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/CommandDialog.cc b/src/CommandDialog.cc index 8534dcd..5e7aa7d 100644 --- a/src/CommandDialog.cc +++ b/src/CommandDialog.cc @@ -130,7 +130,6 @@ void CommandDialog::keyPressEvent(XKeyEvent &event) { XLookupString(&event, &keychar, 1, &ks, 0); if (ks == XK_Return) { - hide(); // hide and return focus to a FluxboxWindow // create Command from line auto_ptr > cmd(FbTk::CommandParser::instance().parse(m_precommand + m_textbox.text())); if (cmd.get()) diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index 79ed1ab..380537e 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc @@ -67,10 +67,10 @@ bool TextButton::setOrientation(FbTk::Orientation orient) { return false; invalidateBackground(); - if ((m_orientation == FbTk::ROT0 || m_orientation == FbTk::ROT180) && - (orient == FbTk::ROT90 || orient == FbTk::ROT270) || - (m_orientation == FbTk::ROT90 || m_orientation == FbTk::ROT270) && - (orient == FbTk::ROT0 || orient == FbTk::ROT180)) { + if (((m_orientation == FbTk::ROT0 || m_orientation == FbTk::ROT180) && + (orient == FbTk::ROT90 || orient == FbTk::ROT270)) || + ((m_orientation == FbTk::ROT90 || m_orientation == FbTk::ROT270) && + (orient == FbTk::ROT0 || orient == FbTk::ROT180))) { // flip width and height m_orientation = orient; resize(height(), width()); diff --git a/src/Keys.cc b/src/Keys.cc index f201e64..637ccbb 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -403,9 +403,9 @@ bool Keys::addBinding(const string &linebuffer) { // +[1-9] - number between +1 and +9 // numbers 10 and above // - } else if (!val[argc].empty() && (isdigit(val[argc][0]) && - (isdigit(val[argc][1]) || val[argc][1] == 'x') || - val[argc][0] == '+' && isdigit(val[argc][1])) ) { + } else if (!val[argc].empty() && ((isdigit(val[argc][0]) && + (isdigit(val[argc][1]) || val[argc][1] == 'x')) || + (val[argc][0] == '+' && isdigit(val[argc][1])))) { key = strtoul(val[argc].c_str(), NULL, 0); type = KeyPress; diff --git a/src/fluxbox.hh b/src/fluxbox.hh index fcbd368..e761eda 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -160,7 +160,9 @@ public: void timed_reconfigure(); void revertFocus(); - void setShowingDialog(bool value) { m_showing_dialog = value; } + void setShowingDialog(bool value) { + m_showing_dialog = value; if (!value) revertFocus(); + } bool isStartup() const { return m_starting; } bool isRestarting() const { return m_restarting; } -- cgit v0.11.2