mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#263634 30/08/18 08:50 AM
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
I maintain a fairly complex mIRC script which has a settings dialog which has "Options dbu notheme" and which is opened with "Dialog -mdh". A user with a 4k screen has reported that the dialog is "compacted so I cannot see anything".

I am waiting for more details, but I thought I would ask here if anyone knows of any issues in this area?

P.S. Info I have asked for:
  • mIRC version
  • Windows version
  • Display, graphics card, driver versions
  • Screen shot(s)
  • Output from "//echo -ac Normal DBU Width: $dbuw DBU Height: $dbuh"

Is there anything else I should ask for?

Last edited by Protopia; 30/08/18 08:51 AM.
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Is your dialog table set to use pixels or dbus? If its pixels then there's no scaling applied. If its dbu, it should use window's scaling.

With that said, this scaling issue has been brought up a few times
Small Buttons
Small UI

The best end-user solution would be to have two tables: one for smaller res, then one for HD/UHD resolutions

Last edited by FroggieDaFrog; 30/08/18 09:02 AM.

I am SReject
My Stuff
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
As I said, it has "options dbus".

And I have read both the previous posts before posting, but neither seem to fit.

I don't have a 4k screen and so cannot reproduce this issue. But the dialog scales fine on the various screens I display it on.

(That said, I have worked on other software (python, PyQT) which needs special stuff to support 4K screens.)

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
When you say the dialog is compacted, is it completely shrunk, or is it somewhat normal size with the text being too small?

Code:
//echo -a width $window(-1).w height $window(-1).h / dbuw $dbuw dbuh $dbuh


I'm curious what are the dbuw/dbuh values relative to the pixels width/height. I was under the impression that dbuw/dbuh were supposed to vary so that pixel-size divided by dbu-size would always be somewhere in the same ballpark.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
I am trying hard to help the user, but he is not being very helpful in providing screen shots and diagnostic info.

He has posted a screen shot of the output from:
Code:
//echo -ac Normal width $window(-1).w height $window(-1).h / dbuw $dbuw dbuh $dbuh

and it is:
Quote:
width 2560 height 1920 / dbuw 2.5 dbuh 2.5


By comparison, on my laptop the results are:
Quote:
width 1920 height 1080 / dbuw 2 dbuh 2


So the values for dbuw/dbuh look OK.

Here is what they look like:
4K
[img]https://ibb.co/hhpxPe[/img]
Normal
[img]https://ibb.co/iDsvAK[/img]

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
It may be impossible to replicate or resolve without direct access to his machine to test on. It may be possible that custom 'large icons' or 'font zoom' settings on some version of windows behaves unexpectedly and outside of the scope of DBU scale, blowing up the font point scale instead.

Just write a custom scaler that doubles everything in your dialog. Add the option: "Jumbo Mode." Or half the point sizes of your font formattings.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
It looks kinda like the dialog failed to correctly scale the text the same way it scaled the size of the control itself.

Perhaps there's a failure to scale the text due to an unavailable font size, or due to font substitution. It would be nice to know the font-name and font-size used in dialog text controls, so they could be used in $width, but I posted a question for it a while back, but there was no answer.

https://forums.mirc.com/ubbthreads.php/topics/260772/Font_Name/Size_in_Dialog_text_#Post260772

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
It seems to me that the first thing to do is to establish whether this is a general issue on 4K screens, either for my script or for dialogs in general (though if the latter I would have thought it would have been reported by others by now - unless it is the use of options notheme that is causing the issue).

So if anyone else with a 4K screen can check whether they get the same issue - or conversely confirm that they don't - then that would also be helpful to point to whether this is a mIRC issue or something specific to this user.

Originally Posted By: Raccoon
It may be impossible to replicate or resolve without direct access to his machine to test on.

We have yet to establish definitively whether this is specific to this user or a more general issue.

Originally Posted By: Raccoon
It may be possible that custom 'large icons' or 'font zoom' settings on some version of windows behaves unexpectedly and outside of the scope of DBU scale, blowing up the font point scale instead.

Anything is possible.

If you can give more precise instructions on what Windows settings should be checked that would be helpful.

Originally Posted By: Raccoon
Just write a custom scaler that doubles everything in your dialog. Add the option: "Jumbo Mode." Or half the point sizes of your font formattings.

I will not be writing a custom scaler that doubles everything in my dialog - that is really not the solution here. This is either common on 4K screens in which case it is a mIRC issue, or specific to this user's settings in which case he needs to fix his settings - either way it is not the script writer's responsibility to find a kludge workaround in order to resolve an issue for a single user.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Originally Posted By: maroon
It looks kinda like the dialog failed to correctly scale the text the same way it scaled the size of the control itself.

Perhaps there's a failure to scale the text due to an unavailable font size, or due to font substitution. It would be nice to know the font-name and font-size used in dialog text controls, so they could be used in $width, but I posted a question for it a while back, but there was no answer.

https://forums.mirc.com/ubbthreads.php/topics/260772/Font_Name/Size_in_Dialog_text_#Post260772

Actually this sounds very similar - and suggests that there may be a bug in mIRC around scaling of dialogs.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
It's my opinion that the dialog looks awesome, and mIRC scaled it perfectly. The problem is when the fonts are rendered at such an extreme point size, that they will mutilate certain paint-jobs of various controls. The controls are all there and properly fitted, neatly arranged, but swelling under the pressure of bloated text.

If it were a pixel vs dbu problem, you would have controls overlapping each other on the x/y positions, and everything would be shifted to the bottom-right or so.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Ok - had the following responses from the user to the echo script:
Quote:
width 3840 height 2160 / dbuw 2.5 dbuh 2.5
width 2560 height 1920 / dbuw 2.5 dbuh 2.5

This doesn't look right to me. Shouldn't the first one have a higher dbuw/h?

I assume these are different screens as first is 16:9 wide-screen and second 4:3 old-style.

However user incorrectly said he was using 1024x768 for the second - and screen shot at 2560x1920 shows it is still corrupt at that resolution.

User also reports that dialogs are fine on mirc 6.35 but not on mIRC 7.44, and that removing `option notheme` makes no difference.

Last edited by Protopia; 02/09/18 08:02 AM.
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
P.S. Still waiting for information (and getting very frustrated by user not giving the information I have requested), however this is starting to look like a mIRC bug to me.

It seems unlikely, but could it be an issue with dbuw/h being non-integer?

Last edited by Protopia; 02/09/18 08:04 AM.
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Originally Posted By: Raccoon
It's my opinion that the dialog looks awesome, and mIRC scaled it perfectly.


Thank you for the plaudit. I would like to hope that the quality of my code style is equally good. smile

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
User is STILL not providing detail despite me asking multiple times (grrrrr!!!!), but we have narrowed it down to the Windows 10 setting in System/Display/Scaling. If this is 100% then the dialog is fine, but on a 4K display when you need to set it to (say) 150% or 200% or 250% in order to be able to read anything, then the dialogs come out wonky.

My guess is that mIRC is enlarging the text and Windows is enlarging the text too - so we get double enlargement.

I will try setting the Windows scaling on my PC and see whether I can reproduce it.

Last edited by Protopia; 02/09/18 03:17 PM.
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
There can be several reasons for this. Windows sets the default font for all dialogs based on your display and what the application has specified as the required font in its dialog definitions. There are two font names that dialogs normally use, "MS Shell Dlg" or "MS Shell Dlg 2", which map to different fonts depending on your version of Windows and your Windows language settings. Unfortunately, it gets even more complicated after that. See here for a discussion on this.

That said, the only way to track down the cause would be to 1) have a small example script that I can use to reproduce the issue, and 2) use a 4k monitor, which I do not have at this time.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
@Khaled, I have reproduced this issue without a 4K monitor. It is to do with the Windows Settings / System / Display / Scaling.

In Windows 10 1709 you get a dropdown with values of 100%, 125%, 150% and 175%, or you can use custom scaling with any value between 100% and 500%. I need to check, but I think you can also set some sort of scaling in old-style Control Panel, and I will need to test to see if this is the same as custom scaling or something different.

Using non-custom scaling and changing the value in the dropdown changes the display immediately, and the dialog scales ok. It is not necessarily absolutely pixel perfect, but it still looks pretty good.

Using custom scaling if forces you to sign-out and sign-in again before the changes take effect, and this is where the dialog scaling goes wrong even when you use custom scaling with the same values as the dropdowns. We also see the echo command results being different.

I have started to test this comprehensively and record the results - which as you can imagine is time consuming when you have to sign-out/in - and when I have tested it all with sign-out/in I want to retest some of it to see if rebooting between changes of scaling makes any difference.

As soon as I have done this I will report back with full results, but this is definitely an issue between Windows and mIRC. At this stage, I am guessing that Windows does not report scaling consistently between non-custom and custom-scaling and mIRC doesn't know how to handle this.

Last edited by Protopia; 02/09/18 04:21 PM.
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
P.S. Obviously, when you have a 4K display you are much more likely to want Windows display scaling, and perhaps more than the 175% you can get from a dropdown.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
It's not limited to 4K, it has something to do with dpi scaling. I can experience this issue on 1080p, it's simply much worse on 4K.

This laptop is 13" 1080p with dpi scaling at 125%. If I remote desktop to my other laptop (1366x768 100% dpi) the problem occurs, but only after mIRC is restarted while remote desktop is active - there's a Windows setting to apply scaling based on log-in resolution vs resolution at program start. The weird part is the exact same script looks fine running natively on the 1080p laptop. Though I don't blame mIRC for this really, Windows has terrible scaling support in general. Its own tools don't even scale properly.

https://i.imgur.com/OaHe7XN.png

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Originally Posted By: Loki12583
It's not limited to 4K, it has something to do with dpi scaling. I can experience this issue on 1080p, it's simply much worse on 4K.

Worse on 4K because more likely that you will need scaling > 175% which is custom scaling. As per my previous post, scaling using dropdown values of 125%, 150% or 175% seems to be OK.

Originally Posted By: Loki12583
This laptop is 13" 1080p with dpi scaling at 125%.

You need to specify:

a. Windows version i.e. Windows 10 1709
b. Whether it is 125% using the dropdown or custom scaling or old-style control panel.

Originally Posted By: Loki12583
If I remote desktop to my other laptop (1366x768 100% dpi) the problem occurs, but only after mIRC is restarted while remote desktop is active - there's a Windows setting to apply scaling based on log-in resolution vs resolution at program start. The weird part is the exact same script looks fine running natively on the 1080p laptop.

Aaarrrrrrrrgggggggggghhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!!! Please let's not complicate this at the moment by introducing issues that occur when you are using remote desktop, which has scaling settings at both ends plus variations on remote desktop software. Perhaps we can fix the native issues first, and then look at remote desktop as a second phase.

Originally Posted By: Loki12583
Though I don't blame mIRC for this really, Windows has terrible scaling support in general. Its own tools don't even scale properly.

https://i.imgur.com/OaHe7XN.png

This image is not an example of Windows own tools not scaling properly.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Ok - I have completed my testing.

1. We get different results immediately after changing scaling using the dropdown compared to then sign-out/in or rebooting. When you change the dropdown the immediate consequence is similar to changing the screen resolution and the mIRC dialog looks fine - but then when you reboot you get genuine scaling and the dialog breaks.

The change of resolution after changing the dropdown is IMO an anomaly.

2. Screen shots of all of the above suggest that this is a general issue with mIRCs handling of scaling other than 100%.

DETAIL
On my system these are the values I get from:
Code:
//echo Screen resolution: Width: $window(-1).h Height: $window(-1).h / DBU: Width: $dbuw Height: $dbuh

are:
Code:
100% Width: 1920 Height: 1080 / DBUW: 2 DBUH: 2
125% Width: 1920 Height: 1080 / DBUW 2.5 DBUH 2.5
150% Width: 1920 Height: 1080 / DBUW 2.5 DBUH 2.5
175% Width: 1920 Height: 1080 / DBUW 2.5 DBUH 2.5

Here are the screen shots:
100%
[img]https://ibb.co/kexY0K[/img]
125%
[img]https://ibb.co/naTHSz[/img]
150%
[img]https://ibb.co/krJHSz[/img]
175%
[img]https://ibb.co/gG6FEe[/img]

Page 1 of 2 1 2

Link Copied to Clipboard