-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
GUIGraphical user interface componentsGraphical user interface componentsenhancementNew feature or requestNew feature or request
Milestone
Description
Summary
Implement window focus management, including click-to-focus, keyboard event routing, and focus visual indicators.
Goals
- Click-to-focus behavior
- Keyboard event routing to focused window
- Focus visual feedback
- Focus-follows-mouse (optional)
- Tab cycling between windows
Implementation
Focus Management
```c
struct window *focused_window = NULL;
void wm_focus_window(struct window *w) {
if (focused_window) {
focused_window->focused = 0;
wm_redraw_decoration(focused_window); // Inactive color
}
focused_window = w;
w->focused = 1;
wm_raise_window(w);
wm_redraw_decoration(w); // Active color
send_focus_event(w);
}
void wm_handle_mouse_click(int x, int y) {
struct window *w = wm_find_window_at(x, y);
if (w && w != focused_window) {
wm_focus_window(w);
}
}
```
Timeline
Total: 1-2 weeks
Definition of Done
- Click-to-focus works
- Keyboard events go to focused window
- Visual focus indicator
- Tab cycling works
- Focus events sent to applications
Dependencies
- Implement composition engine with damage tracking #405: Window manager core
- Implement GUI input event system #399: Input events
See docs/road/road_to_gui.md for complete roadmap.
Metadata
Metadata
Assignees
Labels
GUIGraphical user interface componentsGraphical user interface componentsenhancementNew feature or requestNew feature or request