Pages: 1
RSS
Why does The Bat lose its window settings if resolution changes?
 
Does anyone know why The Bat loses all its window settings (position and size) if the resolution changes?  I can't think of any good reason for this, and it's very annyoing to lose all my carefully saved settings just because I'm running in a different resolution.

I can see that this *might* be a good idea if the window won't fit on the current screen, but that's not the only time it happens.  I really hope the developers will take out this code, and provide an option to control it.
 
In the past TB didn't do so and that caused all kind of problems. So I can imagine that Ritlabs thought this a nice solution.

Of course TB stores those settings in the registry, so you could save them to disk and open them again after you've been playing around with the screen resolution.

As most users don't change their resolution a lot, I think that this won't be a priority fix.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Roelof, would you happen to know what kind of problems they ran into in the past?

Also, do you know exactly where The Bat stores these settings in the registry?  I've looked before, and couldn't find the correct settings to save.  If I remember correctly, I tried exporting the HKEY_CURRENT_USER\Software\RIT key and importing it back later, but it didn't help.
 
Things like the address book opening on a non reachable location and such after lowering the screen resolution.

The key you mention should be the right one, window locations and sizes are stored there. Keep in mind that that tree contains a lot of other settings too. Loading HKEY_CURRENT_USER\Software\RIT again will only have the proper results when TB is closed when you open the .reg file.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
This is why in my initial post, I suggested that the code to move/resize windows should be limited to times when the program can detect that a window would be off-screen, instead of on ALL resolution changes.

In any case, thanks.
 
It's basically a WINDOWS issue though.

The work-around is to make the make the program a window so it goes off screen then right click it's item on the task bar, select MOVE and use the arrow keys to bring it back into the resized desktop
(or click one arrow key THEN use the mouse)
 
Rick, I'm not sure it's entirely a Windows issue.  In any case, if you make a program multi-monitor-aware, it should be able to detect (on its own) whether it's on screen or off, or only partially visible.  I'm suggesting that the only time The Bat should resize its windows is if the current window size and position would make it completely invisible (off the screen), or if it's larger than the current resolution.

Failing that, the ability to store a separate set of window sizes and positions for each resolution it encounters would also be handy.  At least then, I'd only have to change the size/position at most once per resolution.  Right now, I have to do it each time the resolution changes, even if I've used that resolution before.
 
I have noticed that as long as TheBat!'s window is fully on-screen at  both resolutions when changing resolutions, and TheBat! is open at the time of the resolution change, it seems to leave the window size and layout alone.

However, I do not usually power up my computer and start TheBat! just so I can dock or undock and have TheBat! keep its window position.  I normally don't dock/undock powered.  Instead, I'm either out somewhere where I boot the laptop, use it, then shut it down, or I'm at home where I have the laptop docked, boot it, use it, then shut it down.

When TheBat! is not open across a resolution change, the main window is resized to fill the screen not on reduction of pixel count, but on increase of pixel count.  Yes, that's right -- if I make the display smaller with TheBat! closed, TheBat!'s window settings are unaffected.  If I make the display bigger with TheBat! closed, TheBat! will expand its window to fill the bigger screen (and recent versions also adjust the entire layout to fit the new size).  This happens whether TheBat!'s window is fully onscreen or not at both resolutions.

I have a laptop computer with a 1920*1200 internal display.  In the past, I had a CRT which I ran at 1600*1200.  I could set up TheBat so all the windows looked good on the 1920*1200 display, and when I docked the machine and restarted at 1600*1200. everything was where I left it.  When I later restarted with the machine undocked (so the screen grew fr om the 1600*1200 CRT back to the 1920*1200 LCD), TheBat! would expand its main window to fill the screen and it seemed some of TheBat!'s other window positions were affected.

I upgraded from that CRT to have a 2560*1600 LCD on my desk (actually there's a 1200*1600 panel beside it too), so now it happens the other way around.  I set up windows so they look good on the internal 1920*1200, then dock, and start up with the 2560*1600 panel, TheBat! resizes its windows to fill the new bigger screen.  If I set things up the way I want them on the 2560*1600 panel (and so they would still be completely onscreen at 1920*1200), then shut down, undock, boot up, start TheBat!), the windows will be wh ere I left them.  When I later shut down, dock, restart on the 2560*1600 panel, run TheBat!, the windows are all again resized to fill the bigger screen, whether I made any window adjustments or not while it was at 1920*1200.

So I 'change resolutions' all the time, usually across boot, sometimes multiple times per day -- not because I'm adjusting my monitor, but because I'm using a laptop computer as a PC, with an external keyboard, mouse, and display, when I'm at home.  And in this usage, TheBat! automatically resizes to fill the bigger screen whenever the pixel count is increased, but takes no action when the pixel count is reduced.

I would like to disable this particular behaviour.  TheBat! is the only application I have that imposes an almost maximised window setup and changes layout on me every single time I switch to a higher resolution or otherwise increase pixel count with TheBat! closed..

As I footnote, but not an acceptable (to me) workaround, I have noticed that if I have TheBat! open across such a resolution change, it does nothing.  However, booting the machine and opening TheBat! just so I can dock/undock is absurd, and docking/undocking powered is more stressful than doing so with everything off/standby.  

I would like a simple way to avoid this gratuitous resize when TheBat! is opened on a screen with more pixels than the one on which it was closed.  This is not a Windows bug; it is a problem with the way TheBat! deals  with having a bigger screen than it had when it last exited.

Some experimentation has convinced me that it is a bit of sloppy thinking in the startup code for TheBat!.  This particular sloppiness has existed for a number of years -- I have confirmed it back to v4, and I have even complained about it to RitLabs when v4 was current.  It appears to do something like this:
Code
if ((not exist_reg_value("HKEY_CURRENT_USER\Software\RIT\The Bat!\Screen width")) or
    (CurrentScreenWidth > get_reg_value("HKEY_CURRENT_USER\Software\RIT\The Bat!\Screen width")) or
    (not exist_reg_value("HKEY_CURRENT_USER\Software\RIT\The Bat!\Screen height")) or
    (CurrentScreenHeight > get_reg_value("HKEY_CURRENT_USER\Software\RIT\The Bat!\Screen height"))) then
  resize_all_windows_to_fit_resolution(CurrentScreenWidth, CurrentScreenHeight)
fi 

So it seems like TheBat! assumes it is the first run (at least so far as defaulting all window sizes and layouts) whenever these registry keys do not exist or their value implies a screen that is smaller (fewer pixels) than the current screen (that is, the current screen is larger than the most recently used screen).  These registry values are updated at least sometime during a run of TheBat!, and they seem to reflect the pixel counts for the screen on which TheBat! was placed at that time.  I would propose that there be some other way to do the automatic size and layout default.  Maybe another registry entry to indicate first run (I think this might be good also because someone might actually want this resize to occur after a hardware upgrade or something, so that gives a way to force it), or if there really are people who prefer this behaviuor every single run, then another registry key (and please expose it in the preferences dialogue!) to turn it off so those of us who do not like it no longer have to fight it.

For now, I have to adjust the registry values before TheBat! starts, every time (since the resize occurs if TheBat! was closed across any resolution increase, even if the computer was not rebooted).  Otherwise, if I increase resolution with it closed, the next time it opens it will destroy my window positions and layout only to replace them with an 'almost maximised' layout adjusted for the increased resolution.  Unhappily, this means basically I need to modify all registry references to thebat32.exe to runthebat.cmd and all shortcuts similarly, and so on.  So, I have to rename thebat32.exe to tb32.exe (use thebat64.exe and tb64.exe, perhaps, if that's the version you are running -- I'm waiting a little longer before I switch to the 64b version), then go through my shortcuts (start menu, quick launch, &c) and registry to change references that run thebat32.exe to point to my script instead of the original executable.  Here is the content of my 'runthebat.cmd' script:
Code
@echo off
reg add "HKEY_CURRENT_USER\Software\RIT\The Bat!" /v "Screen width" /t REG_DWORD -d "0x7FFFFFFF" /f
reg add "HKEY_CURRENT_USER\Software\RIT\The Bat!" /v "Screen height" /t REG_DWORD -d "0x7FFFFFFF" /f
start "" "C:\Program Files (x86)\The Bat!\tb32.exe" %*

I get a command prompt window popping up for a moment as TheBat! starts, but at least this way I don't get it stupidly resizing windows and changing window layouts to fill the screen whenever the pixel count goes up with TheBat! closed.  I worry that certain exotic invocations through implied operations of the OS might cause problems, but at least TheBat! would be started cleanly and then I can drag whatever I wanted to open to it.
Pages: 1