We don't need to care about frame windows anymore
+11 −16 · 2 files changed
-
grabber.cc+8 −13 -
main.cc+3 −3
@@ -568,21 +568,16 @@ Window find_wm_state(Window w) { return found; } -// sets w to 0 if the window is a frame -Window get_app_window(Window &w) { +Window get_app_window(Window w) { if (!w) return w; - if (frame_win.contains1(w)) { - Window w2 = frame_win.find1(w); - w = 0; - return w2; - } - if (frame_child.contains1(w)) { - Window w2 = frame_child.find1(w); - if (w != w2) - w = 0; - return w2; - } + + if (frame_win.contains1(w)) + return frame_win.find1(w); + + if (frame_child.contains1(w)) + return frame_child.find1(w); + Window w2 = find_wm_state(w); if (w2) { frame_child.add(w, w2); @@ -1233,7 +1233,7 @@ void Main::create_config_dir() { config_dir += "/"; } -extern Window get_app_window(Window &w); +extern Window get_app_window(Window w); void Main::handle_enter_leave(XEvent &ev) { if (ev.xcrossing.mode == NotifyGrab) @@ -1242,10 +1242,10 @@ void Main::handle_enter_leave(XEvent &ev) { return; Window w = ev.xcrossing.window; if (ev.type == EnterNotify) { - if (verbosity >= 3) - printf("Entered window 0x%lx -> 0x%lx\n", w, current_app); current_window.set(w); current_app = get_app_window(w); + if (verbosity >= 3) + printf("Entered window 0x%lx -> 0x%lx\n", w, current_app); } else if (ev.type == LeaveNotify) { if (ev.xcrossing.window != current_window.get()) return;