Layout Persistence

Your Layout Survives Everything

SQLite-backed persistence ensures your desktop layout survives reboots, Explorer crashes, and multi-monitor changes.

The Problem: Chaotic Icon Positions

You've probably experienced this frustration: you spend time organizing your desktop icons perfectly, only to find them scrambled after:

  • Windows Explorer crashes or restarts
  • Connecting or disconnecting an external monitor
  • Changing screen resolution or DPI
  • System updates or reboots
  • Remote desktop sessions

RuleDock solves this by storing your layout in a robust SQLite database and restoring it automatically.

How Layout Persistence Works

📸

Continuous Snapshots

RuleDock continuously tracks icon positions and fence configurations, saving changes to SQLite in real-time.

Automatic Recovery

When Explorer restarts, RuleDock detects the change and restores your layout within seconds—no manual intervention needed.

Multi-Monitor Aware

Each display is tracked separately with its own coordinate system. Connect or disconnect monitors without losing icon positions.

📐

DPI-Safe Coordinates

Positions are stored in a normalized coordinate system that handles DPI changes and scaling differences gracefully.

Explorer Crash Recovery

When Windows Explorer crashes (or you restart it manually), most desktop organizers lose track of your icons. RuleDock is different:

Recovery Process
1. Explorer crashes or restarts2. RuleDock detects ListView handle is invalid3. Enters "reconnecting" state (UI shows status)4. Polls for new Desktop ListView handle5. Reconnects and loads layout from SQLite6. Restores all fence positions and icon mappings7. Resume normal operation (~2-5 seconds total)

This recovery happens automatically. You don't need to do anything.

Multi-Monitor Support

RuleDock tracks each display independently using a combination of:

  • Display ID - Unique identifier for each monitor
  • Resolution - Current width × height
  • DPI Scale - System scaling percentage (100%, 125%, 150%, etc.)
  • Position - Where the display sits in the virtual desktop space

Common Scenarios Handled

Scenario What RuleDock Does
Laptop undocked (external monitor removed) Icons from external display are temporarily hidden, restored when you redock
New monitor added Creates empty workspace, existing layouts untouched
Resolution changed Recalculates positions relative to new bounds
DPI changed Applies scaling factor to maintain relative positions
Monitors swapped (left↔right) Detects by display ID, keeps layouts on correct screens

Storage Details

RuleDock uses SQLite for reliable, fast persistence. The database includes:

Database Schema (Simplified)
-- Fences table
CREATE TABLE fences (
    id INTEGER PRIMARY KEY,
    name TEXT,
    x REAL, y REAL,
    width REAL, height REAL,
    is_collapsed INTEGER,
    is_pinned INTEGER,
    opacity REAL,
    display_id TEXT
);

-- Icon mappings
CREATE TABLE icon_map (
    fence_id INTEGER,
    icon_path TEXT,
    original_x REAL,
    original_y REAL
);

-- Layout snapshots for recovery
CREATE TABLE layout_snapshot (
    timestamp TEXT,
    data BLOB
);

Database Location

The SQLite database is stored at:

%LOCALAPPDATA%\RuleDock\ruledock.db

You can back up this file to preserve your layout configuration.

Export & Import

Moving to a new computer? RuleDock supports layout export and import:

  1. Open RuleDock Settings
  2. Go to Backup & Restore
  3. Click Export Configuration
  4. Save the .ruledock file
  5. On your new machine, use Import Configuration

Never Lose Your Layout Again

Download RuleDock and experience bulletproof desktop persistence.

Download RuleDock Free