Skip to content

Implement window manager core #406

@pbalduino

Description

@pbalduino

Summary

Implement the window manager that handles window placement, sizing, stacking order, and user interactions (move, resize, minimize, maximize, close).

Goals

  • Window placement policies
  • Move and resize operations
  • Minimize, maximize, close
  • Z-order management (raise, lower)
  • Window decorations integration

Implementation

Window Operations

```c
void wm_move_window(struct window *w, int x, int y);
void wm_resize_window(struct window *w, int width, int height);
void wm_raise_window(struct window *w); // Bring to front
void wm_lower_window(struct window *w); // Send to back
void wm_close_window(struct window *w);
void wm_minimize_window(struct window *w);
void wm_maximize_window(struct window *w);
```

Window Placement

```c
// Cascade: Each new window offset from previous
void wm_place_cascade(struct window *w) {
static int offset = 0;
w->x = 100 + offset;
w->y = 100 + offset;
offset = (offset + 30) % 200;
}

// Center: Place in screen center
void wm_place_center(struct window *w) {
w->x = (screen_width - w->width) / 2;
w->y = (screen_height - w->height) / 2;
}
```

Timeline

Total: 3-4 weeks

Definition of Done

  • Windows can be moved
  • Windows can be resized
  • Minimize/maximize/close work
  • Z-order management works
  • Placement policies work
  • Smooth user experience

Dependencies

See docs/road/road_to_gui.md for complete roadmap.

Metadata

Metadata

Assignees

Labels

GUIGraphical user interface componentsenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions