AardCrowley / Search-and-Destroy

Safe, Legal Search and Destroy
10 stars 14 forks source link

xset winreset doesn't bring miniwindow back on screen #101

Closed Anssett closed 2 years ago

Anssett commented 2 years ago

I run on two different computers with wildly different resolutions. Moving from larger screen to smaller, I would expect xset winreset to move the S&D miniwindow somewhere guaranteed to be visible. From looking at the state file, it seems like it doesn't do anything to the x coordinate of the window, or that doesn't get written to state when that command runs.

Desktop (larger screen): <variable name="mcvar_window_pos_x">2080</variable> Laptop (smaller screen): <variable name="mcvar_window_pos_x">749</variable>

I'm pretty sure that 2080 exceeds the width of this screen entirely.

I dug through the xg_create_window() function (called by the xset winreset alias) and I didn't see anything that stood out to me as "hey put this thing at x=0, y=0". Which may just mean that I don't know enough about miniwindows to read the code properly.

-Ans

Anssett commented 2 years ago

Looks like the problem may actually be these two:

  <variable name="mw_sd_window_30000000537461726c696e67_windowx">0</variable>
  <variable name="mw_sd_window_30000000537461726c696e67_windowy">0</variable>

Setting them to 0 as shown above resets the gui location to top left. xset winreset does not do that.

AardCrowley commented 2 years ago

I've put in what I hope is a quick fix. Not an official release, but you can do 'snd force update master' to get the updated file. Let me know if it works or bugs out or anything. Thanks!

Anssett commented 2 years ago

Looks like it's working for me. I'll re-open if it gives problems when I change computers again.