fix(streaming): keep Flash Player's window in place while it's open
Flash Player moves its window back to the top of the screen once the movie has loaded, bringing the menu bar back. The streamer now checks the window twice a second and puts it back, logging the first few times.
This commit is contained in:
@@ -57,5 +57,6 @@ stretched to the display and moved up by its menu bar's height, which hides the
|
||||
menu bar. GTK draws the menu bar in the window itself and the movie in a child
|
||||
window below it, so the movie's offset, read with `xwininfo`, is the menu bar's
|
||||
height. The window is made override-redirect first, since the window manager
|
||||
keeps windows on screen. Its full-screen mode isn't used, since some games, such
|
||||
keeps windows on screen, and is kept in place while it's open, since Flash
|
||||
Player moves it back once the movie has loaded. Its full-screen mode isn't used, since some games, such
|
||||
as Bloons, don't play right in it. Flashpoint Navigator's toolbars are hidden.
|
||||
|
||||
@@ -68,9 +68,20 @@ case ${app,,} in
|
||||
xdotool windowunmap --sync "$wid"
|
||||
xdotool set_window --overrideredirect 1 "$wid"
|
||||
xdotool windowmap --sync "$wid"
|
||||
xdotool windowsize "$wid" "$width" $((height + menu)) \
|
||||
windowmove "$wid" 0 $((-menu)) windowfocus "$wid"
|
||||
xdotool getwindowgeometry "$wid"
|
||||
place() { xdotool windowsize "$wid" "$width" $((height + menu)) windowmove "$wid" 0 $((-menu)); }
|
||||
place
|
||||
xdotool windowfocus "$wid"
|
||||
# Flash Player moves its window back once the movie has loaded, so it's
|
||||
# kept in place for as long as it's open
|
||||
moves=0
|
||||
while geometry=$(xdotool getwindowgeometry --shell "$wid" 2>/dev/null); do
|
||||
eval "$geometry"
|
||||
if ((X != 0 || Y != -menu || WIDTH != width || HEIGHT != height + menu)); then
|
||||
((++moves <= 3)) && echo "Flash Player window moved to $X,$Y (${WIDTH}x${HEIGHT}); putting it back"
|
||||
place
|
||||
fi
|
||||
sleep 0.5
|
||||
done
|
||||
) &
|
||||
fi
|
||||
cd "${argv[0]}"
|
||||
|
||||
Reference in New Issue
Block a user