summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-15 11:37:20 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-15 11:37:20 -0400
commitf7f739c0576b4cf2fe9e5748fcdf861c0d970523 (patch)
treea1ac021068764e9c876a04f5c350fb44037a9129
parentMerge pull request #27 from taiyu-len/master (diff)
parentfixed focus (diff)
downloadsway-f7f739c0576b4cf2fe9e5748fcdf861c0d970523.tar.gz
sway-f7f739c0576b4cf2fe9e5748fcdf861c0d970523.tar.zst
sway-f7f739c0576b4cf2fe9e5748fcdf861c0d970523.zip
Merge pull request #29 from taiyu-len/master
fixed focus
-rw-r--r--sway/layout.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 8b9315b4..e2e91593 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -223,16 +223,17 @@ void unfocus_all(swayc_t *container) {
223} 223}
224 224
225void focus_view(swayc_t *view) { 225void focus_view(swayc_t *view) {
226 sway_log(L_DEBUG, "Setting focus to %p", view); 226 sway_log(L_DEBUG, "Setting focus for %p", view);
227 if (view->type == C_VIEW) {
228 wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
229 wlc_view_bring_to_front(view->handle);
230 wlc_view_focus(view->handle);
231 }
232 // Propagete focus up
233 while (view != &root_container) { 227 while (view != &root_container) {
234 view->parent->focused = view; 228 view->parent->focused = view;
235 view = view->parent; 229 view = view->parent;
236 } 230 }
231 while (view && view->type != C_VIEW) {
232 view = view->focused;
233 }
234 if (view) {
235 wlc_view_set_state(view->handle, WLC_BIT_ACTIVATED, true);
236 wlc_view_focus(view->handle);
237 }
237} 238}
238 239