In my application I have a dialog with the notebook and a buttons below. This dialog is tall and will be cut short on higher DPI.
When the DPI changes I'd expect the dialog to be Re-layout so it is displayed in full or in short.
N/A
It is visual issue.
I ave only one laptop with X11/GNOME and the monitor there supports 100 and 200 scaling.
When the program have a tall dialog it will not be relayout on the DPI change
Following scenario happening:
In one of the panels of the notebook there is a GtkFontPanel class so the dialog is very tall.
But when the DPI is going to 100% the dialog is not resized to display the buttons.
I will see if I can make a patch to the dialog sample with the reprod, but at this point I'd like to know if this behavior is correct.
I can also try to make a screenshot of my application dialog on both 200%, 100% and how it behaves when started on 100%.
If this how the program should behave on wxGTK, I can catch DPI change event at call Layout there, probably conditionally.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Please reproduce this in a sample. With GTK logical and physical pixels are the same so it shouldn't be necessary to relayout, but the layout should be correct (and same) in both cases.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz ,
Reproduced.
Unmodified dialogs sample.
Build the sample
Set the Scale to 200.
Run the dialog and choose "Dialogs->Rich Message dialog"
Observe that the dialog will be cut short.
Change the scale to 100
Switch to the sample
Observe that the dialog is still displayed short.
Keeping the scale to 100, restart the dialog
Again choose "Dialogs->Rich Message dialog"
Observe that the dialog is displayed in full.
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I.e. the total size of the dialog changes? This could be due to imposing an upper limit on it to fit on the screen. Not sure if we can do anything about it if this is what it is.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz ,
Not sure what you mean?
The size of the dialog didn't change. How can it change - it is the same.
But I totally expect the dialog to be displayed in full when I change the scale to 100%.
Do you want to see a screenshots?
Try the steps I outlined.
Disclaimer - I'm not using 2 monitor setup, just changing the scale factor on the fly.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Yes, please show screenshots.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Start on 200%
image.png (view on web)After changing to 100%
image.png (view on web)Start on 100%
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Right, this is exactly what I wrote: dialog is limited to the display height (actually somewhat less) and when the resolution changes its size doesn't change.
To fix this we'd need to be notified about resolution change (I'm already not sure how to do it) and also store the initially computed best size in the TLW to check if we should expand to it if we have enough place now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz ,
According to GTK maintainer here, we should be using GObject::notify in this case.
And then do the relayout in response to that change.
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The current code in master listens to the "configure" event in gtk/toplevel.cpp and then compares old and new scale factors. Does this code get called when you change the scaling?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
And could you ask on that chat on the GTK list if that signal is called "notify:gtk-widget-scale" or something else? Unless someone knows the full name.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
And I just asked Emmanuelle for the proper name...
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
And I just asked Emmanuelle for the proper name
JFC, it's scale-factor, it's RIGHT THERE.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Is my understanding right that the scale factor eventually does get changed, but the configure event is not sent, so we have to catch "notify::scale-factor"
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Try this patch, please
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I don't know if you got my comment in the closed PR.
I just tried to add the Bind from it and I did get the event of DPI change. So presumably what is needed is to call Layout() when the DPI changed.
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()