diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-01 18:29:36 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-01 18:29:36 (GMT) |
commit | 7588fc10a61c141208ccccc423cc7920207b2e89 (patch) | |
tree | ca9acf5c5bb36df5a9a77a4b7ce0f79cb3e054ab /src/Window.cc | |
parent | 72d2f0e48143115aae38b75d5b1bda4cee5d512a (diff) | |
download | fluxbox_pavel-7588fc10a61c141208ccccc423cc7920207b2e89.zip fluxbox_pavel-7588fc10a61c141208ccccc423cc7920207b2e89.tar.bz2 |
fix some flickering on focus change
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Window.cc b/src/Window.cc index cdfcfea..8222c06 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -1013,10 +1013,21 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { | |||
1013 | 1013 | ||
1014 | WinClient *old = m_client; | 1014 | WinClient *old = m_client; |
1015 | m_client = &client; | 1015 | m_client = &client; |
1016 | |||
1017 | bool ret = setinput && focus(); | ||
1018 | if (setinput) { | ||
1019 | m_client = old; | ||
1020 | return ret; | ||
1021 | } | ||
1022 | |||
1016 | m_client->raise(); | 1023 | m_client->raise(); |
1017 | if (setinput != m_focused || setinput && m_client != old) | 1024 | if (m_focused) { |
1018 | m_client->focusSig().notify(); | 1025 | m_client->focusSig().notify(); |
1019 | titleSig().notify(); | 1026 | if (old) |
1027 | old->focusSig().notify(); | ||
1028 | } | ||
1029 | if (old != &client) | ||
1030 | titleSig().notify(); | ||
1020 | 1031 | ||
1021 | #ifdef DEBUG | 1032 | #ifdef DEBUG |
1022 | cerr<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<< | 1033 | cerr<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<< |
@@ -1025,16 +1036,6 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { | |||
1025 | // frame focused doesn't necessarily mean input focused | 1036 | // frame focused doesn't necessarily mean input focused |
1026 | frame().setLabelButtonFocus(*button); | 1037 | frame().setLabelButtonFocus(*button); |
1027 | frame().setShapingClient(&client, false); | 1038 | frame().setShapingClient(&client, false); |
1028 | |||
1029 | bool ret = setinput && focus(); | ||
1030 | if (setinput) { | ||
1031 | // restore old client until focus event comes | ||
1032 | m_client = old; | ||
1033 | if (!ret && old) { | ||
1034 | old->raise(); | ||
1035 | titleSig().notify(); | ||
1036 | } | ||
1037 | } | ||
1038 | return ret; | 1039 | return ret; |
1039 | } | 1040 | } |
1040 | 1041 | ||