Project

General

Profile

Window position and opacity

Added by Shin Ishi over 6 years ago

Hi guys,

Great program so far, just a few niggles that have been driving me up the wall but hopefully I'm just being silly and this is an easy fix...

I'm running the latest publicly available build of Windows 10 (no windows insider) and I'm having an issue where even though AdiIRC window coordinates will save to config.ini, when I shutdown and restart the client it will change to a kind of default position on my main screen. This is odd since I position my client at the bottom left corner of my second screen.

In options I of course have "Save and restore main window size/position" option checked and as I said previously, the coordinates save to the config.ini. So I don't really understand why this is happening.

Should also note that this position reset doesn't happen when I position the client in the corner of my main monitor and restart. Makes me think this is an incompatibility with multiple screens. Perhaps the window coordinates are triggering some sort of fail safe fix so users don't lose their window off-screen?

It's just a little annoying when I have to carefully reposition the window every time I start my machine. Sorry :)

The second issue is with the CTRL+ALT+UP/DOWN feature for window opacity. The level of opacity doesn't seem to save anywhere so that's another thing I need to manually input after a restart.

I know these might seem like nitpicks but any help would be much appreciated.

Best Regards,

-Shinjunk


Replies (13)

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

You are right, there is a protection against invalid position, there is multi monitor support, but not all configurations are tested.

Can you paste the WindowX/WindowY/WindowHeight/WindowWidth from config.ini and explain the second monitors relation to the main monitor? e.g left/right/top/bottom.

I have been thinking about saving opacity, but it's dangerous if user accidentally changed it and the main window would be gone on each restart, instead you press ALT + R to open the script editor and paste the script below

; Add a script to run when AdiIRC starts
; /setlayer set opacity on the main window with a number between 0 and 255.
on *:START:setlayer <change this to a number between 0 and 255>

See /setlayer for more information

RE: Window position and opacity - Added by Shin Ishi over 6 years ago

Hi Per,

Many thanks for quick reply and the script, it works perfectly!

My second monitor is to the left of my main.

Here's the lines you requested...

WindowHeight=461
WindowWidth=789
WindowX=-1927
WindowY=626

Many thanks once again :)

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

Thanks, I know it's a lot to ask to run a random exe, but could you try download https://adiirc.com/build/TestLocation.exe put the exe on the second monitor, and run it, then copy/paste the output and paste it here?

It shows the coordinates and size of the screen it's opened on, then enumerate and prints all the coordinates and sizes of all screens to compare.

RE: Window position and opacity - Added by Shin Ishi over 6 years ago

Hi Per,

Ran your exe from 2nd screen and this was the output...

{X=-1920,Y=0,Width=1920,Height=1080}

\\.\DISPLAY1 - {X=0,Y=0,Width=1920,Height=1050}
\\.\DISPLAY2 - {X=-1920,Y=0,Width=1920,Height=1080}

Not quite sure why 1050 is reported for display 1, I assume that's due to taskbar which seems to take up 30px height.

Might be unrelated but this reminds me of an issue I was having with hexchat as well. I'd put it in that same corner and after a restart it'd move ~7 pixels from the edge where it was previously. Just doesn't make much sense to me why one of my previously reported coordinates are "-1927".

Hope you can make more sense of it than I can.

Many thanks for assistance,

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

Yeah the reduced height for DISPLAY1 is the Taskbar, it's exclude in the rectangle I ask for.

Not sure where the 7 pixels comes from, possibly window borders, but they don't seem to matter when checking the rectangle.

This is very puzzling, I plotted your screens in where AdiIRC checks for a valid screen, and it matches just fine.

For the next beta (which I will upload soon) I added some debug stuff to see if there is an error in any of the rectangles, the steps to get this data:

Start AdiIRC, move it to the second monitor.
Open Menubar -> File -> Rawlog
Close AdiIRC
Start AdiIRC, (Rawlog should open itself on startup) if AdiIRC is on the wrong screen, then go the Rawlog tab, and see if there are any messages related to screen, copy/paste them here.

RE: Window position and opacity - Added by Shin Ishi over 6 years ago

No messages in rawlog relating to monitor or screen but boy, I have a real treat for you now.

I decided to muck around with my monitor setup to see if it would change anything and I discovered something odd. When specifying my 2nd monitor as my "main" one (that is the monitor to the left), then your irc client pops up in the correct positions every time. No matter what screen I start the program from it goes to the correct position. I've recorded coordinates here...

on right monitor when left is main...
(positioned adiirc in bottom right corner)

WindowHeight=461
WindowWidth=789
WindowX=3058
WindowY=626

on left monitor when left is main
(positioned adiirc in bottom left corner)

WindowHeight=461
WindowWidth=789
WindowX=-7
WindowY=626

So this setup works properly but obviously it's not something that's really sustainable for me as it'll throw up a whole host of other problems concerning positioning of other programs.

I've decided to also test my original settings when the monitor to the right is set as "main" and there's a larger negative coordinate space to the left on my left monitor. This might get a bit complicated but I've found the "acceptable" negative X axis coordinate range on my left monitor. This means the program starts correctly in this range but anything below (negative numbers) it will reset the position of the window.

on left monitor when right is main
(positioned in bottom right corner)

WindowHeight=461
WindowWidth=789
WindowX=-782
WindowY=626

on left monitor when right is main
(positioned slightly away from bottom right corner)
WindowHeight=461
WindowWidth=789
WindowX=-788
WindowY=626

So that last X coordinate is the last workable position where the program will successfully restore to. Going -789 and further "below" (I guess I should say), causes the program to reset position.

PS: Unrelated but I had to restart the program many times for this and it caused the url monitor (with save and restore urls option + Ignore duplicate lines on or off) to spam the program with urls causing it to crash.

Just let me know if you need me to test any other positions or if I need to clarify anything.

Many thanks and hope this is useful,

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

You have done some nice tests.

Sorry I forgot to mention you have to set RawlogBuffer, because these debug messages is sent before rawlog is shown, you can type /setoptions Misc RawlogBuffer 20 to enable it.

The debug I added, should explain if there is a problem with the 2 rectangles intersects or something else.

If you have a big url catcher list saved, I would suggest reduce the number of links, the crash is probably just taking a looong time to add all the urls to the datagrid.

RE: Window position and opacity - Added by Shin Ishi over 6 years ago

Even when setting "/setoption Misc RawlogBuffer 20" there's no messages referencing the screen or monitor in the rawlog, just connection information.

I also see that the last acceptable "restorable position" for the X coordinate is linked to WindowWidth. So whatever WindowWidth is, if the value of "WindowX" negates the entirety of what "WindowWidth" is and moves the entire window from the main monitor to the left monitor then the window will reset.

Therefore that's why I was seeing the behaviour with the following...

WindowWidth=789
WindowX=-788

Decrease WindowX to -789 and it moves adiirc entirely from the main monitor.

So essentially if the border window of the irc client isn't at least touching the main monitor (with 1 px width) then it won't restore position properly.

There must be some way for this to work. Skype and Steam both restore to their proper positions and it's not like my setup is somehow unique.

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

Just curious, are you using the latest beta with the added debug info? If not you can type /betaup.

AdiIRC uses the standard way trying to intersect rectangles to find the screen with the biggest portion of the window rectangle, but I think there is something else going on here, so I need the debug information.

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

I found and hooked up a second monitor in about the same setup as you, and I think I found the problem, the compared rectangle X and Width was switched around for some reason, fix should be in next beta.

RE: Window position and opacity - Added by Shin Ishi over 6 years ago

Excellent work! Very glad you found the issue :)

I was just about to post to say that nothing else came up in rawlog using latest beta version "2.9 beta build 2017/07/15-1", just the same login/network info as before.

Really appreciate the extra effort you put into solving this. I know implementing fixes like this can sometimes be a thankless job but I appreciate it.

Many thanks once again.

RE: Window position and opacity - Added by Shin Ishi over 6 years ago

Can confirm it's working now with new beta build 15-2

Again, many thanks for looking into this :)

RE: Window position and opacity - Added by Per Amundsen over 6 years ago

Glad it's sorted and your welcome!

As a bonus I found and fixed some other multi monitor bugs as well.

    (1-13/13)