Skip to content

Marked Feature added: Pause per monitor when maximized/fullscreen#250

Open
JannickRichter wants to merge 1 commit intojeffshee:masterfrom
JannickRichter:master
Open

Marked Feature added: Pause per monitor when maximized/fullscreen#250
JannickRichter wants to merge 1 commit intojeffshee:masterfrom
JannickRichter:master

Conversation

@JannickRichter
Copy link

Summary

This PR implements per-monitor detection for maximized and fullscreen windows. Instead of pausing all video wallpapers globally when any window is maximized, it now only pauses the video on the specific monitor where the maximized/fullscreen window is located.

Changes

[src/utils.py] (WindowHandler class)

  • Added [_get_monitor_geometries()] to cache monitor positions and dimensions
  • Added [_get_window_monitor(window)] to determine which monitor a window is on based on its center point
  • Modified [eval()] to track per-monitor state in a monitor_states dictionary
  • Maintains backward compatibility with is_any_maximized and is_any_fullscreen flags

[src/player/video_player.py] (VideoPlayer class)

  • Added monitor_states instance variable
  • Modified [_on_window_state_changed()] to pause/resume videos on a per-monitor basis
  • Updated [_should_playback_start()] to accept optional monitor_name parameter

Behavior

  • Before: Maximizing a window on Monitor 1 pauses videos on ALL monitors
  • After: Maximizing a window on Monitor 1 only pauses the video on Monitor 1; Monitor 2 continues playing

Testing

Tested on X11 with dual-monitor setup (HDMI-0 + DP-0). Verified that:

  • Maximizing on one monitor only pauses that monitor's video
  • Closing/minimizing the window resumes playback on the affected monitor
  • Other monitors remain unaffected

Notes

  • This feature only works on X11 (same limitation as the existing maximized detection)
  • Uses Gdk.Display for monitor geometry and Wnck for window positions
    Hoping for a updated flatpak soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant