winapps-org / winapps

The winapps main project, forked from https://github.com/Fmstrat/winapps/
Other
998 stars 45 forks source link

Paint.net's sub-windows always floats on top of all windows unless main window is minimised #80

Open ImGGAAVVIINN opened 6 months ago

ImGGAAVVIINN commented 6 months ago

Issue The sub-windows of paint.net (colour, layers, history, tools) does not hide alongside the main window and stayed on top of all windows, even on other desktops. But get minimised when the main window get minimised DE/WM KDE Plasma & I3wm Video https://github.com/winapps-org/winapps/assets/68761233/619b4e61-f9e4-441f-b6c8-cbf7c32de7ef My current work around A very janky bash script that automatically minimise the main window when it is not focused for 4 seconds. It only works in floating window manager, where you can minimise a window

#!/bin/bash

# Define function to minimize windows
minimize_windows() {
    # Get the list of window IDs corresponding to "RAIL" class
    window_ids=$(xdotool search --classname RAIL)

    # Loop through each window ID
    for id in $window_ids; do
        # Check if the window is focused
        is_focused=$(xdotool getwindowfocus | grep -c "$id")

        # If the window is not focused, wait for 5 seconds and then minimize it
        if [ "$is_focused" -eq 0 ]; then
            sleep 1
            xdotool windowminimize "$id"
        fi
    done
}

# Continuously loop until Ctrl+C is pressed
while true; do
    minimize_windows
done