Allows to relayout controls when scaling is changed in large monitor Previous code assumed the configure event would be triggered by GTK+ Hopefully fixes #25733
https://github.com/wxWidgets/wxWidgets/pull/25754
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
The scale-factor
notification is coming from "configure-event" handling anyway:
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkwindow.c?ref_type=heads#L7975
so I don't think this PR would make any difference.
The current code works fine for me changing the scale programmatically with gdk_x11_display_set_window_scale()
, and we have no independent verification that it doesn't work, the details provided in #25733 being questionable.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@paulcor ,
Did you try what I described?
Build the library with --enable-debug --with-gtk
Build the dialog sample.
Change the monitor scale to 200%
Start the sample and run the Rich text dialog.
Change the monitor scale to 100 leaving the dialog open.
Observe the size of the dialog didnt change.
As said - im running only one monitor with different scales. Using X with GNOME non-classic interface (no menu bar at the top).
Can you run this and see the problem?
Thx.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Strange - I did test the code on my Ubuntu and choosing a different scale in the GNOME control centre did not cause a configure event, but new code was triggered.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
FWIW this is not going to fix #25733 on its own anyhow, the problem is not the lack of event (if it's lacking) but that we don't change the TLW size when the DPI changes and it's not obvious whether we should do it and how.
Also, I do get DPI change events when dragging the window from one monitor (using 200% DPI) to the other (using 100%), this can be seen just by adding
Bind(wxEVT_DPI_CHANGED, [](wxDPIChangedEvent& event) { wxLogDebug("DPI changed, new DPI: %d", event.GetNewDPI().x); event.Skip(); });
to MyFrame
ctor in the minimal sample.
I don't use GNOME, however, so I can't (easily) test changing the scale using its control center. Maybe it doesn't result to a reconfigure event?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I'm not sure what to do about this one.
@RobertRoeb Can you please confirm that adding the snippet above to minimal sample doesn't show you "DPI changed" messages without this PR but does it with it?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@vadz ,
I'd also ask Paul if he can reproduce it without this PR, and cant with it.
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Closed #25754.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I checked again with fresh rebuilds - and my observation was wrong. When changing the scaling using the GNOME control centre, the event get triggered in both arms, printing out the same numbers (new DPI 192) and when going back (new DPI 96). We can close this PR.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb ,
Did you try the instructions I provided in the bug report for reproduce case?
Do you see the problem?
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
This PR attempted to correct catching a signal when the DPI changes, but it didn't change anything in my test case of using the GNOME control centre. I don't have multiple monitors to test anything and I didn't hear from you that the patch fixed anything
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb ,
I’m sorry I didn’t have time to look at it.
I’m getting ready to move as I lost my contract.
Can you run the instructions I provided in the ticket with and without this PR? I suspect that only frame windows are handled and not the dialogs.
BTW, as I wrote in the ticket, I also don’t have second monitor to test with and use GNOME Display Settings to change scale. I’m using mode GNOME UI with X. (Not classic one with the menu bar on top).
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.