Skip to content

Handle content type and input hints#12

Open
n2klb wants to merge 1 commit intomaliit:masterfrom
n2klb:content-type
Open

Handle content type and input hints#12
n2klb wants to merge 1 commit intomaliit:masterfrom
n2klb:content-type

Conversation

@n2klb
Copy link
Copy Markdown
Contributor

@n2klb n2klb commented Apr 25, 2026

No description provided.

@n2klb
Copy link
Copy Markdown
Contributor Author

n2klb commented Apr 30, 2026

cc @pvuorela

Copy link
Copy Markdown
Contributor

@pvuorela pvuorela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment but generally looking good. Could approve already.


g_variant_dict_insert(&dict, WIDGET_INFO_CONTENT_TYPE, "i", content_type);
g_variant_dict_insert(&dict, WIDGET_INFO_AUTOCAPITALIZATION_ENABLED, "b",
!!(hints & (GTK_INPUT_HINT_UPPERCASE_WORDS |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autocapitalization on maliit is only for sentences, though I guess this doesn't per se do much harm.

Then again to me this seems like almost useless flag. Could be used for titles if always checking on app side that the locale is in english, and for pleasant use the virtual keyboard would allow forcing it off in case the content is anyway non-english. And even then it would be wrong for english title case lowercasing some words.

Maybe just skip it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, I haven't actually seen any app setting UPPERCASE_WORDS. The UPPERCASE_SENTENCES flag also doesn't seem to be widely used, but it seems better to have autocapitalization depend on this flag than to keep it on in some cases where it might not be desired.

For some reason, autocapitalization was on by default when the plugin didn't set "autocapitalizationEnabled".

g_variant_dict_insert(&dict, WIDGET_INFO_AUTOCAPITALIZATION_ENABLED, "b",
!!(hints & GTK_INPUT_HINT_UPPERCASE_SENTENCES));
g_variant_dict_insert(&dict, WIDGET_INFO_PREDICTION_ENABLED, "b",
!!(hints & GTK_INPUT_HINT_WORD_COMPLETION));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be using also GTK_INPUT_HINT_SPELLCHECK?

On maliit side and Qt hints there's just one thing to control the prediction.

As side-note the gtk way of opting in for basic features is interesting.

Copy link
Copy Markdown
Contributor Author

@n2klb n2klb May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wasn't sure about this at first, but then noticed that gedit sets WORD_COMPLETION "for on screen keyboards": https://gitlab.gnome.org/World/gedit/gedit/-/blob/97164e6113fd469cfaf3dc31a635a1203f01c9da/gedit/gedit-view.c#L605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants