diff options
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/Window.cc b/src/Window.cc index 47fe00c..e104ae6 100644 --- a/src/Window.cc +++ b/src/Window.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: Window.cc,v 1.238 2003/10/02 16:14:41 rathnor Exp $ | 25 | // $Id: Window.cc,v 1.239 2003/10/05 02:31:22 rathnor Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -888,7 +888,7 @@ void FluxboxWindow::updateClientLeftWindow() { | |||
888 | } | 888 | } |
889 | } | 889 | } |
890 | 890 | ||
891 | bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { | 891 | bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput, long ignore_event) { |
892 | // make sure it's in our list | 892 | // make sure it's in our list |
893 | if (client.m_win != this) | 893 | if (client.m_win != this) |
894 | return false; | 894 | return false; |
@@ -896,7 +896,7 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { | |||
896 | m_client = &client; | 896 | m_client = &client; |
897 | m_client->raise(); | 897 | m_client->raise(); |
898 | frame().setLabelButtonFocus(*m_labelbuttons[m_client]); | 898 | frame().setLabelButtonFocus(*m_labelbuttons[m_client]); |
899 | return setinput && setInputFocus(); | 899 | return setinput && setInputFocus(ignore_event); |
900 | } | 900 | } |
901 | 901 | ||
902 | bool FluxboxWindow::isGroupable() const { | 902 | bool FluxboxWindow::isGroupable() const { |
@@ -1138,7 +1138,7 @@ void FluxboxWindow::moveResize(int new_x, int new_y, | |||
1138 | // tried. A FocusqIn event should eventually arrive for that | 1138 | // tried. A FocusqIn event should eventually arrive for that |
1139 | // window if it actually got the focus, then setFocusedFlag is called, | 1139 | // window if it actually got the focus, then setFocusedFlag is called, |
1140 | // which updates all the graphics etc | 1140 | // which updates all the graphics etc |
1141 | bool FluxboxWindow::setInputFocus() { | 1141 | bool FluxboxWindow::setInputFocus(long ignore_event) { |
1142 | 1142 | ||
1143 | if (((signed) (frame().x() + frame().width())) < 0) { | 1143 | if (((signed) (frame().x() + frame().width())) < 0) { |
1144 | if (((signed) (frame().y() + frame().height())) < 0) { | 1144 | if (((signed) (frame().y() + frame().height())) < 0) { |
@@ -1181,6 +1181,14 @@ bool FluxboxWindow::setInputFocus() { | |||
1181 | if (m_client->getFocusMode() == WinClient::F_LOCALLYACTIVE || | 1181 | if (m_client->getFocusMode() == WinClient::F_LOCALLYACTIVE || |
1182 | m_client->getFocusMode() == WinClient::F_PASSIVE) { | 1182 | m_client->getFocusMode() == WinClient::F_PASSIVE) { |
1183 | m_client->setInputFocus(RevertToPointerRoot, CurrentTime); | 1183 | m_client->setInputFocus(RevertToPointerRoot, CurrentTime); |
1184 | |||
1185 | // People can ignore an event until the focus comes through | ||
1186 | // this is most likely to be an EnterNotify for sloppy focus | ||
1187 | if (ignore_event) | ||
1188 | Fluxbox::instance()->addRedirectEvent( | ||
1189 | &screen(), ignore_event, None, | ||
1190 | FocusIn, m_client->window(), None); | ||
1191 | |||
1184 | // this may or may not send, but we've setInputFocus already, so return true | 1192 | // this may or may not send, but we've setInputFocus already, so return true |
1185 | m_client->sendFocus(); | 1193 | m_client->sendFocus(); |
1186 | return true; | 1194 | return true; |
@@ -2724,7 +2732,16 @@ void FluxboxWindow::startMoving(Window win) { | |||
2724 | if (m_windowmenu.isVisible()) | 2732 | if (m_windowmenu.isVisible()) |
2725 | m_windowmenu.hide(); | 2733 | m_windowmenu.hide(); |
2726 | 2734 | ||
2727 | fluxbox->maskWindowEvents(screen().rootWindow().window(), this); | 2735 | // The "stop" window and event aren't going to happen (since it's |
2736 | // grabbed, so they are just so we can remove it in stopMoving) | ||
2737 | fluxbox->addRedirectEvent(&screen(), | ||
2738 | MotionNotify, screen().rootWindow().window(), | ||
2739 | MotionNotify, fbWindow().window(), | ||
2740 | fbWindow().window()); | ||
2741 | fluxbox->addRedirectEvent(&screen(), | ||
2742 | ButtonRelease, screen().rootWindow().window(), | ||
2743 | ButtonRelease, fbWindow().window(), | ||
2744 | fbWindow().window()); | ||
2728 | 2745 | ||
2729 | m_last_move_x = frame().x(); | 2746 | m_last_move_x = frame().x(); |
2730 | m_last_move_y = frame().y(); | 2747 | m_last_move_y = frame().y(); |
@@ -2742,8 +2759,8 @@ void FluxboxWindow::stopMoving() { | |||
2742 | moving = false; | 2759 | moving = false; |
2743 | Fluxbox *fluxbox = Fluxbox::instance(); | 2760 | Fluxbox *fluxbox = Fluxbox::instance(); |
2744 | 2761 | ||
2745 | fluxbox->maskWindowEvents(0, 0); | 2762 | fluxbox->removeRedirectEvent(MotionNotify, fbWindow().window()); |
2746 | 2763 | fluxbox->removeRedirectEvent(ButtonRelease, fbWindow().window()); | |
2747 | 2764 | ||
2748 | if (! screen().doOpaqueMove()) { | 2765 | if (! screen().doOpaqueMove()) { |
2749 | parent().drawRectangle(screen().rootTheme().opGC(), | 2766 | parent().drawRectangle(screen().rootTheme().opGC(), |