Skip to content

Releases: JustLachin/PyDisplayWindow

v2.0.1 Always on top fixed!

28 Mar 13:00
c3bd9c1

Choose a tag to compare

PyDisplayWindow Pro - Changelog v2.0.1

🔧 Critical Fixes

1. Always on Top Feature Completely Rewritten

Old Problem:

  • Window always stayed on top regardless of checkbox state
  • Setting had no effect, it was purely cosmetic

New Solution:

  • _on_always_on_top_changed() method completely rewritten
  • Using correct method for Windows: hide() → setWindowFlags() → show()
  • Window state (minimized, maximized, fullscreen) is preserved
  • Every change is automatically saved to config.json
  • Post-change verification implemented (_verify_always_on_top())
  • Full transparency with console logging

Technical Details:

# Old (non-working) method:
self.setWindowFlag(Qt.WindowType.WindowStaysOnTopHint, on_top)
self.show()

# New (working) method:
self.hide()
self.setWindowFlags(self.windowFlags() & ~Qt.WindowType.WindowStaysOnTopHint)
if on_top:
    self.setWindowFlags(self.windowFlags() | Qt.WindowType.WindowStaysOnTopHint)
self.show()

2. Screen Capture Continues When Minimized

Old Problem:

  • Screen capture completely stopped when window was minimized
  • Major issue during streaming

New Solution:

  • changeEvent() event handler added
  • Only rendering is paused with isMinimized() check
  • Capture worker thread continues running
  • Frames are stored in self.current_frame
  • Console log written every 60 frames (proof)
  • Shows how many frames were captured when window is restored

Technical Details:

def _on_frame_captured(self, frame: np.ndarray):
    # Store frame FIRST
    self.current_frame = frame
    
    # Skip rendering if minimized, but capture continues
    if self.isMinimized():
        # Prove it with log counter
        self._minimize_log_counter += 1
        if self._minimize_log_counter % 60 == 0:
            logger.info(f"Still capturing while minimized (frame #{self._minimize_log_counter})")
        return
    
    # Normal rendering...

3. Settings Loading Order Fixed

Old Problem:

  • _load_config() was called before UI was created
  • Tried to apply settings when checkbox didn't exist yet

New Solution:

  • Config is loaded FIRST
  • UI is created
  • Then _apply_always_on_top_setting() is called
  • Checkbox signals are blocked to prevent infinite loops

4. Presentation Mode Fixed

Old Problem:

  • Presentation mode always forced always on top to be enabled
  • User setting was ignored

New Solution:

  • Presentation mode no longer forces always on top
  • Only follows user's setting
  • Status reported via log messages

📊 Console Logs

Detailed log messages for every operation:

Startup:

============================================================
INITIAL Always on top setting: True
Window flag actually set: True
[OK] Always on top correctly applied at startup
============================================================

Always on Top Change:

Always on top changed to: True
[OK] Always on top verified: True

Minimize:

============================================================
WINDOW MINIMIZED - Capture worker continues running!
Frame capture continues, only Qt rendering is paused
============================================================
[OK] Capture worker is RUNNING (is_running=True)
[OK] Still capturing while minimized (frame #60)
[OK] Still capturing while minimized (frame #120)

Restore:

============================================================
WINDOW RESTORED - Rendering resumed
============================================================
Window restored - captured 180 frames while minimized

🧪 Test Instructions

See TEST_INSTRUCTIONS.md for detailed test instructions.

Quick Test:

  1. Always on Top:

    • Toggle checkbox on/off
    • Open another window
    • Check if PyDisplayWindow stays on top or not
  2. Minimize Capture:

    • Start capture
    • Minimize window
    • Check console logs
    • Verify frame counter is increasing

🔍 Changed Files

  • main.py - Main program file (all fixes here)
  • README.md - New features added
  • TEST_INSTRUCTIONS.md - Test instructions (NEW)
  • CHANGELOG_v2.0.1.md - This file (NEW)

🎯 Result

Both issues are completely fixed:

✅ Always on Top now actually works
✅ Capture continues when minimized
✅ Settings are correctly saved and loaded
✅ Full transparency with detailed logs
✅ Much better user experience


Developer: PyDisplayWindow Team
Date: March 28, 2026
Version: 2.0.1

v2.0.0

19 Mar 19:31
8c57c41

Choose a tag to compare

PyDisplayWindow

Display to Window Capture Stream Application

A professional screen capture application that displays your screen in a window, enabling full screen sharing through window capture in streaming platforms like Discord, TikTok Live, OBS Studio, and more.


🎯 What Problem Does This Solve?

When streaming on platforms like TikTok Live or Discord, you're often limited to either:

  • Window Capture - Share only a specific application window
  • Screen Capture - Share your entire screen

However, many platforms (especially TikTok Live Studio app) only offer Window Capture with no "Share Screen" option. This is problematic when you want to share multiple windows or your entire desktop.

PyDisplayWindow solves this by:

  1. Capturing your entire screen (or selected monitor)
  2. Displaying it in a window
  3. You select this window in the streaming platform's "Window Capture"
  4. Result: Full screen sharing through a window! 🎉

✨ Features

  • 🖥️ Multi-Monitor Support - Select any connected display to capture
  • High Performance - Optimized for 15-60 FPS with minimal CPU usage
  • Scale Factor - Reduce resolution for better performance (25-100%)
  • FPS Counter - Real-time performance monitoring
  • 🎛️ Professional Controls - Pause, resume, change displays on-the-fly
  • 🪟 Always on Top - Keep the window visible above other applications
  • 💾 Persistent Settings - Your preferences are saved between sessions
  • 🎨 Dark Theme - Modern, eye-friendly interface
  • ⌨️ Keyboard Shortcuts - Quick access to common actions
  • 📝 Logging System - Detailed logs for troubleshooting

📦 Installation

Requirements

  • Python 3.8 or higher
  • Windows, macOS, or Linux

Install Dependencies

pip install -r requirements.txt

Or install individually:

pip install PyQt6 Pillow numpy opencv-python

🚀 Usage

Quick Start

Option 1: Use Launcher (Windows)

  1. Double-click start.bat
  2. The launcher will check dependencies and start the app

Option 2: Manual Start

  1. Run the application:

    python main.py
  2. Select your display:

    • On first launch, the Display Selector dialog appears automatically
    • Choose which monitor you want to capture
    • Set your preferred FPS (15-60)
    • Click "OK"
  3. Start capturing:

    • Click the "Start Capture" button
    • Your selected screen will appear in the window
  4. Stream!

    • Open your streaming platform (Discord, TikTok, OBS, etc.)
    • Select "Window Capture"
    • Choose "PyDisplayWindow" from the window list
    • Your viewers now see your full screen!

Controls

Button Function
▶ Start Capture Begin screen capture
⏹ Stop Capture Stop screen capture
⏸ Pause Pause the stream (freeze frame)
🖥 Change Display Switch to a different monitor
FPS Dropdown Change frame rate (15/30/45/60)

Keyboard Shortcuts

Shortcut Action
Ctrl + D Select Display
Ctrl + Q Quit Application
F11 Toggle Fullscreen

🎮 Use Cases

TikTok Live Streaming

Share your entire gaming setup, tutorial, or desktop when TikTok only offers window capture.

Discord Screen Sharing

Work around Discord's limitations when you need to share multiple windows seamlessly.

OBS Studio

Use as a source in OBS for advanced scene switching and effects.

Presentations & Tutorials

Mirror your main screen to a secondary window for recording or streaming.


⚙️ Configuration

Settings are automatically saved to:

  • Windows: %USERPROFILE%\.pydisplaywindow\config.json
  • macOS/Linux: ~/.pydisplaywindow/config.json

Adjustable Settings

Setting Range Default Description
Target FPS 15-60 30 Frame rate for capture
Quality 50-100% 85% Image quality
Scale Factor 25-100% 50% Reduce resolution for better performance
Always on Top On/Off Off Keep window above others
Show FPS On/Off On Display FPS counter

🔧 Troubleshooting

Application won't start

  • Ensure all dependencies are installed: pip install -r requirements.txt
  • Check Python version: python --version (must be 3.8+)

Display not detected

  • Click the "🔄 Refresh Display List" button
  • Ensure your monitor is properly connected
  • Try restarting the application

Low FPS / Stuttering

  • Lower the FPS setting (try 15 or 30)
  • Use Scale Factor - Reduce to 50% or 25% for much better performance
  • Close other applications to free up CPU/GPU
  • Reduce screen resolution if possible

Black screen

  • Some applications with DRM protection may show black (this is expected)
  • Try capturing a different display or region

🏗️ Architecture

PyDisplayWindow/
├── main.py              # Main application entry point
├── start.bat            # Windows launcher script
├── requirements.txt     # Python dependencies
└── README.md           # This file

Key Components

Component Purpose
DisplayManager Detects and manages connected monitors
CaptureWorker Background thread for screen capture
DisplaySelectionDialog UI for choosing display and settings
MainWindow Primary application window with controls

📝 License

MIT License - Feel free to use, modify, and distribute!


🙏 Credits

  • Built with PyQt6 for the user interface
  • Screen capture powered by Windows APIs and Pillow
  • Image processing with Pillow, NumPy, and OpenCV

💡 Tips for Best Results

  1. Match FPS to your stream - If streaming at 30fps, set PyDisplayWindow to 30fps
  2. Use "Always on Top" when you need the window visible while working
  3. Pause when switching - Pause capture when changing sensitive content
  4. Close unnecessary apps - For best performance, minimize background applications

📧 Support

For issues, suggestions, or contributions:

  • Open an issue on the project repository
  • Contact the PyDisplayWindow team

Enjoy streaming with PyDisplayWindow! 🎥✨