View Single Post
Simon Simon's Avatar

JCF Member

Joined: Dec 2016

Posts: 58

Simon is doing well so far

Jan 5, 2017, 09:23 AM
Simon is offline
Reply With Quote
Similar problem on Linux. Maybe someone in the dark future will need this?

Problem: I run JJ2 in Wine on a Linux desktop environment, and I'm unhappy with the small window. I want a large window, e.g. JJ2's internal 640x400 scaled to 1280x800, but I don't want fullscreen. I can drag the window borders with the mouse and that produces the desired upscaling, but starting the first level instantly resets the window size to 640x400.

My first attempt was with devilspie, but that program resizes windows only once when they open, not continuously.

Duct-tape solution: Write a script to force the large window size 100 times per second, overriding the reset. As a downside, for a frame, I see the small window before it springs large.

Code:
#!/bin/bash

cd ~/softw/win/jazz2
wine Jazz2.exe &

while true; do
    xdotool search --name "Jazz Jackrabbit 2" windowsize 1304 824
    sleep 0.01
done
Assumptions:
  • Requires xdotool, but that depends only on X, not on any particular desktop environment.
  • Relies on GNU sleep's ability to sleep for fractional seconds.
  • Edit the path to where JJ2 sits.
  • Edit the window size, because 1304x824 in the above code depends on my window decoration. (I want 1280x800, and I found that I have to add 24 in each direction on my particular desktop environment.)
Works with vanilla and TSF, with or without JJ2+.

-- Simon

Last edited by Simon; Jan 5, 2017 at 11:18 AM.