diff options
author | rathnor <rathnor> | 2003-07-20 18:05:40 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-07-20 18:05:40 (GMT) |
commit | 037bd174bfb107fef4657c949ce49c188090f3e7 (patch) | |
tree | 35d56080c76f4751946be2ddf95e4ce18e2a5bf2 /src | |
parent | 8500132b0a05d22470e63cee1d16191ecb138ecf (diff) | |
download | fluxbox_lack-037bd174bfb107fef4657c949ce49c188090f3e7.zip fluxbox_lack-037bd174bfb107fef4657c949ce49c188090f3e7.tar.bz2 |
fix focus and raising for transient windows in particular
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Menu.hh | 3 | ||||
-rw-r--r-- | src/FbTk/MultLayers.cc | 8 | ||||
-rw-r--r-- | src/FbTk/MultLayers.hh | 8 | ||||
-rw-r--r-- | src/FbTk/XLayer.cc | 7 | ||||
-rw-r--r-- | src/WinClient.cc | 21 | ||||
-rw-r--r-- | src/WinClient.hh | 11 | ||||
-rw-r--r-- | src/Window.cc | 70 | ||||
-rw-r--r-- | src/fluxbox.cc | 12 |
8 files changed, 94 insertions, 46 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 9ab69b4..fba7ae2 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -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: Menu.hh,v 1.21 2003/07/20 10:41:56 rathnor Exp $ | 25 | // $Id: Menu.hh,v 1.22 2003/07/20 18:05:39 rathnor Exp $ |
26 | 26 | ||
27 | #ifndef FBTK_MENU_HH | 27 | #ifndef FBTK_MENU_HH |
28 | #define FBTK_MENU_HH | 28 | #define FBTK_MENU_HH |
@@ -37,7 +37,6 @@ | |||
37 | #include "RefCount.hh" | 37 | #include "RefCount.hh" |
38 | #include "Command.hh" | 38 | #include "Command.hh" |
39 | #include "Observer.hh" | 39 | #include "Observer.hh" |
40 | #include "XLayerItem.hh" | ||
41 | #include "FbPixmap.hh" | 40 | #include "FbPixmap.hh" |
42 | #include "MenuTheme.hh" | 41 | #include "MenuTheme.hh" |
43 | 42 | ||
diff --git a/src/FbTk/MultLayers.cc b/src/FbTk/MultLayers.cc index fea4dae..9e3272b 100644 --- a/src/FbTk/MultLayers.cc +++ b/src/FbTk/MultLayers.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: MultLayers.cc,v 1.6 2003/02/18 15:08:12 rathnor Exp $ | 23 | // $Id: MultLayers.cc,v 1.7 2003/07/20 18:05:39 rathnor Exp $ |
24 | 24 | ||
25 | #include "MultLayers.hh" | 25 | #include "MultLayers.hh" |
26 | #include "XLayer.hh" | 26 | #include "XLayer.hh" |
@@ -32,7 +32,9 @@ using namespace std; | |||
32 | 32 | ||
33 | using namespace FbTk; | 33 | using namespace FbTk; |
34 | 34 | ||
35 | MultLayers::MultLayers(int numlayers) { | 35 | MultLayers::MultLayers(int numlayers) : |
36 | m_lock(0) | ||
37 | { | ||
36 | for (int i=0; i < numlayers; ++i) | 38 | for (int i=0; i < numlayers; ++i) |
37 | m_layers.push_back(new XLayer(*this, i)); | 39 | m_layers.push_back(new XLayer(*this, i)); |
38 | } | 40 | } |
@@ -150,6 +152,8 @@ void MultLayers::moveToLayer(XLayerItem &item, int layernum) { | |||
150 | } | 152 | } |
151 | 153 | ||
152 | void MultLayers::restack() { | 154 | void MultLayers::restack() { |
155 | if (!isUpdatable()) | ||
156 | return; | ||
153 | 157 | ||
154 | int layernum=0, winnum=0, size = this->size(); | 158 | int layernum=0, winnum=0, size = this->size(); |
155 | 159 | ||
diff --git a/src/FbTk/MultLayers.hh b/src/FbTk/MultLayers.hh index 5cfc731..29c80a8 100644 --- a/src/FbTk/MultLayers.hh +++ b/src/FbTk/MultLayers.hh | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: MultLayers.hh,v 1.5 2003/02/09 14:11:14 rathnor Exp $ | 23 | // $Id: MultLayers.hh,v 1.6 2003/07/20 18:05:40 rathnor Exp $ |
24 | 24 | ||
25 | #ifndef FBTK_MULTLAYERS_HH | 25 | #ifndef FBTK_MULTLAYERS_HH |
26 | #define FBTK_MULTLAYERS_HH | 26 | #define FBTK_MULTLAYERS_HH |
@@ -59,9 +59,15 @@ public: | |||
59 | XLayer *getLayer(size_t num); | 59 | XLayer *getLayer(size_t num); |
60 | const XLayer *getLayer(size_t num) const; | 60 | const XLayer *getLayer(size_t num) const; |
61 | 61 | ||
62 | inline bool isUpdatable() const { return m_lock == 0; } | ||
63 | inline void lock() { ++m_lock; } | ||
64 | inline void unlock() { if (--m_lock == 0) restack(); } | ||
65 | |||
62 | private: | 66 | private: |
63 | std::vector<XLayer *> m_layers; | 67 | std::vector<XLayer *> m_layers; |
64 | 68 | ||
69 | int m_lock; | ||
70 | |||
65 | }; | 71 | }; |
66 | 72 | ||
67 | }; | 73 | }; |
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 023a80d..8164444 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: XLayer.cc,v 1.8 2003/04/15 23:20:31 rathnor Exp $ | 23 | // $Id: XLayer.cc,v 1.9 2003/07/20 18:05:40 rathnor Exp $ |
24 | 24 | ||
25 | #include "XLayer.hh" | 25 | #include "XLayer.hh" |
26 | #include "XLayerItem.hh" | 26 | #include "XLayerItem.hh" |
@@ -39,6 +39,9 @@ XLayer::~XLayer() { | |||
39 | } | 39 | } |
40 | 40 | ||
41 | void XLayer::restack() { | 41 | void XLayer::restack() { |
42 | if (!m_manager.isUpdatable()) | ||
43 | return; | ||
44 | |||
42 | int num_windows = countWindows(); | 45 | int num_windows = countWindows(); |
43 | 46 | ||
44 | // each LayerItem can contain several windows | 47 | // each LayerItem can contain several windows |
@@ -78,6 +81,8 @@ int XLayer::countWindows() { | |||
78 | 81 | ||
79 | // Stack all windows associated with 'item' below the 'above' item | 82 | // Stack all windows associated with 'item' below the 'above' item |
80 | void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) { | 83 | void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) { |
84 | if (!m_manager.isUpdatable()) | ||
85 | return; | ||
81 | 86 | ||
82 | Window *winlist; | 87 | Window *winlist; |
83 | size_t winnum, size, num = item->numWindows(); | 88 | size_t winnum, size, num = item->numWindows(); |
diff --git a/src/WinClient.cc b/src/WinClient.cc index ddd3cd1..416dd63 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WinClient.cc,v 1.17 2003/07/10 11:58:13 fluxgen Exp $ | 22 | // $Id: WinClient.cc,v 1.18 2003/07/20 18:05:39 rathnor Exp $ |
23 | 23 | ||
24 | #include "WinClient.hh" | 24 | #include "WinClient.hh" |
25 | 25 | ||
@@ -54,7 +54,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb | |||
54 | wm_hint_flags(0), | 54 | wm_hint_flags(0), |
55 | send_focus_message(false), | 55 | send_focus_message(false), |
56 | m_win(fbwin), | 56 | m_win(fbwin), |
57 | modal(false), | 57 | m_modal(0), |
58 | m_title(""), m_icon_title(""), | 58 | m_title(""), m_icon_title(""), |
59 | m_class_name(""), m_instance_name(""), | 59 | m_class_name(""), m_instance_name(""), |
60 | m_blackbox_hint(0), | 60 | m_blackbox_hint(0), |
@@ -245,8 +245,9 @@ void WinClient::updateTransientInfo() { | |||
245 | return; | 245 | return; |
246 | 246 | ||
247 | if (win != None && m_win->screen().rootWindow() == win) { | 247 | if (win != None && m_win->screen().rootWindow() == win) { |
248 | modal = true; | 248 | // transient for root window... = transient for group |
249 | return; // transient for root window... | 249 | // I don't think we are group-aware yet |
250 | return; | ||
250 | } | 251 | } |
251 | 252 | ||
252 | FluxboxWindow *transient_win = Fluxbox::instance()->searchWindow(win); | 253 | FluxboxWindow *transient_win = Fluxbox::instance()->searchWindow(win); |
@@ -514,3 +515,15 @@ bool WinClient::hasGroupLeftWindow() const { | |||
514 | } | 515 | } |
515 | return false; | 516 | return false; |
516 | } | 517 | } |
518 | |||
519 | void WinClient::addModal() { | ||
520 | ++m_modal; | ||
521 | if (transient_for) | ||
522 | transient_for->addModal(); | ||
523 | } | ||
524 | |||
525 | void WinClient::removeModal() { | ||
526 | --m_modal; | ||
527 | if (transient_for) | ||
528 | transient_for->removeModal(); | ||
529 | } | ||
diff --git a/src/WinClient.hh b/src/WinClient.hh index c72208f..cedbdd7 100644 --- a/src/WinClient.hh +++ b/src/WinClient.hh | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WinClient.hh,v 1.8 2003/06/23 14:16:05 rathnor Exp $ | 22 | // $Id: WinClient.hh,v 1.9 2003/07/20 18:05:39 rathnor Exp $ |
23 | 23 | ||
24 | #ifndef WINCLIENT_HH | 24 | #ifndef WINCLIENT_HH |
25 | #define WINCLIENT_HH | 25 | #define WINCLIENT_HH |
@@ -70,7 +70,10 @@ public: | |||
70 | TransientList &transientList() { return transients; } | 70 | TransientList &transientList() { return transients; } |
71 | const TransientList &transientList() const { return transients; } | 71 | const TransientList &transientList() const { return transients; } |
72 | bool isTransient() const { return transient_for != 0; } | 72 | bool isTransient() const { return transient_for != 0; } |
73 | bool isModal() const { return modal; } | 73 | |
74 | bool isModal() const { return m_modal > 0; } | ||
75 | void addModal(); // some transient of ours (or us) is modal | ||
76 | void removeModal(); // some transient (or us) is no longer modal | ||
74 | 77 | ||
75 | bool operator == (const FluxboxWindow &win) const { | 78 | bool operator == (const FluxboxWindow &win) const { |
76 | return (m_win == &win); | 79 | return (m_win == &win); |
@@ -138,7 +141,9 @@ public: | |||
138 | enum { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE }; | 141 | enum { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE }; |
139 | 142 | ||
140 | private: | 143 | private: |
141 | bool modal; | 144 | // number of transients which we are modal for |
145 | // or indicates that we are modal if don't have any transients | ||
146 | int m_modal; | ||
142 | 147 | ||
143 | std::string m_title, m_icon_title; | 148 | std::string m_title, m_icon_title; |
144 | std::string m_class_name, m_instance_name; | 149 | std::string m_class_name, m_instance_name; |
diff --git a/src/Window.cc b/src/Window.cc index bfb7dae..4e45370 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.206 2003/07/20 08:12:36 rathnor Exp $ | 25 | // $Id: Window.cc,v 1.207 2003/07/20 18:05:39 rathnor Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -145,6 +145,11 @@ void raiseFluxboxWindow(FluxboxWindow &win) { | |||
145 | if (win.oplock) return; | 145 | if (win.oplock) return; |
146 | win.oplock = true; | 146 | win.oplock = true; |
147 | 147 | ||
148 | // we need to lock actual restacking so that raising above active transient | ||
149 | // won't do anything nasty | ||
150 | if (!win.winClient().transientList().empty()) | ||
151 | win.screen().layerManager().lock(); | ||
152 | |||
148 | if (!win.isIconic()) { | 153 | if (!win.isIconic()) { |
149 | win.screen().updateNetizenWindowRaise(win.clientWindow()); | 154 | win.screen().updateNetizenWindowRaise(win.clientWindow()); |
150 | win.layerItem().raise(); | 155 | win.layerItem().raise(); |
@@ -159,6 +164,9 @@ void raiseFluxboxWindow(FluxboxWindow &win) { | |||
159 | raiseFluxboxWindow(*(*it)->fbwindow()); | 164 | raiseFluxboxWindow(*(*it)->fbwindow()); |
160 | } | 165 | } |
161 | win.oplock = false; | 166 | win.oplock = false; |
167 | |||
168 | if (!win.winClient().transientList().empty()) | ||
169 | win.screen().layerManager().unlock(); | ||
162 | } | 170 | } |
163 | 171 | ||
164 | /// lower window and do the same for each transient it holds | 172 | /// lower window and do the same for each transient it holds |
@@ -166,6 +174,11 @@ void lowerFluxboxWindow(FluxboxWindow &win) { | |||
166 | if (win.oplock) return; | 174 | if (win.oplock) return; |
167 | win.oplock = true; | 175 | win.oplock = true; |
168 | 176 | ||
177 | // we need to lock actual restacking so that raising above active transient | ||
178 | // won't do anything nasty | ||
179 | if (!win.winClient().transientList().empty()) | ||
180 | win.screen().layerManager().lock(); | ||
181 | |||
169 | if (!win.isIconic()) { | 182 | if (!win.isIconic()) { |
170 | win.screen().updateNetizenWindowLower(win.clientWindow()); | 183 | win.screen().updateNetizenWindowLower(win.clientWindow()); |
171 | win.layerItem().lower(); | 184 | win.layerItem().lower(); |
@@ -179,6 +192,8 @@ void lowerFluxboxWindow(FluxboxWindow &win) { | |||
179 | lowerFluxboxWindow(*(*it)->fbwindow()); | 192 | lowerFluxboxWindow(*(*it)->fbwindow()); |
180 | } | 193 | } |
181 | win.oplock = false; | 194 | win.oplock = false; |
195 | if (!win.winClient().transientList().empty()) | ||
196 | win.screen().layerManager().unlock(); | ||
182 | } | 197 | } |
183 | 198 | ||
184 | /// raise window and do the same for each transient it holds | 199 | /// raise window and do the same for each transient it holds |
@@ -186,6 +201,9 @@ void tempRaiseFluxboxWindow(FluxboxWindow &win) { | |||
186 | if (win.oplock) return; | 201 | if (win.oplock) return; |
187 | win.oplock = true; | 202 | win.oplock = true; |
188 | 203 | ||
204 | if (!win.winClient().transientList().empty()) | ||
205 | win.screen().layerManager().lock(); | ||
206 | |||
189 | if (!win.isIconic()) { | 207 | if (!win.isIconic()) { |
190 | // don't update netizen, as it is only temporary | 208 | // don't update netizen, as it is only temporary |
191 | win.layerItem().tempRaise(); | 209 | win.layerItem().tempRaise(); |
@@ -200,6 +218,10 @@ void tempRaiseFluxboxWindow(FluxboxWindow &win) { | |||
200 | tempRaiseFluxboxWindow(*(*it)->fbwindow()); | 218 | tempRaiseFluxboxWindow(*(*it)->fbwindow()); |
201 | } | 219 | } |
202 | win.oplock = false; | 220 | win.oplock = false; |
221 | |||
222 | if (!win.winClient().transientList().empty()) | ||
223 | win.screen().layerManager().unlock(); | ||
224 | |||
203 | } | 225 | } |
204 | 226 | ||
205 | class SetClientCmd:public FbTk::Command { | 227 | class SetClientCmd:public FbTk::Command { |
@@ -1107,8 +1129,6 @@ bool FluxboxWindow::setInputFocus() { | |||
1107 | if (! validateClient()) | 1129 | if (! validateClient()) |
1108 | return false; | 1130 | return false; |
1109 | 1131 | ||
1110 | bool ret = false; | ||
1111 | |||
1112 | if (!m_client->transients.empty() && m_client->isModal()) { | 1132 | if (!m_client->transients.empty() && m_client->isModal()) { |
1113 | WinClient::TransientList::iterator it = m_client->transients.begin(); | 1133 | WinClient::TransientList::iterator it = m_client->transients.begin(); |
1114 | WinClient::TransientList::iterator it_end = m_client->transients.end(); | 1134 | WinClient::TransientList::iterator it_end = m_client->transients.end(); |
@@ -1116,30 +1136,19 @@ bool FluxboxWindow::setInputFocus() { | |||
1116 | if ((*it)->isModal()) | 1136 | if ((*it)->isModal()) |
1117 | return (*it)->fbwindow()->setCurrentClient(**it, true); | 1137 | return (*it)->fbwindow()->setCurrentClient(**it, true); |
1118 | } | 1138 | } |
1139 | } | ||
1140 | if (m_client->getFocusMode() == WinClient::F_LOCALLYACTIVE || | ||
1141 | m_client->getFocusMode() == WinClient::F_PASSIVE) { | ||
1142 | m_client->setInputFocus(RevertToPointerRoot, CurrentTime); | ||
1119 | } else { | 1143 | } else { |
1120 | if (m_client->getFocusMode() == WinClient::F_LOCALLYACTIVE || | 1144 | return false; |
1121 | m_client->getFocusMode() == WinClient::F_PASSIVE) { | ||
1122 | m_client->setInputFocus(RevertToPointerRoot, CurrentTime); | ||
1123 | } else { | ||
1124 | return false; | ||
1125 | } | ||
1126 | |||
1127 | screen().setFocusedWindow(*m_client); | ||
1128 | |||
1129 | Fluxbox::instance()->setFocusedWindow(this); | ||
1130 | |||
1131 | frame().setFocus(true); | ||
1132 | |||
1133 | m_client->sendFocus(); | ||
1134 | |||
1135 | if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus()) | ||
1136 | && screen().doAutoRaise()) | ||
1137 | m_timer.start(); | ||
1138 | |||
1139 | ret = true; | ||
1140 | } | 1145 | } |
1141 | 1146 | ||
1142 | return ret; | 1147 | if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus()) |
1148 | && screen().doAutoRaise()) | ||
1149 | m_timer.start(); | ||
1150 | |||
1151 | return true; | ||
1143 | } | 1152 | } |
1144 | 1153 | ||
1145 | void FluxboxWindow::hide() { | 1154 | void FluxboxWindow::hide() { |
@@ -1224,8 +1233,9 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { | |||
1224 | 1233 | ||
1225 | frame().show(); | 1234 | frame().show(); |
1226 | 1235 | ||
1227 | if (was_iconic && screen().doFocusNew()) | 1236 | if (was_iconic && screen().doFocusNew()) { |
1228 | setInputFocus(); | 1237 | setInputFocus(); |
1238 | } | ||
1229 | 1239 | ||
1230 | if (focused != frame().focused()) | 1240 | if (focused != frame().focused()) |
1231 | frame().setFocus(focused); | 1241 | frame().setFocus(focused); |
@@ -1579,9 +1589,11 @@ void FluxboxWindow::setFocusFlag(bool focus) { | |||
1579 | if (focused) | 1589 | if (focused) |
1580 | gettimeofday(&m_last_focus_time, 0); | 1590 | gettimeofday(&m_last_focus_time, 0); |
1581 | 1591 | ||
1592 | screen().setFocusedWindow(*m_client); | ||
1593 | m_client->sendFocus(); | ||
1582 | frame().setFocus(focus); | 1594 | frame().setFocus(focus); |
1583 | 1595 | ||
1584 | if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus()) && | 1596 | if (!focused && (screen().isSloppyFocus() || screen().isSemiSloppyFocus()) && |
1585 | screen().doAutoRaise()) | 1597 | screen().doAutoRaise()) |
1586 | m_timer.stop(); | 1598 | m_timer.stop(); |
1587 | } | 1599 | } |
@@ -2042,8 +2054,9 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { | |||
2042 | 2054 | ||
2043 | setState(NormalState); | 2055 | setState(NormalState); |
2044 | 2056 | ||
2045 | if (client->isTransient() || screen().doFocusNew()) | 2057 | if (client->isTransient() || screen().doFocusNew()) { |
2046 | setInputFocus(); | 2058 | setInputFocus(); |
2059 | } | ||
2047 | else | 2060 | else |
2048 | setFocusFlag(false); | 2061 | setFocusFlag(false); |
2049 | 2062 | ||
@@ -2555,8 +2568,9 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) { | |||
2555 | 2568 | ||
2556 | // if client is set, use setCurrent client, otherwise just setInputFocus | 2569 | // if client is set, use setCurrent client, otherwise just setInputFocus |
2557 | if ((!sa.leave || sa.inferior) && | 2570 | if ((!sa.leave || sa.inferior) && |
2558 | ((client && setCurrentClient(*client, true)) || setInputFocus())) | 2571 | ((client && setCurrentClient(*client, true)) || setInputFocus())) { |
2559 | installColormap(True); | 2572 | installColormap(True); |
2573 | } | ||
2560 | } | 2574 | } |
2561 | } | 2575 | } |
2562 | } | 2576 | } |
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 027da76..b7a4d5b 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.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: fluxbox.cc,v 1.171 2003/07/18 15:40:55 rathnor Exp $ | 25 | // $Id: fluxbox.cc,v 1.172 2003/07/20 18:05:39 rathnor Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -891,11 +891,13 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
891 | break; | 891 | break; |
892 | 892 | ||
893 | FluxboxWindow *win = searchWindow(e->xfocus.window); | 893 | FluxboxWindow *win = searchWindow(e->xfocus.window); |
894 | if (win && ! win->isFocused()) | 894 | if (win && ! win->isFocused()) { |
895 | setFocusedWindow(win); | 895 | setFocusedWindow(win); |
896 | } | ||
896 | 897 | ||
897 | } break; | 898 | } break; |
898 | case FocusOut:{ | 899 | case FocusOut:{ |
900 | |||
899 | if (e->xfocus.mode == NotifyUngrab || | 901 | if (e->xfocus.mode == NotifyUngrab || |
900 | e->xfocus.detail == NotifyPointer) | 902 | e->xfocus.detail == NotifyPointer) |
901 | break; | 903 | break; |
@@ -904,8 +906,7 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
904 | #ifdef DEBUG | 906 | #ifdef DEBUG |
905 | cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; | 907 | cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; |
906 | #endif // DEBUG | 908 | #endif // DEBUG |
907 | if (getFocusedWindow()) | 909 | |
908 | getFocusedWindow()->setInputFocus(); | ||
909 | } | 910 | } |
910 | } | 911 | } |
911 | break; | 912 | break; |
@@ -1084,8 +1085,9 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) { | |||
1084 | 1085 | ||
1085 | } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) { | 1086 | } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) { |
1086 | FluxboxWindow *win = searchWindow(ce.window); | 1087 | FluxboxWindow *win = searchWindow(ce.window); |
1087 | if (win && win->isVisible() && win->setInputFocus()) | 1088 | if (win && win->isVisible() && win->setInputFocus()) { |
1088 | win->installColormap(true); | 1089 | win->installColormap(true); |
1090 | } | ||
1089 | } else if (ce.message_type == m_fbatoms->getFluxboxCycleWindowFocusAtom()) { | 1091 | } else if (ce.message_type == m_fbatoms->getFluxboxCycleWindowFocusAtom()) { |
1090 | BScreen *screen = searchScreen(ce.window); | 1092 | BScreen *screen = searchScreen(ce.window); |
1091 | 1093 | ||