-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GTK4] Migrate deprecated FontChooser to FontDialog #1583
base: master
Are you sure you want to change the base?
Conversation
d451171
to
7c29698
Compare
In terms of appearance, both dialogs are pretty much identical, though I think the old one looks better...
|
This PR should be kept strictly to FontChooser->FontDialog change and the async helper code change together with adopting existing code should go into #1582 |
Of course, that's why this is still marked as "draft" :) The plan was to wait for the other refactoring to be merged, do a rebase and then the offending commit should disappear on its own. I just didn't want to use the "old" approach when refactoring it anyway. |
@ptziegler we have now GTK4 build enabled, so if you rebase your PR it will at last check that compilation has no issues! |
7c29698
to
28866b6
Compare
Please continue with this one. |
28866b6
to
a20a58e
Compare
public void async(long callback) { | ||
// The font dialog ignores the given font and simply picks the first installed font | ||
// See https://gitlab.gnome.org/GNOME/gtk/-/issues/6892 | ||
GTK4.gtk_font_dialog_choose_font(handle, shellHandle, font.handle, 0, callback, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in the linked issue: What exactly is the procedure for dealing with actual bugs in GTK? As far as I can tell, there is no way to work around this problem inside of SWT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One option is to stay with FontChooser until it's fixed and use FontDialog in an "if (GTK4 > 4.16)" or similar version block where we know it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried out the FontChooser with GTK4 and there I see the same issue...
Given that the FontChooser dialog looks exactly like the FontDialog dialog, I believe that internally, the method calls are simply delegated from one to the other. So I don't think there is anything to gain by keeping the old implementation.
This moves all native FontChooser bindings from the shared GTK to the GTK3 component and also defines new GTK4 bindings for the FontDialog API. Note: The FontDialog doesn't seem to remember the initial font that is passed as an argument. This looks like a bug within GTK, given that the same behavior also happens for the FontDialogButton[1]. [1] - https://gitlab.gnome.org/GNOME/gtk/-/issues/6892
a20a58e
to
0ab423e
Compare
I don't see any warnings/errors regarding the
But why doesn't this also happen on the master? |
The Jenkins build succeeded but windows was aborted/timed out For the Github verification, this might be because ubuntu is using a more recent GTK version (with more deprecation) as our Jenkins job. So this can be ignored for now until we reaching a clean state, that's also the reason we currently not build for other architectures than x86. |
This moves all native FontChooser bindings from the shared GTK to the GTK3 component and also defines new GTK4 bindings for the FontDialog API.
Note: The FontDialog doesn't seem to remember the initial font that is passed as an argument. This looks like a bug within GTK, given that the same behavior also happens for the FontDialogButton[1].
[1] - https://gitlab.gnome.org/GNOME/gtk/-/issues/6892